Class TokenRejectFlow

java.lang.Object
com.hedera.hashgraph.sdk.TokenRejectFlow

public class TokenRejectFlow extends Object
Reject undesired token(s) and dissociate in a single flow.
  • Constructor Details

    • TokenRejectFlow

      public TokenRejectFlow()
  • Method Details

    • getOwnerId

      public AccountId getOwnerId()
      Extract the Account ID of the Owner.
      Returns:
      the Account ID of the Owner.
    • setOwnerId

      public TokenRejectFlow setOwnerId(AccountId ownerId)
      Assign the Account ID of the Owner.
      Parameters:
      ownerId - the Account ID of the Owner.
      Returns:
      this
    • getTokenIds

      public List<TokenId> getTokenIds()
      Extract the list of tokenIds.
      Returns:
      the list of tokenIds.
    • setTokenIds

      public TokenRejectFlow setTokenIds(List<TokenId> tokenIds)
      Assign the list of tokenIds.
      Parameters:
      tokenIds - the list of tokenIds.
      Returns:
      this
    • addTokenId

      public TokenRejectFlow addTokenId(TokenId tokenId)
      Add a token to the list of tokens.
      Parameters:
      tokenId - token to add.
      Returns:
      this
    • getNftIds

      public List<NftId> getNftIds()
      Extract the list of nftIds.
      Returns:
      the list of nftIds.
    • setNftIds

      public TokenRejectFlow setNftIds(List<NftId> nftIds)
      Assign the list of nftIds.
      Parameters:
      nftIds - the list of nftIds.
      Returns:
      this
    • addNftId

      public TokenRejectFlow addNftId(NftId nftId)
      Add a nft to the list of nfts.
      Parameters:
      nftId - nft to add.
      Returns:
      this
    • setNodeAccountIds

      public TokenRejectFlow setNodeAccountIds(List<AccountId> nodeAccountIds)
      Set the account IDs of the nodes that this transaction will be submitted to.

      Providing an explicit node account ID interferes with client-side load balancing of the network. By default, the SDK will pre-generate a transaction for 1/3 of the nodes on the network. If a node is down, busy, or otherwise reports a fatal error, the SDK will try again with a different node.

      Parameters:
      nodeAccountIds - The list of node AccountIds to be set
      Returns:
      this
    • freezeWith

      public TokenRejectFlow freezeWith(Client client)
      Set the client that this transaction will be frozen with.
      Parameters:
      client - the client with the transaction to execute
      Returns:
      this
    • sign

      public TokenRejectFlow sign(PrivateKey privateKey)
      Set the private key that this transaction will be signed with.
      Parameters:
      privateKey - the private key used for signing
      Returns:
      this
    • signWith

      public TokenRejectFlow signWith(PublicKey publicKey, UnaryOperator<byte[]> transactionSigner)
      Set the public key and key list that this transaction will be signed with.
      Parameters:
      publicKey - the public key
      transactionSigner - the key list
      Returns:
      this
    • signWithOperator

      public TokenRejectFlow signWithOperator(Client client)
      Set the operator that this transaction will be signed with.
      Parameters:
      client - the client with the transaction to execute
      Returns:
      this
    • execute

      Execute the transactions in the flow with the passed in client.
      Parameters:
      client - the client with the transaction to execute
      Returns:
      the response
      Throws:
      PrecheckStatusException - when the precheck fails
      TimeoutException - when the transaction times out
    • execute

      public TransactionResponse execute(Client client, Duration timeoutPerTransaction) throws PrecheckStatusException, TimeoutException
      Execute the transactions in the flow with the passed in client.
      Parameters:
      client - the client with the transaction to execute
      timeoutPerTransaction - The timeout after which each transaction's execution attempt will be cancelled.
      Returns:
      the response of TokenRejectTransaction
      Throws:
      PrecheckStatusException - when the precheck fails
      TimeoutException - when the transaction times out
    • executeAsync

      public CompletableFuture<TransactionResponse> executeAsync(Client client)
      Execute the transactions in the flow with the passed in client asynchronously.
      Parameters:
      client - the client with the transaction to execute
      Returns:
      the response
    • executeAsync

      public CompletableFuture<TransactionResponse> executeAsync(Client client, Duration timeoutPerTransaction)
      Execute the transactions in the flow with the passed in client asynchronously.
      Parameters:
      client - the client with the transaction to execute
      timeoutPerTransaction - The timeout after which each transaction's execution attempt will be cancelled.
      Returns:
      the response
    • executeAsync

      public void executeAsync(Client client, BiConsumer<TransactionResponse,Throwable> callback)
      Execute the transactions in the flow with the passed in client asynchronously.
      Parameters:
      client - the client with the transaction to execute
      callback - a BiConsumer which handles the result or error.
    • executeAsync

      public void executeAsync(Client client, Duration timeoutPerTransaction, BiConsumer<TransactionResponse,Throwable> callback)
      Execute the transactions in the flow with the passed in client asynchronously.
      Parameters:
      client - the client with the transaction to execute
      timeoutPerTransaction - The timeout after which each transaction's execution attempt will be cancelled.
      callback - a BiConsumer which handles the result or error.
    • executeAsync

      public void executeAsync(Client client, Consumer<TransactionResponse> onSuccess, Consumer<Throwable> onFailure)
      Execute the transactions in the flow with the passed in client asynchronously.
      Parameters:
      client - the client with the transaction to execute
      onSuccess - a Consumer which consumes the result on success.
      onFailure - a Consumer which consumes the error on failure.
    • executeAsync

      public void executeAsync(Client client, Duration timeoutPerTransaction, Consumer<TransactionResponse> onSuccess, Consumer<Throwable> onFailure)
      Execute the transactions in the flow with the passed in client asynchronously.
      Parameters:
      client - the client with the transaction to execute
      timeoutPerTransaction - The timeout after which each transaction's execution attempt will be cancelled.
      onSuccess - a Consumer which consumes the result on success.
      onFailure - a Consumer which consumes the error on failure.