eth_feeHistory

Transaction fee history

https://api.1inch.com/web3/143
Supported on:
Monad

Parameters

blockCount (required)

Requested range of blocks. Clients will return less than the requested range if not all blocks are available.

blockCount
* string

newestBlock (required)

Highest block of the requested range.

newestBlock
* any
oneOf[0]
string
oneOf[1]
string (Enum)
earliest
finalized
safe
latest
pending

rewardPercentiles (required)

A monotonically increasing list of percentile values. For each block in the requested range, the transactions will be sorted in ascending order by effective tip per gas and the corresponding effective tip for the percentile will be determined, accounting for gas consumed.

rewardPercentiles
* array
items
number

Request

Request
object
jsonrpc
* string (Enum)
2.0
method
* string
params
array
items
any
oneOf[0]
string
oneOf[1]
any
oneOf[0]
string
oneOf[1]
string (Enum)
earliest
finalized
safe
latest
pending
oneOf[2]
array
items
number
id
* number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const response = await fetch('https://api.1inch.com/web3/143', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${API_KEY}`,
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_feeHistory',
    params: ['string', 'string', [0]],
    id: 1,
  }),
});

const data = await response.json();
console.log(data);

Response

Fee history result

Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.

Fee history result
object
oldestBlock
* string
baseFeePerGas
* array
items
string
baseFeePerBlobGas
array
items
string
gasUsedRatio
* array
items
number
blobGasUsedRatio
array
items
number
reward
array
items
array
items
string
additionalProperties
none
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
  "oldestblock": "0x10b52f",
  "baseFeePerGas": [
    "0x3fa63a3f",
    "0x37f999ee",
    "0x3e36f20a",
    "0x4099f79a",
    "0x430d532d",
    "0x46fcd4a4"
  ],
  "baseFeePerBlobGas": [
    "0x7b7609c19",
    "0x6dbe41789",
    "0x7223341d4",
    "0x6574a002c",
    "0x7223341d4",
    "0x6574a002c"
  ],
  "gasUsedRatio": [
    0.017712333333333333, 0.9458865666666667, 0.6534561, 0.6517375666666667,
    0.7347769666666667
  ],
  "blobGasUsedRatio": [0, 0.6666666666666666, 0, 1, 0],
  "reward": [
    ["0x3b9aca00", "0x59682f00"],
    ["0x3a13012", "0x3a13012"],
    ["0x3a13012", "0x3a13012"],
    ["0xf4240", "0xf4240"],
    ["0xf4240", "0xf4240"]
  ]
}

Did you find what you need?