Delete a file
Constructor
Description
new FileDeleteTransaction()Methods
Method
Type
Description
FileDeleteTransaction transaction = new FileDeleteTransaction()
.setFileId(newFileId);
//Change the default transaction fee to 2 hbars
FileDeleteTransaction newMaxFee = transaction.setMaxTransactionFee(new Hbar(2));
//Prepare transaction for signing, sign with the key on the file, sign with the client operator key and submit to a Hedera network
TransactionId txId = newMaxFee.build(client).sign(key).execute(client);
//Request the receipt
TransactionReceipt receipt = txId.getReceipt(client);
//Get the transaction consensus status
Status transactionStatus = receipt.status;
System.out.println("The transaction consensus status is " + transactionStatus);
//v1.3.2const transaction = new FileDeleteTransaction()
.setFileId(newFileId);
//Change the default transaction fee to 2 hbars
const newMaxFee = transaction.setMaxTransactionFee(new Hbar(2));
//Prepare transaction for signing, sign with the key on the file, sign with the client operator key and submit to a Hedera network
const txId = await newMaxFee.build(client).sign(key).execute(client);
//Request the receipt
const receipt = await txId.getReceipt(client);
//Get the transaction consensus status
const transactionStatus = receipt.status;
console.log("The transaction consensus status is " + transactionStatus);
//v1.4.4 (issue: returns unauthorized)Get transaction values
Method
Type
Description
Last updated