carbon-meteora-dbc-decoder 1.0.0

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

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "PartnerMetadata")]
pub struct PartnerMetadataGraphQL {
    pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
    pub fee_claimer: Pubkey,
    pub padding: Vec<U128>,
    pub name: String,
    pub website: String,
    pub logo: String,
}

impl TryFrom<crate::accounts::postgres::PartnerMetadataRow> for PartnerMetadataGraphQL {
    type Error = carbon_core::error::Error;
    fn try_from(row: crate::accounts::postgres::PartnerMetadataRow) -> Result<Self, Self::Error> {
        Ok(Self {
            account_metadata: row.account_metadata.into(),
            fee_claimer: carbon_core::graphql::primitives::Pubkey(row.fee_claimer.0),
            padding: row
                .padding
                .into_iter()
                .map(|item| carbon_core::graphql::primitives::U128(*item))
                .collect(),
            name: row.name,
            website: row.website,
            logo: row.logo,
        })
    }
}