use {
carbon_core::graphql::primitives::{Pubkey, U8},
juniper::GraphQLObject,
};
#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "RestakingPool")]
pub struct RestakingPoolGraphQL {
pub account_metadata: crate::accounts::graphql::AccountMetadataGraphQL,
pub lst_mint: Pubkey,
pub rst_mint: Pubkey,
pub bump: U8,
}
impl TryFrom<crate::accounts::postgres::RestakingPoolRow> for RestakingPoolGraphQL {
type Error = carbon_core::error::Error;
fn try_from(row: crate::accounts::postgres::RestakingPoolRow) -> Result<Self, Self::Error> {
Ok(Self {
account_metadata: row.account_metadata.into(),
lst_mint: carbon_core::graphql::primitives::Pubkey(row.lst_mint.0),
rst_mint: carbon_core::graphql::primitives::Pubkey(row.rst_mint.0),
bump: carbon_core::graphql::primitives::U8((*row.bump) as u8),
})
}
}