carbon-meteora-dbc-decoder 1.0.0

Meteora DBC 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 PartnerMetadata {
    /// fee claimer
    pub fee_claimer: Pubkey,
    /// padding for future use
    pub padding: [u128; 6],
    /// Name of partner.
    pub name: String,
    /// Website of partner.
    pub website: String,
    /// Logo of partner
    pub logo: String,
}

impl PartnerMetadata {
    pub fn decode(data: &[u8]) -> Option<Self> {
        if data.len() < 8 {
            return None;
        }
        let discriminator = &data[0..8];
        if discriminator != [68, 68, 130, 19, 16, 209, 98, 156] {
            return None;
        }

        let mut data_slice = data;

        data_slice = &data_slice[8..];

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