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 : 
- earliest
- latest_checkpoint
- latest_finalized
- latest_confirmed
- latest_state
- latest_mined
reward_percentiles required
Schema
type : array
- items[x]numbertype : number
Result
Schema
type : object
- baseFeePerGas baseFeePerGastype : array- items[x]U256type : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
 
- gasUsedRatio gasUsedRatiotype : array- items[x]f64type : number
 
- oldestEpoch oldestEpochtype : stringPattern :- ^0x([1-9a-f][0-9a-f]{0,63}|0)$
- reward rewardtype : array- items[x](U256,...)[]type : array- items[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"
    ]
  ]
}