carbon-zeta-decoder 2.0.0

Zeta Program Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
pub mod cross_margin_account_manager_schema;
pub mod cross_margin_account_schema;
pub mod cross_open_orders_map_schema;
pub mod greeks_schema;
pub mod insurance_deposit_account_schema;
pub mod margin_account_schema;
pub mod market_indexes_schema;
pub mod market_node_schema;
pub mod open_orders_map_schema;
pub mod perp_sync_queue_schema;
pub mod pricing_schema;
pub mod referral_account_schema;
pub mod referrer_account_schema;
pub mod referrer_alias_schema;
pub mod settlement_account_schema;
pub mod socialized_loss_account_schema;
pub mod spread_account_schema;
pub mod state_schema;
pub mod underlying_schema;
pub mod whitelist_deposit_account_schema;
pub mod whitelist_insurance_account_schema;
pub mod whitelist_trading_fees_account_schema;
pub mod zeta_group_schema;

use juniper::GraphQLObject;
pub use {
    cross_margin_account_manager_schema::*, cross_margin_account_schema::*,
    cross_open_orders_map_schema::*, greeks_schema::*, insurance_deposit_account_schema::*,
    margin_account_schema::*, market_indexes_schema::*, market_node_schema::*,
    open_orders_map_schema::*, perp_sync_queue_schema::*, pricing_schema::*,
    referral_account_schema::*, referrer_account_schema::*, referrer_alias_schema::*,
    settlement_account_schema::*, socialized_loss_account_schema::*, spread_account_schema::*,
    state_schema::*, underlying_schema::*, whitelist_deposit_account_schema::*,
    whitelist_insurance_account_schema::*, whitelist_trading_fees_account_schema::*,
    zeta_group_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)),
        }
    }
}