Skip to main content

carbon_raydium_launchpad_decoder/events/
pool_create_event.rs

1//! This code was AUTOGENERATED using the Codama library.
2use {
3    crate::types::{AmmCreatorFeeOn, CurveParams, MintParams, VestingParams},
4    solana_pubkey::Pubkey,
5};
6
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
9pub struct PoolCreateEventEvent {
10    pub pool_state: Pubkey,
11    pub creator: Pubkey,
12    pub config: Pubkey,
13    pub base_mint_param: MintParams,
14    pub curve_param: CurveParams,
15    pub vesting_param: VestingParams,
16    pub amm_fee_on: AmmCreatorFeeOn,
17}
18
19impl PoolCreateEventEvent {
20    pub fn decode(data: &[u8]) -> Option<Self> {
21        if data.len() < 8 {
22            return None;
23        }
24        let discriminator = &data[0..8];
25        if discriminator != [151, 215, 226, 9, 118, 161, 115, 174] {
26            return None;
27        }
28
29        let mut data_slice = data;
30
31        data_slice = &data_slice[8..];
32
33        borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
34    }
35}