Skip to main content

A Solana transaction can contain one or more instructions that are executed sequentially and atomically by the network. This way, you can pack multiple transfers into a single transaction instead of sending e.g. three separate transactions. You send one transaction with three transfer instructions. Use just like with SPL token:
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.
setup.ts
Find full code examples: batch transfer.
2

Send to Multiple Recipients in One Transaction

Batching multiple transfers requires building each instruction separately, then combining them into a single transaction.The method createTransferInterfaceInstructions 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).

Basic payment

Send a single transfer.

Gasless transactions

Separate the fee payer from the token owner.

Verify payments

Query balances and transaction history.

Didn’t find what you were looking for?

Reach out! Telegram | email | Discord