aepp-sdk-js
aepp-sdk-js copied to clipboard
Create tx price estimation function
As we are in the lucky situation to be a very popular network right now, it needs to be made sure that people have a way to outbid other transactions with a higher transaction price to be properly prioritised by miners, just like it works on Ethereum and Bitcoin.
The most suitable place for this feature is the SDK. Some inspiration can be taken here: https://etherscan.io/gastracker The firm way is to draw correlations like corr(when the tx was seen first, when it was mined, what gas it had), but for now it would be enough to just propose the average for the last microblock and add some percentage of markup.
Ah damn, closing in favour of https://github.com/aeternity/aepp-sdk-js/issues/1786
How I would do that:
- expose minimum gas price per N blocks from the top on the node side https://github.com/aeternity/aeternity/pull/4191
- pick the gas price to mine in the next block by default in SDK https://github.com/aeternity/aepp-sdk-js/pull/1884
Using the new node's endpoint, wallet/aepp would be able to ask user to pick an estimate mining time, showing the approximate tx price. It needs to provide selected gasPrice to sdk.
I'm stuck on how to estimate the transaction price in https://github.com/aeternity/aepp-sdk-js/issues/1328
The recent sdk uses gas price provided by node 👌