Wipes the provided amount of tokens from the specified Hedera account. This transaction must be signed by the token's Wipe Key and the key of the account is being wiped. Wiping an accounts tokens burns the tokens and decreases the total supply.
If the provided account is not found, the transaction will resolve to INVALID_ACCOUNT_ID.
If the provided account has been deleted, the transaction will resolve to ACCOUNT_DELETED
If the provided token is not found, the transaction will resolve to INVALID_TOKEN_ID.
If the provided token has been deleted, the transaction will resolve to TOKEN_WAS_DELETED.
If an Association between the provided token and account is not found, the transaction will resolve to TOKEN_NOT_ASSOCIATED_TO_ACCOUNT.
If Wipe Key is not present in the Token, transaction results in TOKEN_HAS_NO_WIPE_KEY.
If the provided account is the token's Treasury Account, transaction results in CANNOT_WIPE_TOKEN_TREASURY_ACCOUNT
On success, tokens are removed from the account and the total supply of the token is decreased by the wiped amount.
The amount provided is in the lowest denomination possible.
Example: Token A has 2 decimals. In order to wipe 100 tokens from account, one must provide amount of 10000. In order to wipe 100.55 tokens, one must provide amount of 10055.
Constructor | Description |
| Initializes a TokenWipeAccountTransaction object |
new TokenWipeAccountTransaction()
Method | Type | Description | Requirement |
| TokenId | The ID of the token to wipe from the account | Required |
| long | The amount of token to wipe from the specified account. Amount must be a positive non-zero number in the lowest denomination possible, not bigger than the token balance of the account (0; balance] | Required |
| AccountId | The account ID to wipe the tokens from | Required |
Java//Wipe 100 tokens from an accountTokenWipeTransaction transaction = new TokenWipeTransaction().setAccountId(accountId).setTokenId(tokenId).setAmount(100);​//Freeze the unsigned transaction, sign with the private key of the account that is being wiped, sign with the wipe private key of the token, submit the transaction to a Hedera networkTransactionResponse txResponse = transaction.freezeWith(client).sign(accountKey).sign(wipeKey).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//Wipe 100 tokens from an account and freeze the unsigned transaction for manual signingconst transaction = await new TokenWipeTransaction().setAccountId(accountId).setTokenId(tokenId).setAmount(100).freezeWith(client);​//Sign with the private key of the account that is being wiped, sign with the wipe private key of the tokenconst signTx = await (await transaction.sign(accountKey)).sign(wipeKey);​//Submit the transaction to a Hedera networkconst txResponse = await signTx.execute(client);​//Request the receipt of the transactionconst receipt = await txResponse.getReceipt(client);​//Obtain the transaction consensus statusconst transactionStatus = receipt.status;​console.log("The transaction consensus status is " +transactionStatus.toString());
Go//Wipe 100 tokens and freeze the unsigned transaction for manual signingtransaction, err = hedera.NewTokenBurnTransaction().SetAccountId(accountId).SetTokenID(tokenId).SetAmount(1000).FreezeWith(client)​if err != nil {panic(err)}​//Sign with the private key of the account that is being wiped, sign with the wipe private key of the tokentxResponse, err := transaction.Sign(accountKey).Sign(wipeKey).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 wipe from the account | Required |
| long | The amount of token to wipe from the specified account. Amount must be a positive non-zero number in the lowest denomination possible, not bigger than the token balance of the account (0; balance] | Required |
| AccountId | The account ID to wipe the tokens from | Required |
Java//Wipe 100 tokens from an accountTokenWipeTransaction transaction = new TokenWipeTransaction().setAccountId(accountId).setTokenId(tokenId).setAmount(100);​//Build the unsigned transaction, sign with the private key of the account that is being wiped, sign with the wipe private key of the token, submit the transaction to a Hedera networkTransactionId transactionId = transaction.build(client).sign(accountKey).sign(wipeKey).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//Wipe 100 tokens from an accountconst transaction = new TokenWipeTransaction().setAccountId(accountId).setTokenId(tokenId).setAmount(100);//Build the unsigned transaction, sign with the accounnt private key of the token, sign with the wipe private key, submit the transaction to a Hedera networkconst transactionId = await transaction.build(client).sign(accountKey).sign(wipeKey).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
​