Skip to main content

TxPayload

Enum TxPayload 

Source
pub enum TxPayload {
Show 18 variants TokenCreate { symbol: String, decimals: u8, master_authority: Address, is_private: bool, clawback_enabled: bool, name: String, }, TokenTransfer { value: String, recipient: Address, token: Option<Address>, }, TokenClawback { from: Address, recipient: Address, value: String, token: Address, }, TokenGrantAuthority { authority_type: String, authority_address: Address, value: Option<String>, token: Address, }, TokenRevokeAuthority { authority_type: String, authority_address: Address, value: Option<String>, token: Address, }, TokenBlacklistAccount { address: Address, token: Address, }, TokenWhitelistAccount { address: Address, token: Address, }, TokenMint { value: String, recipient: Address, token: Address, }, TokenBridgeAndMint { recipient: Address, value: String, source_chain_id: u64, source_tx_hash: String, bridge_metadata: String, token: Address, }, TokenBurn { value: String, token: Address, }, TokenBurnAndBridge { value: String, sender: Address, destination_chain_id: u64, destination_address: String, escrow_fee: String, bridge_metadata: String, bridge_param: Bytes, token: Address, }, TokenCloseAccount { token: Address, }, TokenPause { token: Address, }, TokenUnpause { token: Address, }, TokenUpdateMetadata { metadata: TokenMetadata, token: Address, }, CreateMultiSig { signers: Vec<MultiSigSignerInfo>, threshold: u16, multisig_address: Address, }, Raw { input: Bytes, token: Address, }, Empty,
}
Expand description

Instructions supported by mint token

Variants§

§

TokenCreate

Create a new mint token. After the token is created, the master_authority of the token is initialized with the provided master_authority parameter.

Refer to TokenInstruction::CreateNewToken.

Fields

§symbol: String

The symbol of the token to create.

§decimals: u8

Number of base 10 digits to the right of the decimal place.

§master_authority: Address

The master authority of the token.

§is_private: bool

true if this token is private and only whitelisted addresses can operate with the tokens

§clawback_enabled: bool

Whether clawback is enabled for this token. This is immutable after issuance and must be set at mint creation.

§name: String

The name of the token to create.

§

TokenTransfer

Transfer tokens from one account to another. The signer of message must be the owner of the source account. Otherwise the transaction may fail.

Refer to TokenInstruction::Transfer.

Fields

§value: String

The amount of tokens to transfer.

§recipient: Address

The real recipient address.

§token: Option<Address>

The token address, if it’s native token, token address is None.

§

TokenClawback

Claw back tokens from a frozen account. The signer must be an issuer clawback authority and the source account must have been frozen via list management.

Refer to TokenInstruction::Clawback.

Fields

§from: Address

The wallet address to claw back tokens from.

§recipient: Address

The destination wallet address to receive clawed-back tokens.

§value: String

The amount of tokens to claw back.

§token: Address

The token address.

§

TokenGrantAuthority

Grant authority to another account. The signer of message must be the Mint’s master_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::GrantAuthority.

Fields

§authority_type: String

The type of authority to update.

§authority_address: Address

The new authority address to grant or revoke.

§value: Option<String>

The allowance value of tokens to grant, only works for MintBurnTokens type.

§token: Address

The token address

§

TokenRevokeAuthority

Revoke authority to another account. The signer of message must be the Mint’s master_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::RevokeAuthority.

Fields

§authority_type: String

The type of authority to update.

§authority_address: Address

The new authority

§value: Option<String>

The allowance value of tokens to revoke, only works for MintBurnTokens type.

§token: Address

The token address

§

TokenBlacklistAccount

Add the account to the blacklisted accounts. The signer of message must be the Mint’s blacklist_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::BlacklistAccount.

Fields

§address: Address

The account to blacklist

§token: Address

The token address

§

TokenWhitelistAccount

Whitelist the a previously blacklisted account. The signer of message must be the Mint’s blacklist_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::WhitelistAccount.

Fields

§address: Address

The account to whitelist

§token: Address

The token address

§

TokenMint

Mints new tokens to an account. The signer of the message must be Mint’s mint_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::MintTo.

Fields

§value: String

The amount of new tokens to mint.

§recipient: Address

The recipient address of the token mint to.

§token: Address

