carbon-pump-swap-decoder 2.0.0

PumpSwap Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
pub mod admin_set_coin_creator_schema;
pub mod admin_update_token_incentives_schema;
pub mod buy_exact_quote_in_schema;
pub mod buy_schema;
pub mod claim_cashback_schema;
pub mod claim_token_incentives_schema;
pub mod close_user_volume_accumulator_schema;
pub mod collect_coin_creator_fee_schema;
pub mod cpi_event_schema;
pub mod create_config_schema;
pub mod create_pool_schema;
pub mod deposit_schema;
pub mod disable_schema;
pub mod extend_account_schema;
pub mod init_user_volume_accumulator_schema;
pub mod migrate_pool_coin_creator_schema;
pub mod sell_schema;
pub mod set_coin_creator_schema;
pub mod set_reserved_fee_recipients_schema;
pub mod sync_user_volume_accumulator_schema;
pub mod toggle_cashback_enabled_schema;
pub mod toggle_mayhem_mode_schema;
pub mod transfer_creator_fees_to_pump_schema;
pub mod update_admin_schema;
pub mod update_fee_config_schema;
pub mod withdraw_schema;

use juniper::GraphQLObject;
pub use {
    admin_set_coin_creator_schema::*, admin_update_token_incentives_schema::*,
    buy_exact_quote_in_schema::*, buy_schema::*, claim_cashback_schema::*,
    claim_token_incentives_schema::*, close_user_volume_accumulator_schema::*,
    collect_coin_creator_fee_schema::*, cpi_event_schema::*, create_config_schema::*,
    create_pool_schema::*, deposit_schema::*, disable_schema::*, extend_account_schema::*,
    init_user_volume_accumulator_schema::*, migrate_pool_coin_creator_schema::*, sell_schema::*,
    set_coin_creator_schema::*, set_reserved_fee_recipients_schema::*,
    sync_user_volume_accumulator_schema::*, toggle_cashback_enabled_schema::*,
    toggle_mayhem_mode_schema::*, transfer_creator_fees_to_pump_schema::*, update_admin_schema::*,
    update_fee_config_schema::*, withdraw_schema::*,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "InstructionMetadata")]
pub struct InstructionMetadataGraphQL {
    pub signature: String,
    pub instruction_index: carbon_core::graphql::primitives::U32,
    pub stack_height: carbon_core::graphql::primitives::U32,
    pub slot: Option<carbon_core::graphql::primitives::U64>,
}

impl From<carbon_core::postgres::metadata::InstructionRowMetadata> for InstructionMetadataGraphQL {
    fn from(metadata: carbon_core::postgres::metadata::InstructionRowMetadata) -> Self {
        Self {
            signature: metadata.signature,
            instruction_index: carbon_core::graphql::primitives::U32(
                (*metadata.instruction_index) as u32,
            ),
            stack_height: carbon_core::graphql::primitives::U32((*metadata.stack_height) as u32),
            slot: metadata
                .slot
                .map(|v| carbon_core::graphql::primitives::U64(*v)),
        }
    }
}