Delete a token
Transaction Signing Requirements
Methods
Method
Type
Description
Requirement
//Create the transaction
TokenDeleteTransaction transaction = new TokenDeleteTransaction()
.setTokenId(tokenId);
//Freeze the unsigned transaction, sign with the admin private key of the account, submit the transaction to a Hedera network
TransactionResponse txResponse = transaction.freezeWith(client).sign(adminKey).execute(client);
//Request the receipt of the transaction
TransactionReceipt receipt = txResponse.getReceipt(client);
//Obtain the transaction consensus status
Status transactionStatus = receipt.status;
System.out.println("The transaction consensus status is " +transactionStatus);
//v2.0.1//Create the transaction and freeze the unsigned transaction for manual signing
const transaction = await new TokenDeleteTransaction()
.setTokenId(tokenId)
.freezeWith(client);
//Sign with the admin private key of the token
const signTx = await transaction.sign(adminKey);
//Submit the transaction to a Hedera network
const txResponse = await signTx.execute(client);
//Request the receipt of the transaction
const receipt = await txResponse.getReceipt(client);
//Get the transaction consensus status
const transactionStatus = receipt.status;
console.log("The transaction consensus status " +transactionStatus.toString());
//v2.0.5Last updated