The token address

§

TokenBridgeAndMint

Bridge tokens from another chain and mint them to an account. This instruction creates new tokens representing bridged assets. The signer must have bridge authority.

Refer to TokenInstruction::BridgeAndMint.

Fields

§recipient: Address

The recipient address to mint tokens to.

§value: String

The amount of tokens to mint from the bridge.

§source_chain_id: u64

The chain ID from which tokens are being bridged.

§source_tx_hash: String

The transaction hash on the source chain proving the lock/burn.

§bridge_metadata: String

Optional bridge metadata for additional verification.

§token: Address

The token address

§

TokenBurn

Burns tokens by removing them from an account. The signer of the message must be Mint’s mint_burn authority. Otherwise the transaction may fail.

Refer to TokenInstruction::BurnFromAccount.

Fields

§value: String

The amount of tokens to burn.

§token: Address

The token address

§

TokenBurnAndBridge

Burn tokens and initiate bridge to another chain. This instruction burns tokens and records bridge information for the destination chain. The signer must be the account owner or have appropriate authority.

Refer to TokenInstruction::BurnAndBridge.

Fields

§value: String

The amount of tokens to burn for bridging

§sender: Address

This field is obsolete and will be ignored. The tokens will be burnt from the signer’s wallet.

§destination_chain_id: u64

The destination chain ID to bridge tokens to

§destination_address: String

The destination address on the target chain

§escrow_fee: String

The bridging fee necessary to escrow for transferring tokens to the destination chain

§bridge_metadata: String

Optional bridge metadata for additional information

§bridge_param: Bytes

Optional bridge parameters as arbitrary bytes

§token: Address

The token address

§

TokenCloseAccount

Close an account. Note that an account can be closed only if the token balance is zero.

Refer to TokenInstruction::CloseAccount.

Fields

§token: Address

The token address

§

TokenPause

Pause all transactions associated with the Mint. The signer of the message must be the Mint’s pause_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::Pause.

Fields

§token: Address

The token address

§

TokenUnpause

Unpause transactions for the Mint. The signer of the message must be the Mint’s pause_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::Unpause.

Fields

§token: Address

The token address

§

TokenUpdateMetadata

Update token metadata. The signer of the message must be the Mint’s metadata_update_authority. Otherwise the transaction may fail.

Refer to TokenInstruction::UpdateMetadata.

Fields

§metadata: TokenMetadata

The metadata to update

§token: Address

The token address

§

CreateMultiSig

Create a new multi-signature account. The account is controlled by multiple signers with a defined threshold for transaction approval.

Refer to MultiSigInstruction::CreateAccount.

Fields

§signers: Vec<MultiSigSignerInfo>

List of authorized signers with their weights

§threshold: u16

Minimum total weight required to authorize a transaction

§multisig_address: Address

The derived multi-sig account address (read-only, computed from signers and threshold)

§

Raw

Raw transaction data, all unsupported instructions are encoded as raw data.

This variant is used for all instructions that are not supported by the current version of the API. Just for compatibility.

Fields

§input: Bytes

The input data of the transaction.

§token: Address

The token address

§

Empty

Implementations§

Source§

impl TxPayload

Source

pub fn is_raw(&self) -> bool

Trait Implementations§

Source§

impl Clone for TxPayload

Source§

fn clone(&self) -> TxPayload

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TxPayload

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for TxPayload

Source§

fn default() -> TxPayload

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for TxPayload

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TxPayload, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for TxPayload

Source§

fn eq(&self, other: &TxPayload) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for TxPayload

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl ToSchema for TxPayload

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this type. Read more
Source§

impl Eq for TxPayload

Source§

impl StructuralPartialEq for TxPayload

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<'de, T> BorrowedRpcObject<'de> for T
where T: RpcBorrow<'de> + RpcSend,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<'de, T> RpcBorrow<'de> for T
where T: Deserialize<'de> + Debug + Send + Sync + Unpin,

Source§

impl<T> RpcObject for T
where T: RpcSend + RpcRecv,

Source§

impl<T> RpcRecv for T
where T: DeserializeOwned + Debug + Send + Sync + Unpin + 'static,

Source§

impl<T> RpcSend for T
where T: Serialize + Clone + Debug + Send + Sync + Unpin,