carbon_mpl_core_decoder/instructions/
collect.rs1use carbon_core::{borsh, CarbonDeserialize};
2
3#[derive(
4    CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
5)]
6#[carbon(discriminator = "0x13")]
7pub struct Collect {}
8
9pub struct CollectInstructionAccounts {
10    pub recipient1: solana_sdk::pubkey::Pubkey,
11    pub recipient2: solana_sdk::pubkey::Pubkey,
12}
13
14impl carbon_core::deserialize::ArrangeAccounts for Collect {
15    type ArrangedAccounts = CollectInstructionAccounts;
16
17    fn arrange_accounts(
18        accounts: &[solana_sdk::instruction::AccountMeta],
19    ) -> Option<Self::ArrangedAccounts> {
20        let [recipient1, recipient2, _remaining @ ..] = accounts else {
21            return None;
22        };
23
24        Some(CollectInstructionAccounts {
25            recipient1: recipient1.pubkey,
26            recipient2: recipient2.pubkey,
27        })
28    }
29}