BaseFeePerGas unit

I am using eth_feeHistory for EIP-1559 based transactoin and confuse regarding unit to use. baseFeePerGas in wei or gwei?

Gwei WEI is the amount you have to enter.

Hey @sachin_bisht

eth_feeHistory will return you values in wei, and also, when you're pricing a transaction, you have to provide in wei as well.

An example

curl -X POST -H 'Content-Type: application/json' --data \
'{"jsonrpc":"2.0","method":"eth_feeHistory","params":["0xa", "latest", []], "id": 1}'  \


As you can see, values are expressed in the order of 1e9. For example, 0x2c482ce61 is 11.88e9

@CryptoWorld is also correct but only from a UI that takes care of parsing the values correctly. Or am I missing something?

Best to both


No you are absolutely right, it is WEI, i have no idea why i typed gwei :frowning:

1 Like

No problem @CryptoWorld
I was asking anyway in case I was missing a case :smiley: