cfx_feeHistory
Params
(3)1. block_count (required)
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$
2. newest_block (required)
U64
(one of)
string
Match pattern:
^0x([1-9a-f][0-9a-f]{0,15}|0)$
3. reward_percentiles (required)
array[number]
Result
(cfx_feeHistory_result)baseFeePerGas
array[string]gasUsedRatio
array[number]oldestEpoch
stringMatch 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": "cfx_feeHistory",
"params": [
"0x3",
"latest_state",
[
10,
90
]
],
"jsonrpc": "2.0",
"id": 1
}' \
-H "Content-Type: application/json" \
localhost:12539
Result
{
"baseFeePerGas": [
"0x3b9aca00",
"0x3b9aca00",
"0x3b9aca00",
"0x3b9aca00"
],
"gasUsedRatio": [
0,
0,
0
],
"oldestEpoch": "0x19ad20",
"reward": [
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
]
]
}