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

#[derive(Debug, Clone, GraphQLObject)]
#[graphql(name = "LiquidityChangeEvent")]
pub struct LiquidityChangeEventGraphQL {
    pub pool_state: Pubkey,
    pub tick: i32,
    pub tick_lower: i32,
    pub tick_upper: i32,
    pub liquidity_before: U128,
    pub liquidity_after: U128,
}

impl From<crate::types::LiquidityChangeEvent> for LiquidityChangeEventGraphQL {
    fn from(original: crate::types::LiquidityChangeEvent) -> Self {
        Self {
            pool_state: carbon_core::graphql::primitives::Pubkey(original.pool_state),
            tick: original.tick,
            tick_lower: original.tick_lower,
            tick_upper: original.tick_upper,
            liquidity_before: carbon_core::graphql::primitives::U128(original.liquidity_before),
            liquidity_after: carbon_core::graphql::primitives::U128(original.liquidity_after),
        }
    }
}
