carbon-sharky-decoder 2.0.0

Sharky Decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
pub mod escrow_p_d_a_schema;
pub mod loan_schema;
pub mod n_f_t_list_schema;
pub mod order_book_schema;
pub mod price_update_v2_schema;
pub mod program_version_schema;
pub mod token_lending_loan_schema;
pub mod token_lending_order_book_schema;
pub mod token_lending_pool_schema;

use juniper::GraphQLObject;
pub use {
    escrow_p_d_a_schema::*, loan_schema::*, n_f_t_list_schema::*, order_book_schema::*,
    price_update_v2_schema::*, program_version_schema::*, token_lending_loan_schema::*,
    token_lending_order_book_schema::*, token_lending_pool_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)),
        }
    }
}