//! This code was AUTOGENERATED using the codama library.
//! Please DO NOT EDIT THIS FILE, instead use visitors
//! to add features, then rerun codama to update it.
//!
//! <https://github.com/codama-idl/codama>
//!

use crate::generated::types::BondingCurveCreationType;
use crate::generated::types::GraduationMethodData;
use borsh::BorshDeserialize;
use borsh::BorshSerialize;
use solana_pubkey::Pubkey;

#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Event {
    BondingCurveCreated {
        creation_type: BondingCurveCreationType,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        base_mint: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        quote_mint: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        creator: Pubkey,
        start_price: u128,
        end_price: u128,
        control_points: [u16; 4],
        swap_fee_bps: u16,
        quote_fee_bps: u16,
        base_fee_bps: u16,
        base_allocation_bps: u16,
        launch_slot: u64,
        creator_reward: u64,
        graduation_methods: [GraduationMethodData; 8],
        graduation_target: u64,
        graduation_slot: u64,
        graduation_reward: u64,
        retain_mint_authority: bool,
        min_reserve_bps: u16,
        buy_requires_permission: bool,
        buy_permission_bitmap: [u8; 32],
        max_buy_amount: u64,
        sell_requires_permission: bool,
        sell_permission_bitmap: [u8; 32],
        max_sell_amount: u64,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        quote_token_program: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        base_token_program: Pubkey,
        quote_token_decimals: u8,
        base_token_decimals: u8,
    },
    TokenBought {
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        buyer: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        base_mint: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        quote_mint: Pubkey,
        amount_in: u64,
        amount_out: u64,
        price_before: u128,
        price_after: u128,
        quote_amount_before: u64,
        quote_amount_after: u64,
        base_amount_before: u64,
        base_amount_after: u64,
        protocol_fee: u64,
    },
    TokenSold {
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        seller: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        base_mint: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        quote_mint: Pubkey,
        amount_in: u64,
        amount_out: u64,
        price_before: u128,
        price_after: u128,
        quote_amount_before: u64,
        quote_amount_after: u64,
        base_amount_before: u64,
        base_amount_after: u64,
        protocol_fee: u64,
    },
    TokenRefunded {
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        signer: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        base_mint: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        quote_mint: Pubkey,
        price: u128,
        quote_amount: u64,
        base_amount: u64,
    },
    BondingCurveGraduated {
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        graduator: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        base_mint: Pubkey,
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        quote_mint: Pubkey,
        final_price: u128,
        graduation_methods: [GraduationMethodData; 8],
    },
    BondingCurveClosed {
        #[cfg_attr(
            feature = "serde",
            serde(with = "serde_with::As::<serde_with::DisplayFromStr>")
        )]
        bonding_curve: Pubkey,
    },
}
