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::{
12    compressed_proof::ValidityProof, data::PackedAddressTreeInfo,
13};
14
15/// Proof data for instruction params when creating new compressed accounts.
16/// Used in the INIT flow - pass directly to instruction data.
17/// All accounts use the same address tree, so only one `address_tree_info` is needed.
18#[derive(AnchorSerialize, AnchorDeserialize, Clone, Debug)]
19pub struct CreateAccountsProof {
20    /// The validity proof.
21    pub proof: ValidityProof,
22    /// Single packed address tree info (all accounts use same tree).
23    pub address_tree_info: PackedAddressTreeInfo,
24    /// Output state tree index for new compressed accounts.
25    pub output_state_tree_index: u8,
26    /// State merkle tree index (needed for mint creation decompress validation).
27    /// This is optional to maintain backwards compatibility.
28    pub state_tree_index: Option<u8>,
29}