carbon_pumpfun_decoder/instructions/
create.rs1use alloc::string::String;
2
3use carbon_core::{account_utils::next_account, borsh, CarbonDeserialize};
4
5#[derive(
6 CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
7)]
8#[carbon(discriminator = "0x181ec828051c0777")]
9pub struct Create {
10 pub name: String,
11 pub symbol: String,
12 pub uri: String,
13 pub creator: solana_pubkey::Pubkey,
14}
15
16#[derive(Debug, PartialEq, Eq, Clone, Hash, serde::Serialize, serde::Deserialize)]
17pub struct CreateInstructionAccounts {
18 pub mint: solana_pubkey::Pubkey,
19 pub mint_authority: solana_pubkey::Pubkey,
20 pub bonding_curve: solana_pubkey::Pubkey,
21 pub associated_bonding_curve: solana_pubkey::Pubkey,
22 pub global: solana_pubkey::Pubkey,
23 pub mpl_token_metadata: solana_pubkey::Pubkey,
24 pub metadata: solana_pubkey::Pubkey,
25 pub user: solana_pubkey::Pubkey,
26 pub system_program: solana_pubkey::Pubkey,
27 pub token_program: solana_pubkey::Pubkey,
28 pub associated_token_program: solana_pubkey::Pubkey,
29 pub rent: solana_pubkey::Pubkey,
30 pub event_authority: solana_pubkey::Pubkey,
31 pub program: solana_pubkey::Pubkey,
32}
33
34impl carbon_core::deserialize::ArrangeAccounts for Create {
35 type ArrangedAccounts = CreateInstructionAccounts;
36
37 fn arrange_accounts(
38 accounts: &[solana_instruction::AccountMeta],
39 ) -> Option<Self::ArrangedAccounts> {
40 let mut iter = accounts.iter();
41 let mint = next_account(&mut iter)?;
42 let mint_authority = next_account(&mut iter)?;
43 let bonding_curve = next_account(&mut iter)?;
44 let associated_bonding_curve = next_account(&mut iter)?;
45 let global = next_account(&mut iter)?;
46 let mpl_token_metadata = next_account(&mut iter)?;
47 let metadata = next_account(&mut iter)?;
48 let user = next_account(&mut iter)?;
49 let system_program = next_account(&mut iter)?;
50 let token_program = next_account(&mut iter)?;
51 let associated_token_program = next_account(&mut iter)?;
52 let rent = next_account(&mut iter)?;
53 let event_authority = next_account(&mut iter)?;
54 let program = next_account(&mut iter)?;
55
56 Some(CreateInstructionAccounts {
57 mint,
58 mint_authority,
59 bonding_curve,
60 associated_bonding_curve,
61 global,
62 mpl_token_metadata,
63 metadata,
64 user,
65 system_program,
66 token_program,
67 associated_token_program,
68 rent,
69 event_authority,
70 program,
71 })
72 }
73}