carbon-gavel-decoder 1.0.0

Gavel Pool Decoder
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! This code was AUTOGENERATED using the Codama library.
use crate::types::{Amm, PoolHeader};

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
pub struct PoolAccount {
    pub pool_header: PoolHeader,
    pub amm: Amm,
}

impl PoolAccount {
    pub fn decode(data: &[u8]) -> Option<Self> {
        let mut data_slice = data;

        borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
    }
}