Expand description
§Light Token SDK
The base library to use Light Token Accounts, Light Mints, and compressed token accounts.
§Light Token Accounts
- are on Solana devnet.
- are Solana accounts.
- can hold Light Mint and SPL Mint tokens.
- cost 17,288 lamports to create with 24 hours rent.
- are rentfree:
- rent exemption is sponsored by the protocol.
- rent is 388 lamports per rent epoch (1.5 hours).
- once the account’s lamports balance is insufficient, it is compressed to a compressed token account.
- compressed tokens can be decompressed to a Light Token account.
- configurable lamports per write (eg transfer) keep the Light Token account perpetually funded when used. So you don’t have to worry about funding rent.
§Compressed Token Accounts
- are on Solana mainnet.
- are compressed accounts.
- can hold Light Mint and SPL Mint tokens.
- cost 5,000 lamports to create.
- are well suited for airdrops and reward distribution.
§Light Mints
- are on Solana devnet.
- are Compressed accounts.
- cost 15,000 lamports to create.
- support
TokenMetadata.
For full program examples, see the Light Token Examples.
For detailed documentation, visit zkcompression.com.
For rust client development see light-client.
For rust program testing see light-program-test.
For local test validator with light system programs see Light CLI.
§Features
- anchor - Derives AnchorSerialize, AnchorDeserialize instead of BorshSerialize, BorshDeserialize.
- compressible - utility functions for compressible sdk macros.
§Common Operations
| Operation | Instruction Builder | CPI Builder |
|---|---|---|
| Create Associated Token Account | CreateAssociatedTokenAccount | CreateAssociatedAccountCpi |
| Create Token Account | CreateTokenAccount | CreateTokenAccountCpi |
| Transfer | Transfer | TransferCpi |
| Transfer Interface (auto-detect) | TransferInterface | TransferInterfaceCpi |
| Close Token account | CloseAccount | CloseAccountCpi |
| Create Mint | CreateMint | CreateMintCpi |
| MintTo | MintTo | MintToCpi |
§Disclaimer
This library is not audited and in a beta state. Use at your own risk and expect breaking changes.
Re-exports§
pub use pack::compat;
Modules§
- compressed_
token - Compressed token account types and instruction builders.
- compressible
- Compressible token utilities for runtime decompression.
- constants
- error
- instruction
- High-level builders for Light Token operations.
- pack
- Pack implementation for TokenData types for c-tokens.
- spl_
interface - SPL interface PDA derivation utilities.
- utils
- Utility functions and default account configurations.