You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: native/consensus/submit-message.mdx
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,15 +16,15 @@ The **max chunk size** refers to the maximum size (in bytes) of each individual
16
16
17
17
## **Custom Fee Payment**
18
18
19
-
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.
19
+
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.
20
20
21
-
**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.
21
+
**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.
22
22
23
23
```java
24
24
TopicMessageSubmitTransaction()
25
25
.setTopicId(<TOPIC_ID>)
26
26
.setMessage(<MESSAGE>)
27
-
.setCustomFees(<MAX_CUSTOM_FEES>) // Ensure this covers the required amount
27
+
.setCustomFeeLimits(<CUSTOM_FEE_LIMITS>) // Ensure this covers the required amount
28
28
.execute(client);
29
29
```
30
30
@@ -38,7 +38,7 @@ TopicMessageSubmitTransaction()
38
38
- Each transaction incurs a standard Hedera network fee based on network resource usage.
39
39
- If a custom fee is set for a topic, users submitting messages must pay this fee in HBAR or HTS tokens.
40
40
- The Fee Schedule Key allows authorized users to update fee structures. If set, it must sign transactions modifying fees.
41
-
- If the topic has custom fees, the sender must have sufficient balance to cover the fees unless they are exempt via the Fee Exempt Key List. It is recommended to use `setCustomFees` on the `TopicMessageSubmitTransaction` to ensure the expected fee structure is applied and avoid unexpected transaction failures due to insufficient funds.
41
+
- If the topic has custom fees, the sender must have sufficient balance to cover the fees unless they are exempt via the Fee Exempt Key List. It is recommended to use `setCustomFeeLimits` or `addCustomFeeLimit` on the `TopicMessageSubmitTransaction` to ensure the expected fee structure is applied and avoid unexpected transaction failures due to insufficient funds.
42
42
- If you submit a message to a topic with a custom fee, the cost changes from the baseline $0.0001 USD to roughly $0.05 USD per `TopicMessageSubmitTransaction`.
43
43
- Use the [query fees table](/learn/networks/mainnet/fees#consensus-service) for the base transaction fee and the [Hedera Fee Estimator](https://hedera.com/fees) to estimate standard network fees.
0 commit comments