light_token_interface/
constants.rs

1use light_macros::pubkey_array;
2
3pub const CPI_AUTHORITY: [u8; 32] = pubkey_array!("GXtd2izAiMJPwMEjfgTRH3d7k9mjn4Jq3JrWFv9gySYy");
4pub const LIGHT_TOKEN_PROGRAM_ID: [u8; 32] =
5    pubkey_array!("cTokenmWW8bLPjZEBAUgYy3zKxQZW6VKi7bqNFEVv3m");
6
7/// Account size constants
8/// Size of a Token account with embedded compression info (no extensions).
9/// TokenZeroCopy includes: SPL token layout (165) + account_type (1) + decimal_option_prefix (1)
10/// + decimals (1) + compression_only (1) + CompressionInfo (96) + has_extensions (1)
11pub use crate::state::BASE_TOKEN_ACCOUNT_SIZE;
12
13/// Extension metadata overhead: Vec length (4) - added when any extensions are present
14/// Note: The Option discriminator is the has_extensions bool in the base struct
15pub const EXTENSION_METADATA: u64 = 4;
16
17/// Size of CompressedOnly extension (16 bytes for two u64 fields: delegated_amount and withheld_transfer_fee)
18pub const COMPRESSED_ONLY_EXTENSION_SIZE: u64 = 16;
19
20/// Size of a Token-2022 mint account
21pub const MINT_ACCOUNT_SIZE: u64 = 82;
22pub const COMPRESSED_MINT_SEED: &[u8] = b"compressed_mint";
23pub const NATIVE_MINT: [u8; 32] = pubkey_array!("So11111111111111111111111111111111111111112");
24
25pub const MINT_ADDRESS_TREE: [u8; 32] =
26    pubkey_array!("amt2kaJA14v3urZbZvnc5v2np8jqvc4Z8zDep5wbtzx");
27
28/// Size of TransferFeeAccountExtension: 1 discriminant + 8 withheld_amount
29pub const TRANSFER_FEE_ACCOUNT_EXTENSION_LEN: u64 = 9;
30
31/// Size of TransferHookAccountExtension: 1 discriminant + 1 transferring
32pub const TRANSFER_HOOK_ACCOUNT_EXTENSION_LEN: u64 = 2;
33
34/// Instruction discriminator for Transfer2
35pub const TRANSFER2: u8 = 101;
36
37/// Pool PDA seeds
38pub const POOL_SEED: &[u8] = b"pool";
39pub const RESTRICTED_POOL_SEED: &[u8] = b"restricted";