use crate::{MemoProgramDecoder, PROGRAM_ID};
#[cfg(feature = "postgres")]
pub mod postgres;
#[cfg(feature = "graphql")]
pub mod graphql;
pub mod add_memo;
pub use self::add_memo::*;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
pub enum MemoProgramInstruction {
AddMemo {
program_id: solana_pubkey::Pubkey,
data: AddMemo,
accounts: AddMemoInstructionAccounts,
},
}
impl carbon_core::instruction::InstructionDecoder<'_> for MemoProgramDecoder {
type InstructionType = MemoProgramInstruction;
fn decode_instruction(
&self,
instruction: &solana_instruction::Instruction,
) -> Option<Self::InstructionType> {
if instruction.program_id != PROGRAM_ID {
return None;
}
carbon_core::try_decode_instructions!(
instruction,
PROGRAM_ID,
MemoProgramInstruction::AddMemo => AddMemo,
)
}
}