1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//!
//!
//! To create, update, or close compressed accounts,
//! programs need to invoke the light system program via cross program invocation (cpi).
//!
//! ```ignore
//! declare_id!("2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt");
//! pub const LIGHT_CPI_SIGNER: CpiSigner =
//! derive_light_cpi_signer!("2tzfijPBGbrR5PboyFUFKzfEoLTwdDSHUjANCw929wyt");
//!
//! let light_cpi_accounts = CpiAccounts::new(
//! ctx.accounts.fee_payer.as_ref(),
//! ctx.remaining_accounts,
//! crate::LIGHT_CPI_SIGNER,
//! )?;
//!
//! let (address, address_seed) = derive_address(
//! &[b"compressed", name.as_bytes()],
//! &address_tree_info.get_tree_pubkey(&light_cpi_accounts)?,
//! &crate::ID,
//! );
//! let new_address_params = address_tree_info.into_new_address_params_packed(address_seed);
//!
//! let mut my_compressed_account = LightAccount::<MyCompressedAccount>::new_init(
//! &crate::ID,
//! Some(address),
//! output_tree_index,
//! );
//!
//! my_compressed_account.name = name;
//!
//! LightSystemProgramCpi::new_cpi(crate::LIGHT_CPI_SIGNER, proof)
//! .with_light_account(my_compressed_account)?
//! .with_new_addresses(&[new_address_params])
//! .invoke(light_cpi_accounts)?;
//! ```
// Re-export local traits at crate::cpi:: level
pub use CpiAccountsTrait;
pub use LightCpiInstruction;
pub use ;
// Re-export non-conflicting items from sdk-types
pub use ;