Skip to main content
  1. The Light-token API matches the SPL-token API almost entirely, and extends their functionality to include the light token program in addition to the SPL-token and Token-2022 programs.
  2. Your users hold and receive tokens of the same mints, just stored more efficiently.

What you will implement

SPLLight
ReceivegetOrCreateAssociatedTokenAccount()createLoadAtaInstructions() / loadAta()
TransfercreateTransferInstruction()createTransferInterfaceInstructions() / transferInterface()
Get BalancegetAccount()getAtaInterface()
Tx HistorygetSignaturesForAddress()rpc.getSignaturesForOwnerInterface()
Wrap from SPLN/Awrap() / createWrapInstruction()
Unwrap to SPLN/AcreateUnwrapInstructions() / unwrap()
Find full runnable code examples here.
Use the payments-and-wallets agent skill to add light-token payment support to your project:
Add the marketplace and install:
For orchestration, install the general skill:

Setup

Snippets below assume rpc, payer, mint, owner, recipient, and amount are defined. See the full examples for runnable setup.
About loading: Light Token accounts reduce account rent ~200x by auto-compressing inactive accounts. Before any action, the SDK detects cold balances and adds instructions to load them. This almost always fits in a single atomic transaction with your regular transfer. APIs return TransactionInstruction[][] so the same loop handles the rare multi-transaction case automatically.

Receive Payments

Find a full code example here.
Load creates the associated token account (ATA) if needed and loads any compressed state into it. Share the ATA address with the sender.

Send Payments

Find a full code example: instruction | action.

Show Balance

Find a full code example here.

Transaction History

Find a full code example here.
Use getSignaturesForAddressInterface(address) if you want address-specific rather than owner-wide history.

Wrap from SPL

Wrap tokens from SPL/Token-2022 accounts to light-token ATA.
Find a full code example here.

Unwrap to SPL

Unwrap moves the token balance from a light-token account to a SPL-token account. Use this to compose with applications that do not yet support light-token.
Find a full code example here.