carbon_points_decoder/instructions/
create_user_point_account.rs1use carbon_core::{CarbonDeserialize, account_utils::next_account, borsh};
2
3#[derive(
4 CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
5)]
6#[carbon(discriminator = "0x9c94e28d3059298b")]
7pub struct CreateUserPointAccount {}
8
9#[derive(Debug, PartialEq, Eq, Clone, Hash, serde::Serialize, serde::Deserialize)]
10pub struct CreateUserPointAccountInstructionAccounts {
11 pub user_profile: solana_pubkey::Pubkey,
12 pub funder: solana_pubkey::Pubkey,
13 pub point_category_account: solana_pubkey::Pubkey,
14 pub user_points_account: solana_pubkey::Pubkey,
15 pub system_program: solana_pubkey::Pubkey,
16}
17
18impl carbon_core::deserialize::ArrangeAccounts for CreateUserPointAccount {
19 type ArrangedAccounts = CreateUserPointAccountInstructionAccounts;
20
21 fn arrange_accounts(
22 accounts: &[solana_instruction::AccountMeta],
23 ) -> Option<Self::ArrangedAccounts> {
24 let mut iter = accounts.iter();
25 let user_profile = next_account(&mut iter)?;
26 let funder = next_account(&mut iter)?;
27 let point_category_account = next_account(&mut iter)?;
28 let user_points_account = next_account(&mut iter)?;
29 let system_program = next_account(&mut iter)?;
30
31 Some(CreateUserPointAccountInstructionAccounts {
32 user_profile,
33 funder,
34 point_category_account,
35 user_points_account,
36 system_program,
37 })
38 }
39}