├── amm-cpi ├── programs │ └── amm-cpi │ │ ├── Xargo.toml │ │ ├── src │ │ ├── instructions │ │ │ ├── mod.rs │ │ │ ├── proxy_deposit.rs │ │ │ ├── proxy_swap_base_in.rs │ │ │ ├── proxy_swap_base_out.rs │ │ │ ├── proxy_withdraw.rs │ │ │ └── proxy_initialize.rs │ │ └── lib.rs │ │ └── Cargo.toml ├── Cargo.toml └── Anchor.toml ├── clmm-cpi ├── programs │ └── clmm-cpi │ │ ├── Xargo.toml │ │ ├── src │ │ ├── instructions │ │ │ ├── mod.rs │ │ │ ├── proxy_close_position.rs │ │ │ ├── proxy_swap.rs │ │ │ ├── proxy_initialize.rs │ │ │ ├── proxy_increase_liquidity.rs │ │ │ ├── proxy_decrease_liquidity.rs │ │ │ └── proxy_open_position.rs │ │ └── lib.rs │ │ └── Cargo.toml ├── Cargo.toml └── Anchor.toml ├── cp-swap-cpi ├── programs │ └── cp-swap-cpi │ │ ├── Xargo.toml │ │ ├── src │ │ ├── instructions │ │ │ ├── mod.rs │ │ │ ├── proxy_swap_base_output.rs │ │ │ ├── proxy_swap_base_input.rs │ │ │ ├── proxy_deposit.rs │ │ │ ├── proxy_withdraw.rs │ │ │ └── proxy_initialize.rs │ │ └── lib.rs │ │ └── Cargo.toml ├── Cargo.toml ├── Anchor.toml └── Cargo.lock ├── .gitignore └── README.md /amm-cpi/programs/amm-cpi/Xargo.toml: -------------------------------------------------------------------------------- 1 | [target.bpfel-unknown-unknown.dependencies.std] 2 | features = [] 3 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/Xargo.toml: -------------------------------------------------------------------------------- 1 | [target.bpfel-unknown-unknown.dependencies.std] 2 | features = [] 3 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/Xargo.toml: -------------------------------------------------------------------------------- 1 | [target.bpfel-unknown-unknown.dependencies.std] 2 | features = [] 3 | -------------------------------------------------------------------------------- /amm-cpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "programs/*" 4 | ] 5 | 6 | [profile.release] 7 | overflow-checks = true 8 | lto = "fat" 9 | codegen-units = 1 10 | [profile.release.build-override] 11 | opt-level = 3 12 | incremental = false 13 | codegen-units = 1 14 | -------------------------------------------------------------------------------- /clmm-cpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "programs/*" 4 | ] 5 | 6 | [profile.release] 7 | overflow-checks = true 8 | lto = "fat" 9 | codegen-units = 1 10 | [profile.release.build-override] 11 | opt-level = 3 12 | incremental = false 13 | codegen-units = 1 14 | -------------------------------------------------------------------------------- /cp-swap-cpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "programs/*" 4 | ] 5 | 6 | [profile.release] 7 | overflow-checks = true 8 | lto = "fat" 9 | codegen-units = 1 10 | [profile.release.build-override] 11 | opt-level = 3 12 | incremental = false 13 | codegen-units = 1 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | 3 | 4 | # Include target/deploy/whirlpool_cpi_sample-keypair.json (this secret key is dedicated for sample only) 5 | **/target/* 6 | !**/target/deploy 7 | **/target/deploy/* 8 | # !**/target/deploy/amm_cpi-keypair.json 9 | # !**/target/deploy/cp_swap_cpi-keypair.json 10 | 11 | .DS_Store 12 | .anchor/ 13 | 14 | test-ledger/ -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/instructions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod proxy_deposit; 2 | pub mod proxy_initialize; 3 | pub mod proxy_swap_base_in; 4 | pub mod proxy_swap_base_out; 5 | pub mod proxy_withdraw; 6 | 7 | pub use proxy_deposit::*; 8 | pub use proxy_initialize::*; 9 | pub use proxy_swap_base_in::*; 10 | pub use proxy_swap_base_out::*; 11 | pub use proxy_withdraw::*; 12 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/instructions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod proxy_deposit; 2 | pub mod proxy_initialize; 3 | pub mod proxy_swap_base_input; 4 | pub mod proxy_swap_base_output; 5 | pub mod proxy_withdraw; 6 | 7 | pub use proxy_deposit::*; 8 | pub use proxy_initialize::*; 9 | pub use proxy_swap_base_input::*; 10 | pub use proxy_swap_base_output::*; 11 | pub use proxy_withdraw::*; 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Solana-Raydium-CPI 2 | This is Raydium CPI example that use anchor. You can learn how to interact with Raydium program. If you feed difficutly or any new project, feel free to reach out of me[Telegram: https://t.me/DevCutup, Whatspp: https://wa.me/13137423660]. 3 | 4 | 5 | ### Contact Information 6 | - Telegram: https://t.me/DevCutup 7 | - Whatsapp: https://wa.me/13137423660 8 | - Twitter: https://x.com/devcutup 9 | -------------------------------------------------------------------------------- /amm-cpi/Anchor.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | 3 | [features] 4 | seeds = false 5 | skip-lint = false 6 | 7 | [programs.localnet] 8 | amm_cpi = "3igNEs6GbvsAgEicsLTkduyhVFWXNkGerQobX1fdZdf9" 9 | 10 | [registry] 11 | url = "https://api.apr.dev" 12 | 13 | [provider] 14 | cluster = "Localnet" 15 | wallet = "/home/ubuntu/.config/solana/id.json" 16 | 17 | [scripts] 18 | test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" 19 | -------------------------------------------------------------------------------- /clmm-cpi/Anchor.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | 3 | [features] 4 | seeds = false 5 | skip-lint = false 6 | 7 | [programs.localnet] 8 | clmm_cpi = "8wGnAiSXYK31kdas6qNgfr8N3pzHoBEAaDK824qgYE81" 9 | 10 | [registry] 11 | url = "https://api.apr.dev" 12 | 13 | [provider] 14 | cluster = "Localnet" 15 | wallet = "/home/ubuntu/.config/solana/id.json" 16 | 17 | [scripts] 18 | test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" 19 | -------------------------------------------------------------------------------- /cp-swap-cpi/Anchor.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | 3 | [features] 4 | seeds = false 5 | skip-lint = false 6 | 7 | [programs.localnet] 8 | cpswap_cpi = "A5DqDJBweQTieKjx3RXrnFHU1oQCD69edaDe5ztyn7KK" 9 | 10 | [registry] 11 | url = "https://api.apr.dev" 12 | 13 | [provider] 14 | cluster = "Localnet" 15 | wallet = "/home/ubuntu/.config/solana/id.json" 16 | 17 | [scripts] 18 | test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" 19 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/mod.rs: -------------------------------------------------------------------------------- 1 | pub mod proxy_close_position; 2 | pub mod proxy_decrease_liquidity; 3 | pub mod proxy_increase_liquidity; 4 | pub mod proxy_initialize; 5 | pub mod proxy_open_position; 6 | pub mod proxy_swap; 7 | 8 | pub use proxy_close_position::*; 9 | pub use proxy_decrease_liquidity::*; 10 | pub use proxy_increase_liquidity::*; 11 | pub use proxy_initialize::*; 12 | pub use proxy_open_position::*; 13 | pub use proxy_swap::*; 14 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "amm-cpi" 3 | version = "0.1.0" 4 | description = "Created with Anchor" 5 | edition = "2021" 6 | 7 | [lib] 8 | crate-type = ["cdylib", "lib"] 9 | name = "amm_cpi" 10 | 11 | [features] 12 | no-entrypoint = [] 13 | no-idl = [] 14 | no-log-ix-name = [] 15 | cpi = ["no-entrypoint"] 16 | default = [] 17 | 18 | [dependencies] 19 | anchor-lang = "0.29.0" 20 | anchor-spl = "0.29.0" 21 | amm-anchor = { git = "https://github.com/raydium-io/raydium-contract-instructions", package = "amm-anchor" } 22 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "clmm-cpi" 3 | version = "0.1.0" 4 | description = "Created with Anchor" 5 | edition = "2021" 6 | 7 | [lib] 8 | crate-type = ["cdylib", "lib"] 9 | name = "clmm_cpi" 10 | 11 | [features] 12 | no-entrypoint = [] 13 | no-idl = [] 14 | no-log-ix-name = [] 15 | cpi = ["no-entrypoint"] 16 | default = [] 17 | 18 | [dependencies] 19 | anchor-lang = "=0.29.0" 20 | anchor-spl = "=0.29.0" 21 | raydium-amm-v3 = { git = "https://github.com/raydium-io/raydium-clmm", features = [ 22 | "no-entrypoint", 23 | "cpi", 24 | ] } 25 | spl-memo = "4.0.0" 26 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cp-swap-cpi" 3 | version = "0.1.0" 4 | description = "Created with Anchor" 5 | edition = "2021" 6 | 7 | [lib] 8 | crate-type = ["cdylib", "lib"] 9 | name = "cp_swap_cpi" 10 | 11 | [features] 12 | no-entrypoint = [] 13 | no-idl = [] 14 | no-log-ix-name = [] 15 | cpi = ["no-entrypoint"] 16 | default = [] 17 | 18 | [dependencies] 19 | anchor-lang = "=0.29.0" 20 | anchor-spl = "=0.29.0" 21 | raydium-cp-swap = { git = "https://github.com/raydium-io/raydium-cp-swap", features = [ 22 | "no-entrypoint", 23 | "cpi", 24 | ] } 25 | spl-memo = "4.0.0" 26 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/lib.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use instructions::*; 3 | 4 | pub mod instructions; 5 | 6 | declare_id!("3igNEs6GbvsAgEicsLTkduyhVFWXNkGerQobX1fdZdf9"); 7 | 8 | #[program] 9 | pub mod amm_cpi { 10 | use super::*; 11 | 12 | /// Initiazlize a swap pool 13 | pub fn proxy_initialize( 14 | ctx: Context, 15 | nonce: u8, 16 | open_time: u64, 17 | init_pc_amount: u64, 18 | init_coin_amount: u64, 19 | ) -> Result<()> { 20 | instructions::initialize(ctx, nonce, open_time, init_pc_amount, init_coin_amount) 21 | } 22 | 23 | /// deposit instruction 24 | pub fn proxy_deposit( 25 | ctx: Context, 26 | max_coin_amount: u64, 27 | max_pc_amount: u64, 28 | base_side: u64, 29 | ) -> Result<()> { 30 | instructions::deposit(ctx, max_coin_amount, max_pc_amount, base_side) 31 | } 32 | 33 | /// withdraw instruction 34 | pub fn proxy_withdraw(ctx: Context, amount: u64) -> Result<()> { 35 | instructions::withdraw(ctx, amount) 36 | } 37 | 38 | /// swap_base_in instruction 39 | pub fn proxy_swap_base_in( 40 | ctx: Context, 41 | amount_in: u64, 42 | minimum_amount_out: u64, 43 | ) -> Result<()> { 44 | instructions::swap_base_in(ctx, amount_in, minimum_amount_out) 45 | } 46 | 47 | /// swap_base_out instruction 48 | pub fn proxy_swap_base_out( 49 | ctx: Context, 50 | max_amount_in: u64, 51 | amount_out: u64, 52 | ) -> Result<()> { 53 | instructions::swap_base_out(ctx, max_amount_in, amount_out) 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/lib.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | 3 | pub mod instructions; 4 | use instructions::*; 5 | 6 | declare_id!("A5DqDJBweQTieKjx3RXrnFHU1oQCD69edaDe5ztyn7KK"); 7 | 8 | #[program] 9 | pub mod cp_swap_cpi { 10 | use super::*; 11 | 12 | pub fn proxy_initialize( 13 | ctx: Context, 14 | init_amount_0: u64, 15 | init_amount_1: u64, 16 | open_time: u64, 17 | ) -> Result<()> { 18 | instructions::proxy_initialize(ctx, init_amount_0, init_amount_1, open_time) 19 | } 20 | 21 | pub fn proxy_deposit( 22 | ctx: Context, 23 | lp_token_amount: u64, 24 | maximum_token_0_amount: u64, 25 | maximum_token_1_amount: u64, 26 | ) -> Result<()> { 27 | instructions::proxy_deposit( 28 | ctx, 29 | lp_token_amount, 30 | maximum_token_0_amount, 31 | maximum_token_1_amount, 32 | ) 33 | } 34 | 35 | pub fn proxy_withdraw( 36 | ctx: Context, 37 | lp_token_amount: u64, 38 | minimum_token_0_amount: u64, 39 | minimum_token_1_amount: u64, 40 | ) -> Result<()> { 41 | instructions::proxy_withdraw( 42 | ctx, 43 | lp_token_amount, 44 | minimum_token_0_amount, 45 | minimum_token_1_amount, 46 | ) 47 | } 48 | 49 | pub fn proxy_swap_base_input( 50 | ctx: Context, 51 | amount_in: u64, 52 | minimum_amount_out: u64, 53 | ) -> Result<()> { 54 | instructions::proxy_swap_base_input(ctx, amount_in, minimum_amount_out) 55 | } 56 | 57 | pub fn proxy_swap_base_output( 58 | ctx: Context, 59 | max_amount_in: u64, 60 | amount_out: u64, 61 | ) -> Result<()> { 62 | instructions::proxy_swap_base_output(ctx, max_amount_in, amount_out) 63 | } 64 | } 65 | 66 | #[derive(Accounts)] 67 | pub struct Initialize {} 68 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/proxy_close_position.rs: -------------------------------------------------------------------------------- 1 | 2 | use anchor_lang::prelude::*; 3 | use anchor_spl::token::Token; 4 | use anchor_spl::token_interface::{Mint,TokenAccount}; 5 | use raydium_amm_v3::{ 6 | cpi, 7 | program::AmmV3, 8 | states::{PersonalPositionState, POSITION_SEED,}, 9 | }; 10 | #[derive(Accounts)] 11 | pub struct ProxyClosePosition<'info> { 12 | pub clmm_program: Program<'info, AmmV3>, 13 | /// The position nft owner 14 | #[account(mut)] 15 | pub nft_owner: Signer<'info>, 16 | 17 | /// Unique token mint address 18 | #[account( 19 | mut, 20 | address = personal_position.nft_mint, 21 | mint::token_program = token_program, 22 | )] 23 | pub position_nft_mint: Box>, 24 | 25 | /// Token account where position NFT will be minted 26 | #[account( 27 | mut, 28 | associated_token::mint = position_nft_mint, 29 | associated_token::authority = nft_owner, 30 | constraint = position_nft_account.amount == 1, 31 | token::token_program = token_program, 32 | )] 33 | pub position_nft_account: Box>, 34 | 35 | /// To store metaplex metadata 36 | /// CHECK: Safety check performed inside function body 37 | // #[account(mut)] 38 | // pub metadata_account: UncheckedAccount<'info>, 39 | 40 | /// Metadata for the tokenized position 41 | #[account( 42 | mut, 43 | seeds = [POSITION_SEED.as_bytes(), position_nft_mint.key().as_ref()], 44 | bump, 45 | close = nft_owner 46 | )] 47 | pub personal_position: Box>, 48 | 49 | /// Program to create the position manager state account 50 | pub system_program: Program<'info, System>, 51 | /// Program to create mint account and mint tokens 52 | pub token_program: Program<'info, Token>, 53 | // /// Reserved for upgrade 54 | // pub token_program_2022: Program<'info, Token2022>, 55 | } 56 | 57 | pub fn proxy_close_position<'a, 'b, 'c, 'info>( 58 | ctx: Context<'a, 'b, 'c, 'info, ProxyClosePosition<'info>>, 59 | ) -> Result<()> { 60 | let cpi_accounts = cpi::accounts::ClosePosition { 61 | nft_owner:ctx.accounts.nft_owner.to_account_info(), 62 | position_nft_mint:ctx.accounts.position_nft_mint.to_account_info(), 63 | position_nft_account:ctx.accounts.position_nft_account.to_account_info(), 64 | personal_position:ctx.accounts.personal_position.to_account_info(), 65 | system_program:ctx.accounts.system_program.to_account_info(), 66 | token_program:ctx.accounts.token_program.to_account_info(), 67 | }; 68 | let cpi_context = CpiContext::new(ctx.accounts.clmm_program.to_account_info(), cpi_accounts) 69 | .with_remaining_accounts(ctx.remaining_accounts.to_vec()); 70 | cpi::close_position( cpi_context) 71 | } -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/lib.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | pub mod instructions; 3 | pub use instructions::*; 4 | 5 | declare_id!("8wGnAiSXYK31kdas6qNgfr8N3pzHoBEAaDK824qgYE81"); 6 | 7 | #[program] 8 | pub mod clmm_cpi { 9 | use super::*; 10 | 11 | pub fn proxy_initialize( 12 | ctx: Context, 13 | sqrt_price_x64: u128, 14 | open_time: u64, 15 | ) -> Result<()> { 16 | instructions::proxy_initialize(ctx, sqrt_price_x64, open_time) 17 | } 18 | 19 | pub fn proxy_open_position<'a, 'b, 'c: 'info, 'info>( 20 | ctx: Context<'a, 'b, 'c, 'info, ProxyOpenPosition<'info>>, 21 | tick_lower_index: i32, 22 | tick_upper_index: i32, 23 | tick_array_lower_start_index: i32, 24 | tick_array_upper_start_index: i32, 25 | liquidity: u128, 26 | amount_0_max: u64, 27 | amount_1_max: u64, 28 | with_matedata: bool, 29 | base_flag: Option, 30 | ) -> Result<()> { 31 | instructions::proxy_open_position( 32 | ctx, 33 | tick_lower_index, 34 | tick_upper_index, 35 | tick_array_lower_start_index, 36 | tick_array_upper_start_index, 37 | liquidity, 38 | amount_0_max, 39 | amount_1_max, 40 | with_matedata, 41 | base_flag, 42 | ) 43 | } 44 | pub fn proxy_close_position<'a, 'b, 'c: 'info, 'info>( 45 | ctx: Context<'a, 'b, 'c, 'info, ProxyClosePosition<'info>>, 46 | ) -> Result<()> { 47 | instructions::proxy_close_position(ctx) 48 | } 49 | 50 | pub fn proxy_increase_liquidity<'a, 'b, 'c: 'info, 'info>( 51 | ctx: Context<'a, 'b, 'c, 'info, ProxyIncreaseLiquidity<'info>>, 52 | liquidity: u128, 53 | amount_0_max: u64, 54 | amount_1_max: u64, 55 | base_flag: Option, 56 | ) -> Result<()> { 57 | instructions::proxy_increase_liquidity( 58 | ctx, 59 | liquidity, 60 | amount_0_max, 61 | amount_1_max, 62 | base_flag, 63 | ) 64 | } 65 | pub fn proxy_decrease_liquidity<'a, 'b, 'c: 'info, 'info>( 66 | ctx: Context<'a, 'b, 'c, 'info, ProxyDecreaseLiquidity<'info>>, 67 | liquidity: u128, 68 | amount_0_min: u64, 69 | amount_1_min: u64, 70 | ) -> Result<()> { 71 | instructions::proxy_decrease_liquidity(ctx, liquidity, amount_0_min, amount_1_min) 72 | } 73 | pub fn proxy_swap<'a, 'b, 'c: 'info, 'info>( 74 | ctx: Context<'a, 'b, 'c, 'info, ProxySwap<'info>>, 75 | amount: u64, 76 | other_amount_threshold: u64, 77 | sqrt_price_limit_x64: u128, 78 | is_base_input: bool, 79 | ) -> Result<()> { 80 | instructions::proxy_swap( 81 | ctx, 82 | amount, 83 | other_amount_threshold, 84 | sqrt_price_limit_x64, 85 | is_base_input, 86 | ) 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/instructions/proxy_deposit.rs: -------------------------------------------------------------------------------- 1 | use amm_anchor::Deposit; 2 | use anchor_lang::prelude::*; 3 | use anchor_spl::token::Token; 4 | #[derive(Accounts, Clone)] 5 | pub struct ProxyDeposit<'info> { 6 | /// CHECK: Safe 7 | pub amm_program: UncheckedAccount<'info>, 8 | /// CHECK: Safe. Amm Account 9 | #[account(mut)] 10 | pub amm: UncheckedAccount<'info>, 11 | /// CHECK: Safe. Amm authority, a PDA create with seed = [b"amm authority"] 12 | #[account()] 13 | pub amm_authority: UncheckedAccount<'info>, 14 | /// CHECK: Safe. AMM open_orders Account. 15 | #[account()] 16 | pub amm_open_orders: UncheckedAccount<'info>, 17 | /// CHECK: Safe. AMM target orders account. To store plan orders infomations. 18 | #[account(mut)] 19 | pub amm_target_orders: UncheckedAccount<'info>, 20 | /// CHECK: Safe. LP mint account. Must be empty, owned by $authority. 21 | #[account(mut)] 22 | pub amm_lp_mint: UncheckedAccount<'info>, 23 | /// CHECK: Safe. amm_coin_vault account, $authority can transfer amount. 24 | #[account(mut)] 25 | pub amm_coin_vault: UncheckedAccount<'info>, 26 | /// CHECK: Safe. amm_pc_vault account, $authority can transfer amount. 27 | #[account(mut)] 28 | pub amm_pc_vault: UncheckedAccount<'info>, 29 | /// CHECK: Safe. OpenBook market account, OpenBook program is the owner. 30 | pub market: UncheckedAccount<'info>, 31 | /// CHECK: Safe. OpenBook market event queue account, OpenBook program is the owner. 32 | pub market_event_queue: UncheckedAccount<'info>, 33 | /// CHECK: Safe. User token coin to deposit into. 34 | #[account(mut)] 35 | pub user_token_coin: UncheckedAccount<'info>, 36 | /// CHECK: Safe. User token pc to deposit into. 37 | #[account(mut)] 38 | pub user_token_pc: UncheckedAccount<'info>, 39 | /// CHECK: Safe. User lp token, to deposit the generated tokens, user is the owner 40 | #[account(mut)] 41 | pub user_token_lp: UncheckedAccount<'info>, 42 | /// CHECK: Safe. User wallet account 43 | #[account(mut)] 44 | pub user_owner: Signer<'info>, 45 | /// CHECK: Safe. The spl token program 46 | pub token_program: Program<'info, Token>, 47 | } 48 | 49 | impl<'a, 'b, 'c, 'info> From<&mut ProxyDeposit<'info>> 50 | for CpiContext<'a, 'b, 'c, 'info, Deposit<'info>> 51 | { 52 | fn from(accounts: &mut ProxyDeposit<'info>) -> CpiContext<'a, 'b, 'c, 'info, Deposit<'info>> { 53 | let cpi_accounts = Deposit { 54 | amm: accounts.amm.clone(), 55 | amm_authority: accounts.amm_authority.clone(), 56 | amm_open_orders: accounts.amm_open_orders.clone(), 57 | amm_target_orders: accounts.amm_target_orders.clone(), 58 | amm_lp_mint: accounts.amm_lp_mint.clone(), 59 | amm_coin_vault: accounts.amm_coin_vault.clone(), 60 | amm_pc_vault: accounts.amm_pc_vault.clone(), 61 | market: accounts.market.clone(), 62 | market_event_queue: accounts.market_event_queue.clone(), 63 | user_token_coin: accounts.user_token_coin.clone(), 64 | user_token_pc: accounts.user_token_pc.clone(), 65 | user_token_lp: accounts.user_token_lp.clone(), 66 | user_owner: accounts.user_owner.clone(), 67 | token_program: accounts.token_program.clone(), 68 | }; 69 | let cpi_program = accounts.amm_program.to_account_info(); 70 | CpiContext::new(cpi_program, cpi_accounts) 71 | } 72 | } 73 | 74 | pub fn deposit( 75 | ctx: Context, 76 | max_coin_amount: u64, 77 | max_pc_amount: u64, 78 | base_side: u64, 79 | ) -> Result<()> { 80 | amm_anchor::deposit( 81 | ctx.accounts.into(), 82 | max_coin_amount, 83 | max_pc_amount, 84 | base_side, 85 | ) 86 | } 87 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/instructions/proxy_swap_base_output.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; 3 | use raydium_cp_swap::{ 4 | cpi, 5 | program::RaydiumCpSwap, 6 | states::{AmmConfig, ObservationState, PoolState}, 7 | }; 8 | 9 | #[derive(Accounts)] 10 | pub struct ProxySwapBaseOutput<'info> { 11 | pub cp_swap_program: Program<'info, RaydiumCpSwap>, 12 | /// The user performing the swap 13 | pub payer: Signer<'info>, 14 | 15 | /// CHECK: pool vault and lp mint authority 16 | #[account( 17 | seeds = [ 18 | raydium_cp_swap::AUTH_SEED.as_bytes(), 19 | ], 20 | bump, 21 | )] 22 | pub authority: UncheckedAccount<'info>, 23 | 24 | /// The factory state to read protocol fees 25 | #[account(address = pool_state.load()?.amm_config)] 26 | pub amm_config: Box>, 27 | 28 | /// The program account of the pool in which the swap will be performed 29 | #[account(mut)] 30 | pub pool_state: AccountLoader<'info, PoolState>, 31 | 32 | /// The user token account for input token 33 | #[account(mut)] 34 | pub input_token_account: Box>, 35 | 36 | /// The user token account for output token 37 | #[account(mut)] 38 | pub output_token_account: Box>, 39 | 40 | /// The vault token account for input token 41 | #[account( 42 | mut, 43 | constraint = input_vault.key() == pool_state.load()?.token_0_vault || input_vault.key() == pool_state.load()?.token_1_vault 44 | )] 45 | pub input_vault: Box>, 46 | 47 | /// The vault token account for output token 48 | #[account( 49 | mut, 50 | constraint = output_vault.key() == pool_state.load()?.token_0_vault || output_vault.key() == pool_state.load()?.token_1_vault 51 | )] 52 | pub output_vault: Box>, 53 | 54 | /// SPL program for input token transfers 55 | pub input_token_program: Interface<'info, TokenInterface>, 56 | 57 | /// SPL program for output token transfers 58 | pub output_token_program: Interface<'info, TokenInterface>, 59 | 60 | /// The mint of input token 61 | #[account( 62 | address = input_vault.mint 63 | )] 64 | pub input_token_mint: Box>, 65 | 66 | /// The mint of output token 67 | #[account( 68 | address = output_vault.mint 69 | )] 70 | pub output_token_mint: Box>, 71 | /// The program account for the most recent oracle observation 72 | #[account(mut, address = pool_state.load()?.observation_key)] 73 | pub observation_state: AccountLoader<'info, ObservationState>, 74 | } 75 | 76 | pub fn proxy_swap_base_output( 77 | ctx: Context, 78 | max_amount_in: u64, 79 | amount_out: u64, 80 | ) -> Result<()> { 81 | let cpi_accounts = cpi::accounts::Swap { 82 | payer: ctx.accounts.payer.to_account_info(), 83 | authority: ctx.accounts.authority.to_account_info(), 84 | amm_config: ctx.accounts.amm_config.to_account_info(), 85 | pool_state: ctx.accounts.pool_state.to_account_info(), 86 | input_token_account: ctx.accounts.input_token_account.to_account_info(), 87 | output_token_account: ctx.accounts.output_token_account.to_account_info(), 88 | input_vault: ctx.accounts.input_vault.to_account_info(), 89 | output_vault: ctx.accounts.output_vault.to_account_info(), 90 | input_token_program: ctx.accounts.input_token_program.to_account_info(), 91 | output_token_program: ctx.accounts.output_token_program.to_account_info(), 92 | input_token_mint: ctx.accounts.input_token_mint.to_account_info(), 93 | output_token_mint: ctx.accounts.output_token_mint.to_account_info(), 94 | observation_state: ctx.accounts.observation_state.to_account_info(), 95 | }; 96 | let cpi_context = CpiContext::new(ctx.accounts.cp_swap_program.to_account_info(), cpi_accounts); 97 | cpi::swap_base_output(cpi_context, max_amount_in, amount_out) 98 | } 99 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/instructions/proxy_swap_base_input.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::token_interface::{Mint, TokenAccount, TokenInterface}; 3 | use raydium_cp_swap::{ 4 | cpi, 5 | program::RaydiumCpSwap, 6 | states::{AmmConfig, ObservationState, PoolState}, 7 | }; 8 | 9 | #[derive(Accounts)] 10 | pub struct ProxySwapBaseInput<'info> { 11 | pub cp_swap_program: Program<'info, RaydiumCpSwap>, 12 | /// The user performing the swap 13 | pub payer: Signer<'info>, 14 | 15 | /// CHECK: pool vault and lp mint authority 16 | #[account( 17 | seeds = [ 18 | raydium_cp_swap::AUTH_SEED.as_bytes(), 19 | ], 20 | bump, 21 | )] 22 | pub authority: UncheckedAccount<'info>, 23 | 24 | /// The factory state to read protocol fees 25 | #[account(address = pool_state.load()?.amm_config)] 26 | pub amm_config: Box>, 27 | 28 | /// The program account of the pool in which the swap will be performed 29 | #[account(mut)] 30 | pub pool_state: AccountLoader<'info, PoolState>, 31 | 32 | /// The user token account for input token 33 | #[account(mut)] 34 | pub input_token_account: Box>, 35 | 36 | /// The user token account for output token 37 | #[account(mut)] 38 | pub output_token_account: Box>, 39 | 40 | /// The vault token account for input token 41 | #[account( 42 | mut, 43 | constraint = input_vault.key() == pool_state.load()?.token_0_vault || input_vault.key() == pool_state.load()?.token_1_vault 44 | )] 45 | pub input_vault: Box>, 46 | 47 | /// The vault token account for output token 48 | #[account( 49 | mut, 50 | constraint = output_vault.key() == pool_state.load()?.token_0_vault || output_vault.key() == pool_state.load()?.token_1_vault 51 | )] 52 | pub output_vault: Box>, 53 | 54 | /// SPL program for input token transfers 55 | pub input_token_program: Interface<'info, TokenInterface>, 56 | 57 | /// SPL program for output token transfers 58 | pub output_token_program: Interface<'info, TokenInterface>, 59 | 60 | /// The mint of input token 61 | #[account( 62 | address = input_vault.mint 63 | )] 64 | pub input_token_mint: Box>, 65 | 66 | /// The mint of output token 67 | #[account( 68 | address = output_vault.mint 69 | )] 70 | pub output_token_mint: Box>, 71 | /// The program account for the most recent oracle observation 72 | #[account(mut, address = pool_state.load()?.observation_key)] 73 | pub observation_state: AccountLoader<'info, ObservationState>, 74 | } 75 | 76 | pub fn proxy_swap_base_input( 77 | ctx: Context, 78 | amount_in: u64, 79 | minimum_amount_out: u64, 80 | ) -> Result<()> { 81 | let cpi_accounts = cpi::accounts::Swap { 82 | payer: ctx.accounts.payer.to_account_info(), 83 | authority: ctx.accounts.authority.to_account_info(), 84 | amm_config: ctx.accounts.amm_config.to_account_info(), 85 | pool_state: ctx.accounts.pool_state.to_account_info(), 86 | input_token_account: ctx.accounts.input_token_account.to_account_info(), 87 | output_token_account: ctx.accounts.output_token_account.to_account_info(), 88 | input_vault: ctx.accounts.input_vault.to_account_info(), 89 | output_vault: ctx.accounts.output_vault.to_account_info(), 90 | input_token_program: ctx.accounts.input_token_program.to_account_info(), 91 | output_token_program: ctx.accounts.output_token_program.to_account_info(), 92 | input_token_mint: ctx.accounts.input_token_mint.to_account_info(), 93 | output_token_mint: ctx.accounts.output_token_mint.to_account_info(), 94 | observation_state: ctx.accounts.observation_state.to_account_info(), 95 | }; 96 | let cpi_context = CpiContext::new(ctx.accounts.cp_swap_program.to_account_info(), cpi_accounts); 97 | cpi::swap_base_input(cpi_context, amount_in, minimum_amount_out) 98 | } 99 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/instructions/proxy_swap_base_in.rs: -------------------------------------------------------------------------------- 1 | use amm_anchor::SwapBaseIn; 2 | use anchor_lang::prelude::*; 3 | use anchor_spl::token::Token; 4 | #[derive(Accounts, Clone)] 5 | pub struct ProxySwapBaseIn<'info> { 6 | /// CHECK: Safe 7 | pub amm_program: UncheckedAccount<'info>, 8 | /// CHECK: Safe. amm Account 9 | #[account(mut)] 10 | pub amm: UncheckedAccount<'info>, 11 | /// CHECK: Safe. Amm authority Account 12 | #[account()] 13 | pub amm_authority: UncheckedAccount<'info>, 14 | /// CHECK: Safe. amm open_orders Account 15 | #[account(mut)] 16 | pub amm_open_orders: UncheckedAccount<'info>, 17 | /// CHECK: Safe. amm_coin_vault Amm Account to swap FROM or To, 18 | #[account(mut)] 19 | pub amm_coin_vault: UncheckedAccount<'info>, 20 | /// CHECK: Safe. amm_pc_vault Amm Account to swap FROM or To, 21 | #[account(mut)] 22 | pub amm_pc_vault: UncheckedAccount<'info>, 23 | /// CHECK: Safe.OpenBook program id 24 | pub market_program: UncheckedAccount<'info>, 25 | /// CHECK: Safe. OpenBook market Account. OpenBook program is the owner. 26 | #[account(mut)] 27 | pub market: UncheckedAccount<'info>, 28 | /// CHECK: Safe. bids Account 29 | #[account(mut)] 30 | pub market_bids: UncheckedAccount<'info>, 31 | /// CHECK: Safe. asks Account 32 | #[account(mut)] 33 | pub market_asks: UncheckedAccount<'info>, 34 | /// CHECK: Safe. event_q Account 35 | #[account(mut)] 36 | pub market_event_queue: UncheckedAccount<'info>, 37 | /// CHECK: Safe. coin_vault Account 38 | #[account(mut)] 39 | pub market_coin_vault: UncheckedAccount<'info>, 40 | /// CHECK: Safe. pc_vault Account 41 | #[account(mut)] 42 | pub market_pc_vault: UncheckedAccount<'info>, 43 | /// CHECK: Safe. vault_signer Account 44 | #[account(mut)] 45 | pub market_vault_signer: UncheckedAccount<'info>, 46 | /// CHECK: Safe. user source token Account. user Account to swap from. 47 | #[account(mut)] 48 | pub user_token_source: UncheckedAccount<'info>, 49 | /// CHECK: Safe. user destination token Account. user Account to swap to. 50 | #[account(mut)] 51 | pub user_token_destination: UncheckedAccount<'info>, 52 | /// CHECK: Safe. user owner Account 53 | #[account(mut)] 54 | pub user_source_owner: Signer<'info>, 55 | /// CHECK: Safe. The spl token program 56 | pub token_program: Program<'info, Token>, 57 | } 58 | 59 | impl<'a, 'b, 'c, 'info> From<&mut ProxySwapBaseIn<'info>> 60 | for CpiContext<'a, 'b, 'c, 'info, SwapBaseIn<'info>> 61 | { 62 | fn from( 63 | accounts: &mut ProxySwapBaseIn<'info>, 64 | ) -> CpiContext<'a, 'b, 'c, 'info, SwapBaseIn<'info>> { 65 | let cpi_accounts = SwapBaseIn { 66 | amm: accounts.amm.clone(), 67 | amm_authority: accounts.amm_authority.clone(), 68 | amm_open_orders: accounts.amm_open_orders.clone(), 69 | amm_coin_vault: accounts.amm_coin_vault.clone(), 70 | amm_pc_vault: accounts.amm_pc_vault.clone(), 71 | market_program: accounts.market_program.clone(), 72 | market: accounts.market.clone(), 73 | market_bids: accounts.market_bids.clone(), 74 | market_asks: accounts.market_asks.clone(), 75 | market_event_queue: accounts.market_event_queue.clone(), 76 | market_coin_vault: accounts.market_coin_vault.clone(), 77 | market_pc_vault: accounts.market_pc_vault.clone(), 78 | market_vault_signer: accounts.market_vault_signer.clone(), 79 | user_token_source: accounts.user_token_source.clone(), 80 | user_token_destination: accounts.user_token_destination.clone(), 81 | user_source_owner: accounts.user_source_owner.clone(), 82 | token_program: accounts.token_program.clone(), 83 | }; 84 | let cpi_program = accounts.amm_program.to_account_info(); 85 | CpiContext::new(cpi_program, cpi_accounts) 86 | } 87 | } 88 | 89 | /// swap_base_in instruction 90 | pub fn swap_base_in( 91 | ctx: Context, 92 | amount_in: u64, 93 | minimum_amount_out: u64, 94 | ) -> Result<()> { 95 | amm_anchor::swap_base_in(ctx.accounts.into(), amount_in, minimum_amount_out) 96 | } 97 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/instructions/proxy_swap_base_out.rs: -------------------------------------------------------------------------------- 1 | use amm_anchor::SwapBaseOut; 2 | use anchor_lang::prelude::*; 3 | use anchor_spl::token::Token; 4 | #[derive(Accounts, Clone)] 5 | pub struct ProxySwapBaseOut<'info> { 6 | /// CHECK: Safe 7 | pub amm_program: AccountInfo<'info>, 8 | /// CHECK: Safe. amm Account 9 | #[account(mut)] 10 | pub amm: UncheckedAccount<'info>, 11 | /// CHECK: Safe. Amm authority Account 12 | #[account()] 13 | pub amm_authority: UncheckedAccount<'info>, 14 | /// CHECK: Safe. amm open_orders Account 15 | #[account(mut)] 16 | pub amm_open_orders: UncheckedAccount<'info>, 17 | /// CHECK: Safe. amm_coin_vault Amm Account to swap FROM or To, 18 | #[account(mut)] 19 | pub amm_coin_vault: UncheckedAccount<'info>, 20 | /// CHECK: Safe. amm_pc_vault Amm Account to swap FROM or To, 21 | #[account(mut)] 22 | pub amm_pc_vault: UncheckedAccount<'info>, 23 | /// CHECK: Safe. OpenBook program id 24 | pub market_program: UncheckedAccount<'info>, 25 | /// CHECK: Safe. OpenBook market Account. OpenBook program is the owner. 26 | #[account(mut)] 27 | pub market: UncheckedAccount<'info>, 28 | /// CHECK: Safe. bids Account 29 | #[account(mut)] 30 | pub market_bids: UncheckedAccount<'info>, 31 | /// CHECK: Safe. asks Account 32 | #[account(mut)] 33 | pub market_asks: UncheckedAccount<'info>, 34 | /// CHECK: Safe. event_q Account 35 | #[account(mut)] 36 | pub market_event_queue: UncheckedAccount<'info>, 37 | /// CHECK: Safe. coin_vault Account 38 | #[account(mut)] 39 | pub market_coin_vault: UncheckedAccount<'info>, 40 | /// CHECK: Safe. pc_vault Account 41 | #[account(mut)] 42 | pub market_pc_vault: UncheckedAccount<'info>, 43 | /// CHECK: Safe. vault_signer Account 44 | #[account(mut)] 45 | pub market_vault_signer: UncheckedAccount<'info>, 46 | /// CHECK: Safe. user source token Account. user Account to swap from. 47 | #[account(mut)] 48 | pub user_token_source: UncheckedAccount<'info>, 49 | /// CHECK: Safe. user destination token Account. user Account to swap to. 50 | #[account(mut)] 51 | pub user_token_destination: UncheckedAccount<'info>, 52 | /// CHECK: Safe. user owner Account 53 | #[account(mut)] 54 | pub user_source_owner: Signer<'info>, 55 | /// CHECK: Safe. The spl token program 56 | pub token_program: Program<'info, Token>, 57 | } 58 | 59 | impl<'a, 'b, 'c, 'info> From<&mut ProxySwapBaseOut<'info>> 60 | for CpiContext<'a, 'b, 'c, 'info, SwapBaseOut<'info>> 61 | { 62 | fn from( 63 | accounts: &mut ProxySwapBaseOut<'info>, 64 | ) -> CpiContext<'a, 'b, 'c, 'info, SwapBaseOut<'info>> { 65 | let cpi_accounts = SwapBaseOut { 66 | amm: accounts.amm.clone(), 67 | amm_authority: accounts.amm_authority.clone(), 68 | amm_open_orders: accounts.amm_open_orders.clone(), 69 | amm_coin_vault: accounts.amm_coin_vault.clone(), 70 | amm_pc_vault: accounts.amm_pc_vault.clone(), 71 | market_program: accounts.market_program.clone(), 72 | market: accounts.market.clone(), 73 | market_bids: accounts.market_bids.clone(), 74 | market_asks: accounts.market_asks.clone(), 75 | market_event_queue: accounts.market_event_queue.clone(), 76 | market_coin_vault: accounts.market_coin_vault.clone(), 77 | market_pc_vault: accounts.market_pc_vault.clone(), 78 | market_vault_signer: accounts.market_vault_signer.clone(), 79 | user_token_source: accounts.user_token_source.clone(), 80 | user_token_destination: accounts.user_token_destination.clone(), 81 | user_source_owner: accounts.user_source_owner.clone(), 82 | token_program: accounts.token_program.clone(), 83 | }; 84 | let cpi_program = accounts.amm_program.to_account_info(); 85 | CpiContext::new(cpi_program, cpi_accounts) 86 | } 87 | } 88 | 89 | /// swap_base_out instruction 90 | pub fn swap_base_out( 91 | ctx: Context, 92 | max_amount_in: u64, 93 | amount_out: u64, 94 | ) -> Result<()> { 95 | amm_anchor::swap_base_out(ctx.accounts.into(), max_amount_in, amount_out) 96 | } 97 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/instructions/proxy_deposit.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::{ 3 | token::Token, 4 | token_2022::Token2022, 5 | token_interface::{Mint, TokenAccount}, 6 | }; 7 | use raydium_cp_swap::{cpi, program::RaydiumCpSwap, states::PoolState}; 8 | 9 | #[derive(Accounts)] 10 | pub struct ProxyDeposit<'info> { 11 | pub cp_swap_program: Program<'info, RaydiumCpSwap>, 12 | 13 | /// Pays to mint the position 14 | pub owner: Signer<'info>, 15 | 16 | /// CHECK: pool vault and lp mint authority 17 | #[account( 18 | seeds = [ 19 | raydium_cp_swap::AUTH_SEED.as_bytes(), 20 | ], 21 | bump, 22 | )] 23 | pub authority: UncheckedAccount<'info>, 24 | 25 | #[account(mut)] 26 | pub pool_state: AccountLoader<'info, PoolState>, 27 | 28 | /// Owner lp tokan account 29 | #[account(mut, token::authority = owner)] 30 | pub owner_lp_token: Box>, 31 | 32 | /// The payer's token account for token_0 33 | #[account( 34 | mut, 35 | token::mint = token_0_vault.mint, 36 | token::authority = owner 37 | )] 38 | pub token_0_account: Box>, 39 | 40 | /// The payer's token account for token_1 41 | #[account( 42 | mut, 43 | token::mint = token_1_vault.mint, 44 | token::authority = owner 45 | )] 46 | pub token_1_account: Box>, 47 | 48 | /// The address that holds pool tokens for token_0 49 | #[account( 50 | mut, 51 | constraint = token_0_vault.key() == pool_state.load()?.token_0_vault 52 | )] 53 | pub token_0_vault: Box>, 54 | 55 | /// The address that holds pool tokens for token_1 56 | #[account( 57 | mut, 58 | constraint = token_1_vault.key() == pool_state.load()?.token_1_vault 59 | )] 60 | pub token_1_vault: Box>, 61 | 62 | /// token Program 63 | pub token_program: Program<'info, Token>, 64 | 65 | /// Token program 2022 66 | pub token_program_2022: Program<'info, Token2022>, 67 | 68 | /// The mint of token_0 vault 69 | #[account( 70 | address = token_0_vault.mint 71 | )] 72 | pub vault_0_mint: Box>, 73 | 74 | /// The mint of token_1 vault 75 | #[account( 76 | address = token_1_vault.mint 77 | )] 78 | pub vault_1_mint: Box>, 79 | 80 | /// Lp token mint 81 | #[account( 82 | mut, 83 | address = pool_state.load()?.lp_mint) 84 | ] 85 | pub lp_mint: Box>, 86 | } 87 | 88 | pub fn proxy_deposit( 89 | ctx: Context, 90 | lp_token_amount: u64, 91 | maximum_token_0_amount: u64, 92 | maximum_token_1_amount: u64, 93 | ) -> Result<()> { 94 | let cpi_accounts = cpi::accounts::Deposit { 95 | owner: ctx.accounts.owner.to_account_info(), 96 | authority: ctx.accounts.authority.to_account_info(), 97 | pool_state: ctx.accounts.pool_state.to_account_info(), 98 | owner_lp_token: ctx.accounts.owner_lp_token.to_account_info(), 99 | token_0_account: ctx.accounts.token_0_account.to_account_info(), 100 | token_1_account: ctx.accounts.token_1_account.to_account_info(), 101 | token_0_vault: ctx.accounts.token_0_vault.to_account_info(), 102 | token_1_vault: ctx.accounts.token_1_vault.to_account_info(), 103 | token_program: ctx.accounts.token_program.to_account_info(), 104 | token_program_2022: ctx.accounts.token_program_2022.to_account_info(), 105 | vault_0_mint: ctx.accounts.vault_0_mint.to_account_info(), 106 | vault_1_mint: ctx.accounts.vault_1_mint.to_account_info(), 107 | lp_mint: ctx.accounts.lp_mint.to_account_info(), 108 | }; 109 | let cpi_context = CpiContext::new(ctx.accounts.cp_swap_program.to_account_info(), cpi_accounts); 110 | cpi::deposit( 111 | cpi_context, 112 | lp_token_amount, 113 | maximum_token_0_amount, 114 | maximum_token_1_amount, 115 | ) 116 | } 117 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/proxy_swap.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::token::Token; 3 | use anchor_spl::token_interface::{Mint, Token2022, TokenAccount}; 4 | use raydium_amm_v3::{ 5 | cpi, 6 | program::AmmV3, 7 | states::{AmmConfig, ObservationState, PoolState}, 8 | }; 9 | 10 | /// Memo msg for swap 11 | pub const SWAP_MEMO_MSG: &'static [u8] = b"raydium_swap"; 12 | #[derive(Accounts)] 13 | pub struct ProxySwap<'info> { 14 | pub clmm_program: Program<'info, AmmV3>, 15 | /// The user performing the swap 16 | pub payer: Signer<'info>, 17 | 18 | /// The factory state to read protocol fees 19 | #[account(address = pool_state.load()?.amm_config)] 20 | pub amm_config: Box>, 21 | 22 | /// The program account of the pool in which the swap will be performed 23 | #[account(mut)] 24 | pub pool_state: AccountLoader<'info, PoolState>, 25 | 26 | /// The user token account for input token 27 | #[account(mut)] 28 | pub input_token_account: Box>, 29 | 30 | /// The user token account for output token 31 | #[account(mut)] 32 | pub output_token_account: Box>, 33 | 34 | /// The vault token account for input token 35 | #[account(mut)] 36 | pub input_vault: Box>, 37 | 38 | /// The vault token account for output token 39 | #[account(mut)] 40 | pub output_vault: Box>, 41 | 42 | /// The program account for the most recent oracle observation 43 | #[account(mut, address = pool_state.load()?.observation_key)] 44 | pub observation_state: AccountLoader<'info, ObservationState>, 45 | 46 | /// SPL program for token transfers 47 | pub token_program: Program<'info, Token>, 48 | 49 | /// SPL program 2022 for token transfers 50 | pub token_program_2022: Program<'info, Token2022>, 51 | 52 | /// CHECK: 53 | #[account( 54 | address = spl_memo::id() 55 | )] 56 | pub memo_program: UncheckedAccount<'info>, 57 | 58 | /// The mint of token vault 0 59 | #[account( 60 | address = input_vault.mint 61 | )] 62 | pub input_vault_mint: Box>, 63 | 64 | /// The mint of token vault 1 65 | #[account( 66 | address = output_vault.mint 67 | )] 68 | pub output_vault_mint: Box>, 69 | // remaining accounts 70 | // tickarray_bitmap_extension: must add account if need regardless the sequence 71 | // tick_array_account_1 72 | // tick_array_account_2 73 | // tick_array_account_... 74 | } 75 | 76 | pub fn proxy_swap<'a, 'b, 'c: 'info, 'info>( 77 | ctx: Context<'a, 'b, 'c, 'info, ProxySwap<'info>>, 78 | amount: u64, 79 | other_amount_threshold: u64, 80 | sqrt_price_limit_x64: u128, 81 | is_base_input: bool, 82 | ) -> Result<()> { 83 | let cpi_accounts = cpi::accounts::SwapSingleV2 { 84 | payer: ctx.accounts.payer.to_account_info(), 85 | amm_config: ctx.accounts.amm_config.to_account_info(), 86 | pool_state: ctx.accounts.pool_state.to_account_info(), 87 | input_token_account: ctx.accounts.input_token_account.to_account_info(), 88 | output_token_account: ctx.accounts.output_token_account.to_account_info(), 89 | input_vault: ctx.accounts.input_vault.to_account_info(), 90 | output_vault: ctx.accounts.output_vault.to_account_info(), 91 | observation_state: ctx.accounts.observation_state.to_account_info(), 92 | token_program: ctx.accounts.token_program.to_account_info(), 93 | token_program_2022: ctx.accounts.token_program_2022.to_account_info(), 94 | memo_program: ctx.accounts.memo_program.to_account_info(), 95 | input_vault_mint: ctx.accounts.input_vault_mint.to_account_info(), 96 | output_vault_mint: ctx.accounts.output_vault_mint.to_account_info(), 97 | }; 98 | let cpi_context = CpiContext::new(ctx.accounts.clmm_program.to_account_info(), cpi_accounts) 99 | .with_remaining_accounts(ctx.remaining_accounts.to_vec()); 100 | cpi::swap_v2( 101 | cpi_context, 102 | amount, 103 | other_amount_threshold, 104 | sqrt_price_limit_x64, 105 | is_base_input, 106 | ) 107 | } 108 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/instructions/proxy_withdraw.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::{ 3 | token::Token, 4 | token_interface::{Mint, TokenAccount, Token2022}, 5 | }; 6 | use raydium_cp_swap::{ 7 | cpi, 8 | program::RaydiumCpSwap, 9 | states::PoolState, 10 | }; 11 | 12 | #[derive(Accounts)] 13 | pub struct ProxyWithdraw<'info> { 14 | pub cp_swap_program: Program<'info, RaydiumCpSwap>, 15 | /// Pays to mint the position 16 | pub owner: Signer<'info>, 17 | 18 | /// CHECK: pool vault and lp mint authority 19 | #[account( 20 | seeds = [ 21 | raydium_cp_swap::AUTH_SEED.as_bytes(), 22 | ], 23 | bump, 24 | )] 25 | pub authority: UncheckedAccount<'info>, 26 | 27 | /// Pool state account 28 | #[account(mut)] 29 | pub pool_state: AccountLoader<'info, PoolState>, 30 | 31 | /// Owner lp token account 32 | #[account( 33 | mut, 34 | token::authority = owner 35 | )] 36 | pub owner_lp_token: Box>, 37 | 38 | /// The owner's token account for receive token_0 39 | #[account( 40 | mut, 41 | token::mint = token_0_vault.mint, 42 | token::authority = owner 43 | )] 44 | pub token_0_account: Box>, 45 | 46 | /// The owner's token account for receive token_1 47 | #[account( 48 | mut, 49 | token::mint = token_1_vault.mint, 50 | token::authority = owner 51 | )] 52 | pub token_1_account: Box>, 53 | 54 | /// The address that holds pool tokens for token_0 55 | #[account( 56 | mut, 57 | constraint = token_0_vault.key() == pool_state.load()?.token_0_vault 58 | )] 59 | pub token_0_vault: Box>, 60 | 61 | /// The address that holds pool tokens for token_1 62 | #[account( 63 | mut, 64 | constraint = token_1_vault.key() == pool_state.load()?.token_1_vault 65 | )] 66 | pub token_1_vault: Box>, 67 | 68 | /// token Program 69 | pub token_program: Program<'info, Token>, 70 | 71 | /// Token program 2022 72 | pub token_program_2022: Program<'info, Token2022>, 73 | 74 | /// The mint of token_0 vault 75 | #[account( 76 | address = token_0_vault.mint 77 | )] 78 | pub vault_0_mint: Box>, 79 | 80 | /// The mint of token_1 vault 81 | #[account( 82 | address = token_1_vault.mint 83 | )] 84 | pub vault_1_mint: Box>, 85 | 86 | /// Pool lp token mint 87 | #[account( 88 | mut, 89 | address = pool_state.load()?.lp_mint) 90 | ] 91 | pub lp_mint: Box>, 92 | 93 | /// memo program 94 | /// CHECK: 95 | #[account( 96 | address = spl_memo::id() 97 | )] 98 | pub memo_program: UncheckedAccount<'info>, 99 | } 100 | 101 | pub fn proxy_withdraw( 102 | ctx: Context, 103 | lp_token_amount: u64, 104 | minimum_token_0_amount: u64, 105 | minimum_token_1_amount: u64, 106 | ) -> Result<()> { 107 | let cpi_accounts = cpi::accounts::Withdraw { 108 | owner: ctx.accounts.owner.to_account_info(), 109 | authority: ctx.accounts.authority.to_account_info(), 110 | pool_state: ctx.accounts.pool_state.to_account_info(), 111 | owner_lp_token: ctx.accounts.owner_lp_token.to_account_info(), 112 | token_0_account: ctx.accounts.token_0_account.to_account_info(), 113 | token_1_account: ctx.accounts.token_1_account.to_account_info(), 114 | token_0_vault: ctx.accounts.token_0_vault.to_account_info(), 115 | token_1_vault: ctx.accounts.token_1_vault.to_account_info(), 116 | token_program: ctx.accounts.token_program.to_account_info(), 117 | token_program_2022: ctx.accounts.token_program_2022.to_account_info(), 118 | vault_0_mint: ctx.accounts.vault_0_mint.to_account_info(), 119 | vault_1_mint: ctx.accounts.vault_1_mint.to_account_info(), 120 | lp_mint: ctx.accounts.lp_mint.to_account_info(), 121 | memo_program: ctx.accounts.memo_program.to_account_info(), 122 | }; 123 | let cpi_context = CpiContext::new(ctx.accounts.cp_swap_program.to_account_info(), cpi_accounts); 124 | cpi::withdraw(cpi_context, lp_token_amount, minimum_token_0_amount, minimum_token_1_amount) 125 | } 126 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/proxy_initialize.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::token_interface::{Mint, TokenInterface}; 3 | use raydium_amm_v3::{ 4 | cpi, 5 | program::AmmV3, 6 | states::{AmmConfig, POOL_SEED, POOL_TICK_ARRAY_BITMAP_SEED, POOL_VAULT_SEED}, 7 | }; 8 | // use solana_program::{program::invoke_signed, system_instruction}; 9 | #[derive(Accounts)] 10 | pub struct ProxyInitialize<'info> { 11 | pub clmm_program: Program<'info, AmmV3>, 12 | 13 | /// Address paying to create the pool. Can be anyone 14 | #[account(mut)] 15 | pub pool_creator: Signer<'info>, 16 | 17 | /// Which config the pool belongs to. 18 | pub amm_config: Box>, 19 | 20 | /// CHECK: Initialize an account to store the pool state 21 | #[account( 22 | mut, 23 | seeds = [ 24 | POOL_SEED.as_bytes(), 25 | amm_config.key().as_ref(), 26 | token_mint_0.key().as_ref(), 27 | token_mint_1.key().as_ref(), 28 | ], 29 | bump, 30 | )] 31 | pub pool_state: UncheckedAccount<'info>, 32 | 33 | /// Token_0 mint, the key must grater then token_1 mint. 34 | #[account( 35 | constraint = token_mint_0.key() < token_mint_1.key(), 36 | mint::token_program = token_program_0 37 | )] 38 | pub token_mint_0: Box>, 39 | 40 | /// Token_1 mint 41 | #[account( 42 | mint::token_program = token_program_1 43 | )] 44 | pub token_mint_1: Box>, 45 | 46 | /// CHECK: Token_0 vault for the pool 47 | #[account( 48 | mut, 49 | seeds =[ 50 | POOL_VAULT_SEED.as_bytes(), 51 | pool_state.key().as_ref(), 52 | token_mint_0.key().as_ref(), 53 | ], 54 | bump, 55 | )] 56 | pub token_vault_0: UncheckedAccount<'info>, 57 | 58 | /// CHECK: Token_1 vault for the pool 59 | #[account( 60 | mut, 61 | seeds =[ 62 | POOL_VAULT_SEED.as_bytes(), 63 | pool_state.key().as_ref(), 64 | token_mint_1.key().as_ref(), 65 | ], 66 | bump, 67 | )] 68 | pub token_vault_1: UncheckedAccount<'info>, 69 | 70 | /// CHECK: Initialize an account to store oracle observations, the account must be created off-chain, constract will initialzied it 71 | #[account(mut)] 72 | pub observation_state: UncheckedAccount<'info>, 73 | 74 | /// CHECK: Initialize an account to store if a tick array is initialized. 75 | #[account( 76 | mut, 77 | seeds = [ 78 | POOL_TICK_ARRAY_BITMAP_SEED.as_bytes(), 79 | pool_state.key().as_ref(), 80 | ], 81 | bump, 82 | )] 83 | pub tick_array_bitmap: UncheckedAccount<'info>, 84 | 85 | /// Spl token program or token program 2022 86 | pub token_program_0: Interface<'info, TokenInterface>, 87 | /// Spl token program or token program 2022 88 | pub token_program_1: Interface<'info, TokenInterface>, 89 | /// To create a new program account 90 | pub system_program: Program<'info, System>, 91 | /// Sysvar for program account 92 | pub rent: Sysvar<'info, Rent>, 93 | } 94 | 95 | pub fn proxy_initialize( 96 | ctx: Context, 97 | sqrt_price_x64: u128, 98 | open_time: u64, 99 | ) -> Result<()> { 100 | let cpi_accounts = cpi::accounts::CreatePool { 101 | pool_creator: ctx.accounts.pool_creator.to_account_info(), 102 | amm_config: ctx.accounts.amm_config.to_account_info(), 103 | pool_state: ctx.accounts.pool_state.to_account_info(), 104 | token_mint_0: ctx.accounts.token_mint_0.to_account_info(), 105 | token_mint_1: ctx.accounts.token_mint_1.to_account_info(), 106 | token_vault_0: ctx.accounts.token_vault_0.to_account_info(), 107 | token_vault_1: ctx.accounts.token_vault_1.to_account_info(), 108 | observation_state: ctx.accounts.observation_state.to_account_info(), 109 | tick_array_bitmap: ctx.accounts.tick_array_bitmap.to_account_info(), 110 | token_program_0: ctx.accounts.token_program_0.to_account_info(), 111 | token_program_1: ctx.accounts.token_program_1.to_account_info(), 112 | system_program: ctx.accounts.system_program.to_account_info(), 113 | rent: ctx.accounts.rent.to_account_info(), 114 | }; 115 | let cpi_context = CpiContext::new(ctx.accounts.clmm_program.to_account_info(), cpi_accounts); 116 | cpi::create_pool(cpi_context, sqrt_price_x64, open_time) 117 | } 118 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/instructions/proxy_withdraw.rs: -------------------------------------------------------------------------------- 1 | use amm_anchor::Withdraw; 2 | use anchor_lang::prelude::*; 3 | use anchor_spl::token::Token; 4 | #[derive(Accounts, Clone)] 5 | pub struct ProxyWithdraw<'info> { 6 | /// CHECK: Safe 7 | pub amm_program: UncheckedAccount<'info>, 8 | /// CHECK: Safe. Amm account 9 | #[account(mut)] 10 | pub amm: UncheckedAccount<'info>, 11 | /// CHECK: Safe. Amm authority Account 12 | #[account()] 13 | pub amm_authority: UncheckedAccount<'info>, 14 | /// CHECK: Safe. amm open_orders Account 15 | #[account(mut)] 16 | pub amm_open_orders: UncheckedAccount<'info>, 17 | /// CHECK: Safe. amm target_orders Account. To store plan orders infomations. 18 | #[account(mut)] 19 | pub amm_target_orders: UncheckedAccount<'info>, 20 | /// CHECK: Safe. pool lp mint account. Must be empty, owned by $authority. 21 | #[account(mut)] 22 | pub amm_lp_mint: UncheckedAccount<'info>, 23 | /// CHECK: Safe. amm_coin_vault Amm Account to withdraw FROM, 24 | #[account(mut)] 25 | pub amm_coin_vault: UncheckedAccount<'info>, 26 | /// CHECK: Safe. amm_pc_vault Amm Account to withdraw FROM, 27 | #[account(mut)] 28 | pub amm_pc_vault: UncheckedAccount<'info>, 29 | /// CHECK: Safe. OpenBook program id 30 | pub market_program: UncheckedAccount<'info>, 31 | /// CHECK: Safe. OpenBook market Account. OpenBook program is the owner. 32 | #[account(mut)] 33 | pub market: UncheckedAccount<'info>, 34 | /// CHECK: Safe. OpenBook coin_vault Account 35 | #[account(mut)] 36 | pub market_coin_vault: UncheckedAccount<'info>, 37 | /// CHECK: Safe. OpenBook pc_vault Account 38 | #[account(mut)] 39 | pub market_pc_vault: UncheckedAccount<'info>, 40 | /// CHECK: Safe. OpenBook vault_signer Account 41 | pub market_vault_signer: UncheckedAccount<'info>, 42 | /// CHECK: Safe. user lp token Account. Source lp, amount is transferable by $authority. 43 | #[account(mut)] 44 | pub user_token_lp: UncheckedAccount<'info>, 45 | /// CHECK: Safe. user token coin Account. user Account to credit. 46 | #[account(mut)] 47 | pub user_token_coin: UncheckedAccount<'info>, 48 | /// CHECK: Safe. user token pc Account. user Account to credit. 49 | #[account(mut)] 50 | pub user_token_pc: UncheckedAccount<'info>, 51 | /// CHECK: Safe. User wallet account 52 | #[account(mut)] 53 | pub user_owner: Signer<'info>, 54 | /// CHECK: Safe. OpenBook event queue account 55 | #[account(mut)] 56 | pub market_event_q: UncheckedAccount<'info>, 57 | /// CHECK: Safe. OpenBook bid account 58 | #[account(mut)] 59 | pub market_bids: UncheckedAccount<'info>, 60 | /// CHECK: Safe. OpenBook ask account 61 | #[account(mut)] 62 | pub market_asks: UncheckedAccount<'info>, 63 | /// CHECK: Safe. The spl token program 64 | pub token_program: Program<'info, Token>, 65 | } 66 | 67 | impl<'a, 'b, 'c, 'info> From<&mut ProxyWithdraw<'info>> 68 | for CpiContext<'a, 'b, 'c, 'info, Withdraw<'info>> 69 | { 70 | fn from(accounts: &mut ProxyWithdraw<'info>) -> CpiContext<'a, 'b, 'c, 'info, Withdraw<'info>> { 71 | let cpi_accounts = Withdraw { 72 | amm: accounts.amm.clone(), 73 | amm_authority: accounts.amm_authority.clone(), 74 | amm_open_orders: accounts.amm_open_orders.clone(), 75 | amm_target_orders: accounts.amm_target_orders.clone(), 76 | amm_lp_mint: accounts.amm_lp_mint.clone(), 77 | amm_coin_vault: accounts.amm_coin_vault.clone(), 78 | amm_pc_vault: accounts.amm_pc_vault.clone(), 79 | market_program: accounts.market_program.clone(), 80 | market: accounts.market.clone(), 81 | market_coin_vault: accounts.market_coin_vault.clone(), 82 | market_pc_vault: accounts.market_pc_vault.clone(), 83 | market_vault_signer: accounts.market_vault_signer.clone(), 84 | user_token_lp: accounts.user_token_lp.clone(), 85 | user_token_coin: accounts.user_token_coin.clone(), 86 | user_token_pc: accounts.user_token_pc.clone(), 87 | user_owner: accounts.user_owner.clone(), 88 | market_event_q: accounts.market_event_q.clone(), 89 | market_bids: accounts.market_bids.clone(), 90 | market_asks: accounts.market_asks.clone(), 91 | token_program: accounts.token_program.clone(), 92 | }; 93 | let cpi_program = accounts.amm_program.to_account_info(); 94 | CpiContext::new(cpi_program, cpi_accounts) 95 | } 96 | } 97 | 98 | /// withdraw instruction 99 | pub fn withdraw(ctx: Context, amount: u64) -> Result<()> { 100 | amm_anchor::withdraw(ctx.accounts.into(), amount) 101 | } 102 | -------------------------------------------------------------------------------- /amm-cpi/programs/amm-cpi/src/instructions/proxy_initialize.rs: -------------------------------------------------------------------------------- 1 | use amm_anchor::Initialize2; 2 | use anchor_lang::prelude::*; 3 | use anchor_spl::associated_token::AssociatedToken; 4 | use anchor_spl::token::Token; 5 | 6 | #[derive(Accounts, Clone)] 7 | pub struct ProxyInitialize<'info> { 8 | /// CHECK: Safe 9 | pub amm_program: UncheckedAccount<'info>, 10 | /// CHECK: Safe. The new amm Account to be create, a PDA create with seed = [program_id, openbook_market_id, b"amm_associated_seed"] 11 | #[account(mut)] 12 | pub amm: UncheckedAccount<'info>, 13 | /// CHECK: Safe. Amm authority, a PDA create with seed = [b"amm authority"] 14 | #[account()] 15 | pub amm_authority: UncheckedAccount<'info>, 16 | /// CHECK: Safe. Amm open_orders Account, a PDA create with seed = [program_id, openbook_market_id, b"open_order_associated_seed"] 17 | #[account(mut)] 18 | pub amm_open_orders: UncheckedAccount<'info>, 19 | /// CHECK: Safe. Pool lp mint account. Must be empty, owned by $authority. 20 | #[account(mut)] 21 | pub amm_lp_mint: UncheckedAccount<'info>, 22 | /// CHECK: Safe. Coin mint account 23 | #[account( 24 | owner = token_program.key() 25 | )] 26 | pub amm_coin_mint: UncheckedAccount<'info>, 27 | /// CHECK: Safe. Pc mint account 28 | #[account( 29 | owner = token_program.key() 30 | )] 31 | pub amm_pc_mint: UncheckedAccount<'info>, 32 | /// CHECK: Safe. amm_coin_vault Account. Must be non zero, owned by $authority 33 | #[account(mut)] 34 | pub amm_coin_vault: UncheckedAccount<'info>, 35 | /// CHECK: Safe. amm_pc_vault Account. Must be non zero, owned by $authority. 36 | #[account(mut)] 37 | pub amm_pc_vault: UncheckedAccount<'info>, 38 | /// CHECK: Safe. amm_target_orders Account. Must be non zero, owned by $authority. 39 | #[account(mut)] 40 | pub amm_target_orders: UncheckedAccount<'info>, 41 | /// CHECK: Safe. Amm Config. 42 | #[account()] 43 | pub amm_config: UncheckedAccount<'info>, 44 | /// CHECK: Safe. Amm create_fee_destination. 45 | #[account(mut)] 46 | pub create_fee_destination: UncheckedAccount<'info>, 47 | /// CHECK: Safe. OpenBook program. 48 | #[account( 49 | address = amm_anchor::openbook_program_id::id(), 50 | )] 51 | pub market_program: UncheckedAccount<'info>, 52 | /// CHECK: Safe. OpenBook market. OpenBook program is the owner. 53 | #[account( 54 | owner = market_program.key(), 55 | )] 56 | pub market: UncheckedAccount<'info>, 57 | /// CHECK: Safe. The user wallet create the pool 58 | #[account(mut)] 59 | pub user_wallet: Signer<'info>, 60 | /// CHECK: Safe. The user coin token 61 | #[account( 62 | mut, 63 | owner = token_program.key(), 64 | )] 65 | pub user_token_coin: UncheckedAccount<'info>, 66 | /// CHECK: Safe. The user pc token 67 | #[account( 68 | mut, 69 | owner = token_program.key(), 70 | )] 71 | pub user_token_pc: UncheckedAccount<'info>, 72 | /// CHECK: Safe. The user lp token 73 | #[account(mut)] 74 | pub user_token_lp: UncheckedAccount<'info>, 75 | /// CHECK: Safe. The spl token program 76 | pub token_program: Program<'info, Token>, 77 | /// CHECK: Safe. The associated token program 78 | pub associated_token_program: Program<'info, AssociatedToken>, 79 | /// CHECK: Safe. System program 80 | pub system_program: Program<'info, System>, 81 | /// CHECK: Safe. Rent program 82 | pub sysvar_rent: Sysvar<'info, Rent>, 83 | } 84 | 85 | impl<'a, 'b, 'c, 'info> From<&mut ProxyInitialize<'info>> 86 | for CpiContext<'a, 'b, 'c, 'info, Initialize2<'info>> 87 | { 88 | fn from( 89 | accounts: &mut ProxyInitialize<'info>, 90 | ) -> CpiContext<'a, 'b, 'c, 'info, Initialize2<'info>> { 91 | let cpi_accounts = Initialize2 { 92 | amm: accounts.amm.clone(), 93 | amm_authority: accounts.amm_authority.clone(), 94 | amm_open_orders: accounts.amm_open_orders.clone(), 95 | amm_lp_mint: accounts.amm_lp_mint.clone(), 96 | amm_coin_mint: accounts.amm_coin_mint.clone(), 97 | amm_pc_mint: accounts.amm_pc_mint.clone(), 98 | amm_coin_vault: accounts.amm_coin_vault.clone(), 99 | amm_pc_vault: accounts.amm_pc_vault.clone(), 100 | amm_target_orders: accounts.amm_target_orders.clone(), 101 | amm_config: accounts.amm_config.clone(), 102 | create_fee_destination: accounts.create_fee_destination.clone(), 103 | market_program: accounts.market_program.clone(), 104 | market: accounts.market.clone(), 105 | user_wallet: accounts.user_wallet.clone(), 106 | user_token_coin: accounts.user_token_coin.clone(), 107 | user_token_pc: accounts.user_token_pc.clone(), 108 | user_token_lp: accounts.user_token_lp.clone(), 109 | token_program: accounts.token_program.clone(), 110 | associated_token_program: accounts.associated_token_program.clone(), 111 | system_program: accounts.system_program.clone(), 112 | sysvar_rent: accounts.sysvar_rent.clone(), 113 | }; 114 | let cpi_program = accounts.amm_program.to_account_info(); 115 | CpiContext::new(cpi_program, cpi_accounts) 116 | } 117 | } 118 | 119 | /// Initiazlize a swap pool 120 | pub fn initialize( 121 | ctx: Context, 122 | nonce: u8, 123 | open_time: u64, 124 | init_pc_amount: u64, 125 | init_coin_amount: u64, 126 | ) -> Result<()> { 127 | amm_anchor::initialize( 128 | ctx.accounts.into(), 129 | nonce, 130 | open_time, 131 | init_pc_amount, 132 | init_coin_amount, 133 | ) 134 | } 135 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/proxy_increase_liquidity.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::token::Token; 3 | use anchor_spl::token_interface::{Mint, Token2022, TokenAccount}; 4 | use raydium_amm_v3::{ 5 | cpi, 6 | program::AmmV3, 7 | states::{ 8 | PersonalPositionState, PoolState, ProtocolPositionState, TickArrayState, POSITION_SEED, 9 | }, 10 | }; 11 | 12 | #[derive(Accounts)] 13 | pub struct ProxyIncreaseLiquidity<'info> { 14 | pub clmm_program: Program<'info, AmmV3>, 15 | /// Pays to mint the position 16 | pub nft_owner: Signer<'info>, 17 | 18 | /// The token account for nft 19 | #[account( 20 | constraint = nft_account.mint == personal_position.nft_mint, 21 | token::token_program = token_program, 22 | )] 23 | pub nft_account: Box>, 24 | 25 | #[account(mut)] 26 | pub pool_state: AccountLoader<'info, PoolState>, 27 | 28 | #[account( 29 | mut, 30 | seeds = [ 31 | POSITION_SEED.as_bytes(), 32 | pool_state.key().as_ref(), 33 | &personal_position.tick_lower_index.to_be_bytes(), 34 | &personal_position.tick_upper_index.to_be_bytes(), 35 | ], 36 | bump, 37 | constraint = protocol_position.pool_id == pool_state.key(), 38 | )] 39 | pub protocol_position: Box>, 40 | 41 | /// Increase liquidity for this position 42 | #[account(mut, constraint = personal_position.pool_id == pool_state.key())] 43 | pub personal_position: Box>, 44 | 45 | /// Stores init state for the lower tick 46 | #[account(mut, constraint = tick_array_lower.load()?.pool_id == pool_state.key())] 47 | pub tick_array_lower: AccountLoader<'info, TickArrayState>, 48 | 49 | /// Stores init state for the upper tick 50 | #[account(mut, constraint = tick_array_upper.load()?.pool_id == pool_state.key())] 51 | pub tick_array_upper: AccountLoader<'info, TickArrayState>, 52 | 53 | /// The payer's token account for token_0 54 | #[account( 55 | mut, 56 | token::mint = token_vault_0.mint 57 | )] 58 | pub token_account_0: Box>, 59 | 60 | /// The token account spending token_1 to mint the position 61 | #[account( 62 | mut, 63 | token::mint = token_vault_1.mint 64 | )] 65 | pub token_account_1: Box>, 66 | 67 | /// The address that holds pool tokens for token_0 68 | #[account( 69 | mut, 70 | constraint = token_vault_0.key() == pool_state.load()?.token_vault_0 71 | )] 72 | pub token_vault_0: Box>, 73 | 74 | /// The address that holds pool tokens for token_1 75 | #[account( 76 | mut, 77 | constraint = token_vault_1.key() == pool_state.load()?.token_vault_1 78 | )] 79 | pub token_vault_1: Box>, 80 | 81 | /// Program to create mint account and mint tokens 82 | pub token_program: Program<'info, Token>, 83 | 84 | /// Token program 2022 85 | pub token_program_2022: Program<'info, Token2022>, 86 | 87 | /// The mint of token vault 0 88 | #[account( 89 | address = token_vault_0.mint 90 | )] 91 | pub vault_0_mint: Box>, 92 | 93 | /// The mint of token vault 1 94 | #[account( 95 | address = token_vault_1.mint 96 | )] 97 | pub vault_1_mint: Box>, 98 | // remaining account 99 | // #[account( 100 | // seeds = [ 101 | // POOL_TICK_ARRAY_BITMAP_SEED.as_bytes(), 102 | // pool_state.key().as_ref(), 103 | // ], 104 | // bump 105 | // )] 106 | // pub tick_array_bitmap: AccountLoader<'info, TickArrayBitmapExtension>, 107 | } 108 | 109 | pub fn proxy_increase_liquidity<'a, 'b, 'c: 'info, 'info>( 110 | ctx: Context<'a, 'b, 'c, 'info, ProxyIncreaseLiquidity<'info>>, 111 | liquidity: u128, 112 | amount_0_max: u64, 113 | amount_1_max: u64, 114 | base_flag: Option, 115 | ) -> Result<()> { 116 | let cpi_accounts = cpi::accounts::IncreaseLiquidityV2 { 117 | nft_owner: ctx.accounts.nft_owner.to_account_info(), 118 | nft_account: ctx.accounts.nft_account.to_account_info(), 119 | pool_state: ctx.accounts.pool_state.to_account_info(), 120 | protocol_position: ctx.accounts.protocol_position.to_account_info(), 121 | personal_position: ctx.accounts.personal_position.to_account_info(), 122 | tick_array_lower: ctx.accounts.tick_array_lower.to_account_info(), 123 | tick_array_upper: ctx.accounts.tick_array_upper.to_account_info(), 124 | token_account_0: ctx.accounts.token_account_0.to_account_info(), 125 | token_account_1: ctx.accounts.token_account_1.to_account_info(), 126 | token_vault_0: ctx.accounts.token_vault_0.to_account_info(), 127 | token_vault_1: ctx.accounts.token_vault_1.to_account_info(), 128 | token_program: ctx.accounts.token_program.to_account_info(), 129 | token_program_2022: ctx.accounts.token_program_2022.to_account_info(), 130 | vault_0_mint: ctx.accounts.vault_0_mint.to_account_info(), 131 | vault_1_mint: ctx.accounts.vault_1_mint.to_account_info(), 132 | }; 133 | let cpi_context = CpiContext::new(ctx.accounts.clmm_program.to_account_info(), cpi_accounts) 134 | .with_remaining_accounts(ctx.remaining_accounts.to_vec()); 135 | cpi::increase_liquidity_v2( 136 | cpi_context, 137 | liquidity, 138 | amount_0_max, 139 | amount_1_max, 140 | base_flag, 141 | ) 142 | } 143 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/proxy_decrease_liquidity.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::token::Token; 3 | use anchor_spl::token_interface::Mint; 4 | use anchor_spl::token_interface::{Token2022, TokenAccount}; 5 | use raydium_amm_v3::{ 6 | cpi, 7 | program::AmmV3, 8 | states::{ 9 | PersonalPositionState, PoolState, ProtocolPositionState, TickArrayState, POSITION_SEED, 10 | }, 11 | }; 12 | 13 | #[derive(Accounts)] 14 | pub struct ProxyDecreaseLiquidity<'info> { 15 | pub clmm_program: Program<'info, AmmV3>, 16 | /// The position owner or delegated authority 17 | pub nft_owner: Signer<'info>, 18 | 19 | /// The token account for the tokenized position 20 | #[account( 21 | constraint = nft_account.mint == personal_position.nft_mint, 22 | token::token_program = token_program, 23 | )] 24 | pub nft_account: Box>, 25 | 26 | /// Decrease liquidity for this position 27 | #[account(mut, constraint = personal_position.pool_id == pool_state.key())] 28 | pub personal_position: Box>, 29 | 30 | #[account(mut)] 31 | pub pool_state: AccountLoader<'info, PoolState>, 32 | 33 | #[account( 34 | mut, 35 | seeds = [ 36 | POSITION_SEED.as_bytes(), 37 | pool_state.key().as_ref(), 38 | &personal_position.tick_lower_index.to_be_bytes(), 39 | &personal_position.tick_upper_index.to_be_bytes(), 40 | ], 41 | bump, 42 | constraint = protocol_position.pool_id == pool_state.key(), 43 | )] 44 | pub protocol_position: Box>, 45 | 46 | /// Token_0 vault 47 | #[account( 48 | mut, 49 | constraint = token_vault_0.key() == pool_state.load()?.token_vault_0 50 | )] 51 | pub token_vault_0: Box>, 52 | 53 | /// Token_1 vault 54 | #[account( 55 | mut, 56 | constraint = token_vault_1.key() == pool_state.load()?.token_vault_1 57 | )] 58 | pub token_vault_1: Box>, 59 | 60 | /// Stores init state for the lower tick 61 | #[account(mut, constraint = tick_array_lower.load()?.pool_id == pool_state.key())] 62 | pub tick_array_lower: AccountLoader<'info, TickArrayState>, 63 | 64 | /// Stores init state for the upper tick 65 | #[account(mut, constraint = tick_array_upper.load()?.pool_id == pool_state.key())] 66 | pub tick_array_upper: AccountLoader<'info, TickArrayState>, 67 | 68 | /// The destination token account for receive amount_0 69 | #[account( 70 | mut, 71 | token::mint = token_vault_0.mint 72 | )] 73 | pub recipient_token_account_0: Box>, 74 | 75 | /// The destination token account for receive amount_1 76 | #[account( 77 | mut, 78 | token::mint = token_vault_1.mint 79 | )] 80 | pub recipient_token_account_1: Box>, 81 | 82 | /// SPL program to transfer out tokens 83 | pub token_program: Program<'info, Token>, 84 | /// Token program 2022 85 | pub token_program_2022: Program<'info, Token2022>, 86 | 87 | /// memo program 88 | /// CHECK: 89 | #[account( 90 | address = spl_memo::id() 91 | )] 92 | pub memo_program: UncheckedAccount<'info>, 93 | 94 | /// The mint of token vault 0 95 | #[account( 96 | address = token_vault_0.mint 97 | )] 98 | pub vault_0_mint: Box>, 99 | 100 | /// The mint of token vault 1 101 | #[account( 102 | address = token_vault_1.mint 103 | )] 104 | pub vault_1_mint: Box>, 105 | // remaining account 106 | // #[account( 107 | // seeds = [ 108 | // POOL_TICK_ARRAY_BITMAP_SEED.as_bytes(), 109 | // pool_state.key().as_ref(), 110 | // ], 111 | // bump 112 | // )] 113 | // pub tick_array_bitmap: AccountLoader<'info, TickArrayBitmapExtension>, 114 | } 115 | 116 | pub fn proxy_decrease_liquidity<'a, 'b, 'c: 'info, 'info>( 117 | ctx: Context<'a, 'b, 'c, 'info, ProxyDecreaseLiquidity<'info>>, 118 | liquidity: u128, 119 | amount_0_min: u64, 120 | amount_1_min: u64, 121 | ) -> Result<()> { 122 | let cpi_accounts = cpi::accounts::DecreaseLiquidityV2 { 123 | nft_owner: ctx.accounts.nft_owner.to_account_info(), 124 | nft_account: ctx.accounts.nft_account.to_account_info(), 125 | pool_state: ctx.accounts.pool_state.to_account_info(), 126 | protocol_position: ctx.accounts.protocol_position.to_account_info(), 127 | personal_position: ctx.accounts.personal_position.to_account_info(), 128 | tick_array_lower: ctx.accounts.tick_array_lower.to_account_info(), 129 | tick_array_upper: ctx.accounts.tick_array_upper.to_account_info(), 130 | recipient_token_account_0: ctx.accounts.recipient_token_account_0.to_account_info(), 131 | recipient_token_account_1: ctx.accounts.recipient_token_account_1.to_account_info(), 132 | token_vault_0: ctx.accounts.token_vault_0.to_account_info(), 133 | token_vault_1: ctx.accounts.token_vault_1.to_account_info(), 134 | token_program: ctx.accounts.token_program.to_account_info(), 135 | token_program_2022: ctx.accounts.token_program_2022.to_account_info(), 136 | vault_0_mint: ctx.accounts.vault_0_mint.to_account_info(), 137 | vault_1_mint: ctx.accounts.vault_1_mint.to_account_info(), 138 | memo_program: ctx.accounts.memo_program.to_account_info(), 139 | }; 140 | let cpi_context = CpiContext::new(ctx.accounts.clmm_program.to_account_info(), cpi_accounts) 141 | .with_remaining_accounts(ctx.remaining_accounts.to_vec()); 142 | cpi::decrease_liquidity_v2(cpi_context, liquidity, amount_0_min, amount_1_min) 143 | } 144 | -------------------------------------------------------------------------------- /cp-swap-cpi/programs/cp-swap-cpi/src/instructions/proxy_initialize.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::{ 3 | associated_token::AssociatedToken, 4 | token::Token, 5 | token_interface::{Mint, TokenAccount, TokenInterface}, 6 | }; 7 | use raydium_cp_swap::{ 8 | cpi, 9 | program::RaydiumCpSwap, 10 | states::{AmmConfig, OBSERVATION_SEED, POOL_LP_MINT_SEED, POOL_SEED, POOL_VAULT_SEED}, 11 | }; 12 | 13 | #[derive(Accounts)] 14 | pub struct ProxyInitialize<'info> { 15 | pub cp_swap_program: Program<'info, RaydiumCpSwap>, 16 | /// Address paying to create the pool. Can be anyone 17 | #[account(mut)] 18 | pub creator: Signer<'info>, 19 | 20 | /// Which config the pool belongs to. 21 | pub amm_config: Box>, 22 | 23 | /// CHECK: pool vault and lp mint authority 24 | #[account( 25 | seeds = [ 26 | raydium_cp_swap::AUTH_SEED.as_bytes(), 27 | ], 28 | bump, 29 | )] 30 | pub authority: UncheckedAccount<'info>, 31 | 32 | /// CHECK: Initialize an account to store the pool state, init by cp-swap 33 | #[account( 34 | mut, 35 | seeds = [ 36 | POOL_SEED.as_bytes(), 37 | amm_config.key().as_ref(), 38 | token_0_mint.key().as_ref(), 39 | token_1_mint.key().as_ref(), 40 | ], 41 | bump, 42 | )] 43 | pub pool_state: UncheckedAccount<'info>, 44 | 45 | /// Token_0 mint, the key must smaller then token_1 mint. 46 | #[account( 47 | constraint = token_0_mint.key() < token_1_mint.key(), 48 | mint::token_program = token_0_program, 49 | )] 50 | pub token_0_mint: Box>, 51 | 52 | /// Token_1 mint, the key must grater then token_0 mint. 53 | #[account( 54 | mint::token_program = token_1_program, 55 | )] 56 | pub token_1_mint: Box>, 57 | 58 | /// CHECK: pool lp mint, init by cp-swap 59 | #[account( 60 | mut, 61 | seeds = [ 62 | POOL_LP_MINT_SEED.as_bytes(), 63 | pool_state.key().as_ref(), 64 | ], 65 | bump, 66 | )] 67 | pub lp_mint: UncheckedAccount<'info>, 68 | 69 | /// payer token0 account 70 | #[account( 71 | mut, 72 | token::mint = token_0_mint, 73 | token::authority = creator, 74 | )] 75 | pub creator_token_0: Box>, 76 | 77 | /// creator token1 account 78 | #[account( 79 | mut, 80 | token::mint = token_1_mint, 81 | token::authority = creator, 82 | )] 83 | pub creator_token_1: Box>, 84 | 85 | /// CHECK: creator lp ATA token account, init by cp-swap 86 | #[account(mut)] 87 | pub creator_lp_token: UncheckedAccount<'info>, 88 | 89 | /// CHECK: Token_0 vault for the pool, init by cp-swap 90 | #[account( 91 | mut, 92 | seeds = [ 93 | POOL_VAULT_SEED.as_bytes(), 94 | pool_state.key().as_ref(), 95 | token_0_mint.key().as_ref() 96 | ], 97 | bump, 98 | )] 99 | pub token_0_vault: UncheckedAccount<'info>, 100 | 101 | /// CHECK: Token_1 vault for the pool, init by cp-swap 102 | #[account( 103 | mut, 104 | seeds = [ 105 | POOL_VAULT_SEED.as_bytes(), 106 | pool_state.key().as_ref(), 107 | token_1_mint.key().as_ref() 108 | ], 109 | bump, 110 | )] 111 | pub token_1_vault: UncheckedAccount<'info>, 112 | 113 | /// create pool fee account 114 | #[account( 115 | mut, 116 | address= raydium_cp_swap::create_pool_fee_reveiver::id(), 117 | )] 118 | pub create_pool_fee: Box>, 119 | 120 | /// CHECK: an account to store oracle observations, init by cp-swap 121 | #[account( 122 | mut, 123 | seeds = [ 124 | OBSERVATION_SEED.as_bytes(), 125 | pool_state.key().as_ref(), 126 | ], 127 | bump, 128 | )] 129 | pub observation_state: UncheckedAccount<'info>, 130 | 131 | /// Program to create mint account and mint tokens 132 | pub token_program: Program<'info, Token>, 133 | /// Spl token program or token program 2022 134 | pub token_0_program: Interface<'info, TokenInterface>, 135 | /// Spl token program or token program 2022 136 | pub token_1_program: Interface<'info, TokenInterface>, 137 | /// Program to create an ATA for receiving position NFT 138 | pub associated_token_program: Program<'info, AssociatedToken>, 139 | /// To create a new program account 140 | pub system_program: Program<'info, System>, 141 | /// Sysvar for program account 142 | pub rent: Sysvar<'info, Rent>, 143 | } 144 | 145 | pub fn proxy_initialize( 146 | ctx: Context, 147 | init_amount_0: u64, 148 | init_amount_1: u64, 149 | open_time: u64, 150 | ) -> Result<()> { 151 | let cpi_accounts = cpi::accounts::Initialize { 152 | creator: ctx.accounts.creator.to_account_info(), 153 | amm_config: ctx.accounts.amm_config.to_account_info(), 154 | authority: ctx.accounts.authority.to_account_info(), 155 | pool_state: ctx.accounts.pool_state.to_account_info(), 156 | token_0_mint: ctx.accounts.token_0_mint.to_account_info(), 157 | token_1_mint: ctx.accounts.token_1_mint.to_account_info(), 158 | lp_mint: ctx.accounts.lp_mint.to_account_info(), 159 | creator_token_0: ctx.accounts.creator_token_0.to_account_info(), 160 | creator_token_1: ctx.accounts.creator_token_1.to_account_info(), 161 | creator_lp_token: ctx.accounts.creator_lp_token.to_account_info(), 162 | token_0_vault: ctx.accounts.token_0_vault.to_account_info(), 163 | token_1_vault: ctx.accounts.token_1_vault.to_account_info(), 164 | create_pool_fee: ctx.accounts.create_pool_fee.to_account_info(), 165 | observation_state: ctx.accounts.observation_state.to_account_info(), 166 | token_program: ctx.accounts.token_program.to_account_info(), 167 | token_0_program: ctx.accounts.token_0_program.to_account_info(), 168 | token_1_program: ctx.accounts.token_1_program.to_account_info(), 169 | associated_token_program: ctx.accounts.associated_token_program.to_account_info(), 170 | system_program: ctx.accounts.system_program.to_account_info(), 171 | rent: ctx.accounts.rent.to_account_info(), 172 | }; 173 | let cpi_context = CpiContext::new(ctx.accounts.cp_swap_program.to_account_info(), cpi_accounts); 174 | cpi::initialize(cpi_context, init_amount_0, init_amount_1, open_time) 175 | } 176 | -------------------------------------------------------------------------------- /clmm-cpi/programs/clmm-cpi/src/instructions/proxy_open_position.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | use anchor_spl::{ 3 | associated_token::AssociatedToken, 4 | metadata::Metadata, 5 | token::Token, 6 | token_interface::{Mint, Token2022, TokenAccount}, 7 | }; 8 | use raydium_amm_v3::{ 9 | cpi, 10 | program::AmmV3, 11 | states::{PoolState, POSITION_SEED, TICK_ARRAY_SEED}, 12 | }; 13 | #[derive(Accounts)] 14 | #[instruction(tick_lower_index: i32, tick_upper_index: i32,tick_array_lower_start_index:i32,tick_array_upper_start_index:i32)] 15 | pub struct ProxyOpenPosition<'info> { 16 | pub clmm_program: Program<'info, AmmV3>, 17 | /// Pays to mint the position 18 | #[account(mut)] 19 | pub payer: Signer<'info>, 20 | 21 | /// CHECK: Receives the position NFT 22 | pub position_nft_owner: UncheckedAccount<'info>, 23 | 24 | /// CHECK: Unique token mint address 25 | #[account(mut)] 26 | pub position_nft_mint: UncheckedAccount<'info>, 27 | 28 | /// CHECK: Token account where position NFT will be minted 29 | /// This account created in the contract by cpi to avoid large stack variables 30 | #[account(mut)] 31 | pub position_nft_account: UncheckedAccount<'info>, 32 | 33 | /// To store metaplex metadata 34 | /// CHECK: Safety check performed inside function body 35 | #[account(mut)] 36 | pub metadata_account: UncheckedAccount<'info>, 37 | 38 | /// Add liquidity for this pool 39 | #[account(mut)] 40 | pub pool_state: AccountLoader<'info, PoolState>, 41 | 42 | /// CHECK: Store the information of market marking in range 43 | #[account( 44 | mut, 45 | seeds = [ 46 | POSITION_SEED.as_bytes(), 47 | pool_state.key().as_ref(), 48 | &tick_lower_index.to_be_bytes(), 49 | &tick_upper_index.to_be_bytes(), 50 | ], 51 | bump, 52 | )] 53 | pub protocol_position: UncheckedAccount<'info>, 54 | 55 | /// CHECK: Account to mark the lower tick as initialized 56 | #[account( 57 | mut, 58 | seeds = [ 59 | TICK_ARRAY_SEED.as_bytes(), 60 | pool_state.key().as_ref(), 61 | &tick_array_lower_start_index.to_be_bytes(), 62 | ], 63 | bump, 64 | )] 65 | pub tick_array_lower: UncheckedAccount<'info>, 66 | 67 | /// CHECK:Account to store data for the position's upper tick 68 | #[account( 69 | mut, 70 | seeds = [ 71 | TICK_ARRAY_SEED.as_bytes(), 72 | pool_state.key().as_ref(), 73 | &tick_array_upper_start_index.to_be_bytes(), 74 | ], 75 | bump, 76 | )] 77 | pub tick_array_upper: UncheckedAccount<'info>, 78 | 79 | /// CHECK: personal position state 80 | #[account( 81 | mut, 82 | seeds = [POSITION_SEED.as_bytes(), position_nft_mint.key().as_ref()], 83 | bump, 84 | )] 85 | pub personal_position: UncheckedAccount<'info>, 86 | 87 | /// The token_0 account deposit token to the pool 88 | #[account( 89 | mut, 90 | token::mint = token_vault_0.mint 91 | )] 92 | pub token_account_0: Box>, 93 | 94 | /// The token_1 account deposit token to the pool 95 | #[account( 96 | mut, 97 | token::mint = token_vault_1.mint 98 | )] 99 | pub token_account_1: Box>, 100 | 101 | /// The address that holds pool tokens for token_0 102 | #[account( 103 | mut, 104 | constraint = token_vault_0.key() == pool_state.load()?.token_vault_0 105 | )] 106 | pub token_vault_0: Box>, 107 | 108 | /// The address that holds pool tokens for token_1 109 | #[account( 110 | mut, 111 | constraint = token_vault_1.key() == pool_state.load()?.token_vault_1 112 | )] 113 | pub token_vault_1: Box>, 114 | 115 | /// Sysvar for token mint and ATA creation 116 | pub rent: Sysvar<'info, Rent>, 117 | 118 | /// Program to create the position manager state account 119 | pub system_program: Program<'info, System>, 120 | 121 | /// Program to create mint account and mint tokens 122 | pub token_program: Program<'info, Token>, 123 | /// Program to create an ATA for receiving position NFT 124 | pub associated_token_program: Program<'info, AssociatedToken>, 125 | 126 | /// Program to create NFT metadata 127 | /// CHECK: Metadata program address constraint applied 128 | pub metadata_program: Program<'info, Metadata>, 129 | /// Program to create mint account and mint tokens 130 | pub token_program_2022: Program<'info, Token2022>, 131 | /// The mint of token vault 0 132 | #[account( 133 | address = token_vault_0.mint 134 | )] 135 | pub vault_0_mint: Box>, 136 | /// The mint of token vault 1 137 | #[account( 138 | address = token_vault_1.mint 139 | )] 140 | pub vault_1_mint: Box>, 141 | // remaining account 142 | // #[account( 143 | // seeds = [ 144 | // POOL_TICK_ARRAY_BITMAP_SEED.as_bytes(), 145 | // pool_state.key().as_ref(), 146 | // ], 147 | // bump 148 | // )] 149 | // pub tick_array_bitmap: AccountLoader<'info, TickArrayBitmapExtension>, 150 | } 151 | 152 | pub fn proxy_open_position<'a, 'b, 'c: 'info, 'info>( 153 | ctx: Context<'a, 'b, 'c, 'info, ProxyOpenPosition<'info>>, 154 | tick_lower_index: i32, 155 | tick_upper_index: i32, 156 | tick_array_lower_start_index: i32, 157 | tick_array_upper_start_index: i32, 158 | liquidity: u128, 159 | amount_0_max: u64, 160 | amount_1_max: u64, 161 | with_matedata: bool, 162 | base_flag: Option, 163 | ) -> Result<()> { 164 | let cpi_accounts = cpi::accounts::OpenPositionV2 { 165 | payer: ctx.accounts.payer.to_account_info(), 166 | position_nft_owner: ctx.accounts.position_nft_owner.to_account_info(), 167 | position_nft_mint: ctx.accounts.position_nft_mint.to_account_info(), 168 | position_nft_account: ctx.accounts.position_nft_account.to_account_info(), 169 | metadata_account: ctx.accounts.metadata_account.to_account_info(), 170 | pool_state: ctx.accounts.pool_state.to_account_info(), 171 | protocol_position: ctx.accounts.protocol_position.to_account_info(), 172 | tick_array_lower: ctx.accounts.tick_array_lower.to_account_info(), 173 | tick_array_upper: ctx.accounts.tick_array_upper.to_account_info(), 174 | personal_position: ctx.accounts.personal_position.to_account_info(), 175 | token_account_0: ctx.accounts.token_account_0.to_account_info(), 176 | token_account_1: ctx.accounts.token_account_1.to_account_info(), 177 | token_vault_0: ctx.accounts.token_vault_0.to_account_info(), 178 | token_vault_1: ctx.accounts.token_vault_1.to_account_info(), 179 | rent: ctx.accounts.rent.to_account_info(), 180 | system_program: ctx.accounts.system_program.to_account_info(), 181 | token_program: ctx.accounts.token_program.to_account_info(), 182 | associated_token_program: ctx.accounts.associated_token_program.to_account_info(), 183 | metadata_program: ctx.accounts.metadata_program.to_account_info(), 184 | token_program_2022: ctx.accounts.token_program_2022.to_account_info(), 185 | vault_0_mint: ctx.accounts.vault_0_mint.to_account_info(), 186 | vault_1_mint: ctx.accounts.vault_1_mint.to_account_info(), 187 | }; 188 | let cpi_context = CpiContext::new(ctx.accounts.clmm_program.to_account_info(), cpi_accounts) 189 | .with_remaining_accounts(ctx.remaining_accounts.to_vec()); 190 | cpi::open_position_v2( 191 | cpi_context, 192 | tick_lower_index, 193 | tick_upper_index, 194 | tick_array_lower_start_index, 195 | tick_array_upper_start_index, 196 | liquidity, 197 | amount_0_max, 198 | amount_1_max, 199 | with_matedata, 200 | base_flag, 201 | ) 202 | } 203 | -------------------------------------------------------------------------------- /cp-swap-cpi/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aead" 7 | version = "0.4.3" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" 10 | dependencies = [ 11 | "generic-array", 12 | ] 13 | 14 | [[package]] 15 | name = "aes" 16 | version = "0.7.5" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" 19 | dependencies = [ 20 | "cfg-if", 21 | "cipher", 22 | "cpufeatures", 23 | "opaque-debug", 24 | ] 25 | 26 | [[package]] 27 | name = "aes-gcm-siv" 28 | version = "0.10.3" 29 | source = "registry+https://github.com/rust-lang/crates.io-index" 30 | checksum = "589c637f0e68c877bbd59a4599bbe849cac8e5f3e4b5a3ebae8f528cd218dcdc" 31 | dependencies = [ 32 | "aead", 33 | "aes", 34 | "cipher", 35 | "ctr", 36 | "polyval", 37 | "subtle", 38 | "zeroize", 39 | ] 40 | 41 | [[package]] 42 | name = "ahash" 43 | version = "0.7.8" 44 | source = "registry+https://github.com/rust-lang/crates.io-index" 45 | checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" 46 | dependencies = [ 47 | "getrandom 0.2.12", 48 | "once_cell", 49 | "version_check", 50 | ] 51 | 52 | [[package]] 53 | name = "ahash" 54 | version = "0.8.6" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" 57 | dependencies = [ 58 | "cfg-if", 59 | "getrandom 0.2.12", 60 | "once_cell", 61 | "version_check", 62 | "zerocopy", 63 | ] 64 | 65 | [[package]] 66 | name = "aho-corasick" 67 | version = "1.1.2" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" 70 | dependencies = [ 71 | "memchr", 72 | ] 73 | 74 | [[package]] 75 | name = "anchor-attribute-access-control" 76 | version = "0.29.0" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "e5f619f1d04f53621925ba8a2e633ba5a6081f2ae14758cbb67f38fd823e0a3e" 79 | dependencies = [ 80 | "anchor-syn", 81 | "proc-macro2", 82 | "quote", 83 | "syn 1.0.109", 84 | ] 85 | 86 | [[package]] 87 | name = "anchor-attribute-account" 88 | version = "0.29.0" 89 | source = "registry+https://github.com/rust-lang/crates.io-index" 90 | checksum = "e7f2a3e1df4685f18d12a943a9f2a7456305401af21a07c9fe076ef9ecd6e400" 91 | dependencies = [ 92 | "anchor-syn", 93 | "bs58 0.5.0", 94 | "proc-macro2", 95 | "quote", 96 | "syn 1.0.109", 97 | ] 98 | 99 | [[package]] 100 | name = "anchor-attribute-constant" 101 | version = "0.29.0" 102 | source = "registry+https://github.com/rust-lang/crates.io-index" 103 | checksum = "9423945cb55627f0b30903288e78baf6f62c6c8ab28fb344b6b25f1ffee3dca7" 104 | dependencies = [ 105 | "anchor-syn", 106 | "quote", 107 | "syn 1.0.109", 108 | ] 109 | 110 | [[package]] 111 | name = "anchor-attribute-error" 112 | version = "0.29.0" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "93ed12720033cc3c3bf3cfa293349c2275cd5ab99936e33dd4bf283aaad3e241" 115 | dependencies = [ 116 | "anchor-syn", 117 | "quote", 118 | "syn 1.0.109", 119 | ] 120 | 121 | [[package]] 122 | name = "anchor-attribute-event" 123 | version = "0.29.0" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "eef4dc0371eba2d8c8b54794b0b0eb786a234a559b77593d6f80825b6d2c77a2" 126 | dependencies = [ 127 | "anchor-syn", 128 | "proc-macro2", 129 | "quote", 130 | "syn 1.0.109", 131 | ] 132 | 133 | [[package]] 134 | name = "anchor-attribute-program" 135 | version = "0.29.0" 136 | source = "registry+https://github.com/rust-lang/crates.io-index" 137 | checksum = "b18c4f191331e078d4a6a080954d1576241c29c56638783322a18d308ab27e4f" 138 | dependencies = [ 139 | "anchor-syn", 140 | "quote", 141 | "syn 1.0.109", 142 | ] 143 | 144 | [[package]] 145 | name = "anchor-derive-accounts" 146 | version = "0.29.0" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "5de10d6e9620d3bcea56c56151cad83c5992f50d5960b3a9bebc4a50390ddc3c" 149 | dependencies = [ 150 | "anchor-syn", 151 | "quote", 152 | "syn 1.0.109", 153 | ] 154 | 155 | [[package]] 156 | name = "anchor-derive-serde" 157 | version = "0.29.0" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "f4e2e5be518ec6053d90a2a7f26843dbee607583c779e6c8395951b9739bdfbe" 160 | dependencies = [ 161 | "anchor-syn", 162 | "borsh-derive-internal 0.10.3", 163 | "proc-macro2", 164 | "quote", 165 | "syn 1.0.109", 166 | ] 167 | 168 | [[package]] 169 | name = "anchor-derive-space" 170 | version = "0.29.0" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "1ecc31d19fa54840e74b7a979d44bcea49d70459de846088a1d71e87ba53c419" 173 | dependencies = [ 174 | "proc-macro2", 175 | "quote", 176 | "syn 1.0.109", 177 | ] 178 | 179 | [[package]] 180 | name = "anchor-lang" 181 | version = "0.29.0" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "35da4785497388af0553586d55ebdc08054a8b1724720ef2749d313494f2b8ad" 184 | dependencies = [ 185 | "anchor-attribute-access-control", 186 | "anchor-attribute-account", 187 | "anchor-attribute-constant", 188 | "anchor-attribute-error", 189 | "anchor-attribute-event", 190 | "anchor-attribute-program", 191 | "anchor-derive-accounts", 192 | "anchor-derive-serde", 193 | "anchor-derive-space", 194 | "arrayref", 195 | "base64 0.13.1", 196 | "bincode", 197 | "borsh 0.10.3", 198 | "bytemuck", 199 | "getrandom 0.2.12", 200 | "solana-program", 201 | "thiserror", 202 | ] 203 | 204 | [[package]] 205 | name = "anchor-spl" 206 | version = "0.29.0" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "6c4fd6e43b2ca6220d2ef1641539e678bfc31b6cc393cf892b373b5997b6a39a" 209 | dependencies = [ 210 | "anchor-lang", 211 | "mpl-token-metadata", 212 | "solana-program", 213 | "spl-associated-token-account", 214 | "spl-token", 215 | "spl-token-2022", 216 | ] 217 | 218 | [[package]] 219 | name = "anchor-syn" 220 | version = "0.29.0" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "d9101b84702fed2ea57bd22992f75065da5648017135b844283a2f6d74f27825" 223 | dependencies = [ 224 | "anyhow", 225 | "bs58 0.5.0", 226 | "heck", 227 | "proc-macro2", 228 | "quote", 229 | "serde", 230 | "serde_json", 231 | "sha2 0.10.8", 232 | "syn 1.0.109", 233 | "thiserror", 234 | ] 235 | 236 | [[package]] 237 | name = "anyhow" 238 | version = "1.0.80" 239 | source = "registry+https://github.com/rust-lang/crates.io-index" 240 | checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" 241 | 242 | [[package]] 243 | name = "ark-bn254" 244 | version = "0.4.0" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" 247 | dependencies = [ 248 | "ark-ec", 249 | "ark-ff", 250 | "ark-std", 251 | ] 252 | 253 | [[package]] 254 | name = "ark-ec" 255 | version = "0.4.2" 256 | source = "registry+https://github.com/rust-lang/crates.io-index" 257 | checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" 258 | dependencies = [ 259 | "ark-ff", 260 | "ark-poly", 261 | "ark-serialize", 262 | "ark-std", 263 | "derivative", 264 | "hashbrown 0.13.2", 265 | "itertools", 266 | "num-traits", 267 | "zeroize", 268 | ] 269 | 270 | [[package]] 271 | name = "ark-ff" 272 | version = "0.4.2" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" 275 | dependencies = [ 276 | "ark-ff-asm", 277 | "ark-ff-macros", 278 | "ark-serialize", 279 | "ark-std", 280 | "derivative", 281 | "digest 0.10.7", 282 | "itertools", 283 | "num-bigint", 284 | "num-traits", 285 | "paste", 286 | "rustc_version", 287 | "zeroize", 288 | ] 289 | 290 | [[package]] 291 | name = "ark-ff-asm" 292 | version = "0.4.2" 293 | source = "registry+https://github.com/rust-lang/crates.io-index" 294 | checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" 295 | dependencies = [ 296 | "quote", 297 | "syn 1.0.109", 298 | ] 299 | 300 | [[package]] 301 | name = "ark-ff-macros" 302 | version = "0.4.2" 303 | source = "registry+https://github.com/rust-lang/crates.io-index" 304 | checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" 305 | dependencies = [ 306 | "num-bigint", 307 | "num-traits", 308 | "proc-macro2", 309 | "quote", 310 | "syn 1.0.109", 311 | ] 312 | 313 | [[package]] 314 | name = "ark-poly" 315 | version = "0.4.2" 316 | source = "registry+https://github.com/rust-lang/crates.io-index" 317 | checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" 318 | dependencies = [ 319 | "ark-ff", 320 | "ark-serialize", 321 | "ark-std", 322 | "derivative", 323 | "hashbrown 0.13.2", 324 | ] 325 | 326 | [[package]] 327 | name = "ark-serialize" 328 | version = "0.4.2" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" 331 | dependencies = [ 332 | "ark-serialize-derive", 333 | "ark-std", 334 | "digest 0.10.7", 335 | "num-bigint", 336 | ] 337 | 338 | [[package]] 339 | name = "ark-serialize-derive" 340 | version = "0.4.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" 343 | dependencies = [ 344 | "proc-macro2", 345 | "quote", 346 | "syn 1.0.109", 347 | ] 348 | 349 | [[package]] 350 | name = "ark-std" 351 | version = "0.4.0" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" 354 | dependencies = [ 355 | "num-traits", 356 | "rand 0.8.5", 357 | ] 358 | 359 | [[package]] 360 | name = "array-bytes" 361 | version = "1.4.1" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "9ad284aeb45c13f2fb4f084de4a420ebf447423bdf9386c0540ce33cb3ef4b8c" 364 | 365 | [[package]] 366 | name = "arrayref" 367 | version = "0.3.7" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" 370 | 371 | [[package]] 372 | name = "arrayvec" 373 | version = "0.7.4" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 376 | 377 | [[package]] 378 | name = "assert_matches" 379 | version = "1.5.0" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" 382 | 383 | [[package]] 384 | name = "atty" 385 | version = "0.2.14" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 388 | dependencies = [ 389 | "hermit-abi", 390 | "libc", 391 | "winapi", 392 | ] 393 | 394 | [[package]] 395 | name = "autocfg" 396 | version = "1.1.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 399 | 400 | [[package]] 401 | name = "base64" 402 | version = "0.12.3" 403 | source = "registry+https://github.com/rust-lang/crates.io-index" 404 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 405 | 406 | [[package]] 407 | name = "base64" 408 | version = "0.13.1" 409 | source = "registry+https://github.com/rust-lang/crates.io-index" 410 | checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" 411 | 412 | [[package]] 413 | name = "base64" 414 | version = "0.21.7" 415 | source = "registry+https://github.com/rust-lang/crates.io-index" 416 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 417 | 418 | [[package]] 419 | name = "bincode" 420 | version = "1.3.3" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 423 | dependencies = [ 424 | "serde", 425 | ] 426 | 427 | [[package]] 428 | name = "bitflags" 429 | version = "1.3.2" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 432 | 433 | [[package]] 434 | name = "bitmaps" 435 | version = "2.1.0" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" 438 | dependencies = [ 439 | "typenum", 440 | ] 441 | 442 | [[package]] 443 | name = "blake3" 444 | version = "1.5.0" 445 | source = "registry+https://github.com/rust-lang/crates.io-index" 446 | checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" 447 | dependencies = [ 448 | "arrayref", 449 | "arrayvec", 450 | "cc", 451 | "cfg-if", 452 | "constant_time_eq", 453 | "digest 0.10.7", 454 | ] 455 | 456 | [[package]] 457 | name = "block-buffer" 458 | version = "0.9.0" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 461 | dependencies = [ 462 | "block-padding", 463 | "generic-array", 464 | ] 465 | 466 | [[package]] 467 | name = "block-buffer" 468 | version = "0.10.4" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 471 | dependencies = [ 472 | "generic-array", 473 | ] 474 | 475 | [[package]] 476 | name = "block-padding" 477 | version = "0.2.1" 478 | source = "registry+https://github.com/rust-lang/crates.io-index" 479 | checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" 480 | 481 | [[package]] 482 | name = "borsh" 483 | version = "0.9.3" 484 | source = "registry+https://github.com/rust-lang/crates.io-index" 485 | checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" 486 | dependencies = [ 487 | "borsh-derive 0.9.3", 488 | "hashbrown 0.11.2", 489 | ] 490 | 491 | [[package]] 492 | name = "borsh" 493 | version = "0.10.3" 494 | source = "registry+https://github.com/rust-lang/crates.io-index" 495 | checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" 496 | dependencies = [ 497 | "borsh-derive 0.10.3", 498 | "hashbrown 0.13.2", 499 | ] 500 | 501 | [[package]] 502 | name = "borsh-derive" 503 | version = "0.9.3" 504 | source = "registry+https://github.com/rust-lang/crates.io-index" 505 | checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" 506 | dependencies = [ 507 | "borsh-derive-internal 0.9.3", 508 | "borsh-schema-derive-internal 0.9.3", 509 | "proc-macro-crate 0.1.5", 510 | "proc-macro2", 511 | "syn 1.0.109", 512 | ] 513 | 514 | [[package]] 515 | name = "borsh-derive" 516 | version = "0.10.3" 517 | source = "registry+https://github.com/rust-lang/crates.io-index" 518 | checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" 519 | dependencies = [ 520 | "borsh-derive-internal 0.10.3", 521 | "borsh-schema-derive-internal 0.10.3", 522 | "proc-macro-crate 0.1.5", 523 | "proc-macro2", 524 | "syn 1.0.109", 525 | ] 526 | 527 | [[package]] 528 | name = "borsh-derive-internal" 529 | version = "0.9.3" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" 532 | dependencies = [ 533 | "proc-macro2", 534 | "quote", 535 | "syn 1.0.109", 536 | ] 537 | 538 | [[package]] 539 | name = "borsh-derive-internal" 540 | version = "0.10.3" 541 | source = "registry+https://github.com/rust-lang/crates.io-index" 542 | checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" 543 | dependencies = [ 544 | "proc-macro2", 545 | "quote", 546 | "syn 1.0.109", 547 | ] 548 | 549 | [[package]] 550 | name = "borsh-schema-derive-internal" 551 | version = "0.9.3" 552 | source = "registry+https://github.com/rust-lang/crates.io-index" 553 | checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" 554 | dependencies = [ 555 | "proc-macro2", 556 | "quote", 557 | "syn 1.0.109", 558 | ] 559 | 560 | [[package]] 561 | name = "borsh-schema-derive-internal" 562 | version = "0.10.3" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" 565 | dependencies = [ 566 | "proc-macro2", 567 | "quote", 568 | "syn 1.0.109", 569 | ] 570 | 571 | [[package]] 572 | name = "bs58" 573 | version = "0.4.0" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" 576 | 577 | [[package]] 578 | name = "bs58" 579 | version = "0.5.0" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" 582 | dependencies = [ 583 | "tinyvec", 584 | ] 585 | 586 | [[package]] 587 | name = "bumpalo" 588 | version = "3.15.4" 589 | source = "registry+https://github.com/rust-lang/crates.io-index" 590 | checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" 591 | 592 | [[package]] 593 | name = "bv" 594 | version = "0.11.1" 595 | source = "registry+https://github.com/rust-lang/crates.io-index" 596 | checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" 597 | dependencies = [ 598 | "feature-probe", 599 | "serde", 600 | ] 601 | 602 | [[package]] 603 | name = "bytemuck" 604 | version = "1.14.3" 605 | source = "registry+https://github.com/rust-lang/crates.io-index" 606 | checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" 607 | dependencies = [ 608 | "bytemuck_derive", 609 | ] 610 | 611 | [[package]] 612 | name = "bytemuck_derive" 613 | version = "1.5.0" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" 616 | dependencies = [ 617 | "proc-macro2", 618 | "quote", 619 | "syn 2.0.52", 620 | ] 621 | 622 | [[package]] 623 | name = "byteorder" 624 | version = "1.5.0" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 627 | 628 | [[package]] 629 | name = "cc" 630 | version = "1.0.90" 631 | source = "registry+https://github.com/rust-lang/crates.io-index" 632 | checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" 633 | dependencies = [ 634 | "jobserver", 635 | "libc", 636 | ] 637 | 638 | [[package]] 639 | name = "cfg-if" 640 | version = "1.0.0" 641 | source = "registry+https://github.com/rust-lang/crates.io-index" 642 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 643 | 644 | [[package]] 645 | name = "chrono" 646 | version = "0.4.35" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" 649 | dependencies = [ 650 | "num-traits", 651 | ] 652 | 653 | [[package]] 654 | name = "cipher" 655 | version = "0.3.0" 656 | source = "registry+https://github.com/rust-lang/crates.io-index" 657 | checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" 658 | dependencies = [ 659 | "generic-array", 660 | ] 661 | 662 | [[package]] 663 | name = "console_error_panic_hook" 664 | version = "0.1.7" 665 | source = "registry+https://github.com/rust-lang/crates.io-index" 666 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 667 | dependencies = [ 668 | "cfg-if", 669 | "wasm-bindgen", 670 | ] 671 | 672 | [[package]] 673 | name = "console_log" 674 | version = "0.2.2" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" 677 | dependencies = [ 678 | "log", 679 | "web-sys", 680 | ] 681 | 682 | [[package]] 683 | name = "constant_time_eq" 684 | version = "0.3.0" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" 687 | 688 | [[package]] 689 | name = "cp-swap-cpi" 690 | version = "0.1.0" 691 | dependencies = [ 692 | "anchor-lang", 693 | "anchor-spl", 694 | "raydium-cp-swap", 695 | "spl-memo", 696 | ] 697 | 698 | [[package]] 699 | name = "cpufeatures" 700 | version = "0.2.12" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 703 | dependencies = [ 704 | "libc", 705 | ] 706 | 707 | [[package]] 708 | name = "crossbeam-deque" 709 | version = "0.8.5" 710 | source = "registry+https://github.com/rust-lang/crates.io-index" 711 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 712 | dependencies = [ 713 | "crossbeam-epoch", 714 | "crossbeam-utils", 715 | ] 716 | 717 | [[package]] 718 | name = "crossbeam-epoch" 719 | version = "0.9.18" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 722 | dependencies = [ 723 | "crossbeam-utils", 724 | ] 725 | 726 | [[package]] 727 | name = "crossbeam-utils" 728 | version = "0.8.19" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 731 | 732 | [[package]] 733 | name = "crunchy" 734 | version = "0.2.2" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 737 | 738 | [[package]] 739 | name = "crypto-common" 740 | version = "0.1.6" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 743 | dependencies = [ 744 | "generic-array", 745 | "typenum", 746 | ] 747 | 748 | [[package]] 749 | name = "crypto-mac" 750 | version = "0.8.0" 751 | source = "registry+https://github.com/rust-lang/crates.io-index" 752 | checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" 753 | dependencies = [ 754 | "generic-array", 755 | "subtle", 756 | ] 757 | 758 | [[package]] 759 | name = "ctr" 760 | version = "0.8.0" 761 | source = "registry+https://github.com/rust-lang/crates.io-index" 762 | checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" 763 | dependencies = [ 764 | "cipher", 765 | ] 766 | 767 | [[package]] 768 | name = "curve25519-dalek" 769 | version = "3.2.1" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" 772 | dependencies = [ 773 | "byteorder", 774 | "digest 0.9.0", 775 | "rand_core 0.5.1", 776 | "serde", 777 | "subtle", 778 | "zeroize", 779 | ] 780 | 781 | [[package]] 782 | name = "darling" 783 | version = "0.20.8" 784 | source = "registry+https://github.com/rust-lang/crates.io-index" 785 | checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" 786 | dependencies = [ 787 | "darling_core", 788 | "darling_macro", 789 | ] 790 | 791 | [[package]] 792 | name = "darling_core" 793 | version = "0.20.8" 794 | source = "registry+https://github.com/rust-lang/crates.io-index" 795 | checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" 796 | dependencies = [ 797 | "fnv", 798 | "ident_case", 799 | "proc-macro2", 800 | "quote", 801 | "strsim", 802 | "syn 2.0.52", 803 | ] 804 | 805 | [[package]] 806 | name = "darling_macro" 807 | version = "0.20.8" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" 810 | dependencies = [ 811 | "darling_core", 812 | "quote", 813 | "syn 2.0.52", 814 | ] 815 | 816 | [[package]] 817 | name = "derivation-path" 818 | version = "0.2.0" 819 | source = "registry+https://github.com/rust-lang/crates.io-index" 820 | checksum = "6e5c37193a1db1d8ed868c03ec7b152175f26160a5b740e5e484143877e0adf0" 821 | 822 | [[package]] 823 | name = "derivative" 824 | version = "2.2.0" 825 | source = "registry+https://github.com/rust-lang/crates.io-index" 826 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 827 | dependencies = [ 828 | "proc-macro2", 829 | "quote", 830 | "syn 1.0.109", 831 | ] 832 | 833 | [[package]] 834 | name = "digest" 835 | version = "0.9.0" 836 | source = "registry+https://github.com/rust-lang/crates.io-index" 837 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 838 | dependencies = [ 839 | "generic-array", 840 | ] 841 | 842 | [[package]] 843 | name = "digest" 844 | version = "0.10.7" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 847 | dependencies = [ 848 | "block-buffer 0.10.4", 849 | "crypto-common", 850 | "subtle", 851 | ] 852 | 853 | [[package]] 854 | name = "ed25519" 855 | version = "1.5.3" 856 | source = "registry+https://github.com/rust-lang/crates.io-index" 857 | checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" 858 | dependencies = [ 859 | "signature", 860 | ] 861 | 862 | [[package]] 863 | name = "ed25519-dalek" 864 | version = "1.0.1" 865 | source = "registry+https://github.com/rust-lang/crates.io-index" 866 | checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" 867 | dependencies = [ 868 | "curve25519-dalek", 869 | "ed25519", 870 | "rand 0.7.3", 871 | "serde", 872 | "sha2 0.9.9", 873 | "zeroize", 874 | ] 875 | 876 | [[package]] 877 | name = "ed25519-dalek-bip32" 878 | version = "0.2.0" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "9d2be62a4061b872c8c0873ee4fc6f101ce7b889d039f019c5fa2af471a59908" 881 | dependencies = [ 882 | "derivation-path", 883 | "ed25519-dalek", 884 | "hmac 0.12.1", 885 | "sha2 0.10.8", 886 | ] 887 | 888 | [[package]] 889 | name = "either" 890 | version = "1.10.0" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 893 | 894 | [[package]] 895 | name = "env_logger" 896 | version = "0.9.3" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" 899 | dependencies = [ 900 | "atty", 901 | "humantime", 902 | "log", 903 | "regex", 904 | "termcolor", 905 | ] 906 | 907 | [[package]] 908 | name = "equivalent" 909 | version = "1.0.1" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 912 | 913 | [[package]] 914 | name = "feature-probe" 915 | version = "0.1.1" 916 | source = "registry+https://github.com/rust-lang/crates.io-index" 917 | checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" 918 | 919 | [[package]] 920 | name = "fnv" 921 | version = "1.0.7" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 924 | 925 | [[package]] 926 | name = "generic-array" 927 | version = "0.14.7" 928 | source = "registry+https://github.com/rust-lang/crates.io-index" 929 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 930 | dependencies = [ 931 | "serde", 932 | "typenum", 933 | "version_check", 934 | ] 935 | 936 | [[package]] 937 | name = "getrandom" 938 | version = "0.1.16" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 941 | dependencies = [ 942 | "cfg-if", 943 | "js-sys", 944 | "libc", 945 | "wasi 0.9.0+wasi-snapshot-preview1", 946 | "wasm-bindgen", 947 | ] 948 | 949 | [[package]] 950 | name = "getrandom" 951 | version = "0.2.12" 952 | source = "registry+https://github.com/rust-lang/crates.io-index" 953 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" 954 | dependencies = [ 955 | "cfg-if", 956 | "js-sys", 957 | "libc", 958 | "wasi 0.11.0+wasi-snapshot-preview1", 959 | "wasm-bindgen", 960 | ] 961 | 962 | [[package]] 963 | name = "hashbrown" 964 | version = "0.11.2" 965 | source = "registry+https://github.com/rust-lang/crates.io-index" 966 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 967 | dependencies = [ 968 | "ahash 0.7.8", 969 | ] 970 | 971 | [[package]] 972 | name = "hashbrown" 973 | version = "0.13.2" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" 976 | dependencies = [ 977 | "ahash 0.8.6", 978 | ] 979 | 980 | [[package]] 981 | name = "hashbrown" 982 | version = "0.14.3" 983 | source = "registry+https://github.com/rust-lang/crates.io-index" 984 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 985 | 986 | [[package]] 987 | name = "heck" 988 | version = "0.3.3" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" 991 | dependencies = [ 992 | "unicode-segmentation", 993 | ] 994 | 995 | [[package]] 996 | name = "hermit-abi" 997 | version = "0.1.19" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 1000 | dependencies = [ 1001 | "libc", 1002 | ] 1003 | 1004 | [[package]] 1005 | name = "hex" 1006 | version = "0.4.3" 1007 | source = "registry+https://github.com/rust-lang/crates.io-index" 1008 | checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 1009 | 1010 | [[package]] 1011 | name = "hmac" 1012 | version = "0.8.1" 1013 | source = "registry+https://github.com/rust-lang/crates.io-index" 1014 | checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" 1015 | dependencies = [ 1016 | "crypto-mac", 1017 | "digest 0.9.0", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "hmac" 1022 | version = "0.12.1" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" 1025 | dependencies = [ 1026 | "digest 0.10.7", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "hmac-drbg" 1031 | version = "0.3.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" 1034 | dependencies = [ 1035 | "digest 0.9.0", 1036 | "generic-array", 1037 | "hmac 0.8.1", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "humantime" 1042 | version = "2.1.0" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" 1045 | 1046 | [[package]] 1047 | name = "ident_case" 1048 | version = "1.0.1" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 1051 | 1052 | [[package]] 1053 | name = "im" 1054 | version = "15.1.0" 1055 | source = "registry+https://github.com/rust-lang/crates.io-index" 1056 | checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" 1057 | dependencies = [ 1058 | "bitmaps", 1059 | "rand_core 0.6.4", 1060 | "rand_xoshiro", 1061 | "rayon", 1062 | "serde", 1063 | "sized-chunks", 1064 | "typenum", 1065 | "version_check", 1066 | ] 1067 | 1068 | [[package]] 1069 | name = "indexmap" 1070 | version = "2.2.5" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" 1073 | dependencies = [ 1074 | "equivalent", 1075 | "hashbrown 0.14.3", 1076 | ] 1077 | 1078 | [[package]] 1079 | name = "itertools" 1080 | version = "0.10.5" 1081 | source = "registry+https://github.com/rust-lang/crates.io-index" 1082 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 1083 | dependencies = [ 1084 | "either", 1085 | ] 1086 | 1087 | [[package]] 1088 | name = "itoa" 1089 | version = "1.0.10" 1090 | source = "registry+https://github.com/rust-lang/crates.io-index" 1091 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 1092 | 1093 | [[package]] 1094 | name = "jobserver" 1095 | version = "0.1.28" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" 1098 | dependencies = [ 1099 | "libc", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "js-sys" 1104 | version = "0.3.69" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 1107 | dependencies = [ 1108 | "wasm-bindgen", 1109 | ] 1110 | 1111 | [[package]] 1112 | name = "keccak" 1113 | version = "0.1.5" 1114 | source = "registry+https://github.com/rust-lang/crates.io-index" 1115 | checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" 1116 | dependencies = [ 1117 | "cpufeatures", 1118 | ] 1119 | 1120 | [[package]] 1121 | name = "lazy_static" 1122 | version = "1.4.0" 1123 | source = "registry+https://github.com/rust-lang/crates.io-index" 1124 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 1125 | 1126 | [[package]] 1127 | name = "libc" 1128 | version = "0.2.153" 1129 | source = "registry+https://github.com/rust-lang/crates.io-index" 1130 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 1131 | 1132 | [[package]] 1133 | name = "libsecp256k1" 1134 | version = "0.6.0" 1135 | source = "registry+https://github.com/rust-lang/crates.io-index" 1136 | checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" 1137 | dependencies = [ 1138 | "arrayref", 1139 | "base64 0.12.3", 1140 | "digest 0.9.0", 1141 | "hmac-drbg", 1142 | "libsecp256k1-core", 1143 | "libsecp256k1-gen-ecmult", 1144 | "libsecp256k1-gen-genmult", 1145 | "rand 0.7.3", 1146 | "serde", 1147 | "sha2 0.9.9", 1148 | "typenum", 1149 | ] 1150 | 1151 | [[package]] 1152 | name = "libsecp256k1-core" 1153 | version = "0.2.2" 1154 | source = "registry+https://github.com/rust-lang/crates.io-index" 1155 | checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" 1156 | dependencies = [ 1157 | "crunchy", 1158 | "digest 0.9.0", 1159 | "subtle", 1160 | ] 1161 | 1162 | [[package]] 1163 | name = "libsecp256k1-gen-ecmult" 1164 | version = "0.2.1" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" 1167 | dependencies = [ 1168 | "libsecp256k1-core", 1169 | ] 1170 | 1171 | [[package]] 1172 | name = "libsecp256k1-gen-genmult" 1173 | version = "0.2.1" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" 1176 | dependencies = [ 1177 | "libsecp256k1-core", 1178 | ] 1179 | 1180 | [[package]] 1181 | name = "lock_api" 1182 | version = "0.4.11" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 1185 | dependencies = [ 1186 | "autocfg", 1187 | "scopeguard", 1188 | ] 1189 | 1190 | [[package]] 1191 | name = "log" 1192 | version = "0.4.21" 1193 | source = "registry+https://github.com/rust-lang/crates.io-index" 1194 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 1195 | 1196 | [[package]] 1197 | name = "memchr" 1198 | version = "2.7.1" 1199 | source = "registry+https://github.com/rust-lang/crates.io-index" 1200 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 1201 | 1202 | [[package]] 1203 | name = "memmap2" 1204 | version = "0.5.10" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" 1207 | dependencies = [ 1208 | "libc", 1209 | ] 1210 | 1211 | [[package]] 1212 | name = "memoffset" 1213 | version = "0.9.0" 1214 | source = "registry+https://github.com/rust-lang/crates.io-index" 1215 | checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" 1216 | dependencies = [ 1217 | "autocfg", 1218 | ] 1219 | 1220 | [[package]] 1221 | name = "merlin" 1222 | version = "3.0.0" 1223 | source = "registry+https://github.com/rust-lang/crates.io-index" 1224 | checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" 1225 | dependencies = [ 1226 | "byteorder", 1227 | "keccak", 1228 | "rand_core 0.6.4", 1229 | "zeroize", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "mpl-token-metadata" 1234 | version = "3.2.3" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "ba8ee05284d79b367ae8966d558e1a305a781fc80c9df51f37775169117ba64f" 1237 | dependencies = [ 1238 | "borsh 0.10.3", 1239 | "num-derive 0.3.3", 1240 | "num-traits", 1241 | "solana-program", 1242 | "thiserror", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "num-bigint" 1247 | version = "0.4.4" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" 1250 | dependencies = [ 1251 | "autocfg", 1252 | "num-integer", 1253 | "num-traits", 1254 | ] 1255 | 1256 | [[package]] 1257 | name = "num-derive" 1258 | version = "0.3.3" 1259 | source = "registry+https://github.com/rust-lang/crates.io-index" 1260 | checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" 1261 | dependencies = [ 1262 | "proc-macro2", 1263 | "quote", 1264 | "syn 1.0.109", 1265 | ] 1266 | 1267 | [[package]] 1268 | name = "num-derive" 1269 | version = "0.4.2" 1270 | source = "registry+https://github.com/rust-lang/crates.io-index" 1271 | checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" 1272 | dependencies = [ 1273 | "proc-macro2", 1274 | "quote", 1275 | "syn 2.0.52", 1276 | ] 1277 | 1278 | [[package]] 1279 | name = "num-integer" 1280 | version = "0.1.46" 1281 | source = "registry+https://github.com/rust-lang/crates.io-index" 1282 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 1283 | dependencies = [ 1284 | "num-traits", 1285 | ] 1286 | 1287 | [[package]] 1288 | name = "num-traits" 1289 | version = "0.2.18" 1290 | source = "registry+https://github.com/rust-lang/crates.io-index" 1291 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 1292 | dependencies = [ 1293 | "autocfg", 1294 | ] 1295 | 1296 | [[package]] 1297 | name = "num_enum" 1298 | version = "0.6.1" 1299 | source = "registry+https://github.com/rust-lang/crates.io-index" 1300 | checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" 1301 | dependencies = [ 1302 | "num_enum_derive 0.6.1", 1303 | ] 1304 | 1305 | [[package]] 1306 | name = "num_enum" 1307 | version = "0.7.2" 1308 | source = "registry+https://github.com/rust-lang/crates.io-index" 1309 | checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" 1310 | dependencies = [ 1311 | "num_enum_derive 0.7.2", 1312 | ] 1313 | 1314 | [[package]] 1315 | name = "num_enum_derive" 1316 | version = "0.6.1" 1317 | source = "registry+https://github.com/rust-lang/crates.io-index" 1318 | checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" 1319 | dependencies = [ 1320 | "proc-macro-crate 1.3.1", 1321 | "proc-macro2", 1322 | "quote", 1323 | "syn 2.0.52", 1324 | ] 1325 | 1326 | [[package]] 1327 | name = "num_enum_derive" 1328 | version = "0.7.2" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" 1331 | dependencies = [ 1332 | "proc-macro-crate 1.3.1", 1333 | "proc-macro2", 1334 | "quote", 1335 | "syn 2.0.52", 1336 | ] 1337 | 1338 | [[package]] 1339 | name = "once_cell" 1340 | version = "1.19.0" 1341 | source = "registry+https://github.com/rust-lang/crates.io-index" 1342 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 1343 | 1344 | [[package]] 1345 | name = "opaque-debug" 1346 | version = "0.3.1" 1347 | source = "registry+https://github.com/rust-lang/crates.io-index" 1348 | checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" 1349 | 1350 | [[package]] 1351 | name = "parking_lot" 1352 | version = "0.12.1" 1353 | source = "registry+https://github.com/rust-lang/crates.io-index" 1354 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1355 | dependencies = [ 1356 | "lock_api", 1357 | "parking_lot_core", 1358 | ] 1359 | 1360 | [[package]] 1361 | name = "parking_lot_core" 1362 | version = "0.9.9" 1363 | source = "registry+https://github.com/rust-lang/crates.io-index" 1364 | checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" 1365 | dependencies = [ 1366 | "cfg-if", 1367 | "libc", 1368 | "redox_syscall", 1369 | "smallvec", 1370 | "windows-targets", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "paste" 1375 | version = "1.0.14" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 1378 | 1379 | [[package]] 1380 | name = "pbkdf2" 1381 | version = "0.4.0" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" 1384 | dependencies = [ 1385 | "crypto-mac", 1386 | ] 1387 | 1388 | [[package]] 1389 | name = "pbkdf2" 1390 | version = "0.11.0" 1391 | source = "registry+https://github.com/rust-lang/crates.io-index" 1392 | checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" 1393 | dependencies = [ 1394 | "digest 0.10.7", 1395 | ] 1396 | 1397 | [[package]] 1398 | name = "percent-encoding" 1399 | version = "2.3.1" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 1402 | 1403 | [[package]] 1404 | name = "polyval" 1405 | version = "0.5.3" 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" 1407 | checksum = "8419d2b623c7c0896ff2d5d96e2cb4ede590fed28fcc34934f4c33c036e620a1" 1408 | dependencies = [ 1409 | "cfg-if", 1410 | "cpufeatures", 1411 | "opaque-debug", 1412 | "universal-hash", 1413 | ] 1414 | 1415 | [[package]] 1416 | name = "ppv-lite86" 1417 | version = "0.2.17" 1418 | source = "registry+https://github.com/rust-lang/crates.io-index" 1419 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1420 | 1421 | [[package]] 1422 | name = "proc-macro-crate" 1423 | version = "0.1.5" 1424 | source = "registry+https://github.com/rust-lang/crates.io-index" 1425 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1426 | dependencies = [ 1427 | "toml", 1428 | ] 1429 | 1430 | [[package]] 1431 | name = "proc-macro-crate" 1432 | version = "1.3.1" 1433 | source = "registry+https://github.com/rust-lang/crates.io-index" 1434 | checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" 1435 | dependencies = [ 1436 | "once_cell", 1437 | "toml_edit", 1438 | ] 1439 | 1440 | [[package]] 1441 | name = "proc-macro2" 1442 | version = "1.0.78" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" 1445 | dependencies = [ 1446 | "unicode-ident", 1447 | ] 1448 | 1449 | [[package]] 1450 | name = "qstring" 1451 | version = "0.7.2" 1452 | source = "registry+https://github.com/rust-lang/crates.io-index" 1453 | checksum = "d464fae65fff2680baf48019211ce37aaec0c78e9264c84a3e484717f965104e" 1454 | dependencies = [ 1455 | "percent-encoding", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "quote" 1460 | version = "1.0.35" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 1463 | dependencies = [ 1464 | "proc-macro2", 1465 | ] 1466 | 1467 | [[package]] 1468 | name = "rand" 1469 | version = "0.7.3" 1470 | source = "registry+https://github.com/rust-lang/crates.io-index" 1471 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1472 | dependencies = [ 1473 | "getrandom 0.1.16", 1474 | "libc", 1475 | "rand_chacha 0.2.2", 1476 | "rand_core 0.5.1", 1477 | "rand_hc", 1478 | ] 1479 | 1480 | [[package]] 1481 | name = "rand" 1482 | version = "0.8.5" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1485 | dependencies = [ 1486 | "rand_chacha 0.3.1", 1487 | "rand_core 0.6.4", 1488 | ] 1489 | 1490 | [[package]] 1491 | name = "rand_chacha" 1492 | version = "0.2.2" 1493 | source = "registry+https://github.com/rust-lang/crates.io-index" 1494 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1495 | dependencies = [ 1496 | "ppv-lite86", 1497 | "rand_core 0.5.1", 1498 | ] 1499 | 1500 | [[package]] 1501 | name = "rand_chacha" 1502 | version = "0.3.1" 1503 | source = "registry+https://github.com/rust-lang/crates.io-index" 1504 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1505 | dependencies = [ 1506 | "ppv-lite86", 1507 | "rand_core 0.6.4", 1508 | ] 1509 | 1510 | [[package]] 1511 | name = "rand_core" 1512 | version = "0.5.1" 1513 | source = "registry+https://github.com/rust-lang/crates.io-index" 1514 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1515 | dependencies = [ 1516 | "getrandom 0.1.16", 1517 | ] 1518 | 1519 | [[package]] 1520 | name = "rand_core" 1521 | version = "0.6.4" 1522 | source = "registry+https://github.com/rust-lang/crates.io-index" 1523 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1524 | dependencies = [ 1525 | "getrandom 0.2.12", 1526 | ] 1527 | 1528 | [[package]] 1529 | name = "rand_hc" 1530 | version = "0.2.0" 1531 | source = "registry+https://github.com/rust-lang/crates.io-index" 1532 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1533 | dependencies = [ 1534 | "rand_core 0.5.1", 1535 | ] 1536 | 1537 | [[package]] 1538 | name = "rand_xoshiro" 1539 | version = "0.6.0" 1540 | source = "registry+https://github.com/rust-lang/crates.io-index" 1541 | checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" 1542 | dependencies = [ 1543 | "rand_core 0.6.4", 1544 | ] 1545 | 1546 | [[package]] 1547 | name = "raydium-cp-swap" 1548 | version = "0.1.0" 1549 | source = "git+https://github.com/raydium-io/raydium-cp-swap#74737973b7288db55ce337e4837ff1123b392843" 1550 | dependencies = [ 1551 | "anchor-lang", 1552 | "anchor-spl", 1553 | "solana-security-txt", 1554 | "spl-math", 1555 | "spl-memo", 1556 | "spl-token", 1557 | "uint", 1558 | ] 1559 | 1560 | [[package]] 1561 | name = "rayon" 1562 | version = "1.9.0" 1563 | source = "registry+https://github.com/rust-lang/crates.io-index" 1564 | checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" 1565 | dependencies = [ 1566 | "either", 1567 | "rayon-core", 1568 | ] 1569 | 1570 | [[package]] 1571 | name = "rayon-core" 1572 | version = "1.12.1" 1573 | source = "registry+https://github.com/rust-lang/crates.io-index" 1574 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 1575 | dependencies = [ 1576 | "crossbeam-deque", 1577 | "crossbeam-utils", 1578 | ] 1579 | 1580 | [[package]] 1581 | name = "redox_syscall" 1582 | version = "0.4.1" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 1585 | dependencies = [ 1586 | "bitflags", 1587 | ] 1588 | 1589 | [[package]] 1590 | name = "regex" 1591 | version = "1.10.3" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" 1594 | dependencies = [ 1595 | "aho-corasick", 1596 | "memchr", 1597 | "regex-automata", 1598 | "regex-syntax", 1599 | ] 1600 | 1601 | [[package]] 1602 | name = "regex-automata" 1603 | version = "0.4.6" 1604 | source = "registry+https://github.com/rust-lang/crates.io-index" 1605 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" 1606 | dependencies = [ 1607 | "aho-corasick", 1608 | "memchr", 1609 | "regex-syntax", 1610 | ] 1611 | 1612 | [[package]] 1613 | name = "regex-syntax" 1614 | version = "0.8.2" 1615 | source = "registry+https://github.com/rust-lang/crates.io-index" 1616 | checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" 1617 | 1618 | [[package]] 1619 | name = "rustc-hash" 1620 | version = "1.1.0" 1621 | source = "registry+https://github.com/rust-lang/crates.io-index" 1622 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1623 | 1624 | [[package]] 1625 | name = "rustc_version" 1626 | version = "0.4.0" 1627 | source = "registry+https://github.com/rust-lang/crates.io-index" 1628 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1629 | dependencies = [ 1630 | "semver", 1631 | ] 1632 | 1633 | [[package]] 1634 | name = "rustversion" 1635 | version = "1.0.14" 1636 | source = "registry+https://github.com/rust-lang/crates.io-index" 1637 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1638 | 1639 | [[package]] 1640 | name = "ryu" 1641 | version = "1.0.17" 1642 | source = "registry+https://github.com/rust-lang/crates.io-index" 1643 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 1644 | 1645 | [[package]] 1646 | name = "scopeguard" 1647 | version = "1.2.0" 1648 | source = "registry+https://github.com/rust-lang/crates.io-index" 1649 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1650 | 1651 | [[package]] 1652 | name = "semver" 1653 | version = "1.0.22" 1654 | source = "registry+https://github.com/rust-lang/crates.io-index" 1655 | checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" 1656 | 1657 | [[package]] 1658 | name = "serde" 1659 | version = "1.0.197" 1660 | source = "registry+https://github.com/rust-lang/crates.io-index" 1661 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 1662 | dependencies = [ 1663 | "serde_derive", 1664 | ] 1665 | 1666 | [[package]] 1667 | name = "serde_bytes" 1668 | version = "0.11.14" 1669 | source = "registry+https://github.com/rust-lang/crates.io-index" 1670 | checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" 1671 | dependencies = [ 1672 | "serde", 1673 | ] 1674 | 1675 | [[package]] 1676 | name = "serde_derive" 1677 | version = "1.0.197" 1678 | source = "registry+https://github.com/rust-lang/crates.io-index" 1679 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 1680 | dependencies = [ 1681 | "proc-macro2", 1682 | "quote", 1683 | "syn 2.0.52", 1684 | ] 1685 | 1686 | [[package]] 1687 | name = "serde_json" 1688 | version = "1.0.114" 1689 | source = "registry+https://github.com/rust-lang/crates.io-index" 1690 | checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" 1691 | dependencies = [ 1692 | "itoa", 1693 | "ryu", 1694 | "serde", 1695 | ] 1696 | 1697 | [[package]] 1698 | name = "serde_with" 1699 | version = "2.3.3" 1700 | source = "registry+https://github.com/rust-lang/crates.io-index" 1701 | checksum = "07ff71d2c147a7b57362cead5e22f772cd52f6ab31cfcd9edcd7f6aeb2a0afbe" 1702 | dependencies = [ 1703 | "serde", 1704 | "serde_with_macros", 1705 | ] 1706 | 1707 | [[package]] 1708 | name = "serde_with_macros" 1709 | version = "2.3.3" 1710 | source = "registry+https://github.com/rust-lang/crates.io-index" 1711 | checksum = "881b6f881b17d13214e5d494c939ebab463d01264ce1811e9d4ac3a882e7695f" 1712 | dependencies = [ 1713 | "darling", 1714 | "proc-macro2", 1715 | "quote", 1716 | "syn 2.0.52", 1717 | ] 1718 | 1719 | [[package]] 1720 | name = "sha2" 1721 | version = "0.9.9" 1722 | source = "registry+https://github.com/rust-lang/crates.io-index" 1723 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 1724 | dependencies = [ 1725 | "block-buffer 0.9.0", 1726 | "cfg-if", 1727 | "cpufeatures", 1728 | "digest 0.9.0", 1729 | "opaque-debug", 1730 | ] 1731 | 1732 | [[package]] 1733 | name = "sha2" 1734 | version = "0.10.8" 1735 | source = "registry+https://github.com/rust-lang/crates.io-index" 1736 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 1737 | dependencies = [ 1738 | "cfg-if", 1739 | "cpufeatures", 1740 | "digest 0.10.7", 1741 | ] 1742 | 1743 | [[package]] 1744 | name = "sha3" 1745 | version = "0.9.1" 1746 | source = "registry+https://github.com/rust-lang/crates.io-index" 1747 | checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" 1748 | dependencies = [ 1749 | "block-buffer 0.9.0", 1750 | "digest 0.9.0", 1751 | "keccak", 1752 | "opaque-debug", 1753 | ] 1754 | 1755 | [[package]] 1756 | name = "sha3" 1757 | version = "0.10.8" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 1760 | dependencies = [ 1761 | "digest 0.10.7", 1762 | "keccak", 1763 | ] 1764 | 1765 | [[package]] 1766 | name = "signature" 1767 | version = "1.6.4" 1768 | source = "registry+https://github.com/rust-lang/crates.io-index" 1769 | checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" 1770 | 1771 | [[package]] 1772 | name = "sized-chunks" 1773 | version = "0.6.5" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" 1776 | dependencies = [ 1777 | "bitmaps", 1778 | "typenum", 1779 | ] 1780 | 1781 | [[package]] 1782 | name = "smallvec" 1783 | version = "1.13.1" 1784 | source = "registry+https://github.com/rust-lang/crates.io-index" 1785 | checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" 1786 | 1787 | [[package]] 1788 | name = "solana-frozen-abi" 1789 | version = "1.16.25" 1790 | source = "registry+https://github.com/rust-lang/crates.io-index" 1791 | checksum = "a7077f6495ccc313dff49c3e3f3ed03e49058258bae7fee77ac29ba0a474ba82" 1792 | dependencies = [ 1793 | "ahash 0.8.6", 1794 | "blake3", 1795 | "block-buffer 0.10.4", 1796 | "bs58 0.4.0", 1797 | "bv", 1798 | "byteorder", 1799 | "cc", 1800 | "either", 1801 | "generic-array", 1802 | "getrandom 0.1.16", 1803 | "im", 1804 | "lazy_static", 1805 | "log", 1806 | "memmap2", 1807 | "once_cell", 1808 | "rand_core 0.6.4", 1809 | "rustc_version", 1810 | "serde", 1811 | "serde_bytes", 1812 | "serde_derive", 1813 | "serde_json", 1814 | "sha2 0.10.8", 1815 | "solana-frozen-abi-macro", 1816 | "subtle", 1817 | "thiserror", 1818 | ] 1819 | 1820 | [[package]] 1821 | name = "solana-frozen-abi-macro" 1822 | version = "1.16.25" 1823 | source = "registry+https://github.com/rust-lang/crates.io-index" 1824 | checksum = "f516f992211a2ab70de5c367190575c97e02d156f9f1d8b76886d673f30e88a2" 1825 | dependencies = [ 1826 | "proc-macro2", 1827 | "quote", 1828 | "rustc_version", 1829 | "syn 2.0.52", 1830 | ] 1831 | 1832 | [[package]] 1833 | name = "solana-logger" 1834 | version = "1.16.25" 1835 | source = "registry+https://github.com/rust-lang/crates.io-index" 1836 | checksum = "7b64def674bfaa4a3f8be7ba19c03c9caec4ec028ba62b9a427ec1bf608a2486" 1837 | dependencies = [ 1838 | "env_logger", 1839 | "lazy_static", 1840 | "log", 1841 | ] 1842 | 1843 | [[package]] 1844 | name = "solana-program" 1845 | version = "1.16.25" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "3e92350aa5b42564681655331e7e0b9d5c99a442de317ceeb4741efbbe9a6c05" 1848 | dependencies = [ 1849 | "ark-bn254", 1850 | "ark-ec", 1851 | "ark-ff", 1852 | "ark-serialize", 1853 | "array-bytes", 1854 | "base64 0.21.7", 1855 | "bincode", 1856 | "bitflags", 1857 | "blake3", 1858 | "borsh 0.10.3", 1859 | "borsh 0.9.3", 1860 | "bs58 0.4.0", 1861 | "bv", 1862 | "bytemuck", 1863 | "cc", 1864 | "console_error_panic_hook", 1865 | "console_log", 1866 | "curve25519-dalek", 1867 | "getrandom 0.2.12", 1868 | "itertools", 1869 | "js-sys", 1870 | "lazy_static", 1871 | "libc", 1872 | "libsecp256k1", 1873 | "log", 1874 | "memoffset", 1875 | "num-bigint", 1876 | "num-derive 0.3.3", 1877 | "num-traits", 1878 | "parking_lot", 1879 | "rand 0.7.3", 1880 | "rand_chacha 0.2.2", 1881 | "rustc_version", 1882 | "rustversion", 1883 | "serde", 1884 | "serde_bytes", 1885 | "serde_derive", 1886 | "serde_json", 1887 | "sha2 0.10.8", 1888 | "sha3 0.10.8", 1889 | "solana-frozen-abi", 1890 | "solana-frozen-abi-macro", 1891 | "solana-sdk-macro", 1892 | "thiserror", 1893 | "tiny-bip39", 1894 | "wasm-bindgen", 1895 | "zeroize", 1896 | ] 1897 | 1898 | [[package]] 1899 | name = "solana-sdk" 1900 | version = "1.16.25" 1901 | source = "registry+https://github.com/rust-lang/crates.io-index" 1902 | checksum = "2087e15c92d4d6b3f085dc12fbe9614141c811f90a54cc418240ac30b608133f" 1903 | dependencies = [ 1904 | "assert_matches", 1905 | "base64 0.21.7", 1906 | "bincode", 1907 | "bitflags", 1908 | "borsh 0.10.3", 1909 | "bs58 0.4.0", 1910 | "bytemuck", 1911 | "byteorder", 1912 | "chrono", 1913 | "derivation-path", 1914 | "digest 0.10.7", 1915 | "ed25519-dalek", 1916 | "ed25519-dalek-bip32", 1917 | "generic-array", 1918 | "hmac 0.12.1", 1919 | "itertools", 1920 | "js-sys", 1921 | "lazy_static", 1922 | "libsecp256k1", 1923 | "log", 1924 | "memmap2", 1925 | "num-derive 0.3.3", 1926 | "num-traits", 1927 | "num_enum 0.6.1", 1928 | "pbkdf2 0.11.0", 1929 | "qstring", 1930 | "rand 0.7.3", 1931 | "rand_chacha 0.2.2", 1932 | "rustc_version", 1933 | "rustversion", 1934 | "serde", 1935 | "serde_bytes", 1936 | "serde_derive", 1937 | "serde_json", 1938 | "serde_with", 1939 | "sha2 0.10.8", 1940 | "sha3 0.10.8", 1941 | "solana-frozen-abi", 1942 | "solana-frozen-abi-macro", 1943 | "solana-logger", 1944 | "solana-program", 1945 | "solana-sdk-macro", 1946 | "thiserror", 1947 | "uriparse", 1948 | "wasm-bindgen", 1949 | ] 1950 | 1951 | [[package]] 1952 | name = "solana-sdk-macro" 1953 | version = "1.16.25" 1954 | source = "registry+https://github.com/rust-lang/crates.io-index" 1955 | checksum = "2e0e0e7ee984b0f9179a1d4f4e9e67ce675de2324b5a98b61d2bdb61be3c19bb" 1956 | dependencies = [ 1957 | "bs58 0.4.0", 1958 | "proc-macro2", 1959 | "quote", 1960 | "rustversion", 1961 | "syn 2.0.52", 1962 | ] 1963 | 1964 | [[package]] 1965 | name = "solana-security-txt" 1966 | version = "1.1.1" 1967 | source = "registry+https://github.com/rust-lang/crates.io-index" 1968 | checksum = "468aa43b7edb1f9b7b7b686d5c3aeb6630dc1708e86e31343499dd5c4d775183" 1969 | 1970 | [[package]] 1971 | name = "solana-zk-token-sdk" 1972 | version = "1.16.25" 1973 | source = "registry+https://github.com/rust-lang/crates.io-index" 1974 | checksum = "1457c85ab70a518438b9ac2b0c56037b9f6693060dfb617bbb93c7116e4f0c22" 1975 | dependencies = [ 1976 | "aes-gcm-siv", 1977 | "base64 0.21.7", 1978 | "bincode", 1979 | "bytemuck", 1980 | "byteorder", 1981 | "curve25519-dalek", 1982 | "getrandom 0.1.16", 1983 | "itertools", 1984 | "lazy_static", 1985 | "merlin", 1986 | "num-derive 0.3.3", 1987 | "num-traits", 1988 | "rand 0.7.3", 1989 | "serde", 1990 | "serde_json", 1991 | "sha3 0.9.1", 1992 | "solana-program", 1993 | "solana-sdk", 1994 | "subtle", 1995 | "thiserror", 1996 | "zeroize", 1997 | ] 1998 | 1999 | [[package]] 2000 | name = "spl-associated-token-account" 2001 | version = "2.2.0" 2002 | source = "registry+https://github.com/rust-lang/crates.io-index" 2003 | checksum = "385e31c29981488f2820b2022d8e731aae3b02e6e18e2fd854e4c9a94dc44fc3" 2004 | dependencies = [ 2005 | "assert_matches", 2006 | "borsh 0.10.3", 2007 | "num-derive 0.4.2", 2008 | "num-traits", 2009 | "solana-program", 2010 | "spl-token", 2011 | "spl-token-2022", 2012 | "thiserror", 2013 | ] 2014 | 2015 | [[package]] 2016 | name = "spl-discriminator" 2017 | version = "0.1.0" 2018 | source = "registry+https://github.com/rust-lang/crates.io-index" 2019 | checksum = "cce5d563b58ef1bb2cdbbfe0dfb9ffdc24903b10ae6a4df2d8f425ece375033f" 2020 | dependencies = [ 2021 | "bytemuck", 2022 | "solana-program", 2023 | "spl-discriminator-derive", 2024 | ] 2025 | 2026 | [[package]] 2027 | name = "spl-discriminator-derive" 2028 | version = "0.1.2" 2029 | source = "registry+https://github.com/rust-lang/crates.io-index" 2030 | checksum = "07fd7858fc4ff8fb0e34090e41d7eb06a823e1057945c26d480bfc21d2338a93" 2031 | dependencies = [ 2032 | "quote", 2033 | "spl-discriminator-syn", 2034 | "syn 2.0.52", 2035 | ] 2036 | 2037 | [[package]] 2038 | name = "spl-discriminator-syn" 2039 | version = "0.1.2" 2040 | source = "registry+https://github.com/rust-lang/crates.io-index" 2041 | checksum = "18fea7be851bd98d10721782ea958097c03a0c2a07d8d4997041d0ece6319a63" 2042 | dependencies = [ 2043 | "proc-macro2", 2044 | "quote", 2045 | "sha2 0.10.8", 2046 | "syn 2.0.52", 2047 | "thiserror", 2048 | ] 2049 | 2050 | [[package]] 2051 | name = "spl-math" 2052 | version = "0.2.0" 2053 | source = "registry+https://github.com/rust-lang/crates.io-index" 2054 | checksum = "102d87a7608c793497fa3e85e9d0e24a33be06a94fb029b2cd30d794295f8110" 2055 | dependencies = [ 2056 | "borsh 0.10.3", 2057 | "num-derive 0.3.3", 2058 | "num-traits", 2059 | "solana-program", 2060 | "thiserror", 2061 | "uint", 2062 | ] 2063 | 2064 | [[package]] 2065 | name = "spl-memo" 2066 | version = "4.0.0" 2067 | source = "registry+https://github.com/rust-lang/crates.io-index" 2068 | checksum = "f0f180b03318c3dbab3ef4e1e4d46d5211ae3c780940dd0a28695aba4b59a75a" 2069 | dependencies = [ 2070 | "solana-program", 2071 | ] 2072 | 2073 | [[package]] 2074 | name = "spl-pod" 2075 | version = "0.1.0" 2076 | source = "registry+https://github.com/rust-lang/crates.io-index" 2077 | checksum = "2881dddfca792737c0706fa0175345ab282b1b0879c7d877bad129645737c079" 2078 | dependencies = [ 2079 | "borsh 0.10.3", 2080 | "bytemuck", 2081 | "solana-program", 2082 | "solana-zk-token-sdk", 2083 | "spl-program-error", 2084 | ] 2085 | 2086 | [[package]] 2087 | name = "spl-program-error" 2088 | version = "0.3.0" 2089 | source = "registry+https://github.com/rust-lang/crates.io-index" 2090 | checksum = "249e0318493b6bcf27ae9902600566c689b7dfba9f1bdff5893e92253374e78c" 2091 | dependencies = [ 2092 | "num-derive 0.4.2", 2093 | "num-traits", 2094 | "solana-program", 2095 | "spl-program-error-derive", 2096 | "thiserror", 2097 | ] 2098 | 2099 | [[package]] 2100 | name = "spl-program-error-derive" 2101 | version = "0.3.2" 2102 | source = "registry+https://github.com/rust-lang/crates.io-index" 2103 | checksum = "1845dfe71fd68f70382232742e758557afe973ae19e6c06807b2c30f5d5cb474" 2104 | dependencies = [ 2105 | "proc-macro2", 2106 | "quote", 2107 | "sha2 0.10.8", 2108 | "syn 2.0.52", 2109 | ] 2110 | 2111 | [[package]] 2112 | name = "spl-tlv-account-resolution" 2113 | version = "0.4.0" 2114 | source = "registry+https://github.com/rust-lang/crates.io-index" 2115 | checksum = "062e148d3eab7b165582757453632ffeef490c02c86a48bfdb4988f63eefb3b9" 2116 | dependencies = [ 2117 | "bytemuck", 2118 | "solana-program", 2119 | "spl-discriminator", 2120 | "spl-pod", 2121 | "spl-program-error", 2122 | "spl-type-length-value", 2123 | ] 2124 | 2125 | [[package]] 2126 | name = "spl-token" 2127 | version = "4.0.0" 2128 | source = "registry+https://github.com/rust-lang/crates.io-index" 2129 | checksum = "08459ba1b8f7c1020b4582c4edf0f5c7511a5e099a7a97570c9698d4f2337060" 2130 | dependencies = [ 2131 | "arrayref", 2132 | "bytemuck", 2133 | "num-derive 0.3.3", 2134 | "num-traits", 2135 | "num_enum 0.6.1", 2136 | "solana-program", 2137 | "thiserror", 2138 | ] 2139 | 2140 | [[package]] 2141 | name = "spl-token-2022" 2142 | version = "0.9.0" 2143 | source = "registry+https://github.com/rust-lang/crates.io-index" 2144 | checksum = "e4abf34a65ba420584a0c35f3903f8d727d1f13ababbdc3f714c6b065a686e86" 2145 | dependencies = [ 2146 | "arrayref", 2147 | "bytemuck", 2148 | "num-derive 0.4.2", 2149 | "num-traits", 2150 | "num_enum 0.7.2", 2151 | "solana-program", 2152 | "solana-zk-token-sdk", 2153 | "spl-memo", 2154 | "spl-pod", 2155 | "spl-token", 2156 | "spl-token-metadata-interface", 2157 | "spl-transfer-hook-interface", 2158 | "spl-type-length-value", 2159 | "thiserror", 2160 | ] 2161 | 2162 | [[package]] 2163 | name = "spl-token-metadata-interface" 2164 | version = "0.2.0" 2165 | source = "registry+https://github.com/rust-lang/crates.io-index" 2166 | checksum = "4c16ce3ba6979645fb7627aa1e435576172dd63088dc7848cb09aa331fa1fe4f" 2167 | dependencies = [ 2168 | "borsh 0.10.3", 2169 | "solana-program", 2170 | "spl-discriminator", 2171 | "spl-pod", 2172 | "spl-program-error", 2173 | "spl-type-length-value", 2174 | ] 2175 | 2176 | [[package]] 2177 | name = "spl-transfer-hook-interface" 2178 | version = "0.3.0" 2179 | source = "registry+https://github.com/rust-lang/crates.io-index" 2180 | checksum = "051d31803f873cabe71aec3c1b849f35248beae5d19a347d93a5c9cccc5d5a9b" 2181 | dependencies = [ 2182 | "arrayref", 2183 | "bytemuck", 2184 | "solana-program", 2185 | "spl-discriminator", 2186 | "spl-pod", 2187 | "spl-program-error", 2188 | "spl-tlv-account-resolution", 2189 | "spl-type-length-value", 2190 | ] 2191 | 2192 | [[package]] 2193 | name = "spl-type-length-value" 2194 | version = "0.3.0" 2195 | source = "registry+https://github.com/rust-lang/crates.io-index" 2196 | checksum = "a468e6f6371f9c69aae760186ea9f1a01c2908351b06a5e0026d21cfc4d7ecac" 2197 | dependencies = [ 2198 | "bytemuck", 2199 | "solana-program", 2200 | "spl-discriminator", 2201 | "spl-pod", 2202 | "spl-program-error", 2203 | ] 2204 | 2205 | [[package]] 2206 | name = "static_assertions" 2207 | version = "1.1.0" 2208 | source = "registry+https://github.com/rust-lang/crates.io-index" 2209 | checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" 2210 | 2211 | [[package]] 2212 | name = "strsim" 2213 | version = "0.10.0" 2214 | source = "registry+https://github.com/rust-lang/crates.io-index" 2215 | checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" 2216 | 2217 | [[package]] 2218 | name = "subtle" 2219 | version = "2.4.1" 2220 | source = "registry+https://github.com/rust-lang/crates.io-index" 2221 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 2222 | 2223 | [[package]] 2224 | name = "syn" 2225 | version = "1.0.109" 2226 | source = "registry+https://github.com/rust-lang/crates.io-index" 2227 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 2228 | dependencies = [ 2229 | "proc-macro2", 2230 | "quote", 2231 | "unicode-ident", 2232 | ] 2233 | 2234 | [[package]] 2235 | name = "syn" 2236 | version = "2.0.52" 2237 | source = "registry+https://github.com/rust-lang/crates.io-index" 2238 | checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" 2239 | dependencies = [ 2240 | "proc-macro2", 2241 | "quote", 2242 | "unicode-ident", 2243 | ] 2244 | 2245 | [[package]] 2246 | name = "termcolor" 2247 | version = "1.4.1" 2248 | source = "registry+https://github.com/rust-lang/crates.io-index" 2249 | checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" 2250 | dependencies = [ 2251 | "winapi-util", 2252 | ] 2253 | 2254 | [[package]] 2255 | name = "thiserror" 2256 | version = "1.0.57" 2257 | source = "registry+https://github.com/rust-lang/crates.io-index" 2258 | checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" 2259 | dependencies = [ 2260 | "thiserror-impl", 2261 | ] 2262 | 2263 | [[package]] 2264 | name = "thiserror-impl" 2265 | version = "1.0.57" 2266 | source = "registry+https://github.com/rust-lang/crates.io-index" 2267 | checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" 2268 | dependencies = [ 2269 | "proc-macro2", 2270 | "quote", 2271 | "syn 2.0.52", 2272 | ] 2273 | 2274 | [[package]] 2275 | name = "tiny-bip39" 2276 | version = "0.8.2" 2277 | source = "registry+https://github.com/rust-lang/crates.io-index" 2278 | checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" 2279 | dependencies = [ 2280 | "anyhow", 2281 | "hmac 0.8.1", 2282 | "once_cell", 2283 | "pbkdf2 0.4.0", 2284 | "rand 0.7.3", 2285 | "rustc-hash", 2286 | "sha2 0.9.9", 2287 | "thiserror", 2288 | "unicode-normalization", 2289 | "wasm-bindgen", 2290 | "zeroize", 2291 | ] 2292 | 2293 | [[package]] 2294 | name = "tinyvec" 2295 | version = "1.6.0" 2296 | source = "registry+https://github.com/rust-lang/crates.io-index" 2297 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 2298 | dependencies = [ 2299 | "tinyvec_macros", 2300 | ] 2301 | 2302 | [[package]] 2303 | name = "tinyvec_macros" 2304 | version = "0.1.1" 2305 | source = "registry+https://github.com/rust-lang/crates.io-index" 2306 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 2307 | 2308 | [[package]] 2309 | name = "toml" 2310 | version = "0.5.11" 2311 | source = "registry+https://github.com/rust-lang/crates.io-index" 2312 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" 2313 | dependencies = [ 2314 | "serde", 2315 | ] 2316 | 2317 | [[package]] 2318 | name = "toml_datetime" 2319 | version = "0.6.5" 2320 | source = "registry+https://github.com/rust-lang/crates.io-index" 2321 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 2322 | 2323 | [[package]] 2324 | name = "toml_edit" 2325 | version = "0.19.15" 2326 | source = "registry+https://github.com/rust-lang/crates.io-index" 2327 | checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" 2328 | dependencies = [ 2329 | "indexmap", 2330 | "toml_datetime", 2331 | "winnow", 2332 | ] 2333 | 2334 | [[package]] 2335 | name = "typenum" 2336 | version = "1.17.0" 2337 | source = "registry+https://github.com/rust-lang/crates.io-index" 2338 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 2339 | 2340 | [[package]] 2341 | name = "uint" 2342 | version = "0.9.5" 2343 | source = "registry+https://github.com/rust-lang/crates.io-index" 2344 | checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" 2345 | dependencies = [ 2346 | "byteorder", 2347 | "crunchy", 2348 | "hex", 2349 | "static_assertions", 2350 | ] 2351 | 2352 | [[package]] 2353 | name = "unicode-ident" 2354 | version = "1.0.12" 2355 | source = "registry+https://github.com/rust-lang/crates.io-index" 2356 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 2357 | 2358 | [[package]] 2359 | name = "unicode-normalization" 2360 | version = "0.1.23" 2361 | source = "registry+https://github.com/rust-lang/crates.io-index" 2362 | checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" 2363 | dependencies = [ 2364 | "tinyvec", 2365 | ] 2366 | 2367 | [[package]] 2368 | name = "unicode-segmentation" 2369 | version = "1.11.0" 2370 | source = "registry+https://github.com/rust-lang/crates.io-index" 2371 | checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" 2372 | 2373 | [[package]] 2374 | name = "universal-hash" 2375 | version = "0.4.1" 2376 | source = "registry+https://github.com/rust-lang/crates.io-index" 2377 | checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" 2378 | dependencies = [ 2379 | "generic-array", 2380 | "subtle", 2381 | ] 2382 | 2383 | [[package]] 2384 | name = "uriparse" 2385 | version = "0.6.4" 2386 | source = "registry+https://github.com/rust-lang/crates.io-index" 2387 | checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" 2388 | dependencies = [ 2389 | "fnv", 2390 | "lazy_static", 2391 | ] 2392 | 2393 | [[package]] 2394 | name = "version_check" 2395 | version = "0.9.4" 2396 | source = "registry+https://github.com/rust-lang/crates.io-index" 2397 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 2398 | 2399 | [[package]] 2400 | name = "wasi" 2401 | version = "0.9.0+wasi-snapshot-preview1" 2402 | source = "registry+https://github.com/rust-lang/crates.io-index" 2403 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 2404 | 2405 | [[package]] 2406 | name = "wasi" 2407 | version = "0.11.0+wasi-snapshot-preview1" 2408 | source = "registry+https://github.com/rust-lang/crates.io-index" 2409 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 2410 | 2411 | [[package]] 2412 | name = "wasm-bindgen" 2413 | version = "0.2.92" 2414 | source = "registry+https://github.com/rust-lang/crates.io-index" 2415 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 2416 | dependencies = [ 2417 | "cfg-if", 2418 | "wasm-bindgen-macro", 2419 | ] 2420 | 2421 | [[package]] 2422 | name = "wasm-bindgen-backend" 2423 | version = "0.2.92" 2424 | source = "registry+https://github.com/rust-lang/crates.io-index" 2425 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 2426 | dependencies = [ 2427 | "bumpalo", 2428 | "log", 2429 | "once_cell", 2430 | "proc-macro2", 2431 | "quote", 2432 | "syn 2.0.52", 2433 | "wasm-bindgen-shared", 2434 | ] 2435 | 2436 | [[package]] 2437 | name = "wasm-bindgen-macro" 2438 | version = "0.2.92" 2439 | source = "registry+https://github.com/rust-lang/crates.io-index" 2440 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 2441 | dependencies = [ 2442 | "quote", 2443 | "wasm-bindgen-macro-support", 2444 | ] 2445 | 2446 | [[package]] 2447 | name = "wasm-bindgen-macro-support" 2448 | version = "0.2.92" 2449 | source = "registry+https://github.com/rust-lang/crates.io-index" 2450 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 2451 | dependencies = [ 2452 | "proc-macro2", 2453 | "quote", 2454 | "syn 2.0.52", 2455 | "wasm-bindgen-backend", 2456 | "wasm-bindgen-shared", 2457 | ] 2458 | 2459 | [[package]] 2460 | name = "wasm-bindgen-shared" 2461 | version = "0.2.92" 2462 | source = "registry+https://github.com/rust-lang/crates.io-index" 2463 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 2464 | 2465 | [[package]] 2466 | name = "web-sys" 2467 | version = "0.3.69" 2468 | source = "registry+https://github.com/rust-lang/crates.io-index" 2469 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 2470 | dependencies = [ 2471 | "js-sys", 2472 | "wasm-bindgen", 2473 | ] 2474 | 2475 | [[package]] 2476 | name = "winapi" 2477 | version = "0.3.9" 2478 | source = "registry+https://github.com/rust-lang/crates.io-index" 2479 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2480 | dependencies = [ 2481 | "winapi-i686-pc-windows-gnu", 2482 | "winapi-x86_64-pc-windows-gnu", 2483 | ] 2484 | 2485 | [[package]] 2486 | name = "winapi-i686-pc-windows-gnu" 2487 | version = "0.4.0" 2488 | source = "registry+https://github.com/rust-lang/crates.io-index" 2489 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2490 | 2491 | [[package]] 2492 | name = "winapi-util" 2493 | version = "0.1.6" 2494 | source = "registry+https://github.com/rust-lang/crates.io-index" 2495 | checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" 2496 | dependencies = [ 2497 | "winapi", 2498 | ] 2499 | 2500 | [[package]] 2501 | name = "winapi-x86_64-pc-windows-gnu" 2502 | version = "0.4.0" 2503 | source = "registry+https://github.com/rust-lang/crates.io-index" 2504 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2505 | 2506 | [[package]] 2507 | name = "windows-targets" 2508 | version = "0.48.5" 2509 | source = "registry+https://github.com/rust-lang/crates.io-index" 2510 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 2511 | dependencies = [ 2512 | "windows_aarch64_gnullvm", 2513 | "windows_aarch64_msvc", 2514 | "windows_i686_gnu", 2515 | "windows_i686_msvc", 2516 | "windows_x86_64_gnu", 2517 | "windows_x86_64_gnullvm", 2518 | "windows_x86_64_msvc", 2519 | ] 2520 | 2521 | [[package]] 2522 | name = "windows_aarch64_gnullvm" 2523 | version = "0.48.5" 2524 | source = "registry+https://github.com/rust-lang/crates.io-index" 2525 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 2526 | 2527 | [[package]] 2528 | name = "windows_aarch64_msvc" 2529 | version = "0.48.5" 2530 | source = "registry+https://github.com/rust-lang/crates.io-index" 2531 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 2532 | 2533 | [[package]] 2534 | name = "windows_i686_gnu" 2535 | version = "0.48.5" 2536 | source = "registry+https://github.com/rust-lang/crates.io-index" 2537 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 2538 | 2539 | [[package]] 2540 | name = "windows_i686_msvc" 2541 | version = "0.48.5" 2542 | source = "registry+https://github.com/rust-lang/crates.io-index" 2543 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 2544 | 2545 | [[package]] 2546 | name = "windows_x86_64_gnu" 2547 | version = "0.48.5" 2548 | source = "registry+https://github.com/rust-lang/crates.io-index" 2549 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 2550 | 2551 | [[package]] 2552 | name = "windows_x86_64_gnullvm" 2553 | version = "0.48.5" 2554 | source = "registry+https://github.com/rust-lang/crates.io-index" 2555 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 2556 | 2557 | [[package]] 2558 | name = "windows_x86_64_msvc" 2559 | version = "0.48.5" 2560 | source = "registry+https://github.com/rust-lang/crates.io-index" 2561 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 2562 | 2563 | [[package]] 2564 | name = "winnow" 2565 | version = "0.5.40" 2566 | source = "registry+https://github.com/rust-lang/crates.io-index" 2567 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 2568 | dependencies = [ 2569 | "memchr", 2570 | ] 2571 | 2572 | [[package]] 2573 | name = "zerocopy" 2574 | version = "0.7.32" 2575 | source = "registry+https://github.com/rust-lang/crates.io-index" 2576 | checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" 2577 | dependencies = [ 2578 | "zerocopy-derive", 2579 | ] 2580 | 2581 | [[package]] 2582 | name = "zerocopy-derive" 2583 | version = "0.7.32" 2584 | source = "registry+https://github.com/rust-lang/crates.io-index" 2585 | checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" 2586 | dependencies = [ 2587 | "proc-macro2", 2588 | "quote", 2589 | "syn 2.0.52", 2590 | ] 2591 | 2592 | [[package]] 2593 | name = "zeroize" 2594 | version = "1.3.0" 2595 | source = "registry+https://github.com/rust-lang/crates.io-index" 2596 | checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" 2597 | dependencies = [ 2598 | "zeroize_derive", 2599 | ] 2600 | 2601 | [[package]] 2602 | name = "zeroize_derive" 2603 | version = "1.4.2" 2604 | source = "registry+https://github.com/rust-lang/crates.io-index" 2605 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 2606 | dependencies = [ 2607 | "proc-macro2", 2608 | "quote", 2609 | "syn 2.0.52", 2610 | ] 2611 | --------------------------------------------------------------------------------