light_compressible/
lib.rs

1pub mod compression_info;
2pub mod config;
3pub mod error;
4pub mod registry_instructions;
5pub mod rent;
6
7#[cfg(feature = "anchor")]
8use anchor_lang::{AnchorDeserialize, AnchorSerialize};
9#[cfg(not(feature = "anchor"))]
10use borsh::{BorshDeserialize as AnchorDeserialize, BorshSerialize as AnchorSerialize};
11use light_compressed_account::instruction_data::compressed_proof::ValidityProof;
12use light_sdk_types::instruction::PackedAddressTreeInfo;
13
14/// Proof data for instruction params when creating new compressed accounts.
15/// Used in the INIT flow - pass directly to instruction data.
16/// All accounts use the same address tree, so only one `address_tree_info` is needed.
17#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug)]
18pub struct CreateAccountsProof {
19    /// The validity proof.
20    pub proof: ValidityProof,
21    /// Single packed address tree info (all accounts use same tree).
22    pub address_tree_info: PackedAddressTreeInfo,
23    /// Output state tree index for new compressed accounts.
24    pub output_state_tree_index: u8,
25    /// State merkle tree index (needed for mint creation decompress validation).
26    /// This is optional to maintain backwards compatibility.
27    pub state_tree_index: Option<u8>,
28}