Burns tokens from the Treasury Account. If no Supply Key is defined, the transaction will resolve to TOKEN_HAS_NO_SUPPLY_KEY.
The operation decreases the Total Supply of the Token.
Total supply cannot go below zero.
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 amount of 10000. In order to burn 100.55 tokens, one must provide amount of 10055.
Constructor | Description |
| Initializes the TokenBurnTransaction object |
new TokenBurnTransaction()
​
Method | Type | Description | Requirement |
| TokenId | The ID of the token to burn supply | Required |
| long | The number of tokens to burn | Required |
Java//Burn 1,000 tokensTokenBurnTransaction transaction = new TokenBurnTransaction().setTokenId(tokenId).setAmount(1000);​//Freeze the unsigned transaction, sign with the supply private key of the token, submit the transaction to a Hedera networkTransactionResponse txResponse = transaction.freezeWith(client).sign(supplyKey).execute(client);​//Request the receipt of the transactionTransactionReceipt receipt = txResponse.getReceipt(client);​//Obtain the transaction consensus statusStatus transactionStatus = receipt.status;​System.out.println("The transaction consensus status is " +transactionStatus);​//v2.0.1
JavaScript//Burn 1,000 tokens and freeze the unsigned transaction for manual signingconst transaction = await new TokenBurnTransaction().setTokenId(tokenId).setAmount(1000).freezeWith(client);​//Sign with the supply private key of the tokenconst signTx = await transaction.sign(supplyKey);​//Submit the transaction to a Hedera networkconst txResponse = await signTx.execute(client);​//Request the receipt of the transactionconst receipt = await txResponse.getReceipt(client);//Get the transaction consensus statusconst transactionStatus = receipt.status;​console.log("The transaction consensus status " +transactionStatus.toString());​//v2.0.7
Go//Burn 1,000 tokens and freeze the unsigned transaction for manual signingtransaction, err = hedera.NewTokenBurnTransaction().SetTokenID(tokenId).SetAmount(1000).FreezeWith(client)​if err != nil {panic(err)}​//Sign with the supply private key of the token, submit the transaction to a Hedera networktxResponse, err := transaction.Sign(supplyKey).Execute(client)​if err != nil {panic(err)}​//Request the receipt of the transactionreceipt, err = txResponse.GetReceipt(client)​if err != nil {panic(err)}​//Get the transaction consensus statusstatus := receipt.Status​fmt.Printf("The transaction consensus status is %v\n", status)​//v2.1.0
Method | Type | Description | Requirement |
| TokenId | The ID of the token to burn supply | Required |
| long | The number of tokens to burn | Required |
Java//Burn 1,000 tokensTokenBurnTransaction transaction = new TokenBurnTransaction().setTokenId(newTokenId).setAmount(1000)​//Build the unsigned transaction, sign with the supply private key of the token, submit the transaction to a Hedera networkTransactionId transactionId = transaction.build(client).sign(supplyKey).execute(client);//Request the receipt of the transactionTransactionReceipt getReceipt = transactionId.getReceipt(client);//Obtain the transaction consensus statusStatus transactionStatus = getReceipt.status;​System.out.println("The transaction consensus status is " +transactionStatus);//Version: 1.2.2
JavaScript//Burn 1,000 tokensconst transaction = new TokenBurnTransaction().setTokenId(newTokenId).setAmount(1000)​//Build the unsigned transaction, sign with the supply private key of the token, submit the transaction to a Hedera networkconst transactionId = await transaction.build(client).sign(supplyKey).execute(client);//Request the receipt of the transactionconst getReceipt = await transactionId.getReceipt(client);//Obtain the transaction consensus statusconst transactionStatus = getReceipt.status;​console.log("The transaction consensus status is " +transactionStatus);//Version 1.4.2
​