npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lightprotocol/token-interface

v0.1.2

Published

JS SDK helpers for SPL-token that reduces the cost of ATA creation

Readme

@lightprotocol/token-interface

Payments-focused helpers for Light rent-free token flows.

Use this when you want SPL-style transfers with unified sender handling:

  • sender side auto wraps/loads into light ATA
  • recipient ATA can be light (default), SPL, or Token-2022 via tokenProgram

RPC client (required)

All builders expect createRpc() from @lightprotocol/stateless.js.

import { createRpc } from '@lightprotocol/stateless.js';

// Add this to your client. It is a superset of web3.js Connection RPC plus Light APIs.
const rpc = createRpc();
// Optional: createRpc(clusterUrl)

Canonical for Kit users

Use createTransferInstructionPlan from /kit.

import { createTransferInstructionPlan } from '@lightprotocol/token-interface/kit';

const transferPlan = await createTransferInstructionPlan({
    rpc,
    payer: payer.publicKey,
    mint,
    sourceOwner: sender.publicKey,
    authority: sender.publicKey,
    recipient: customer.publicKey,
    // Optional destination program:
    // tokenProgram: TOKEN_PROGRAM_ID
    amount: 25n,
});

If you prefer Kit instruction arrays instead of plans:

import { createTransferInstructions } from '@lightprotocol/token-interface/kit';

Canonical for web3.js users

Use createTransferInstructions from the root export.

import { createTransferInstructions } from '@lightprotocol/token-interface';

const instructions = await createTransferInstructions({
    rpc,
    payer: payer.publicKey,
    mint,
    sourceOwner: sender.publicKey,
    authority: sender.publicKey,
    recipient: customer.publicKey,
    amount: 25n,
});

// add memo if needed, then build/sign/send transaction

Raw single-instruction helpers

Use these when you want manual orchestration:

import {
    createAtaInstruction,
    createLoadInstructions,
    createTransferCheckedInstruction,
} from '@lightprotocol/token-interface/instructions';

No-wrap instruction-flow builders (advanced)

If you explicitly want to disable automatic sender wrapping, use the dedicated /nowrap entrypoint with the same function names:

import { createTransferInstructions } from '@lightprotocol/token-interface/nowrap';

Read account

import { getAta } from '@lightprotocol/token-interface';

const account = await getAta({ rpc, owner: customer.publicKey, mint });
console.log(account.amount, account.hotAmount, account.compressedAmount);

Important rules

  • Only one compressed sender account is loaded per call; smaller ones are ignored for that call.
  • Transfer always builds checked semantics.
  • Canonical builders always use wrap-enabled sender setup (createTransferInstructions, createLoadInstructions, createApproveInstructions, createRevokeInstructions).
  • If sender SPL/T22 balances are wrapped by the flow, source SPL/T22 ATAs are not auto-closed.
  • Recipient ATA is derived from (recipient, mint, tokenProgram); default is light token program.
  • Recipient-side load is still intentionally disabled.