#[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
This instruction succeeds if the mint has no configured transfer fee
and the provided fee is 0. This allows applications to use
TransferCheckedWithFee
with any mint.
Accounts expected by this instruction:
- Single owner/delegate
[writable]
The source account. May include theTransferFeeAmount
extension.[]
The token mint. May include theTransferFeeConfig
extension.[writable]
The destination account. May include theTransferFeeAmount
extension.[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 theTransferFeeConfig
extension.[writable]
The fee receiver account. Must include theTransferFeeAmount
extension 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 theTransferFeeConfig
extension.[writable]
The fee receiver account. Must include theTransferFeeAmount
extension 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 moresource§impl Debug for TransferFeeInstruction
impl Debug for TransferFeeInstruction
source§impl PartialEq for TransferFeeInstruction
impl PartialEq for TransferFeeInstruction
source§fn eq(&self, other: &TransferFeeInstruction) -> bool
fn eq(&self, other: &TransferFeeInstruction) -> bool
self
and other
values to be equal, and is used
by ==
.impl Copy for TransferFeeInstruction
impl StructuralPartialEq for TransferFeeInstruction
Auto Trait Implementations§
impl Freeze for TransferFeeInstruction
impl RefUnwindSafe for TransferFeeInstruction
impl Send for TransferFeeInstruction
impl Sync for TransferFeeInstruction
impl Unpin for TransferFeeInstruction
impl UnwindSafe for TransferFeeInstruction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more