跳到主要内容

cfx_feeHistory

reward_percentiles

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
type : string
Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$

reward_percentiles required

Schema
type : array
  • items[x] number
    type : number

Result

Schema
type : object
  • baseFeePerGas baseFeePerGas
    type : array
    • items[x] U256
      type : string
      Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • gasUsedRatio gasUsedRatio
    type : array
    • items[x] f64
      type : number
  • oldestEpoch oldestEpoch
    type : string
    Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$
  • reward reward
    type : array
    • items[x] (U256,...)[]
      type : array
      • items[x] U256
        type : string
        Pattern : ^0x([1-9a-f][0-9a-f]{0,63}|0)$

Example

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