carbon-token-program-decoder 1.0.0

Token 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 Multisig {
    /// Number of signers required.
    pub m: u8,
    /// Number of valid signers.
    pub n: u8,
    /// Is `true` if this structure has been initialized.
    pub is_initialized: bool,
    /// Signer public keys.
    pub signers: [Pubkey; 11],
}

impl Multisig {
    pub fn decode(data: &[u8]) -> Option<Self> {
        if data.len() != 355 {
            return None;
        }

        let mut data_slice = data;

        data_slice = &data_slice[0..];

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