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

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "LiquidityCalculateEvent")]
pub struct LiquidityCalculateEventGraphQL {
    pub pool_liquidity: U128,
    pub pool_sqrt_price_x64: U128,
    pub pool_tick: i32,
    pub calc_amount0: U64,
    pub calc_amount1: U64,
    pub trade_fee_owed0: U64,
    pub trade_fee_owed1: U64,
    pub transfer_fee0: U64,
    pub transfer_fee1: U64,
}

impl From<crate::types::LiquidityCalculateEvent> for LiquidityCalculateEventGraphQL {
    fn from(original: crate::types::LiquidityCalculateEvent) -> Self {
        Self {
            pool_liquidity: carbon_core::graphql::primitives::U128(original.pool_liquidity),
            pool_sqrt_price_x64: carbon_core::graphql::primitives::U128(
                original.pool_sqrt_price_x64,
            ),
            pool_tick: original.pool_tick,
            calc_amount0: carbon_core::graphql::primitives::U64(original.calc_amount0),
            calc_amount1: carbon_core::graphql::primitives::U64(original.calc_amount1),
            trade_fee_owed0: carbon_core::graphql::primitives::U64(original.trade_fee_owed0),
            trade_fee_owed1: carbon_core::graphql::primitives::U64(original.trade_fee_owed1),
            transfer_fee0: carbon_core::graphql::primitives::U64(original.transfer_fee0),
            transfer_fee1: carbon_core::graphql::primitives::U64(original.transfer_fee1),
        }
    }
}
