Skip to main content

carbon_memo_program_decoder/instructions/
mod.rs

1//! This code was AUTOGENERATED using the Codama library.
2use crate::{MemoProgramDecoder, PROGRAM_ID};
3
4#[cfg(feature = "postgres")]
5pub mod postgres;
6
7#[cfg(feature = "graphql")]
8pub mod graphql;
9
10pub mod add_memo;
11
12pub use self::add_memo::*;
13
14#[derive(Debug, Clone, PartialEq)]
15#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
16#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
17pub enum MemoProgramInstruction {
18    AddMemo {
19        program_id: solana_pubkey::Pubkey,
20        data: AddMemo,
21        accounts: AddMemoInstructionAccounts,
22    },
23}
24
25impl carbon_core::instruction::InstructionDecoder<'_> for MemoProgramDecoder {
26    type InstructionType = MemoProgramInstruction;
27
28    fn decode_instruction(
29        &self,
30        instruction: &solana_instruction::Instruction,
31    ) -> Option<Self::InstructionType> {
32        if instruction.program_id != PROGRAM_ID {
33            return None;
34        }
35
36        carbon_core::try_decode_instructions!(
37            instruction,
38            PROGRAM_ID,
39            MemoProgramInstruction::AddMemo => AddMemo,
40        )
41    }
42}