eth_feeHistory - Celo
eth_feeHistory. Retrieves historical gas fee data for a range of blocks, assisting in analyzing fee trends
eth_feeHistory - celo [Value: 15CU]
Retrieves historical gas fee data for transactions, aiding in better gas price estimation and transaction planning based on past network activity
Use cases
- Retrieve gas price history
- DApp Authentication: Verify user's addresses
- Account Selection UI: Populate account dropdown menus
Constraints
- Requires access to historical block data
- High computational load for large data ranges
- Accuracy depends on node synchronization state
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl --request POST \
--url https://celo.drpc.org \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "eth_feeHistory",
"params": [
4,
4,
4
]
}
Response
200
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"oldestBlock": "0x130b1e6",
"reward": [
[
"0x5041e1e",
"0xdd221b80"
],
[
"0x5041e1e",
"0xb8346df0"
],
[
"0x55d4a80",
"0xb2d05e00"
],
[
"0x4dd9818",
"0x3b9aca00"
]
],
"baseFeePerGas": [
"0x52d80a82c",
"0x50f43f659",
"0x50012de8d",
"0x4e30357d6",
"0x57efff9e7"
],
"gasUsedRatio": [
0.40875283333333334,
0.45308523333333334,
0.4091907,
0.9987537
],
"baseFeePerBlobGas": [
"0x1",
"0x1",
"0x1",
"0x1",
"0x1"
],
"blobGasUsedRatio": [
0.5,
1,
0.6666666666666666,
1
]
}
}
Request params
idinteger
jsonrpcstring
methodstring
array
blockCountinteger
The number of blocks for which to retrieve fee history.
newestBlockstring
The highest block number (inclusive) to be used as the reference point. Can be a block number or a string ("latest", "pending").
rewardPercentilesarray_of_integers
(optional) A list of percentiles for which to return gas used and priority fees per block.
Response
200
Response params
array
idinteger
jsonrpcstring
resultarray_of_strings
A list of addresses owned by the client.
array
oldestBlockint64
Base fees per gas for each block in the list.
gasUsedRatioarray_of_numbers
Ratios of gas used to gas limit for each block.
rewardarray_of_arrays_of_strings
Priority fees per gas at the specified percentiles for each block.
baseFeePerBlobGasarray_of_strings
Base fees per blob gas for each block.
blobGasUsedRatioarray_of_numbers
Ratios of blob gas used to blob gas limit for each block.