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
26 fn arrange_accounts(
27 accounts: &[solana_sdk::instruction::AccountMeta],
28 ) -> Option<Self::ArrangedAccounts> {
29 let [global, last_withdraw, mint, bonding_curve, associated_bonding_curve, associated_user, user, system_program, token_program, rent, event_authority, program, _remaining @ ..] =
30 accounts
31 else {
32 return None;
33 };
34
35 Some(WithdrawInstructionAccounts {
36 global: global.pubkey,
37 last_withdraw: last_withdraw.pubkey,
38 mint: mint.pubkey,
39 bonding_curve: bonding_curve.pubkey,
40 associated_bonding_curve: associated_bonding_curve.pubkey,
41 associated_user: associated_user.pubkey,
42 user: user.pubkey,
43 system_program: system_program.pubkey,
44 token_program: token_program.pubkey,
45 rent: rent.pubkey,
46 event_authority: event_authority.pubkey,
47 program: program.pubkey,
48 })
49 }
50}