java.lang.Object
com.hedera.hashgraph.sdk.Executable<TokenBurnTransaction,Transaction,TransactionResponse,TransactionResponse>
com.hedera.hashgraph.sdk.Transaction<TokenBurnTransaction>
com.hedera.hashgraph.sdk.TokenBurnTransaction
Burns tokens from the Token's treasury Account.
The token MUST have a `supply_key` set and that key MUST NOT
be an empty `KeyList`.
The token `supply_key` MUST sign this transaction.
This operation SHALL decrease the total supply for the token type by the number of tokens "burned".
The total supply for the token type MUST NOT be reduced below zero (`0`) by this transaction.
The tokens to burn SHALL be deducted from the token treasury account.
If the token is a fungible/common type, the amount MUST be specified.
If the token is a non-fungible/unique type, the specific serial numbers MUST be specified.
The global batch size limit (`tokens.nfts.maxBatchSizeBurn`) SHALL set the maximum number of individual NFT serial numbers permitted in a single `tokenBurn` transaction. ### Block Stream Effects None
The token `supply_key` MUST sign this transaction.
This operation SHALL decrease the total supply for the token type by the number of tokens "burned".
The total supply for the token type MUST NOT be reduced below zero (`0`) by this transaction.
The tokens to burn SHALL be deducted from the token treasury account.
If the token is a fungible/common type, the amount MUST be specified.
If the token is a non-fungible/unique type, the specific serial numbers MUST be specified.
The global batch size limit (`tokens.nfts.maxBatchSizeBurn`) SHALL set the maximum number of individual NFT serial numbers permitted in a single `tokenBurn` transaction. ### Block Stream Effects None
-
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.TokenBurnTransaction(TransactionBody txBody) Constructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptionaddSerial(long serial) Add a serial number to the list of serials.(package private) TokenBurnTransactionBody.Builderbuild()Build the transaction body.longExtract the amount of tokens to burn.(package private) io.grpc.MethodDescriptor<Transaction, TransactionResponse> Called to direct the invocation of the query to the appropriate gRPC service.Extract the of token serials.Extract the token id.(package private) voidInitialize from the transaction body.(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.setAmount(long amount) Assign the amount of tokens to burn.setSerials(List<Long> serials) A list of serial numbers to burn from the Treasury Account.setTokenId(TokenId tokenId) A token identifier.(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
-
TokenBurnTransaction
public TokenBurnTransaction()Constructor. -
TokenBurnTransaction
TokenBurnTransaction(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
-
TokenBurnTransaction
TokenBurnTransaction(TransactionBody txBody) Constructor.- Parameters:
txBody- protobuf TransactionBody
-
-
Method Details
-
getTokenId
Extract the token id.- Returns:
- the token id
-
setTokenId
A token identifier.This SHALL identify the token type to "burn".
The identified token MUST exist, and MUST NOT be deleted.- Parameters:
tokenId- the token id- Returns:
this
-
getAmount
public long getAmount()Extract the amount of tokens to burn.- Returns:
- the amount of tokens to burn
-
setAmount
Assign the amount of tokens to burn. The amount provided must be in the lowest denomination possible. Example: Token A has 2 decimals. In order to burn 100 tokens, one must provide an amount of 10000. In order to burn 100.55 tokens, one must provide an amount of 10055. See Hedera Documentation- Parameters:
amount- the amount of tokens to burn- Returns:
this
-
getSerials
Extract the of token serials.- Returns:
- list of token serials
-
setSerials
A list of serial numbers to burn from the Treasury Account.This list MUST NOT contain more entries than the current limit set by the network configuration value `tokens.nfts.maxBatchSizeBurn`.
The treasury account for the token MUST hold each unique token identified in this list.
If this list is not empty, the token MUST be a non-fungible/unique type.
If this list is empty, the token MUST be a fungible/common type.- Parameters:
serials- list of token serials- Returns:
this
-
addSerial
Add a serial number to the list of serials.- Parameters:
serial- the serial number to add- Returns:
this
-
build
TokenBurnTransactionBody.Builder build()Build the transaction body.- Returns:
TokenBurnTransactionBody
-
initFromTransactionBody
void initFromTransactionBody()Initialize from the transaction body. -
validateChecksums
- Specified by:
validateChecksumsin classTransaction<TokenBurnTransaction>- Throws:
BadEntityIdException
-
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<TokenBurnTransaction,Transaction, TransactionResponse, TransactionResponse>
-
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<TokenBurnTransaction>
-
onScheduled
Description copied from class:TransactionCalled inTransaction.schedule()when converting transaction into a scheduled version.- Specified by:
onScheduledin classTransaction<TokenBurnTransaction>
-