carbon-token-program-decoder 2.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 Mint {
    /// Optional authority used to mint new tokens. The mint authority may only
    /// be provided during mint creation. If no mint authority is present
    /// then the mint has a fixed supply and no further tokens may be minted.
    pub mint_authority: Option<Pubkey>,
    /// Total supply of tokens.
    pub supply: u64,
    /// Number of base 10 digits to the right of the decimal place.
    pub decimals: u8,
    /// Is `true` if this structure has been initialized.
    pub is_initialized: bool,
    /// Optional authority to freeze token accounts.
    pub freeze_authority: Option<Pubkey>,
}

impl From<spl_token_interface::state::Mint> for Mint {
    fn from(value: spl_token_interface::state::Mint) -> Self {
        Mint {
            mint_authority: value.mint_authority.into(),
            supply: value.supply,
            decimals: value.decimals,
            is_initialized: value.is_initialized,
            freeze_authority: value.freeze_authority.into(),
        }
    }
}