Skip to main content

carbon_token_program_decoder/accounts/
multisig.rs

1//! This code was AUTOGENERATED using the Codama library.
2use 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 Multisig {
7    /// Number of signers required.
8    pub m: u8,
9    /// Number of valid signers.
10    pub n: u8,
11    /// Is `true` if this structure has been initialized.
12    pub is_initialized: bool,
13    /// Signer public keys.
14    pub signers: [Pubkey; 11],
15}
16
17impl Multisig {
18    pub fn decode(data: &[u8]) -> Option<Self> {
19        if data.len() != 355 {
20            return None;
21        }
22
23        let mut data_slice = data;
24
25        data_slice = &data_slice[0..];
26
27        borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
28    }
29}