Module com.hedera.hashgraph.sdk
Package com.hedera.hashgraph.sdk
Class AccountAllowanceApproveTransaction
java.lang.Object
com.hedera.hashgraph.sdk.Executable<AccountAllowanceApproveTransaction,Transaction,TransactionResponse,TransactionResponse>
com.hedera.hashgraph.sdk.Transaction<AccountAllowanceApproveTransaction>
com.hedera.hashgraph.sdk.AccountAllowanceApproveTransaction
public class AccountAllowanceApproveTransaction
extends Transaction<AccountAllowanceApproveTransaction>
# Approve Allowance
This transaction body provides a mechanism to add "allowance" entries
for an account. These allowances enable one account to spend or transfer
token balances (for fungible/common tokens), individual tokens (for
non-fungible/unique tokens), or all non-fungible tokens owned by the
account, now or in the future (if `approved_for_all` is set).
-
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
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
ConstructorsConstructorDescriptionConstructor.Constructor.AccountAllowanceApproveTransaction(LinkedHashMap<TransactionId, LinkedHashMap<AccountId, Transaction>> txs) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddAllTokenNftAllowance(TokenId tokenId, AccountId spenderAccountId) Deprecated.addHbarAllowance(AccountId spenderAccountId, Hbar amount) Deprecated.- UseapproveHbarAllowance(AccountId, AccountId, Hbar)insteadaddTokenAllowance(TokenId tokenId, AccountId spenderAccountId, long amount) Deprecated.addTokenNftAllowance(NftId nftId, AccountId spenderAccountId) Deprecated.approveHbarAllowance(AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) Approves the Hbar allowance.approveTokenAllowance(TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId, long amount) Approves the Token allowance.approveTokenNftAllowance(NftId nftId, AccountId ownerAccountId, AccountId spenderAccountId) Approve the NFT allowance.approveTokenNftAllowance(NftId nftId, AccountId ownerAccountId, AccountId spenderAccountId, AccountId delegatingSpender) Approve the NFT allowance.approveTokenNftAllowanceAllSerials(TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId) Approve the token nft allowance on all serials.(package private) CryptoApproveAllowanceTransactionBody.Builderbuild()Build the correct transaction body.deleteTokenNftAllowanceAllSerials(TokenId tokenId, AccountId ownerAccountId, AccountId spenderAccountId) Delete the token nft allowance on all serials.Deprecated.- UsegetHbarApprovals()insteadExtract the list of hbar allowances.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.Deprecated.- UsegetTokenApprovals()insteadExtract a list of token allowance approvals.Deprecated.- UsegetTokenNftApprovals()insteadReturns the list of token nft allowances.(package private) voidonFreeze(TransactionBody.Builder bodyBuilder) Called inTransaction.freezeWith(Client)just before the transaction body is built.(package private) voidonScheduled(SchedulableTransactionBody.Builder scheduled) Called inTransaction.schedule()when converting transaction into a scheduled version.(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, 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, getMinBackoff, getNodeAccountIds, getNodeForExecute, grpcDeadline, logTransaction, mergeFromClient, setGrpcDeadline, setLogger, setMaxAttempts, setMaxBackoff, setMaxRetry, setMinBackoff, setNodesFromNodeAccountIds, setRequestListener, setResponseListener, shouldRetryExceptionally
-
Constructor Details
-
AccountAllowanceApproveTransaction
public AccountAllowanceApproveTransaction()Constructor. -
AccountAllowanceApproveTransaction
AccountAllowanceApproveTransaction(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
-
AccountAllowanceApproveTransaction
AccountAllowanceApproveTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
addHbarAllowance
@Deprecated public AccountAllowanceApproveTransaction addHbarAllowance(AccountId spenderAccountId, Hbar amount) Deprecated.- UseapproveHbarAllowance(AccountId, AccountId, Hbar)instead- Parameters:
spenderAccountId- the spender account idamount- the amount of hbar- Returns:
- an account allowance approve transaction
-
approveHbarAllowance
public AccountAllowanceApproveTransaction approveHbarAllowance(@Nullable AccountId ownerAccountId, AccountId spenderAccountId, Hbar amount) Approves the Hbar allowance.- Parameters:
ownerAccountId- owner's account idspenderAccountId- spender's account idamount- amount of hbar add- Returns:
this
-
getHbarAllowances
Deprecated.- UsegetHbarApprovals()instead- Returns:
- list of hbar allowance records
-
getHbarApprovals
Extract the list of hbar allowances.- Returns:
- array list of hbar allowances
-
addTokenAllowance
@Deprecated public AccountAllowanceApproveTransaction addTokenAllowance(TokenId tokenId, AccountId spenderAccountId, long amount) Deprecated.- Parameters:
tokenId- the token idspenderAccountId- the spenders account idamount- the hbar amount- Returns:
- an account allowance approve transaction
-
approveTokenAllowance
public AccountAllowanceApproveTransaction approveTokenAllowance(TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId, long amount) Approves the Token allowance.- Parameters:
tokenId- the token's idownerAccountId- owner's account idspenderAccountId- spender's account idamount- amount of tokens- Returns:
this
-
getTokenAllowances
Deprecated.- UsegetTokenApprovals()instead- Returns:
- a list of token allowances
-
getTokenApprovals
Extract a list of token allowance approvals.- Returns:
- array list of token approvals.
-
addTokenNftAllowance
@Deprecated public AccountAllowanceApproveTransaction addTokenNftAllowance(NftId nftId, AccountId spenderAccountId) Deprecated.- Parameters:
nftId- the nft idspenderAccountId- the spender's account id- Returns:
this
-
addAllTokenNftAllowance
@Deprecated public AccountAllowanceApproveTransaction addAllTokenNftAllowance(TokenId tokenId, AccountId spenderAccountId) Deprecated.- Parameters:
tokenId- the token idspenderAccountId- the spender's account id- Returns:
this
-
approveTokenNftAllowance
public AccountAllowanceApproveTransaction approveTokenNftAllowance(NftId nftId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId, @Nullable AccountId delegatingSpender) Approve the NFT allowance.- Parameters:
nftId- nft's idownerAccountId- owner's account idspenderAccountId- spender's account iddelegatingSpender- delegating spender's account id- Returns:
this
-
approveTokenNftAllowance
public AccountAllowanceApproveTransaction approveTokenNftAllowance(NftId nftId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) Approve the NFT allowance.- Parameters:
nftId- nft's idownerAccountId- owner's account idspenderAccountId- spender's account id- Returns:
this
-
approveTokenNftAllowanceAllSerials
public AccountAllowanceApproveTransaction approveTokenNftAllowanceAllSerials(TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) Approve the token nft allowance on all serials.- Parameters:
tokenId- the token's idownerAccountId- owner's account idspenderAccountId- spender's account id- Returns:
this
-
deleteTokenNftAllowanceAllSerials
public AccountAllowanceApproveTransaction deleteTokenNftAllowanceAllSerials(TokenId tokenId, @Nullable AccountId ownerAccountId, AccountId spenderAccountId) Delete the token nft allowance on all serials.- Parameters:
tokenId- the token's idownerAccountId- owner's account idspenderAccountId- spender's account id- Returns:
this
-
getTokenNftAllowances
Deprecated.- UsegetTokenNftApprovals()instead- Returns:
this
-
getTokenNftApprovals
Returns the list of token nft allowances.- Returns:
- list of token nft allowances.
-
getMethodDescriptor
io.grpc.MethodDescriptor<Transaction,TransactionResponse> getMethodDescriptor()Description copied from class:ExecutableCalled to direct the invocation of the query to the appropriate gRPC service.- Specified by:
getMethodDescriptorin classExecutable<AccountAllowanceApproveTransaction,Transaction, TransactionResponse, TransactionResponse>
-
build
Build the correct transaction body.- Returns:
builder
-
onFreeze
Description copied from class:TransactionCalled inTransaction.freezeWith(Client)just before the transaction body is built. The intent is for the derived class to assign their data variant to the transaction body.- Specified by:
onFreezein classTransaction<AccountAllowanceApproveTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<AccountAllowanceApproveTransaction>
-
validateChecksums
- Specified by:
validateChecksumsin classTransaction<AccountAllowanceApproveTransaction>- Throws:
BadEntityIdException
-
approveTokenNftAllowanceAllSerials(TokenId, AccountId, AccountId)instead