pub trait SplToken {
    // Required methods
    fn create_token_mint(
        &self,
        owner: &Pubkey,
        decimals: u8
    ) -> ClientResult<Keypair>;
    fn create_token_account(
        &self,
        owner: &Pubkey,
        token_mint: &Pubkey
    ) -> ClientResult<Keypair>;
    fn create_token_account_with_lamports(
        &self,
        owner: &Pubkey,
        token_mint: &Pubkey,
        lamports: u64
    ) -> ClientResult<Keypair>;
    fn mint_to(
        &self,
        owner: &Keypair,
        token_mint: &Pubkey,
        account: &Pubkey,
        amount: u64,
        decimals: u8
    ) -> ClientResult<()>;
    fn transfer_to(
        &self,
        owner: &Keypair,
        token_mint: &Pubkey,
        source: &Pubkey,
        destination: &Pubkey,
        amount: u64,
        decimals: u8
    ) -> ClientResult<()>;
    fn get_associated_token_address(
        wallet_address: &Pubkey,
        token_mint: &Pubkey
    ) -> Pubkey;
    fn create_associated_token_account(
        &self,
        funder: &Keypair,
        recipient: &Pubkey,
        token_mint: &Pubkey
    ) -> ClientResult<Pubkey>;
    fn create_associated_token_account_by_payer(
        &self,
        recipient: &Pubkey,
        token_mint: &Pubkey
    ) -> ClientResult<Pubkey>;
    fn close_token_account(
        &self,
        owner: &Keypair,
        account: &Pubkey,
        destination: &Pubkey
    ) -> ClientResult<()>;
}

Required Methods§

source

fn create_token_mint( &self, owner: &Pubkey, decimals: u8 ) -> ClientResult<Keypair>

source

fn create_token_account( &self, owner: &Pubkey, token_mint: &Pubkey ) -> ClientResult<Keypair>

source

fn create_token_account_with_lamports( &self, owner: &Pubkey, token_mint: &Pubkey, lamports: u64 ) -> ClientResult<Keypair>

source

fn mint_to( &self, owner: &Keypair, token_mint: &Pubkey, account: &Pubkey, amount: u64, decimals: u8 ) -> ClientResult<()>

source

fn transfer_to( &self, owner: &Keypair, token_mint: &Pubkey, source: &Pubkey, destination: &Pubkey, amount: u64, decimals: u8 ) -> ClientResult<()>

source

fn get_associated_token_address( wallet_address: &Pubkey, token_mint: &Pubkey ) -> Pubkey

source

fn create_associated_token_account( &self, funder: &Keypair, recipient: &Pubkey, token_mint: &Pubkey ) -> ClientResult<Pubkey>

source

fn create_associated_token_account_by_payer( &self, recipient: &Pubkey, token_mint: &Pubkey ) -> ClientResult<Pubkey>

source

fn close_token_account( &self, owner: &Keypair, account: &Pubkey, destination: &Pubkey ) -> ClientResult<()>

Implementors§