跳到主要内容

eth_feeHistory

reward_percentiles

curl --request POST \
--url https://evm.confluxrpc.com \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"params": ["0x5","latest",[20,30,50]],
"method": "eth_feeHistory"
}'

Params

block_count required

Schema
type : string
Pattern : ^0x([1-9a-f][0-9a-f]{0,15}|0)$

newest_block required

Block Number or Tags
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
  • oldestBlock oldestBlock
    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": "eth_feeHistory",
"params": [
"0x5",
"latest",
[
20,
30,
50
]
]
}' \
-H "Content-Type: application/json" \
localhost:12539

Response

{
"baseFeePerGas": [
"0x44f636afb",
"0x3e35bce1a",
"0x45983936e",
"0x449066338",
"0x443b26700",
"0x4266b4ae0"
],
"gasUsedRatio": [
0.10837093333333334,
0.9748252666666668,
0.44076763333333335,
0.48057266666666665,
0.3927256333333333
],
"oldestBlock": "0x1318eec",
"reward": [
[
"0x3b9aca00",
"0x59682f00",
"0xb2d05e00"
],
[
"0x5f5e100",
"0x68e7780",
"0x38aef1ca"
],
[
"0x5f5e100",
"0x5f5e100",
"0x3b9aca04"
],
[
"0x5f5e100",
"0x23769ac8",
"0x3b9aca00"
],
[
"0x3c2d9c4",
"0x5f5e100",
"0x3b9aca00"
]
]
}