Saltar al contenido principal

eth_feeHistory

Params

(3)

1. block_count (required)

string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$

2. newest_block (required)

(one of)
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$

3. reward_percentiles (required)

array[number]

Result

(eth_feeHistory_result)
baseFeePerGas
array[string]
gasUsedRatio
array[number]
oldestBlock
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$
reward
array[array]
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,63}|0)$

Example

Request

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

Result

{
"baseFeePerGas": [
"0x44f636afb",
"0x3e35bce1a",
"0x45983936e",
"0x449066338",
"0x443b26700",
"0x4266b4ae0"
],
"gasUsedRatio": [
0.10837093333333334,
0.9748252666666668,
0.44076763333333335,
0.48057266666666665,
0.3927256333333333
],
"oldestBlock": "0x1318eec",
"reward": [
[
"0x3b9aca00",
"0x59682f00",
"0xb2d05e00"
],
[
"0x5f5e100",
"0x68e7780",
"0x38aef1ca"
],
[
"0x5f5e100",
"0x5f5e100",
"0x3b9aca04"
],
[
"0x5f5e100",
"0x23769ac8",
"0x3b9aca00"
],
[
"0x3c2d9c4",
"0x5f5e100",
"0x3b9aca00"
]
]
}

Endpoint

Params

block_count

newest_block

reward_percentiles


Request

curl -X POST --data \
'{
"method": "eth_feeHistory",
"params": [
null,
null,
null
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
https://evmtestnet.confluxrpc.com