carbon_stake_program_decoder/instructions/
authorize_checked_with_seed.rs

1use super::super::types::*;
2
3use alloc::string::String;
4use carbon_core::{borsh, CarbonDeserialize};
5
6#[derive(
7    CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
8)]
9#[carbon(discriminator = "0x0ee69aa5e1d1c2d2")]
10pub struct AuthorizeCheckedWithSeed {
11    pub stake_authorize: StakeAuthorize,
12    pub authority_seed: String,
13    pub authority_owner: solana_pubkey::Pubkey,
14}
15
16pub struct AuthorizeCheckedWithSeedInstructionAccounts {
17    pub stake: solana_pubkey::Pubkey,
18    pub authority_base: solana_pubkey::Pubkey,
19    pub clock: solana_pubkey::Pubkey,
20    pub new_authority: solana_pubkey::Pubkey,
21}
22
23impl carbon_core::deserialize::ArrangeAccounts for AuthorizeCheckedWithSeed {
24    type ArrangedAccounts = AuthorizeCheckedWithSeedInstructionAccounts;
25
26    fn arrange_accounts(
27        accounts: &[solana_instruction::AccountMeta],
28    ) -> Option<Self::ArrangedAccounts> {
29        let [stake, authority_base, clock, new_authority, _remaining @ ..] = accounts else {
30            return None;
31        };
32
33        Some(AuthorizeCheckedWithSeedInstructionAccounts {
34            stake: stake.pubkey,
35            authority_base: authority_base.pubkey,
36            clock: clock.pubkey,
37            new_authority: new_authority.pubkey,
38        })
39    }
40}