#[repr(u8)]pub enum TransferFeeInstruction {
InitializeTransferFeeConfig {
transfer_fee_config_authority: COption<Pubkey>,
withdraw_withheld_authority: COption<Pubkey>,
transfer_fee_basis_points: u16,
maximum_fee: u64,
},
TransferCheckedWithFee {
amount: u64,
decimals: u8,
fee: u64,
},
WithdrawWithheldTokensFromMint,
WithdrawWithheldTokensFromAccounts {
num_token_accounts: u8,
},
HarvestWithheldTokensToMint,
SetTransferFee {
transfer_fee_basis_points: u16,
maximum_fee: u64,
},
}Expand description
Transfer Fee extension instructions
Variants§
InitializeTransferFeeConfig
Initialize the transfer fee on a new mint.
Fails if the mint has already been initialized, so must be called before
InitializeMint.
The mint must have exactly enough space allocated for the base mint (82 bytes), plus 83 bytes of padding, 1 byte reserved for the account type, then space required for this extension, plus any others.
Accounts expected by this instruction:
[writable]The mint to initialize.
Fields
Pubkey that may update the fees
Withdraw instructions must be signed by this key
TransferCheckedWithFee
Transfer, providing expected mint information and fees
Accounts expected by this instruction:
- Single owner/delegate
[writable]The source account. Must include theTransferFeeAmountextension.[]The token mint. Must include theTransferFeeConfigextension.[writable]The destination account. Must include theTransferFeeAmountextension.[signer]The source account’s owner/delegate.
- Multisignature owner/delegate
[writable]The source account.[]The token mint.[writable]The destination account.[]The source account’s multisignature owner/delegate.- ..4+M
[signer]M signer accounts.
Fields
WithdrawWithheldTokensFromMint
Transfer all withheld tokens in the mint to an account. Signed by the mint’s withdraw withheld tokens authority.
Accounts expected by this instruction:
- Single owner/delegate
[writable]The token mint. Must include theTransferFeeConfigextension.[writable]The fee receiver account. Must include theTransferFeeAmountextension associated with the provided mint.[signer]The mint’swithdraw_withheld_authority.
- Multisignature owner/delegate
[writable]The token mint.[writable]The destination account.[]The mint’s multisigwithdraw_withheld_authority.- ..3+M
[signer]M signer accounts.
WithdrawWithheldTokensFromAccounts
Transfer all withheld tokens to an account. Signed by the mint’s withdraw withheld tokens authority.
Accounts expected by this instruction:
- Single owner/delegate
[]The token mint. Must include theTransferFeeConfigextension.[writable]The fee receiver account. Must include theTransferFeeAmountextension and be associated with the provided mint.[signer]The mint’swithdraw_withheld_authority.- ..3+N
[writable]The source accounts to withdraw from.
- Multisignature owner/delegate
[]The token mint.[writable]The destination account.[]The mint’s multisigwithdraw_withheld_authority.- ..3+M
[signer]M signer accounts. 3+M+1. ..3+M+N[writable]The source accounts to withdraw from.
HarvestWithheldTokensToMint
Permissionless instruction to transfer all withheld tokens to the mint.
Succeeds for frozen accounts.
Accounts provided should include the TransferFeeAmount extension. If not,
the account is skipped.
Accounts expected by this instruction:
[writable]The mint.- ..1+N
[writable]The source accounts to harvest from.
SetTransferFee
Set transfer fee. Only supported for mints that include the TransferFeeConfig extension.
Accounts expected by this instruction:
- Single authority
[writable]The mint.[signer]The mint’s fee account owner.
- Multisignature authority
[writable]The mint.[]The mint’s multisignature fee account owner.- ..2+M
[signer]M signer accounts.
Implementations§
Trait Implementations§
Source§impl Clone for TransferFeeInstruction
impl Clone for TransferFeeInstruction
Source§fn clone(&self) -> TransferFeeInstruction
fn clone(&self) -> TransferFeeInstruction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more