Crate light_token

Crate light_token 

Source
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

  1. anchor - Derives AnchorSerialize, AnchorDeserialize instead of BorshSerialize, BorshDeserialize.
  2. compressible - utility functions for compressible sdk macros.

§Common Operations

OperationInstruction BuilderCPI Builder
Create Associated Token AccountCreateAssociatedTokenAccountCreateAssociatedAccountCpi
Create Token AccountCreateTokenAccountCreateTokenAccountCpi
TransferTransferTransferCpi
Transfer Interface (auto-detect)TransferInterfaceTransferInterfaceCpi
Close Token accountCloseAccountCloseAccountCpi
Create MintCreateMintCreateMintCpi
MintToMintToMintToCpi

§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.

Structs§

AdditionalMetadata
CompressedProof
TokenMetadataInstructionData
ValidityProof

Enums§

ExtensionInstructionData