carbon_pumpfun_decoder/instructions/
extend_account.rs

1use carbon_core::{borsh, CarbonDeserialize};
2
3#[derive(
4    CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
5)]
6#[carbon(discriminator = "0xea66c2cb96483ee5")]
7pub struct ExtendAccount {}
8
9#[derive(Debug, PartialEq)]
10pub struct ExtendAccountInstructionAccounts {
11    pub account: solana_pubkey::Pubkey,
12    pub user: solana_pubkey::Pubkey,
13    pub system_program: solana_pubkey::Pubkey,
14    pub event_authority: solana_pubkey::Pubkey,
15    pub program: solana_pubkey::Pubkey,
16}
17
18impl carbon_core::deserialize::ArrangeAccounts for ExtendAccount {
19    type ArrangedAccounts = ExtendAccountInstructionAccounts;
20
21    fn arrange_accounts(
22        accounts: &[solana_instruction::AccountMeta],
23    ) -> Option<Self::ArrangedAccounts> {
24        let [account, user, system_program, event_authority, program, _remaining @ ..] = accounts
25        else {
26            return None;
27        };
28
29        Some(ExtendAccountInstructionAccounts {
30            account: account.pubkey,
31            user: user.pubkey,
32            system_program: system_program.pubkey,
33            event_authority: event_authority.pubkey,
34            program: program.pubkey,
35        })
36    }
37}