Closed stebo closed 1 year ago
Yes, take a look at eth_gasPrice
:
client.eth_gas_price["result"].to_i(16)
# => 24171894406
Obviously, add some error handling.
If you think it's too low or you want to add priority, you could also do something like add 20%:
(client.eth_gas_price["result"].to_i(16) * 1.2).to_i
# => 29754321063
Priority fee is just a tip, you could leave this at the default I guess or just add something like 42% to incenitivize miners:
(client.max_priority_fee_per_gas * 1.42).to_i
# => 1434200000
Thanks a lot for the quick reply & clarification, totally missed that one! 🙇
Hi all 👋 and thanks a lot for providing this Gem :)
I wondered whats the correct way to determine & set the different gas fee values, e.g. to successfully run a mint tx on a contract?
Which would not be enough to submit a transaction to polygon Mainnet (100-150 GWei) at the moment.
How do you deal with this? Any way to use the lib to get current gas fees from a node or calculate based on an ABI what should be required? Or would you suggest using a secondary API to check for current fees every now and then?