Skip to main content

carbon_pumpfun_decoder/accounts/
sharing_config.rs

1//! This code was AUTOGENERATED using the Codama library.
2use {
3    crate::types::{ConfigStatus, Shareholder},
4    solana_pubkey::Pubkey,
5};
6
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8#[derive(Debug, Clone, borsh::BorshSerialize, borsh::BorshDeserialize, PartialEq)]
9pub struct SharingConfig {
10    pub bump: u8,
11    pub version: u8,
12    pub status: ConfigStatus,
13    pub mint: Pubkey,
14    pub admin: Pubkey,
15    pub admin_revoked: bool,
16    pub shareholders: Vec<Shareholder>,
17}
18
19impl SharingConfig {
20    pub fn decode(data: &[u8]) -> Option<Self> {
21        if data.len() < 8 {
22            return None;
23        }
24        let discriminator = &data[0..8];
25        if discriminator != [216, 74, 9, 0, 56, 140, 93, 75] {
26            return None;
27        }
28
29        let mut data_slice = data;
30
31        data_slice = &data_slice[8..];
32
33        borsh::BorshDeserialize::deserialize(&mut data_slice).ok()
34    }
35}