Fee collector
How app fees are handled by the Mail and Chat clients in SDK 0.5.x.
There is no public fee collector API in the SDK. The FeeCollectorContract class exists inside @4thtech-sdk/ethereum, but it is not exported from the package index. The Mail and Chat clients extend it and handle fees for you.
What happens when you send
When you create a
MailorChatclient, it reads the fee that is required for your app ID from the contract and keeps it.When you send mail or a chat message, the client attaches that fee as the value of the transaction.
If you do not set an app ID, the zero app ID is used.
You do not set or pass the fee yourself. The user's wallet shows the amount when it asks them to confirm.
Setting a fee for your app
Registering an app ID and setting an integrator fee happens on the protocol side, not through the SDK. See Fees and app registration in the OCC v1 documentation. For the appId option, see Mail.
Last updated
