eth_feeHistory
- CURL
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
- U64
- BlockHash
- BlockNumber
- string
type : string
Pattern :
^0x([1-9a-f][0-9a-f]{0,15}|0)$
type : object
blockHash string required
type : stringPattern :^0x[0-9,a-f,A-F]{64}$
requireCanonical boolean
type : boolean
type : object
blockNumber string required
type : stringPattern :^0x([1-9a-f][0-9a-f]{0,15}|0)$
type : string
Possible values :
earliest
latest
pending
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
oldestBlock oldestBlock
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
- eth_feeHistory
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"
]
]
}