carbon_token_program_decoder/instructions/
revoke.rs

1use carbon_core::{borsh, CarbonDeserialize};
2#[derive(
3    CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
4)]
5#[carbon(discriminator = "0x05")]
6pub struct Revoke {}
7
8pub struct RevokeAccounts {
9    pub source: solana_pubkey::Pubkey,
10    pub owner: solana_pubkey::Pubkey,
11    pub remaining_accounts: Vec<solana_instruction::AccountMeta>,
12}
13
14impl carbon_core::deserialize::ArrangeAccounts for Revoke {
15    type ArrangedAccounts = RevokeAccounts;
16
17    fn arrange_accounts(
18        accounts: &[solana_instruction::AccountMeta],
19    ) -> Option<Self::ArrangedAccounts> {
20        let [source, owner, remaining_accounts @ ..] = accounts else {
21            return None;
22        };
23
24        Some(RevokeAccounts {
25            source: source.pubkey,
26            owner: owner.pubkey,
27            remaining_accounts: remaining_accounts.to_vec(),
28        })
29    }
30}