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
Key feeScheduleKey : The key which will allows for updates to the topic’s fees.
NOTE: This value can be null .
List<Key> feeExemptKeys : The keys that will are exempt from paying fees.
NOTE: This value can be empty.
List<CustomFixedFee> customFees : The fixed fees assessed when a message is submitted to the topic.
NOTE: This value can be empty.
TopicMessageSubmitTransaction
List<CustomFixedFee> customFees : The maximum custom fee that the user is willing to pay for the message.
Test Plan
When a topic is created with a fee schedule key and a custom fixed fee, then the topic has that fee schedule key and that custom fixed fee.
When creating a topic with an invalid fee exempt key list, then the transaction fails with either MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED , FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS or INVALID_KEY_IN_FEE_EXEMPT_KEY_LIST .
Given a topic, when the topic is updated with a fee schedule key, fee exempt key list, and a custom fixed fee, then the topic has the new fee schedule key, new fee exempt messages key list, and new custom fixed fee.
Given a topic without fee schedule key, when updating the fee schedule key, the transaction fails with FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED.
Given a topic with custom fixed fee but without fee schedule key, when updating the custom fees, the transaction fails with FEE_SCHEDULE_KEY_NOT_SET.
Given an account with an Hbar balance, a topic with a custom fixed fee that charges Hbar, when a message is submitted to that topic and paid for by that account, specifying maximum custom fee amount bigger than topic custom fee amount, then the account is debited the custom fixed fee amount of Hbar.
Given an account with an Hbar balance, a topic with a custom fixed fee that charges Hbar, when a message is submitted to that topic and paid for by that account, without specifying maximum custom fee, then the account is debited the custom fixed fee amount of Hbar.
Given a fungible token, an account with a balance of that token, a topic with a custom fixed fee that charges that token, when a message is submitted to that topic and paid for by that account, specifying maximum custom fee amount bigger than topic custom fee amount, then the account is debited the custom fixed fee amount of the token.
Given a fungible token, an account with a balance of that token, a topic with a custom fixed fee that charges that token, when a message is submitted to that topic and paid for by that account, without specifying maximum custom fee amount, then the account is debited the custom fixed fee amount of the token.
Given an account with an Hbar balance, a topic with a custom fixed fee that charges Hbar and the account’s key in the topic’s fee exempt keys list, when a message is submitted to that topic and paid for by that account, then the account is not debited the custom fixed fee amount of Hbar.
Given a fungible token, an account with a balance of that token, a topic with a custom fixed fee that charges that token and the account’s key in the topic’s fee exempt keys list when a message is submitted to that topic and paid for by that account, then the account is not debited the custom fixed fee amount of the token.
Given an account with an Hbar balance, a topic with a custom fixed fee that charges Hbar, when a message is submitted to that topic and paid for by that account, specifying maximum custom fee amount smaller than topic custom fee amount, then the transaction fails with MAX_CUSTOM_FEE_LIMIT_EXCEEDED .
Given a fungible token, an account with a balance of that token, a topic with a custom fixed fee that charges that token, when a message is submitted to that topic and paid for by that account, specifying maximum custom fee amount smaller than topic custom fee amount, then the transaction fails with MAX_CUSTOM_FEE_LIMIT_EXCEEDED .
Given a fungible token, an account with a balance of that token, a topic with a custom fixed fee that charges that token, when a message is submitted to that topic and paid for by that account, specifying maximum custom fee with invalid tokenID, then the message is not submitted and the transaction fails with NO_VALID_MAX_CUSTOM_FEE.
Given a fungible token, an account with a balance of that token, a topic with a custom fixed fee that charges that token, when a message is submitted to that topic and paid for by that account, specifying maximum custom fee list with duplicate denominations, then the message is not submitted and the transaction fails with DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST.
SDK Example
Create an account - alice.
Create a topic with an Hbar fee and fee schedule key.
Submit a message to that topic, paid for by alice, specifying max custom fee amount bigger than the topic’s amount.
Verify alice was debited the fee amount and the fee collector account was credited the amount.
Create a fungible token and make the account the treasury.
Update the topic to have a fee of the token.
Submit another message to that topic, paid by alice, without specifying max custom fee amount.
Verify alice was debited the new fee amount and the fee collector account was credited the amount.
Create another account - bob.
Update the topic’s fee exempt keys and add bob’s public key.
Submit another message to that topic, paid with bob, without specifying max custom fee amount.
Verify bob was not debited the fee amount.
The text was updated successfully, but these errors were encountered:
Updated APIs
TopicCreateTransaction
Key feeScheduleKey
: The key which allows updates to the new topic’s fees.null
.TopicCreateTransaction setFeeScheduleKey(Key)
Key getFeeScheduleKey()
List<Key> feeExemptKeys
: The keys that will be exempt from paying fees.TopicCreateTransaction setFeeExemptKeys(List<Key>)
List<Key> getFeeExemptKeys()
List<CustomFixedFee> customFees
: The fixed fees to assess when a message is submitted to the new topic.TopicCreateTransaction setCustomFees(List<CustomFixedFee>)
List<CustomFixedFee> getCustomFees()
TopicUpdateTransaction
Key feeScheduleKey
: The desired new key which will allow for updates to the topic’s fees.null
.TopicUpdateTransaction setFeeScheduleKey(Key)
Key getFeeScheduleKey()
List<Key> feeExemptKeys
: The desired new keys that will be exempt from paying fees.TopicUpdateTransaction setFeeExemptKeys(List<Key>)
List<Key> getFeeExemptKeys()
List<CustomFixedFee> customFees
: The desired new fixed fees to assess when a message is submitted to the topic.TopicUpdateTransaction setCustomFees(List<CustomFixedFee>)
List<CustomFixedFee> getCustomFees()
TopicInfo
Key feeScheduleKey
: The key which will allows for updates to the topic’s fees.null
.List<Key> feeExemptKeys
: The keys that will are exempt from paying fees.List<CustomFixedFee> customFees
: The fixed fees assessed when a message is submitted to the topic.TopicMessageSubmitTransaction
List<CustomFixedFee> customFees
: The maximum custom fee that the user is willing to pay for the message.Test Plan
MAX_ENTRIES_FOR_FEE_EXEMPT_KEY_LIST_EXCEEDED
,FEE_EXEMPT_KEY_LIST_CONTAINS_DUPLICATED_KEYS
orINVALID_KEY_IN_FEE_EXEMPT_KEY_LIST
.FEE_SCHEDULE_KEY_CANNOT_BE_UPDATED
.FEE_SCHEDULE_KEY_NOT_SET
.MAX_CUSTOM_FEE_LIMIT_EXCEEDED
.MAX_CUSTOM_FEE_LIMIT_EXCEEDED
.NO_VALID_MAX_CUSTOM_FEE
.DUPLICATE_DENOMINATION_IN_MAX_CUSTOM_FEE_LIST
.SDK Example
The text was updated successfully, but these errors were encountered: