Module spl_governance::tools::spl_token
source · Expand description
General purpose SPL token utility functions
Functions§
- Asserts the given account_info represents a valid SPL Token account which is initialized and belongs to spl_token program
- Asserts the given mint_info represents a valid SPL Token Mint account which is initialized and belongs to spl_token program
- Asserts current mint authority matches the given authority and it’s signer of the transaction
- Asserts current token owner matches the given owner and it’s signer of the transaction
- Burns SPL Tokens from a token account owned by the provided PDA authority with seeds
- Creates and initializes SPL token account with PDA using the provided PDA seeds
- Computationally cheap method to get mint from a token account It reads mint without deserializing full account data
- Computationally cheap method to just get authority from a mint without unpacking the whole object
- Computationally cheap method to just get supply from a mint without unpacking the whole object
- Computationally cheap method to get owner from a token account It reads owner without deserializing full account data
- Checks if the given account_info is spl-token token account
- Checks if the given account_info is be spl-token mint account
- Mint SPL Tokens
- Sets spl-token account (Mint or TokenAccount) authority
- Transfers SPL Tokens
- Transfers SPL Tokens from a token account owned by the provided PDA authority with seeds