Update token custom fees
Property
Description
Methods
Method
Type
Requirement
//Create the transaction
TokenFeeScheduleUpdateTransaction transaction = new TokenFeeScheduleUpdateTransaction()
.setTokenId(tokenId)
.setCustomFees(customFee)
//Freeze the unsigned transaction, sign with the fee schedule key of the token, submit the transaction to a Hedera network
TransactionResponse txResponse = transaction.freezeWith(client).sign(feeScheduleKey).execute(client);
//Request the receipt of the transaction
TransactionReceipt receipt = txResponse.getReceipt(client);
//Get the transaction consensus status
Status transactionStatus = receipt.status;
System.out.println("The transaction consensus status is " +transactionStatus);
//Version: 2.0.9//Create the transaction and freeze for manual signing
const transaction = await new TokenFeeScheduleUpdateTransaction()
.setTokenId(tokenId)
.setCustomFees(customFee)
.freezeWith(client);
//Sign the transaction with the fee schedule key
const signTx = await transaction.sign(feeScheduleKey);
//Submit the signed 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.toString();
console.log("The transaction consensus status is " +transactionStatus);
//Version: 2.0.26Last updated