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

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "PoolCreatedEvent")]
pub struct PoolCreatedEventGraphQL {
    pub token_mint0: Pubkey,
    pub token_mint1: Pubkey,
    pub tick_spacing: i32,
    pub pool_state: Pubkey,
    pub sqrt_price_x64: U128,
    pub tick: i32,
    pub token_vault0: Pubkey,
    pub token_vault1: Pubkey,
}

impl From<crate::types::PoolCreatedEvent> for PoolCreatedEventGraphQL {
    fn from(original: crate::types::PoolCreatedEvent) -> Self {
        Self {
            token_mint0: carbon_core::graphql::primitives::Pubkey(original.token_mint0),
            token_mint1: carbon_core::graphql::primitives::Pubkey(original.token_mint1),
            tick_spacing: original.tick_spacing as i32,
            pool_state: carbon_core::graphql::primitives::Pubkey(original.pool_state),
            sqrt_price_x64: carbon_core::graphql::primitives::U128(original.sqrt_price_x64),
            tick: original.tick,
            token_vault0: carbon_core::graphql::primitives::Pubkey(original.token_vault0),
            token_vault1: carbon_core::graphql::primitives::Pubkey(original.token_vault1),
        }
    }
}
