carbon-raydium-launchpad-decoder 2.0.0

Raydium Launchpad Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
pub mod buy_exact_in_schema;
pub mod buy_exact_out_schema;
pub mod claim_creator_fee_schema;
pub mod claim_platform_fee_from_vault_schema;
pub mod claim_platform_fee_schema;
pub mod claim_vested_token_schema;
pub mod close_platform_global_access_schema;
pub mod collect_fee_schema;
pub mod collect_migrate_fee_schema;
pub mod cpi_event_schema;
pub mod create_config_schema;
pub mod create_platform_config_schema;
pub mod create_platform_global_access_schema;
pub mod create_platform_vesting_account_schema;
pub mod create_vesting_account_schema;
pub mod initialize_schema;
pub mod initialize_v2_schema;
pub mod initialize_with_token2022_schema;
pub mod migrate_to_amm_schema;
pub mod migrate_to_cpswap_schema;
pub mod remove_platform_curve_param_schema;
pub mod sell_exact_in_schema;
pub mod sell_exact_out_schema;
pub mod update_config_schema;
pub mod update_platform_config_schema;
pub mod update_platform_curve_param_schema;

use juniper::GraphQLObject;
pub use {
    buy_exact_in_schema::*, buy_exact_out_schema::*, claim_creator_fee_schema::*,
    claim_platform_fee_from_vault_schema::*, claim_platform_fee_schema::*,
    claim_vested_token_schema::*, close_platform_global_access_schema::*, collect_fee_schema::*,
    collect_migrate_fee_schema::*, cpi_event_schema::*, create_config_schema::*,
    create_platform_config_schema::*, create_platform_global_access_schema::*,
    create_platform_vesting_account_schema::*, create_vesting_account_schema::*,
    initialize_schema::*, initialize_v2_schema::*, initialize_with_token2022_schema::*,
    migrate_to_amm_schema::*, migrate_to_cpswap_schema::*, remove_platform_curve_param_schema::*,
    sell_exact_in_schema::*, sell_exact_out_schema::*, update_config_schema::*,
    update_platform_config_schema::*, update_platform_curve_param_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)),
        }
    }
}