java.lang.Object
com.hedera.hashgraph.sdk.TokenRejectFlow
Reject undesired token(s) and dissociate in a single flow.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdd a nft to the list of nfts.addTokenId(TokenId tokenId) Add a token to the list of tokens.Execute the transactions in the flow with the passed in client.Execute the transactions in the flow with the passed in client.executeAsync(Client client) Execute the transactions in the flow with the passed in client asynchronously.executeAsync(Client client, Duration timeoutPerTransaction) Execute the transactions in the flow with the passed in client asynchronously.voidexecuteAsync(Client client, Duration timeoutPerTransaction, BiConsumer<TransactionResponse, Throwable> callback) Execute the transactions in the flow with the passed in client asynchronously.voidexecuteAsync(Client client, Duration timeoutPerTransaction, Consumer<TransactionResponse> onSuccess, Consumer<Throwable> onFailure) Execute the transactions in the flow with the passed in client asynchronously.voidexecuteAsync(Client client, BiConsumer<TransactionResponse, Throwable> callback) Execute the transactions in the flow with the passed in client asynchronously.voidexecuteAsync(Client client, Consumer<TransactionResponse> onSuccess, Consumer<Throwable> onFailure) Execute the transactions in the flow with the passed in client asynchronously.freezeWith(Client client) Set the client that this transaction will be frozen with.Extract the list of nftIds.Extract the Account ID of the Owner.Extract the list of tokenIds.Assign the list of nftIds.setNodeAccountIds(List<AccountId> nodeAccountIds) Set the account IDs of the nodes that this transaction will be submitted to.setOwnerId(AccountId ownerId) Assign the Account ID of the Owner.setTokenIds(List<TokenId> tokenIds) Assign the list of tokenIds.sign(PrivateKey privateKey) Set the private key that this transaction will be signed with.signWith(PublicKey publicKey, UnaryOperator<byte[]> transactionSigner) Set the public key and key list that this transaction will be signed with.signWithOperator(Client client) Set the operator that this transaction will be signed with.
-
Constructor Details
-
TokenRejectFlow
public TokenRejectFlow()
-
-
Method Details
-
getOwnerId
Extract the Account ID of the Owner.- Returns:
- the Account ID of the Owner.
-
setOwnerId
Assign the Account ID of the Owner.- Parameters:
ownerId- the Account ID of the Owner.- Returns:
this
-
getTokenIds
Extract the list of tokenIds.- Returns:
- the list of tokenIds.
-
setTokenIds
Assign the list of tokenIds.- Parameters:
tokenIds- the list of tokenIds.- Returns:
this
-
addTokenId
Add a token to the list of tokens.- Parameters:
tokenId- token to add.- Returns:
this
-
getNftIds
Extract the list of nftIds.- Returns:
- the list of nftIds.
-
setNftIds
Assign the list of nftIds.- Parameters:
nftIds- the list of nftIds.- Returns:
this
-
addNftId
Add a nft to the list of nfts.- Parameters:
nftId- nft to add.- Returns:
this
-
setNodeAccountIds
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
Set the client that this transaction will be frozen with.- Parameters:
client- the client with the transaction to execute- Returns:
this
-
sign
Set the private key that this transaction will be signed with.- Parameters:
privateKey- the private key used for signing- Returns:
this
-
signWith
Set the public key and key list that this transaction will be signed with.- Parameters:
publicKey- the public keytransactionSigner- the key list- Returns:
this
-
signWithOperator
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 failsTimeoutException- 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 executetimeoutPerTransaction- The timeout after which each transaction's execution attempt will be cancelled.- Returns:
- the response of TokenRejectTransaction
- Throws:
PrecheckStatusException- when the precheck failsTimeoutException- when the transaction times out
-
executeAsync
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 executetimeoutPerTransaction- The timeout after which each transaction's execution attempt will be cancelled.- Returns:
- the response
-
executeAsync
Execute the transactions in the flow with the passed in client asynchronously.- Parameters:
client- the client with the transaction to executecallback- 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 executetimeoutPerTransaction- 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 executeonSuccess- 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 executetimeoutPerTransaction- 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.
-