1

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

  • First, that's a lot of thing you are forbidden to do. Is there a reason ? Second, there is no such thing as "best gas price" as said in a comment of on answer. – Itération 122442 Jul 30 '21 at 09:07

1 Answers1

0

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

Mikhail Vladimirov
  • 7,313
  • 1
  • 23
  • 38
  • 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 02: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 07:09