carbon_pumpfun_decoder/instructions/
withdraw.rs1use carbon_core::{borsh, CarbonDeserialize};
2#[derive(
3 CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
4)]
5#[carbon(discriminator = "0xb712469c946da122")]
6pub struct Withdraw {}
7
8pub struct WithdrawInstructionAccounts {
9 pub global: solana_sdk::pubkey::Pubkey,
10 pub last_withdraw: solana_sdk::pubkey::Pubkey,
11 pub mint: solana_sdk::pubkey::Pubkey,
12 pub bonding_curve: solana_sdk::pubkey::Pubkey,
13 pub associated_bonding_curve: solana_sdk::pubkey::Pubkey,
14 pub associated_user: solana_sdk::pubkey::Pubkey,
15 pub user: solana_sdk::pubkey::Pubkey,
16 pub system_program: solana_sdk::pubkey::Pubkey,
17 pub token_program: solana_sdk::pubkey::Pubkey,
18 pub rent: solana_sdk::pubkey::Pubkey,
19 pub event_authority: solana_sdk::pubkey::Pubkey,
20 pub program: solana_sdk::pubkey::Pubkey,
21}
22
23impl carbon_core::deserialize::ArrangeAccounts for Withdraw {
24 type ArrangedAccounts = WithdrawInstructionAccounts;
25
26fn arrange_accounts(
27 accounts: Vec<solana_sdk::instruction::AccountMeta>,
28 ) -> Option<Self::ArrangedAccounts> {
29 let global = accounts.get(0)?;
30 let last_withdraw = accounts.get(1)?;
31 let mint = accounts.get(2)?;
32 let bonding_curve = accounts.get(3)?;
33 let associated_bonding_curve = accounts.get(4)?;
34 let associated_user = accounts.get(5)?;
35 let user = accounts.get(6)?;
36 let system_program = accounts.get(7)?;
37 let token_program = accounts.get(8)?;
38 let rent = accounts.get(9)?;
39 let event_authority = accounts.get(10)?;
40 let program = accounts.get(11)?;
41
42 Some(WithdrawInstructionAccounts {
43 global: global.pubkey,
44 last_withdraw: last_withdraw.pubkey,
45 mint: mint.pubkey,
46 bonding_curve: bonding_curve.pubkey,
47 associated_bonding_curve: associated_bonding_curve.pubkey,
48 associated_user: associated_user.pubkey,
49 user: user.pubkey,
50 system_program: system_program.pubkey,
51 token_program: token_program.pubkey,
52 rent: rent.pubkey,
53 event_authority: event_authority.pubkey,
54 program: program.pubkey,
55 })
56 }
57}