Skip to main content

carbon_virtuals_decoder/accounts/
virtuals_pool.rs

1//! This code was AUTOGENERATED using the Codama library.
2use {crate::types::PoolState, solana_pubkey::Pubkey};
3
4#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
5#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
6pub struct VirtualsPool {
7    pub creator: Pubkey,
8    pub mint: Pubkey,
9    pub virtual_y: u64,
10    pub graduation_x: u64,
11    pub state: PoolState,
12    pub bump: u8,
13}
14
15impl VirtualsPool {
16    pub fn decode(data: &[u8]) -> Option<Self> {
17        if data.len() < 8 {
18            return None;
19        }
20        let discriminator = &data[0..8];
21        if discriminator != [71, 118, 5, 203, 5, 98, 135, 116] {
22            return None;
23        }
24
25        let mut data_slice = data;
26
27        data_slice = &data_slice[8..];
28
29        borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
30    }
31}