- 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.
- Your users hold and receive tokens of the same mints, just stored more efficiently.
| Creation Cost | SPL | Light-token |
|---|---|---|
| Token Account | ~2,000,000 lamports | ~11,000 lamports |
What you will implement
| SPL | Light | |
|---|---|---|
| Get/Create ATA | getOrCreateAssociatedTokenAccount() | getOrCreateAtaInterface() |
| Derive ATA | getAssociatedTokenAddress() | getAssociatedTokenAddressInterface() |
| Transfer | transferChecked() | transferInterface() |
| Get Balance | getAccount() | getAtaInterface() |
| Tx History | getSignaturesForAddress() | rpc.getSignaturesForOwnerInterface() |
| Wrap from SPL | N/A | wrap() |
| Unwrap to SPL | N/A | unwrap() |
Find full code examples
here.
Setup
Receive Payments
Find a full code example here.
- Instruction
- Action helper
Compare to SPL
Compare to SPL
Send Payments
Find a full code example here.
- Instruction
- Action helper
Compare to SPL
Compare to SPL
Show Balance
Find a full code example here.
Compare to SPL
Compare to SPL
Transaction History
Find a full code example here.
getSignaturesForAddressInterface(address) if you want address-specific rather than owner-wide history.
Compare to SPL
Compare to SPL
Wrap from SPL
Wrap tokens from SPL/Token-2022 accounts to light-token ATA.Find a full code example here.
- Instruction
- Action helper
Unwrap to SPL
You can compose with applications that do not yet support the light-token standard by unwrapping your tokens. Unwrap moves the token balance from a light-token account to a SPL-token account.Find a full code example here.
- Instruction
- Action helper