Hedera
Search…
Update token custom fees
Update the custom fees for a given token. If the token does not have a fee schedule, the network response returned will be CUSTOM_SCHEDULE_ALREADY_HAS_NO_FEES. You will need to sign the transaction with the fee schedule key to update the fee schedule for the token. If you do not have a fee schedule key set for the token, you will not be able to update the fee schedule.
Transaction Signing Requirements
  • Fee schedule key
  • Transaction fee payer account key
Transaction Fees
  • Please see the transaction and query fees table for base transaction fee
  • Please use the Hedera fee estimator to estimate your transaction fee cost
Property
Description
Fee Schedule
The new fee schedule for the token
Constructor
Description
new TokenFeeScheduleUpdateTransaction()
Initializes a TokenFeeScheduleUpdateTransaction object
1
new TokenFeeScheduleUpdateTransaction()
Copied!

Methods

V2
V1
Method
Type
Requirement
setTokenId(<tokenId>)
​TokenId​
Required
setCustomFees(<customFees>)
List<CustomFee>
Optional
Java
1
//Create the transaction
2
TokenFeeScheduleUpdateTransaction transaction = new TokenFeeScheduleUpdateTransaction()
3
.setTokenId(tokenId)
4
.setCustomFees(customFee)
5
​
6
//Freeze the unsigned transaction, sign with the fee schedule key of the token, submit the transaction to a Hedera network
7
TransactionResponse txResponse = transaction.freezeWith(client).sign(feeScheduleKey).execute(client);
8
​
9
//Request the receipt of the transaction
10
TransactionReceipt receipt = txResponse.getReceipt(client);
11
​
12
//Get the transaction consensus status
13
Status transactionStatus = receipt.status;
14
​
15
System.out.println("The transaction consensus status is " +transactionStatus);
16
//Version: 2.0.9
Copied!
JavaScript
1
//Create the transaction and freeze for manual signing
2
const transaction = await new TokenFeeScheudleUpdateTransaction()
3
.setTokenId(tokenId)
4
.setCustomFees(customFee)
5
.freezeWith(client);
6
​
7
//Sign the transaction with the fee schedule key
8
const signTx = await transaction.sign(feeScheduleKey);
9
​
10
//Submit the signed transaction to a Hedera network
11
const txResponse = await signTx.execute(client);
12
​
13
//Request the receipt of the transaction
14
const receipt = await txResponse.getReceipt(client);
15
​
16
//Get the transaction consensus status
17
const transactionStatus = receipt.status.toString();
18
​
19
console.log("The transaction consensus status is " +transactionStatus);
20
//Version: 2.0.26
Copied!
Go
1
//Create the transaction and freeze for manual signing
2
transaction, err := hedera.NewTokenFeeScheduleUpdateTransaction().
3
SetCustomFees(customFees).
4
SetTokenID(tokenId).
5
FreezeWith(client)
6
​
7
if err != nil {
8
panic(err)
9
}
10
​
11
//Sign with the fee schedule key of the token, sign with the client operator private key and submit the transaction to a Hedera network
12
txResponse, err := transaction.Sign(feeScheduleKey).Execute(client)
13
​
14
if err != nil {
15
panic(err)
16
}
17
​
18
//Request the receipt of the transaction
19
receipt, err := txResponse.GetReceipt(client)
20
if err != nil {
21
panic(err)
22
}
23
​
24
//Get the transaction consensus status
25
status := receipt.Status
26
​
27
fmt.Printf("The transaction consensus status is %v\n", status)
28
//Version: 2.1.11
Copied!
Method
Type
Requirement
setTokenId(<tokenId>)
TokenId
Required
setCustomFees(<customFees>)
List<CustomFee>
Optional
Java
1
//Create the transaction
2
TokenFeeScheduleUpdateTransaction transaction = new TokenFeeScheduleUpdateTransaction()
3
.setTokenId(tokenId)
4
.addCustomFee(customFee);
5
​
6
//Freeze the unsigned transaction, sign with the fee schedule key of the token, submit the transaction to a Hedera network
7
TransactionId txId = transaction.build(client).sign(feeScheduleKey).execute(client);
8
​
9
//Request the receipt of the transaction
10
TransactionReceipt receipt = txId.getReceipt(client);
11
​
12
//Get the transaction consensus status
13
Status transactionStatus = receipt.status;
14
​
15
System.out.println("The transaction consensus status is " +transactionStatus);
16
//Version: 1.5.0
Copied!
JavaScript
1
//Update the name of the token
2
const transaction = new TokenUpdateTransaction()
3
.setTokenId(tokenId)
4
.addCustomFee(customFee);
5
​
6
//Build the unsigned transaction, sign with the token fee schedule private, submit the transaction to a Hedera network
7
const transactionId = await transaction.build(client).sign(feeScheduleKey).execute(client);
8
​
9
//Request the receipt of the transaction
10
const receipt = await transactionId.getReceipt(client);
11
​
12
//Get the transaction consensus status
13
const transactionStatus = receipt.status;
14
​
15
console.log("The transaction consensus status is " +transactionStatus);
16
//Version: 1.4.10
Copied!
Copy link
Contents
Methods