Delete a token
Transaction Signing Requirements
Constructor
Description
new TokenDeleteTransaction()Methods
Method
Type
Description
Requirement
//Delete a token
TokenDeleteTransaction transaction = new TokenDeleteTransaction()
.setTokenId(newTokenId);
//Build the unsigned transaction, sign with the admin private key of the account, submit the transaction to a Hedera network
TransactionId transactionId = transaction.build(client).sign(adminKey).execute(client);
//Request the receipt of the transaction
TransactionReceipt getReceipt = transactionId.getReceipt(client);
//Obtain the transaction consensus status
Status transactionStatus = getReceipt.status;
System.out.println("The transaction consensus status is " +transactionStatus);
//Version: 1.2.2//Delete a token
const transaction = new TokenDeleteTransaction()
.setTokenId(newTokenId);
//Build the unsigned transaction, sign with admin private key of the token, submit the transaction to a Hedera network
const transactionId = await transaction.build(client).sign(adminKey).execute(client);
//Request the receipt of the transaction
const getReceipt = await transactionId.getReceipt(client);
//Obtain the transaction consensus status
const transactionStatus = getReceipt.status;
console.log("The transaction consensus status is " +transactionStatus);
//Version 1.4.2Last updated