Closed VenkatTeja closed 1 month ago
I haven't checked the project code in detail, but if project contributors think this can be implemented, I can try working on this.
Hello, yes I think it would be very useful. My understanding is that we need two steps:
useEstimateFees
, usually I use the rpc method name) to estimate the fees.useContractWrite
hook to accept the fee estimation from the previous hook.@fracek will try to complete this and raise a PR.
As described in title, it would be good to have support for these two features. We could propose a standard and take help of wallets to do necessary integrations.
Reason for estimate fees: DApps will be able to show precise fee to users on their UI's itself
Reason for simulate: Dapps will be able to precisely use info on tokens in and out to give users easy clarity on what they would receive finally. Usually, this is an easy thing for simple contracts, but for projects like Hashstack.finance which involve integrations with different DeFi apps for swaps, liquidity provisions, staking etc, being able to write logic to estimate tokens output can itself be complex math. Given that the RPC supports simulation, exposing it could be easier and may even help others?