use {carbon_core::graphql::primitives::U64, juniper::GraphQLObject};
#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "MsolTicketSolSpent")]
pub struct MsolTicketSolSpentGraphQL {
pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
pub cost_basis: U64,
pub msol_unstaked: U64,
}
impl TryFrom<crate::accounts::postgres::MsolTicketSolSpentRow> for MsolTicketSolSpentGraphQL {
type Error = carbon_core::error::Error;
fn try_from(
row: crate::accounts::postgres::MsolTicketSolSpentRow,
) -> Result<Self, Self::Error> {
Ok(Self {
account_metadata: row.account_metadata.into(),
cost_basis: carbon_core::graphql::primitives::U64(*row.cost_basis),
msol_unstaked: carbon_core::graphql::primitives::U64(*row.msol_unstaked),
})
}
}