carbon-heaven-decoder 2.0.0

Heaven program decoder
Documentation
//! This code was AUTOGENERATED using the Codama library.
use solana_pubkey::Pubkey;

#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
pub struct UserLpPosition {
    pub pool: Pubkey,
    pub user: Pubkey,
    pub lp_token_balance: u64,
    pub reward_debt: u64,
    pub pending_fees: u64,
    pub bump: u8,
}

impl UserLpPosition {
    pub fn decode(data: &[u8]) -> Option<Self> {
        if data.len() < 8 {
            return None;
        }
        let discriminator = &data[0..8];
        if discriminator != [115, 204, 229, 204, 54, 180, 29, 195] {
            return None;
        }

        let mut data_slice = data;

        data_slice = &data_slice[8..];

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