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 use the same stablecoins, just stored more efficiently.
SPLLight
TransfercreateTransferInstruction()createTransferInterfaceInstructions()
Use the payments agent skill to add light-token payment support to your project:
For orchestration, install the general skill:
1

Setup

Install packages in your working directory:
Install the CLI globally:
In the code examples, use createRpc() without arguments for localnet.
Snippets below assume rpc, payer, mint, owner, recipient, and amount are defined. See the full examples for runnable setup.
setup.ts
Find full runnable code examples: instruction | action.
2

Send a Payment

Use createTransferInterfaceInstructions to transfer tokens between wallets. The method:
  • automatically derives Associated Token Accounts for the sender and recipient. If the recipient’s ATA doesn’t exist, the instruction to create the account is automatically added to the same transaction.
  • determines whether the sender’s account has a cold balance and adds load instructions if needed.
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.
SDK 2.0 (@lightprotocol/token-interface) is the latest JavaScript SDK. It has better API ergonomics, guarantees single-instruction loading, and is compatible with KIT (the new Solana SDKs).
Your app logic may require you to create a single sign request for your user:
While almost always you will have only one transfer transaction, you can optimize sending in the rare cases where you have multiple transactions. Parallelize the loads, confirm them, and then send the transfer instruction after.

Batch payments

Pack multiple transfers to multiple recipients into one transaction.

Gasless transactions

Abstract SOL fees from the user. Sponsor top-ups and transaction fees.

Verify payments

Query balances and transaction history.

Didn’t find what you were looking for?

Reach out! Telegram | email | Discord