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, U8},
    juniper::GraphQLObject,
};

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "ClaimFeeOperator")]
pub struct ClaimFeeOperatorGraphQL {
    pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
    pub operator: Pubkey,
    pub padding: Vec<U8>,
}

impl TryFrom<crate::accounts::postgres::ClaimFeeOperatorRow> for ClaimFeeOperatorGraphQL {
    type Error = carbon_core::error::Error;
    fn try_from(row: crate::accounts::postgres::ClaimFeeOperatorRow) -> Result<Self, Self::Error> {
        Ok(Self {
            account_metadata: row.account_metadata.into(),
            operator: carbon_core::graphql::primitives::Pubkey(row.operator.0),
            padding: row
                .padding
                .into_iter()
                .map(carbon_core::graphql::primitives::U8)
                .collect(),
        })
    }
}