carbon-orca-whirlpool-decoder 1.0.0

Orca Whirlpool Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
use {carbon_core::graphql::primitives::Pubkey, juniper::GraphQLObject};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "FeeTier")]
pub struct FeeTierGraphQL {
    pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
    pub whirlpools_config: Pubkey,
    pub tick_spacing: i32,
    pub default_fee_rate: i32,
}

impl TryFrom<crate::accounts::postgres::FeeTierRow> for FeeTierGraphQL {
    type Error = carbon_core::error::Error;
    fn try_from(row: crate::accounts::postgres::FeeTierRow) -> Result<Self, Self::Error> {
        Ok(Self {
            account_metadata: row.account_metadata.into(),
            whirlpools_config: carbon_core::graphql::primitives::Pubkey(row.whirlpools_config.0),
            tick_spacing: *row.tick_spacing,
            default_fee_rate: *row.default_fee_rate,
        })
    }
}