cp .env.example .env # ...and set RPC_URL
npm installFrom repo root:
# quickstart
npm run quickstart
# cookbook (local)
npm run cookbook create-mint:action
npm run cookbook compress:action
# ... see cookbook/package.json for more
# payments
npm run toolkit:payments send-and-receiveCookbook examples use local test-validator (install via npm i -g @lightprotocol/zk-compression-cli@alpha, then run light test-validator).
End-to-end example: create a mint, token account, mint tokens, and transfer on devnet.
Step-by-step recipes for light-token on localnet.
- create-mint - Create a new light-token mint
- create-ata - Create an associated light-token account
- load-ata - Load a cold token account (compressed) to hot balance (light-token ata)
- mint-to - Mint tokens to a light-account
- transfer-interface - Transfer tokens between light-token, T22, and SPL token accounts.
- wrap - Wrap SPL to light-token
- unwrap - Unwrap light-token to SPL for off-ramps and legacy integrations
Low-level instruction builders:
- create-mint - Build create mint instruction
- create-ata - Build create ATA instruction
- load-ata - Build load ATA instruction
- mint-to - Build mint-to instruction
- transfer-interface - Build transfer interface instruction for transfers between light-token, T22, and SPL token accounts.
- wrap - Build wrap instruction
- unwrap - Build unwrap instruction for off-ramps and legacy integrations
Examples for wallet integrations and payment flows:
- get-balance - Fetch token balances for light-token accounts
- get-history - Fetch transaction history for light-token accounts
- send-and-receive - Send and receive light-tokens using the transfer interface
- wrap-from-spl - Wrap SPL tokens to light-token
- unwrap-to-spl - Unwrap light-token to SPL for off-ramps and legacy integrations
Rust program example with test to stream mint events of the Light-Token Program.