Function ore_api::loaders::load_token_account

source ยท
pub fn load_token_account<'a, 'info>(
    info: &'a AccountInfo<'info>,
    owner: Option<&Pubkey>,
    mint: &Pubkey,
    is_writable: bool,
) -> Result<(), ProgramError>
Expand description

Errors if:

  • Owner is not SPL token program.
  • Data is empty.
  • Data cannot deserialize into a token account.
  • Token account owner does not match the expected owner address.
  • Token account mint does not match the expected mint address.
  • Expected to be writable, but is not.