carbon-orca-whirlpool-decoder 1.0.0

Orca Whirlpool Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
pub mod adaptive_fee_tier_schema;
pub mod dynamic_tick_array_schema;
pub mod fee_tier_schema;
pub mod lock_config_schema;
pub mod oracle_schema;
pub mod position_bundle_schema;
pub mod position_schema;
pub mod tick_array_schema;
pub mod token_badge_schema;
pub mod whirlpool_schema;
pub mod whirlpools_config_extension_schema;
pub mod whirlpools_config_schema;

use juniper::GraphQLObject;
pub use {
    adaptive_fee_tier_schema::*, dynamic_tick_array_schema::*, fee_tier_schema::*,
    lock_config_schema::*, oracle_schema::*, position_bundle_schema::*, position_schema::*,
    tick_array_schema::*, token_badge_schema::*, whirlpool_schema::*,
    whirlpools_config_extension_schema::*, whirlpools_config_schema::*,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "AccountMetadata")]
pub struct AccountMetadataGraphQL {
    pub pubkey: carbon_core::graphql::primitives::Pubkey,
    pub slot: Option<carbon_core::graphql::primitives::U64>,
}

impl From<carbon_core::postgres::metadata::AccountRowMetadata> for AccountMetadataGraphQL {
    fn from(metadata: carbon_core::postgres::metadata::AccountRowMetadata) -> Self {
        Self {
            pubkey: carbon_core::graphql::primitives::Pubkey(*metadata.pubkey),
            slot: metadata
                .slot
                .map(|v| carbon_core::graphql::primitives::U64(*v)),
        }
    }
}