-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
txCost/Fee Helper? #16
Comments
This may be very useful, yes! A trick we sometimes do when calculating how a transaction affected balance, without taking into account gas, is to set |
I agree this would be very useful. I'm not sure what a nice API for it would look like. I wonder if we can do something similar to |
Ah yes! Really simple trick to avoid this problem. :) |
Hey.
A pattern I've often had to do was to either estimate the tx cost (gas * gasPrice) in wei beforehand OR after a transaction take gasUsed * gasPrice to calculate how much wei was spent in the transaction. This is used in transactions, for example, where someone withdraws ETH, to see if the balance AFTER withdrawal is correct [withdrawn ETH - tx fee to withdraw ETH].
Is this something that would be meaningful? Are there others who want a similar helper? If so, I might take a stab at it, but first want to gauge interest.
Something like:
estimatedTxCost(<contract method>, <tx data>)
or
txCost(<txReceipt>, <gasPrice>)
Unsure if this would be meaningful (or something like it). So want to hear from others.
The text was updated successfully, but these errors were encountered: