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