Struct safe_token_2022::state::Account
source · #[repr(C)]pub struct Account {
pub mint: Pubkey,
pub owner: Pubkey,
pub amount: u64,
pub delegate: COption<Pubkey>,
pub state: AccountState,
pub is_native: COption<u64>,
pub delegated_amount: u64,
pub close_authority: COption<Pubkey>,
}
Expand description
Account data.
Fields§
§mint: Pubkey
The mint associated with this account
owner: Pubkey
The owner of this account.
amount: u64
The amount of tokens this account holds.
delegate: COption<Pubkey>
If delegate
is Some
then delegated_amount
represents
the amount authorized by the delegate
state: AccountState
The account’s state
is_native: COption<u64>
If is_some, this is a native token, and the value logs the rent-exempt reserve. An Account is required to be rent-exempt, so the value is used by the Processor to ensure that wrapped SAFE accounts do not drop below this threshold.
delegated_amount: u64
The amount delegated
Optional authority to close the account.
Implementations§
Trait Implementations§
source§impl BaseState for Account
impl BaseState for Account
source§const ACCOUNT_TYPE: AccountType = AccountType::Account
const ACCOUNT_TYPE: AccountType = AccountType::Account
Associated extension type enum, checked at the start of TLV entries
source§impl GenericTokenAccount for Account
impl GenericTokenAccount for Account
source§fn valid_account_data(account_data: &[u8]) -> bool
fn valid_account_data(account_data: &[u8]) -> bool
Check if the account data is a valid token account
source§fn unpack_account_owner_unchecked(account_data: &[u8]) -> &Pubkey
fn unpack_account_owner_unchecked(account_data: &[u8]) -> &Pubkey
Call after account length has already been verified to unpack the account owner
source§fn unpack_account_mint_unchecked(account_data: &[u8]) -> &Pubkey
fn unpack_account_mint_unchecked(account_data: &[u8]) -> &Pubkey
Call after account length has already been verified to unpack the account mint
source§fn unpack_pubkey_unchecked(account_data: &[u8], offset: usize) -> &Pubkey
fn unpack_pubkey_unchecked(account_data: &[u8], offset: usize) -> &Pubkey
Call after account length has already been verified to unpack a Pubkey at
the specified offset. Panics if
account_data.len()
is less than PUBKEY_BYTES
source§impl IsInitialized for Account
impl IsInitialized for Account
source§fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Is initialized
source§impl Pack for Account
impl Pack for Account
source§fn get_packed_len() -> usize
fn get_packed_len() -> usize
Get the packed length
source§fn unpack(input: &[u8]) -> Result<Self, ProgramError>where
Self: IsInitialized,
fn unpack(input: &[u8]) -> Result<Self, ProgramError>where Self: IsInitialized,
Unpack from slice and check if initialized
source§fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
fn unpack_unchecked(input: &[u8]) -> Result<Self, ProgramError>
Unpack from slice without checking if initialized