spl_token::processor

Struct Processor

Source
pub struct Processor {}
Expand description

Program state handler.

Implementations§

Source§

impl Processor

Source

pub fn process_initialize_mint( accounts: &[AccountInfo<'_>], decimals: u8, mint_authority: Pubkey, freeze_authority: COption<Pubkey>, ) -> ProgramResult

Processes an InitializeMint instruction.

Source

pub fn process_initialize_mint2( accounts: &[AccountInfo<'_>], decimals: u8, mint_authority: Pubkey, freeze_authority: COption<Pubkey>, ) -> ProgramResult

Processes an InitializeMint2 instruction.

Source

pub fn process_initialize_account( program_id: &Pubkey, accounts: &[AccountInfo<'_>], ) -> ProgramResult

Processes an InitializeAccount instruction.

Source

pub fn process_initialize_account2( program_id: &Pubkey, accounts: &[AccountInfo<'_>], owner: Pubkey, ) -> ProgramResult

Processes an InitializeAccount2 instruction.

Source

pub fn process_initialize_account3( program_id: &Pubkey, accounts: &[AccountInfo<'_>], owner: Pubkey, ) -> ProgramResult

Processes an InitializeAccount3 instruction.

Source

pub fn process_initialize_multisig( accounts: &[AccountInfo<'_>], m: u8, ) -> ProgramResult

Processes a InitializeMultisig instruction.

Source

pub fn process_initialize_multisig2( accounts: &[AccountInfo<'_>], m: u8, ) -> ProgramResult

Processes a InitializeMultisig2 instruction.

Source

pub fn process_transfer( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, expected_decimals: Option<u8>, ) -> ProgramResult

Processes a Transfer instruction.

Source

pub fn process_approve( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, expected_decimals: Option<u8>, ) -> ProgramResult

Processes an Approve instruction.

Source

pub fn process_revoke( program_id: &Pubkey, accounts: &[AccountInfo<'_>], ) -> ProgramResult

Processes an Revoke instruction.

Source

pub fn process_set_authority( program_id: &Pubkey, accounts: &[AccountInfo<'_>], authority_type: AuthorityType, new_authority: COption<Pubkey>, ) -> ProgramResult

Processes a SetAuthority instruction.

Source

pub fn process_mint_to( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, expected_decimals: Option<u8>, ) -> ProgramResult

Processes a MintTo instruction.

Source

pub fn process_burn( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, expected_decimals: Option<u8>, ) -> ProgramResult

Processes a Burn instruction.

Source

pub fn process_close_account( program_id: &Pubkey, accounts: &[AccountInfo<'_>], ) -> ProgramResult

Processes a CloseAccount instruction.

Source

pub fn process_toggle_freeze_account( program_id: &Pubkey, accounts: &[AccountInfo<'_>], freeze: bool, ) -> ProgramResult

Processes a FreezeAccount or a ThawAccount instruction.

Source

pub fn process_sync_native( program_id: &Pubkey, accounts: &[AccountInfo<'_>], ) -> ProgramResult

Processes a SyncNative instruction

Source

pub fn process_get_account_data_size( program_id: &Pubkey, accounts: &[AccountInfo<'_>], ) -> ProgramResult

Processes a GetAccountDataSize instruction

Source

pub fn process_initialize_immutable_owner( accounts: &[AccountInfo<'_>], ) -> ProgramResult

Processes an InitializeImmutableOwner instruction

Source

pub fn process_amount_to_ui_amount( program_id: &Pubkey, accounts: &[AccountInfo<'_>], amount: u64, ) -> ProgramResult

Processes an AmountToUiAmount instruction

Source

pub fn process_ui_amount_to_amount( program_id: &Pubkey, accounts: &[AccountInfo<'_>], ui_amount: &str, ) -> ProgramResult

Processes an AmountToUiAmount instruction

Source

pub fn process( program_id: &Pubkey, accounts: &[AccountInfo<'_>], input: &[u8], ) -> ProgramResult

Processes an Instruction.

Source

pub fn check_account_owner( program_id: &Pubkey, account_info: &AccountInfo<'_>, ) -> ProgramResult

Checks that the account is owned by the expected program

Source

pub fn cmp_pubkeys(a: &Pubkey, b: &Pubkey) -> bool

Checks two pubkeys for equality in a computationally cheap way using sol_memcmp

Source

pub fn validate_owner( program_id: &Pubkey, expected_owner: &Pubkey, owner_account_info: &AccountInfo<'_>, signers: &[AccountInfo<'_>], ) -> ProgramResult

Validates owner(s) are present

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V