use crate::{VirtualsDecoder, PROGRAM_ID};
#[cfg(feature = "postgres")]
pub mod postgres;
#[cfg(feature = "graphql")]
pub mod graphql;
pub mod buy;
pub mod claim_fees;
pub mod cpi_event;
pub mod create_meteora_pool;
pub mod initialize;
pub mod initialize_meteora_accounts;
pub mod launch;
pub mod sell;
pub mod update_pool_creator;
pub use self::{
buy::*, claim_fees::*, cpi_event::*, create_meteora_pool::*, initialize::*,
initialize_meteora_accounts::*, launch::*, sell::*, update_pool_creator::*,
};
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[cfg_attr(feature = "serde", serde(tag = "type", content = "data"))]
pub enum VirtualsInstruction {
Buy {
program_id: solana_pubkey::Pubkey,
data: Buy,
accounts: BuyInstructionAccounts,
},
ClaimFees {
program_id: solana_pubkey::Pubkey,
data: ClaimFees,
accounts: ClaimFeesInstructionAccounts,
},
CreateMeteoraPool {
program_id: solana_pubkey::Pubkey,
data: CreateMeteoraPool,
accounts: CreateMeteoraPoolInstructionAccounts,
},
Initialize {
program_id: solana_pubkey::Pubkey,
data: Initialize,
accounts: InitializeInstructionAccounts,
},
InitializeMeteoraAccounts {
program_id: solana_pubkey::Pubkey,
data: InitializeMeteoraAccounts,
accounts: InitializeMeteoraAccountsInstructionAccounts,
},
Launch {
program_id: solana_pubkey::Pubkey,
data: Launch,
accounts: LaunchInstructionAccounts,
},
Sell {
program_id: solana_pubkey::Pubkey,
data: Sell,
accounts: SellInstructionAccounts,
},
UpdatePoolCreator {
program_id: solana_pubkey::Pubkey,
data: UpdatePoolCreator,
accounts: UpdatePoolCreatorInstructionAccounts,
},
CpiEvent {
program_id: solana_pubkey::Pubkey,
data: CpiEvent,
accounts: CpiEventInstructionAccounts,
},
}
impl carbon_core::instruction::InstructionDecoder<'_> for VirtualsDecoder {
type InstructionType = VirtualsInstruction;
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,
VirtualsInstruction::Buy => Buy,
VirtualsInstruction::ClaimFees => ClaimFees,
VirtualsInstruction::CreateMeteoraPool => CreateMeteoraPool,
VirtualsInstruction::Initialize => Initialize,
VirtualsInstruction::InitializeMeteoraAccounts => InitializeMeteoraAccounts,
VirtualsInstruction::Launch => Launch,
VirtualsInstruction::Sell => Sell,
VirtualsInstruction::UpdatePoolCreator => UpdatePoolCreator,
VirtualsInstruction::CpiEvent => CpiEvent,
)
}
}