[TASK] Calculate estimated fee for substrate based transactions #364
Labels
difficulty: medium 🚩
feature ➕
Tasks that are functional additions or enhancements
p1 🟠
Issue should be resolved sooner than later
task ✔️
Overview
Calculate the estimated fee for relaying substrate based transactions/extrinsic. Fees on substrate based chains are calculated based on three parameters
You can read more about fee details here
Here is an open issue on subxt Return fee details for an Extrinsic #527
Task Checklist
Similar to EVM Fees Enpoint, we will need one for Substrate.
Estimate the Extrinsic fees
There is an RPC method that you can call with the signed extrinsic call and it will return the fees details, this RPC is
payment_queryFeeDetails
. Here is an example:On the client side, the user will use this method to estimate the fees so they can send to the relayer.
You will notice the following information in the result:
The final fee is like the following:
Example:
If you are using polkadot API, you can see the docs here about estimating the transaction fees.
Wrapped Token to the Native token Conversion
When working on the VAnchors, we are working on wrapped tokens, each VAnchor as an associated
assetId
that can be later used to get that asset information, for example say we haveassetId = 1
, by callingassetRegistry.assets
we will get the following:You will notice the
name
iswebbtTNT
and it is a wrapped token over the nativetTNT
token, so it should be1:1
conversion in this case.The text was updated successfully, but these errors were encountered: