TokenRejectFlow

Struct TokenRejectFlow 

Source
pub struct TokenRejectFlow { /* private fields */ }
Expand description

Reject undesired token(s) and dissociate in a single flow.

The operation of this flow is as follows:

  1. Execute a TokenRejectTransaction using the provided NFT IDs and the Token IDs
  2. Dissociate the rejected tokens from the owner account

Implementations§

Source§

impl TokenRejectFlow

Source

pub fn new() -> Self

Create a new TokenRejectFlow.

Source

pub fn get_owner(&self) -> Option<AccountId>

Returns the owner id of the token to be rejected.

Source

pub fn owner(&mut self, owner: impl Into<AccountId>) -> &mut Self

Sets the owner id of the token to be rejected.

Source

pub fn get_node_account_ids(&self) -> Option<&[AccountId]>

Returns the account IDs of the nodes the transactions may be submitted to.

Source

pub fn node_account_ids( &mut self, node_account_ids: impl IntoIterator<Item = AccountId>, ) -> &mut Self

Sets the account IDs of the nodes the transactions may be submitted to.

Source

pub fn get_token_ids(&self) -> &[TokenId]

Returns the list of token IDs.

Source

pub fn token_ids( &mut self, token_ids: impl IntoIterator<Item = TokenId>, ) -> &mut Self

Sets the list of token IDs.

Source

pub fn add_token_id(&mut self, token_id: TokenId) -> &mut Self

Adds a token ID to the list of token IDs.

Source

pub fn get_nft_ids(&self) -> &[NftId]

Returns the list of NFT IDs.

Source

pub fn nft_ids(&mut self, nft_ids: impl IntoIterator<Item = NftId>) -> &mut Self

Sets the list of NFT IDs.

Source

pub fn add_nft_id(&mut self, nft_id: NftId) -> &mut Self

Adds an NFT ID to the list of NFT IDs.

Source

pub fn freeze_with(&mut self, client: Client) -> &mut Self

Sets the client to use for freezing the generated TokenRejectTransaction.

By default freezing will use the client provided to execute.

Source

pub fn sign(&mut self, key: PrivateKey) -> &mut Self

Sets the signer for use in the TokenRejectTransaction

Important: Only one signer is allowed.

Source

pub fn sign_with<F: Fn(&[u8]) -> Vec<u8> + Send + Sync + 'static>( &mut self, public_key: PublicKey, signer: F, ) -> &mut Self

Sets the signer for use in the TokenRejectTransaction

Important: Only one signer is allowed.

Source

pub fn sign_with_operator(&mut self, client: &Client) -> &mut Self

Set the operator that this transaction will be signed with.

Source

pub async fn execute(&self, client: &Client) -> Result<TransactionResponse>

Generates the required transactions and executes them all.

Source

pub async fn execute_with_timeout( &self, client: &Client, timeout_per_transaction: Duration, ) -> Result<TransactionResponse>

Generates the required transactions and executes them all.

Trait Implementations§

Source§

impl Debug for TokenRejectFlow

Source§

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

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

impl Default for TokenRejectFlow

Source§

fn default() -> TokenRejectFlow

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

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> 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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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