our wallet project is requried some update about gas price

  • 1 not set gasprice by user
  • 2 auto choose the best gas price

Current, I am using rpc method eth_gasPrice in my wallet's code to get gas price.

My boss requried me not use eth_gasPrice , so is there other way to get the gas price?

extra request


Just let user specify it. Use previously specified value as default gas price for the next transaction.

  • If you do this, please set a maximum gas price (like 100 Gwei), to prevent users from accidentally using a way too high gas price and losing a lot of ETH on gas. – Morten Nov 20 '19 at 10:32
  • Sorry , I should write requirement first. It's a update of existed wallet project. - 1: not set gasprice by user - 2: auto choose the best gas price – Toknsit Toknsit Nov 21 '19 at 2:32
  • There is no such thing as best gas price. There is always a trade-off among how much fee one pays for transaction to be included into blockchain, and how fast the transaction will actually be included. If you cannot use block history nor external API, then you may use history of transactions you've sent. Increase gas price for the next transaction a bit if previous transaction took too much time to be mined and decrease if time was really low. – Mikhail Vladimirov Nov 21 '19 at 7:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.