cfx_feeHistory
- CURL
curl --request POST \
--url https://main.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["0x3","latest_state",[10,90]],
"method": "cfx_feeHistory"
}'
Params
block_count required
Schema
type : string
Pattern :
^0x([1-9a-f][0-9a-f]{0,15}|0)$newest_block required
Represents rpc api epoch number param.
oneOf
- U64
- string
type : string
Pattern :
^0x([1-9a-f][0-9a-f]{0,15}|0)$type : string
Possible values :
earliestlatest_checkpointlatest_finalizedlatest_confirmedlatest_statelatest_mined
reward_percentiles required
Schema
type : array
items[x]numbertype : number
Result
Schema
type : object
baseFeePerGas baseFeePerGas
type : arrayitems[x]U256type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
gasUsedRatio gasUsedRatio
type : arrayitems[x]f64type : number
oldestEpoch oldestEpoch
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$reward reward
type : arrayitems[x](U256,...)[]type : arrayitems[x]U256type : stringPattern :^0x([1-9a-f][0-9a-f]{0,63}|0)$
Example
- cfx_feeHistory
Request
curl -X POST --data \
'{
"jsonrpc": "2.0",
"id": 1,
"method": "cfx_feeHistory",
"params": [
"0x3",
"latest_state",
[
10,
90
]
]
}' \
-H "Content-Type: application/json" \
localhost:12539
Response
{
"baseFeePerGas": [
"0x3b9aca00",
"0x3b9aca00",
"0x3b9aca00",
"0x3b9aca00"
],
"gasUsedRatio": [
0,
0,
0
],
"oldestEpoch": "0x19ad20",
"reward": [
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
],
[
"0x0",
"0x0"
]
]
}