carbon_points_decoder/instructions/
create_point_category.rs

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