Struct spl_token_client::token::Token
source · pub struct Token<T> { /* private fields */ }Implementations
sourceimpl<T> Token<T>where
T: SendTransaction,
impl<T> Token<T>where
T: SendTransaction,
pub fn new(
client: Arc<dyn ProgramClient<T>>,
program_id: &Pubkey,
address: &Pubkey,
decimals: Option<u8>,
payer: Arc<dyn Signer>
) -> Self
pub fn new_native(
client: Arc<dyn ProgramClient<T>>,
program_id: &Pubkey,
payer: Arc<dyn Signer>
) -> Self
pub fn is_native(&self) -> bool
sourcepub fn get_address(&self) -> &Pubkey
pub fn get_address(&self) -> &Pubkey
Get token address.
pub fn with_payer(&self, payer: Arc<dyn Signer>) -> Token<T>
pub fn with_nonce(
&self,
nonce_account: &Pubkey,
nonce_authority: &Pubkey
) -> Token<T>
pub fn with_memo<M: AsRef<str>>(&self, memo: M, signers: Vec<Pubkey>) -> &Self
pub async fn get_new_latest_blockhash(&self) -> TokenResult<Hash>
pub async fn process_ixs<S: Signers>(
&self,
token_instructions: &[Instruction],
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn create_mint<'a, S: Signers>(
&self,
mint_authority: &'a Pubkey,
freeze_authority: Option<&'a Pubkey>,
extension_initialization_params: Vec<ExtensionInitializationParams>,
signing_keypairs: &S
) -> TokenResult<T::Output>
sourcepub async fn create_native_mint(
client: Arc<dyn ProgramClient<T>>,
program_id: &Pubkey,
payer: Arc<dyn Signer>
) -> TokenResult<Self>
pub async fn create_native_mint(
client: Arc<dyn ProgramClient<T>>,
program_id: &Pubkey,
payer: Arc<dyn Signer>
) -> TokenResult<Self>
Create native mint
sourcepub async fn create_multisig(
&self,
account: &dyn Signer,
multisig_members: &[&Pubkey],
minimum_signers: u8
) -> TokenResult<T::Output>
pub async fn create_multisig(
&self,
account: &dyn Signer,
multisig_members: &[&Pubkey],
minimum_signers: u8
) -> TokenResult<T::Output>
Create multisig
sourcepub fn get_associated_token_address(&self, owner: &Pubkey) -> Pubkey
pub fn get_associated_token_address(&self, owner: &Pubkey) -> Pubkey
Get the address for the associated token account.
sourcepub async fn create_associated_token_account(
&self,
owner: &Pubkey
) -> TokenResult<T::Output>
pub async fn create_associated_token_account(
&self,
owner: &Pubkey
) -> TokenResult<T::Output>
Create and initialize the associated account.
sourcepub async fn create_auxiliary_token_account(
&self,
account: &dyn Signer,
owner: &Pubkey
) -> TokenResult<T::Output>
pub async fn create_auxiliary_token_account(
&self,
account: &dyn Signer,
owner: &Pubkey
) -> TokenResult<T::Output>
Create and initialize a new token account.
sourcepub async fn create_auxiliary_token_account_with_extension_space(
&self,
account: &dyn Signer,
owner: &Pubkey,
extensions: Vec<ExtensionType>
) -> TokenResult<T::Output>
pub async fn create_auxiliary_token_account_with_extension_space(
&self,
account: &dyn Signer,
owner: &Pubkey,
extensions: Vec<ExtensionType>
) -> TokenResult<T::Output>
Create and initialize a new token account.
sourcepub async fn get_account(&self, account: &Pubkey) -> TokenResult<BaseAccount>
pub async fn get_account(&self, account: &Pubkey) -> TokenResult<BaseAccount>
Retrieve a raw account
sourcepub async fn get_mint_info(&self) -> TokenResult<StateWithExtensionsOwned<Mint>>
pub async fn get_mint_info(&self) -> TokenResult<StateWithExtensionsOwned<Mint>>
Retrive mint information.
sourcepub async fn get_account_info(
&self,
account: &Pubkey
) -> TokenResult<StateWithExtensionsOwned<Account>>
pub async fn get_account_info(
&self,
account: &Pubkey
) -> TokenResult<StateWithExtensionsOwned<Account>>
Retrieve account information.
sourcepub async fn get_or_create_associated_account_info(
&self,
owner: &Pubkey
) -> TokenResult<StateWithExtensionsOwned<Account>>
pub async fn get_or_create_associated_account_info(
&self,
owner: &Pubkey
) -> TokenResult<StateWithExtensionsOwned<Account>>
Retrieve the associated account or create one if not found.
Assign a new authority to the account.
sourcepub async fn mint_to<S: Signers>(
&self,
destination: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn mint_to<S: Signers>(
&self,
destination: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Mint new tokens
sourcepub async fn transfer<S: Signers>(
&self,
source: &Pubkey,
destination: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn transfer<S: Signers>(
&self,
source: &Pubkey,
destination: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Transfer tokens to another account
sourcepub async fn create_recipient_associated_account_and_transfer<S: Signers>(
&self,
source: &Pubkey,
destination: &Pubkey,
destination_owner: &Pubkey,
authority: &Pubkey,
amount: u64,
fee: Option<u64>,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn create_recipient_associated_account_and_transfer<S: Signers>(
&self,
source: &Pubkey,
destination: &Pubkey,
destination_owner: &Pubkey,
authority: &Pubkey,
amount: u64,
fee: Option<u64>,
signing_keypairs: &S
) -> TokenResult<T::Output>
Transfer tokens to an associated account, creating it if it does not exist
sourcepub async fn transfer_with_fee<S: Signers>(
&self,
source: &Pubkey,
destination: &Pubkey,
authority: &Pubkey,
amount: u64,
fee: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn transfer_with_fee<S: Signers>(
&self,
source: &Pubkey,
destination: &Pubkey,
authority: &Pubkey,
amount: u64,
fee: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Transfer tokens to another account, given an expected fee
sourcepub async fn burn<S: Signers>(
&self,
source: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn burn<S: Signers>(
&self,
source: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Burn tokens from account
sourcepub async fn approve<S: Signers>(
&self,
source: &Pubkey,
delegate: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn approve<S: Signers>(
&self,
source: &Pubkey,
delegate: &Pubkey,
authority: &Pubkey,
amount: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Approve a delegate to spend tokens
sourcepub async fn revoke<S: Signers>(
&self,
source: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn revoke<S: Signers>(
&self,
source: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Revoke a delegate
sourcepub async fn close_account<S: Signers>(
&self,
account: &Pubkey,
lamports_destination: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn close_account<S: Signers>(
&self,
account: &Pubkey,
lamports_destination: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Close an empty account and reclaim its lamports
sourcepub async fn empty_and_close_account<S: Signers>(
&self,
account_to_close: &Pubkey,
lamports_destination: &Pubkey,
tokens_destination: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn empty_and_close_account<S: Signers>(
&self,
account_to_close: &Pubkey,
lamports_destination: &Pubkey,
tokens_destination: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Close an account, reclaiming its lamports and tokens
sourcepub async fn freeze<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn freeze<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Freeze a token account
sourcepub async fn thaw<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn thaw<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Thaw / unfreeze a token account
sourcepub async fn wrap<S: Signers>(
&self,
account: &Pubkey,
owner: &Pubkey,
lamports: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn wrap<S: Signers>(
&self,
account: &Pubkey,
owner: &Pubkey,
lamports: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Wrap lamports into native account
sourcepub async fn wrap_with_mutable_ownership<S: Signers>(
&self,
account: &Pubkey,
owner: &Pubkey,
lamports: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn wrap_with_mutable_ownership<S: Signers>(
&self,
account: &Pubkey,
owner: &Pubkey,
lamports: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Wrap lamports into a native account that can always have its ownership changed
sourcepub async fn sync_native(&self, account: &Pubkey) -> TokenResult<T::Output>
pub async fn sync_native(&self, account: &Pubkey) -> TokenResult<T::Output>
Sync native account lamports
sourcepub async fn set_transfer_fee<S: Signers>(
&self,
authority: &Pubkey,
transfer_fee_basis_points: u16,
maximum_fee: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn set_transfer_fee<S: Signers>(
&self,
authority: &Pubkey,
transfer_fee_basis_points: u16,
maximum_fee: u64,
signing_keypairs: &S
) -> TokenResult<T::Output>
Set transfer fee
sourcepub async fn set_default_account_state<S: Signers>(
&self,
authority: &Pubkey,
state: &AccountState,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn set_default_account_state<S: Signers>(
&self,
authority: &Pubkey,
state: &AccountState,
signing_keypairs: &S
) -> TokenResult<T::Output>
Set default account state on mint
sourcepub async fn harvest_withheld_tokens_to_mint(
&self,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
pub async fn harvest_withheld_tokens_to_mint(
&self,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
Harvest withheld tokens to mint
sourcepub async fn withdraw_withheld_tokens_from_mint<S: Signers>(
&self,
destination: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn withdraw_withheld_tokens_from_mint<S: Signers>(
&self,
destination: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Withdraw withheld tokens from mint
sourcepub async fn withdraw_withheld_tokens_from_accounts<S: Signers>(
&self,
destination: &Pubkey,
authority: &Pubkey,
sources: &[&Pubkey],
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn withdraw_withheld_tokens_from_accounts<S: Signers>(
&self,
destination: &Pubkey,
authority: &Pubkey,
sources: &[&Pubkey],
signing_keypairs: &S
) -> TokenResult<T::Output>
Withdraw withheld tokens from accounts
sourcepub async fn reallocate<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
extension_types: &[ExtensionType],
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn reallocate<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
extension_types: &[ExtensionType],
signing_keypairs: &S
) -> TokenResult<T::Output>
Reallocate a token account to be large enough for a set of ExtensionTypes
sourcepub async fn enable_required_transfer_memos<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn enable_required_transfer_memos<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Require memos on transfers into this account
sourcepub async fn disable_required_transfer_memos<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn disable_required_transfer_memos<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Stop requiring memos on transfers into this account
sourcepub async fn enable_cpi_guard<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn enable_cpi_guard<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Prevent unsafe usage of token account through CPI
sourcepub async fn disable_cpi_guard<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn disable_cpi_guard<S: Signers>(
&self,
account: &Pubkey,
authority: &Pubkey,
signing_keypairs: &S
) -> TokenResult<T::Output>
Stop preventing unsafe usage of token account through CPI
sourcepub async fn update_interest_rate<S: Signers>(
&self,
authority: &Pubkey,
new_rate: i16,
signing_keypairs: &S
) -> TokenResult<T::Output>
pub async fn update_interest_rate<S: Signers>(
&self,
authority: &Pubkey,
new_rate: i16,
signing_keypairs: &S
) -> TokenResult<T::Output>
Update interest rate
sourcepub async fn confidential_transfer_update_mint<S: Signer>(
&self,
authority: &S,
new_ct_mint: ConfidentialTransferMint,
new_authority: Option<&S>
) -> TokenResult<T::Output>
pub async fn confidential_transfer_update_mint<S: Signer>(
&self,
authority: &S,
new_ct_mint: ConfidentialTransferMint,
new_authority: Option<&S>
) -> TokenResult<T::Output>
Update confidential transfer mint
sourcepub async fn confidential_transfer_configure_token_account<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_configure_token_account<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Configures confidential transfers for a token account
pub async fn confidential_transfer_configure_token_account_with_pending_counter<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
maximum_pending_balance_credit_counter: u64
) -> TokenResult<T::Output>
pub async fn confidential_transfer_configure_token_account_with_pending_counter_and_keypair<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
maximum_pending_balance_credit_counter: u64,
elgamal_keypair: &ElGamalKeypair,
decryptable_zero_balance: AeCiphertext
) -> TokenResult<T::Output>
sourcepub async fn confidential_transfer_approve_account<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_approve_account<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Approves a token account for confidential transfers
sourcepub async fn confidential_transfer_empty_account<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_empty_account<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Prepare a token account with the confidential transfer extension for closing
pub async fn confidential_transfer_empty_account_with_keypair<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
elgamal_keypair: &ElGamalKeypair
) -> TokenResult<T::Output>
sourcepub async fn confidential_transfer_get_available_balance<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<u64>
pub async fn confidential_transfer_get_available_balance<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<u64>
Fetch and decrypt the available balance of a confidential token account using the uniquely derived decryption key from a signer
sourcepub async fn confidential_transfer_get_available_balance_with_key(
&self,
token_account: &Pubkey,
authenticated_encryption_key: &AeKey
) -> TokenResult<u64>
pub async fn confidential_transfer_get_available_balance_with_key(
&self,
token_account: &Pubkey,
authenticated_encryption_key: &AeKey
) -> TokenResult<u64>
Fetch and decrypt the available balance of a confidential token account using a custom decryption key
sourcepub async fn confidential_transfer_get_pending_balance<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<u64>
pub async fn confidential_transfer_get_pending_balance<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<u64>
Fetch and decrypt the pending balance of a confidential token account using the uniquely derived decryption key from a signer
sourcepub async fn confidential_transfer_get_pending_balance_with_key(
&self,
token_account: &Pubkey,
elgamal_keypair: &ElGamalKeypair
) -> TokenResult<u64>
pub async fn confidential_transfer_get_pending_balance_with_key(
&self,
token_account: &Pubkey,
elgamal_keypair: &ElGamalKeypair
) -> TokenResult<u64>
Fetch and decrypt the pending balance of a confidential token account using a custom decryption key
pub async fn confidential_transfer_get_withheld_amount<S: Signer>(
&self,
withdraw_withheld_authority: &S,
sources: &[&Pubkey]
) -> TokenResult<u64>
pub async fn confidential_transfer_get_withheld_amount_with_key(
&self,
withdraw_withheld_authority_elgamal_keypair: &ElGamalKeypair,
sources: &[&Pubkey]
) -> TokenResult<u64>
sourcepub async fn confidential_transfer_get_encryption_pubkey<S: Signer>(
&self,
token_account: &Pubkey
) -> TokenResult<ElGamalPubkey>
pub async fn confidential_transfer_get_encryption_pubkey<S: Signer>(
&self,
token_account: &Pubkey
) -> TokenResult<ElGamalPubkey>
Fetch the ElGamal public key associated with a confidential token account
sourcepub async fn confidential_transfer_get_auditor_encryption_pubkey<S: Signer>(
&self
) -> TokenResult<ElGamalPubkey>
pub async fn confidential_transfer_get_auditor_encryption_pubkey<S: Signer>(
&self
) -> TokenResult<ElGamalPubkey>
Fetch the ElGamal pubkey key of the auditor associated with a confidential token mint
Fetch the ElGamal pubkey key of the withdraw withheld authority associated with a confidential token mint
sourcepub async fn confidential_transfer_deposit<S: Signer>(
&self,
token_account: &Pubkey,
token_authority: &S,
amount: u64,
decimals: u8
) -> TokenResult<T::Output>
pub async fn confidential_transfer_deposit<S: Signer>(
&self,
token_account: &Pubkey,
token_authority: &S,
amount: u64,
decimals: u8
) -> TokenResult<T::Output>
Deposit SPL Tokens into the pending balance of a confidential token account
sourcepub async fn confidential_transfer_withdraw<S: Signer>(
&self,
token_account: &Pubkey,
token_authority: &S,
amount: u64,
available_balance: u64,
available_balance_ciphertext: &ElGamalCiphertext,
decimals: u8
) -> TokenResult<T::Output>
pub async fn confidential_transfer_withdraw<S: Signer>(
&self,
token_account: &Pubkey,
token_authority: &S,
amount: u64,
available_balance: u64,
available_balance_ciphertext: &ElGamalCiphertext,
decimals: u8
) -> TokenResult<T::Output>
Withdraw SPL Tokens from the available balance of a confidential token account using the uniquely derived decryption key from a signer
sourcepub async fn confidential_transfer_withdraw_with_key<S: Signer>(
&self,
token_account: &Pubkey,
token_authority: &S,
amount: u64,
decimals: u8,
available_balance: u64,
available_balance_ciphertext: &ElGamalCiphertext,
elgamal_keypair: &ElGamalKeypair,
authenticated_encryption_key: &AeKey
) -> TokenResult<T::Output>
pub async fn confidential_transfer_withdraw_with_key<S: Signer>(
&self,
token_account: &Pubkey,
token_authority: &S,
amount: u64,
decimals: u8,
available_balance: u64,
available_balance_ciphertext: &ElGamalCiphertext,
elgamal_keypair: &ElGamalKeypair,
authenticated_encryption_key: &AeKey
) -> TokenResult<T::Output>
Withdraw SPL Tokens from the available balance of a confidential token account using custom keys
sourcepub async fn confidential_transfer_transfer<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey
) -> TokenResult<T::Output>
pub async fn confidential_transfer_transfer<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey
) -> TokenResult<T::Output>
Transfer tokens confidentially using the uniquely derived decryption keys from a signer
sourcepub async fn confidential_transfer_transfer_with_key<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey,
source_elgamal_keypair: &ElGamalKeypair,
source_authenticated_encryption_key: &AeKey
) -> TokenResult<T::Output>
pub async fn confidential_transfer_transfer_with_key<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey,
source_elgamal_keypair: &ElGamalKeypair,
source_authenticated_encryption_key: &AeKey
) -> TokenResult<T::Output>
Transfer tokens confidentially using custom decryption keys
sourcepub async fn confidential_transfer_transfer_with_fee<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey,
withdraw_withheld_authority_elgamal_pubkey: &ElGamalPubkey,
epoch_info: &EpochInfo
) -> TokenResult<T::Output>
pub async fn confidential_transfer_transfer_with_fee<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey,
withdraw_withheld_authority_elgamal_pubkey: &ElGamalPubkey,
epoch_info: &EpochInfo
) -> TokenResult<T::Output>
Transfer tokens confidentially with fee using the uniquely derived decryption keys from a signer
sourcepub async fn confidential_transfer_transfer_with_fee_with_key<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey,
withdraw_withheld_authority_elgamal_pubkey: &ElGamalPubkey,
source_elgamal_keypair: &ElGamalKeypair,
source_authenticated_encryption_key: &AeKey,
epoch_info: &EpochInfo
) -> TokenResult<T::Output>
pub async fn confidential_transfer_transfer_with_fee_with_key<S: Signer>(
&self,
source_token_account: &Pubkey,
destination_token_account: &Pubkey,
source_token_authority: &S,
amount: u64,
source_available_balance: u64,
source_available_balance_ciphertext: &ElGamalCiphertext,
destination_elgamal_pubkey: &ElGamalPubkey,
auditor_elgamal_pubkey: &ElGamalPubkey,
withdraw_withheld_authority_elgamal_pubkey: &ElGamalPubkey,
source_elgamal_keypair: &ElGamalKeypair,
source_authenticated_encryption_key: &AeKey,
epoch_info: &EpochInfo
) -> TokenResult<T::Output>
Transfer tokens confidential with fee using custom decryption keys
sourcepub async fn confidential_transfer_apply_pending_balance<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
available_balance: u64,
pending_balance: u64,
expected_pending_balance_credit_counter: u64
) -> TokenResult<T::Output>
pub async fn confidential_transfer_apply_pending_balance<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
available_balance: u64,
pending_balance: u64,
expected_pending_balance_credit_counter: u64
) -> TokenResult<T::Output>
Applies the confidential transfer pending balance to the available balance using the uniquely derived decryption key
sourcepub async fn confidential_transfer_apply_pending_balance_with_key<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
available_balance: u64,
pending_balance: u64,
expected_pending_balance_credit_counter: u64,
authenticated_encryption_key: &AeKey
) -> TokenResult<T::Output>
pub async fn confidential_transfer_apply_pending_balance_with_key<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S,
available_balance: u64,
pending_balance: u64,
expected_pending_balance_credit_counter: u64,
authenticated_encryption_key: &AeKey
) -> TokenResult<T::Output>
Applies the confidential transfer pending balance to the available balance using a custom decryption key
sourcepub async fn confidential_transfer_enable_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_enable_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Enable confidential transfer Deposit and Transfer instructions for a token account
sourcepub async fn confidential_transfer_disable_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_disable_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Disable confidential transfer Deposit and Transfer instructions for a token account
sourcepub async fn confidential_transfer_enable_non_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_enable_non_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Enable a confidential extension token account to receive non-confidential payments
sourcepub async fn confidential_transfer_disable_non_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
pub async fn confidential_transfer_disable_non_confidential_credits<S: Signer>(
&self,
token_account: &Pubkey,
authority: &S
) -> TokenResult<T::Output>
Disable non-confidential payments for a confidential extension token account
sourcepub async fn confidential_transfer_withdraw_withheld_tokens_from_mint<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
withheld_amount: u64,
withheld_amount_ciphertext: &ElGamalCiphertext
) -> TokenResult<T::Output>
pub async fn confidential_transfer_withdraw_withheld_tokens_from_mint<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
withheld_amount: u64,
withheld_amount_ciphertext: &ElGamalCiphertext
) -> TokenResult<T::Output>
Withdraw withheld confidential tokens from mint using the uniquely derived decryption key
sourcepub async fn confidential_transfer_withdraw_withheld_tokens_from_mint_with_key<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
withheld_amount: u64,
withheld_amount_ciphertext: &ElGamalCiphertext,
withdraw_withheld_authority_elgamal_keypair: &ElGamalKeypair
) -> TokenResult<T::Output>
pub async fn confidential_transfer_withdraw_withheld_tokens_from_mint_with_key<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
withheld_amount: u64,
withheld_amount_ciphertext: &ElGamalCiphertext,
withdraw_withheld_authority_elgamal_keypair: &ElGamalKeypair
) -> TokenResult<T::Output>
Withdraw withheld confidential tokens from mint using a custom decryption key
sourcepub async fn confidential_transfer_withdraw_withheld_tokens_from_accounts<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
aggregate_withheld_amount: u64,
aggregate_withheld_amount_ciphertext: &ElGamalCiphertext,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
pub async fn confidential_transfer_withdraw_withheld_tokens_from_accounts<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
aggregate_withheld_amount: u64,
aggregate_withheld_amount_ciphertext: &ElGamalCiphertext,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
Withdraw withheld confidential tokens from accounts using the uniquely derived decryption key
sourcepub async fn confidential_transfer_withdraw_withheld_tokens_from_accounts_with_key<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
aggregate_withheld_amount: u64,
aggregate_withheld_amount_ciphertext: &ElGamalCiphertext,
withdraw_withheld_authority_elgamal_keypair: &ElGamalKeypair,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
pub async fn confidential_transfer_withdraw_withheld_tokens_from_accounts_with_key<S: Signer>(
&self,
withdraw_withheld_authority: &S,
destination_token_account: &Pubkey,
destination_elgamal_pubkey: &ElGamalPubkey,
aggregate_withheld_amount: u64,
aggregate_withheld_amount_ciphertext: &ElGamalCiphertext,
withdraw_withheld_authority_elgamal_keypair: &ElGamalKeypair,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
Withdraw withheld confidential tokens from accounts using a custom decryption key
sourcepub async fn confidential_transfer_harvest_withheld_tokens_to_mint(
&self,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
pub async fn confidential_transfer_harvest_withheld_tokens_to_mint(
&self,
sources: &[&Pubkey]
) -> TokenResult<T::Output>
Harvest withheld confidential tokens to mint