carbon_solayer_restaking_program_decoder/instructions/
mod.rs1use crate::{SolayerRestakingProgramDecoder, PROGRAM_ID};
3
4#[cfg(feature = "postgres")]
5pub mod postgres;
6
7#[cfg(feature = "graphql")]
8pub mod graphql;
9
10pub mod batch_thaw_lst_accounts;
11pub mod initialize;
12pub mod restake;
13pub mod unrestake;
14
15pub use self::{batch_thaw_lst_accounts::*, initialize::*, restake::*, unrestake::*};
16
17#[derive(Debug, Clone, PartialEq)]
18#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
19#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
20pub enum SolayerRestakingProgramInstruction {
21 BatchThawLstAccounts {
22 program_id: solana_pubkey::Pubkey,
23 data: BatchThawLstAccounts,
24 accounts: BatchThawLstAccountsInstructionAccounts,
25 },
26 Initialize {
27 program_id: solana_pubkey::Pubkey,
28 data: Initialize,
29 accounts: InitializeInstructionAccounts,
30 },
31 Restake {
32 program_id: solana_pubkey::Pubkey,
33 data: Restake,
34 accounts: RestakeInstructionAccounts,
35 },
36 Unrestake {
37 program_id: solana_pubkey::Pubkey,
38 data: Unrestake,
39 accounts: UnrestakeInstructionAccounts,
40 },
41}
42
43impl carbon_core::instruction::InstructionDecoder<'_> for SolayerRestakingProgramDecoder {
44 type InstructionType = SolayerRestakingProgramInstruction;
45
46 fn decode_instruction(
47 &self,
48 instruction: &solana_instruction::Instruction,
49 ) -> Option<Self::InstructionType> {
50 if instruction.program_id != PROGRAM_ID {
51 return None;
52 }
53
54 carbon_core::try_decode_instructions!(
55 instruction,
56 PROGRAM_ID,
57 SolayerRestakingProgramInstruction::BatchThawLstAccounts => BatchThawLstAccounts,
58 SolayerRestakingProgramInstruction::Initialize => Initialize,
59 SolayerRestakingProgramInstruction::Restake => Restake,
60 SolayerRestakingProgramInstruction::Unrestake => Unrestake,
61 )
62 }
63}