carbon_stake_program_decoder/instructions/
set_lockup_checked.rs1use carbon_core::{borsh, CarbonDeserialize};
2
3#[derive(
4 CarbonDeserialize, Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone, Hash,
5)]
6#[carbon(discriminator = "0x169e0cb7765e9cff")]
7pub struct SetLockupChecked {
8 pub unix_timestamp: Option<i64>,
9 pub epoch: Option<u64>,
10}
11
12pub struct SetLockupCheckedInstructionAccounts {
13 pub stake: solana_pubkey::Pubkey,
14 pub authority: solana_pubkey::Pubkey,
15}
16
17impl carbon_core::deserialize::ArrangeAccounts for SetLockupChecked {
18 type ArrangedAccounts = SetLockupCheckedInstructionAccounts;
19
20 fn arrange_accounts(
21 accounts: &[solana_instruction::AccountMeta],
22 ) -> Option<Self::ArrangedAccounts> {
23 let [stake, authority, _remaining @ ..] = accounts else {
24 return None;
25 };
26
27 Some(SetLockupCheckedInstructionAccounts {
28 stake: stake.pubkey,
29 authority: authority.pubkey,
30 })
31 }
32}