Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk
Class AbstractTokenTransferTransaction<T extends AbstractTokenTransferTransaction<T>>
java.lang.Object
com.hedera.hashgraph.sdk.Executable<T,Transaction,TransactionResponse,TransactionResponse>
com.hedera.hashgraph.sdk.Transaction<T>
com.hedera.hashgraph.sdk.AbstractTokenTransferTransaction<T>
- Direct Known Subclasses:
TokenAirdropTransaction,TransferTransaction
abstract class AbstractTokenTransferTransaction<T extends AbstractTokenTransferTransaction<T>>
extends Transaction<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Transaction
Transaction.SignableNodeTransactionBodyBytesNested classes/interfaces inherited from class com.hedera.hashgraph.sdk.Executable
Executable.GrpcRequest -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ArrayList<TokenNftTransfer> protected final ArrayList<TokenTransfer> Fields inherited from class com.hedera.hashgraph.sdk.Transaction
customFeeLimits, DEFAULT_AUTO_RENEW_PERIOD, defaultMaxTransactionFee, DUMMY_ACCOUNT_ID, DUMMY_TRANSACTION_ID, frozenBodyBuilder, innerSignedTransactions, outerTransactions, publicKeys, regenerateTransactionId, signers, sigPairLists, sourceTransactionBody, transactionIdsFields inherited from class com.hedera.hashgraph.sdk.Executable
attemptedAllNodes, blockingUnaryCall, grpcDeadline, logger, maxAttempts, maxBackoff, minBackoff, nodeAccountIds, nodes, random, RST_STREAM -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected(package private)Constructor.(package private)AbstractTokenTransferTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, Transaction>> txs) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddApprovedNftTransfer(NftId nftId, AccountId sender, AccountId receiver) Add an approved nft transfer.addApprovedTokenTransfer(TokenId tokenId, AccountId accountId, long value) Add an approved token transfer to the transaction.addApprovedTokenTransferWithDecimals(TokenId tokenId, AccountId accountId, long value, int decimals) Add an approved token transfer with decimals.addNftTransfer(NftId nftId, AccountId sender, AccountId receiver) Add a non-approved nft transfer.addTokenTransfer(TokenId tokenId, AccountId accountId, long value) Add a non-approved token transfer to the transaction.addTokenTransferWithDecimals(TokenId tokenId, AccountId accountId, long value, int decimals) Add a non-approved token transfer with decimals.protected TdoAddNftTransfer(NftId nftId, AccountId sender, AccountId receiver, boolean isApproved, NftHookCall senderHookCall, NftHookCall receiverHookCall) protected TdoAddTokenTransfer(TokenId tokenId, AccountId accountId, long amount, boolean isApproved, Integer expectedDecimals, FungibleHookCall hookCall) Extract the list of token id decimals.Extract the of token nft transfers.Extract the list of token transfer records.setNftTransferApproval(NftId nftId, boolean isApproved) Deprecated.setTokenTransferApproval(TokenId tokenId, AccountId accountId, boolean isApproved) Deprecated.- UseaddApprovedTokenTransfer(TokenId, AccountId, long)insteadprotected ArrayList<TokenTransferList> (package private) voidvalidateChecksums(Client client) Methods inherited from class com.hedera.hashgraph.sdk.Transaction
addSignature, addSignature, batchify, buildAllTransactions, buildTransaction, doSchedule, estimateFee, freeze, freezeWith, fromBytes, fromScheduledTransaction, generateTransactionIds, getBatchKey, getDefaultMaxTransactionFee, getExecutionState, getHighVolume, getMaxTransactionFee, getRegenerateTransactionId, getRequiredChunks, getSignableNodeBodyBytesList, getSignatures, getSignaturesAtOffset, getTransactionBodySize, getTransactionHash, getTransactionHashPerNode, getTransactionId, getTransactionIdInternal, getTransactionMemo, getTransactionSize, getTransactionValidDuration, hash, isBatchedAndNotBatchTransaction, isFrozen, keyAlreadySigned, makeRequest, mapResponse, mapResponseStatus, onExecute, onExecuteAsync, onFreeze, onScheduled, regenerateTransactionId, requireNotFrozen, requireOneNodeAccountId, schedule, setBatchKey, setHighVolume, setMaxTransactionFee, setNodeAccountIds, setRegenerateTransactionId, setTransactionId, setTransactionMemo, setTransactionValidDuration, sign, signTransaction, signWith, signWithOperator, spawnBodyBuilder, toBytes, toString, wipeTransactionListsMethods inherited from class com.hedera.hashgraph.sdk.Executable
advanceRequest, checkNodeAccountIds, execute, execute, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, executeAsync, getGrpcRequest, getMaxAttempts, getMaxBackoff, getMaxRetry, getMethodDescriptor, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Field Details
-
tokenTransfers
-
nftTransfers
-
-
Constructor Details
-
AbstractTokenTransferTransaction
protected AbstractTokenTransferTransaction() -
AbstractTokenTransferTransaction
AbstractTokenTransferTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, throws com.google.protobuf.InvalidProtocolBufferExceptionTransaction>> txs) Constructor.- Parameters:
txs- Compound list of transaction id's list of (AccountId, Transaction) records- Throws:
com.google.protobuf.InvalidProtocolBufferException- when there is an issue with the protobuf
-
AbstractTokenTransferTransaction
AbstractTokenTransferTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getTokenIdDecimals
Extract the list of token id decimals.- Returns:
- the list of token id decimals
-
getTokenTransfers
Extract the list of token transfer records.- Returns:
- the list of token transfer records
-
doAddTokenTransfer
protected T doAddTokenTransfer(TokenId tokenId, AccountId accountId, long amount, boolean isApproved, @Nullable Integer expectedDecimals, @Nullable FungibleHookCall hookCall) -
addTokenTransfer
Add a non-approved token transfer to the transaction.- Parameters:
tokenId- the token idaccountId- the account idvalue- the value- Returns:
- the updated transaction
-
addApprovedTokenTransfer
Add an approved token transfer to the transaction.- Parameters:
tokenId- the token idaccountId- the account idvalue- the value- Returns:
- the updated transaction
-
addTokenTransferWithDecimals
public T addTokenTransferWithDecimals(TokenId tokenId, AccountId accountId, long value, int decimals) Add a non-approved token transfer with decimals.- Parameters:
tokenId- the token idaccountId- the account idvalue- the valuedecimals- the decimals- Returns:
- the updated transaction
-
addApprovedTokenTransferWithDecimals
public T addApprovedTokenTransferWithDecimals(TokenId tokenId, AccountId accountId, long value, int decimals) Add an approved token transfer with decimals.- Parameters:
tokenId- the token idaccountId- the account idvalue- the valuedecimals- the decimals- Returns:
- the updated transaction
-
setTokenTransferApproval
@Deprecated public T setTokenTransferApproval(TokenId tokenId, AccountId accountId, boolean isApproved) Deprecated.- UseaddApprovedTokenTransfer(TokenId, AccountId, long)instead- Parameters:
tokenId- the token idaccountId- the account idisApproved- whether the transfer is approved- Returns:
this
-
getTokenNftTransfers
Extract the of token nft transfers.- Returns:
- list of token nft transfers
-
doAddNftTransfer
protected T doAddNftTransfer(NftId nftId, AccountId sender, AccountId receiver, boolean isApproved, @Nullable NftHookCall senderHookCall, @Nullable NftHookCall receiverHookCall) -
addNftTransfer
Add a non-approved nft transfer.- Parameters:
nftId- the nft's idsender- the sender account idreceiver- the receiver account id- Returns:
- the updated transaction
-
addApprovedNftTransfer
Add an approved nft transfer.- Parameters:
nftId- the nft's idsender- the sender account idreceiver- the receiver account id- Returns:
- the updated transaction
-
setNftTransferApproval
Deprecated.- UseaddApprovedNftTransfer(NftId, AccountId, AccountId)instead- Parameters:
nftId- the NFT idisApproved- whether the transfer is approved- Returns:
this
-
sortTransfersAndBuild
-
validateChecksums
- Specified by:
validateChecksumsin classTransaction<T extends AbstractTokenTransferTransaction<T>>- Throws:
BadEntityIdException
-
addApprovedNftTransfer(NftId, AccountId, AccountId)instead