Skip to main content

carbon_token_program_decoder/accounts/
mint.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 Mint {
7    /// Optional authority used to mint new tokens. The mint authority may only
8    /// be provided during mint creation. If no mint authority is present
9    /// then the mint has a fixed supply and no further tokens may be minted.
10    pub mint_authority: Option<Pubkey>,
11    /// Total supply of tokens.
12    pub supply: u64,
13    /// Number of base 10 digits to the right of the decimal place.
14    pub decimals: u8,
15    /// Is `true` if this structure has been initialized.
16    pub is_initialized: bool,
17    /// Optional authority to freeze token accounts.
18    pub freeze_authority: Option<Pubkey>,
19}
20
21impl From<spl_token_interface::state::Mint> for Mint {
22    fn from(value: spl_token_interface::state::Mint) -> Self {
23        Mint {
24            mint_authority: value.mint_authority.into(),
25            supply: value.supply,
26            decimals: value.decimals,
27            is_initialized: value.is_initialized,
28            freeze_authority: value.freeze_authority.into(),
29        }
30    }
31}