跳到主要内容

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)

(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
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": "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"
]
]
}

Endpoint

Params

block_count

newest_block

reward_percentiles


Request

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