Preserve existing Hedera token fees when changing one rule

A token fee schedule update carries the fee list to apply. An operator who sends only the edited rule can unintentionally remove another collector’s fee.

Rebuild the intended schedule from the current token state

Read the token’s current custom fees and fee schedule key. Suppose a fixed fee remains unchanged while a fractional rate changes. Populate the final list with both complete definitions, including collectors, denominations, bounds and exemptions relevant to each type.

const update = new TokenFeeScheduleUpdateTransaction()
  .setTokenId(tokenId)
  .setCustomFees([existingFixedFee, revisedFractionalFee]);

Verify the committed rules before the next transfer

Gather the required fee schedule key signature and the payer signature according to transaction construction. Re-read token info after success and compare the entire list with the approved change. An empty list removes custom fees. Preserve older schedules or assessed fee records when reconstructing transfers that happened before the change.

Sources