Skip to content

docs: fix TopicMessageSubmitTransaction custom fee limit method#653

Open
Ziliang-H wants to merge 1 commit into
hashgraph:mainfrom
Ziliang-H:fix-topic-message-custom-fee-limits
Open

docs: fix TopicMessageSubmitTransaction custom fee limit method#653
Ziliang-H wants to merge 1 commit into
hashgraph:mainfrom
Ziliang-H:fix-topic-message-custom-fee-limits

Conversation

@Ziliang-H

Copy link
Copy Markdown

Summary

  • replace the invalid setMaxCustomFees examples with setCustomFeeLimits
  • update the surrounding custom-fee guidance to use setCustomFeeLimits / addCustomFeeLimit

Fixes #104.

Verification

  • searched native/consensus/submit-message.mdx for stale setMaxCustomFees / setCustomFees references

@Ziliang-H Ziliang-H requested review from a team as code owners June 13, 2026 16:31
Copilot AI review requested due to automatic review settings June 13, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates Consensus Service “submit message” documentation to reflect custom-fee limit APIs/terminology instead of the older “max custom fees” wording.

Changes:

  • Replace references to setCustomFees / setMaxCustomFees with setCustomFeeLimits (and mention addCustomFeeLimit).
  • Update Java and JS examples accordingly.
  • Align “Custom Fee Payment” guidance and a related bullet to the new API names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## **Custom Fee Payment**

If a topic has custom fees enabled, users submitting messages must pay the required fee in **HBAR or HTS fungible tokens**. If `setCustomFees` is not specified in the transaction, the user would need to pay any fee associated with that topic ID. The transaction will only fail if the user does not have sufficient assets to cover the fee.
If a topic has custom fees enabled, users submitting messages must pay the required fee in **HBAR or HTS fungible tokens**. If `setCustomFeeLimits` is not specified in the transaction, the user would need to pay any fee associated with that topic ID. The transaction will only fail if the user does not have sufficient assets to cover the fee.
Comment on lines +19 to +21
If a topic has custom fees enabled, users submitting messages must pay the required fee in **HBAR or HTS fungible tokens**. If `setCustomFeeLimits` is not specified in the transaction, the user would need to pay any fee associated with that topic ID. The transaction will only fail if the user does not have sufficient assets to cover the fee.

**Recommendation:** To avoid unexpected fees, it is strongly recommended to use `setCustomFees` when submitting a message. This ensures that only the intended fee structure is applied, providing a safeguard against unintended charges.
**Recommendation:** To avoid unexpected fees, it is strongly recommended to use `setCustomFeeLimits` or `addCustomFeeLimit` when submitting a message. This ensures that only the intended fee structure is applied, providing a safeguard against unintended charges.
Comment on lines 24 to 28
TopicMessageSubmitTransaction()
.setTopicId(<TOPIC_ID>)
.setMessage(<MESSAGE>)
.setCustomFees(<MAX_CUSTOM_FEES>) // Ensure this covers the required amount
.setCustomFeeLimits(<CUSTOM_FEE_LIMITS>) // Ensure this covers the required amount
.execute(client);
Signed-off-by: Ziliang-H <2270669192@qq.com>
@Ziliang-H Ziliang-H force-pushed the fix-topic-message-custom-fee-limits branch from f88071d to 9545574 Compare June 13, 2026 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

submit-a-message - setMaxCustomFees is not a function

2 participants