eth_feeHistory
Transaction fee history
https://api.1inch.com/web3/324
Supported on: ZKsync
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`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error
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 Floating point value between 0 and 100.
Request
Request
object jsonrpc
* string (Enum)JSON-RPC version
2.0
method
* string The method to call
params
array Method parameters
items
any oneOf[0]
string oneOf[1]
any oneOf[0]
string oneOf[1]
string (Enum)`earliest`: The lowest numbered block the client has available; `finalized`: The most recent crypto-economically secure block, cannot be re-orged outside of manual intervention driven by community coordination; `safe`: The most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions; `latest`: The most recent block in the canonical chain observed by the client, this block may be re-orged out of the canonical chain even under healthy/normal conditions; `pending`: A sample next block built by the client on top of `latest` and containing the set of transactions usually taken from local mempool. Before the merge transition is finalized, any call querying for `finalized` or `safe` block MUST be responded to with `-39001: Unknown block` error
earliest
finalized
safe
latest
pending
oneOf[2]
array items
number Floating point value between 0 and 100.
id
* number Request ID
JavaScript
Copy
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/324', {
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 Fee history results.
oldestBlock
* string Lowest number block of returned range.
baseFeePerGas
* array An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.
items
string baseFeePerBlobGas
array An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks.
items
string gasUsedRatio
* array An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.
items
number blobGasUsedRatio
array An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block.
items
number reward
array A two-dimensional array of effective priority fees per gas at the requested block percentiles.
items
array An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
items
string A given percentile sample of effective priority fees per gas from a single block in ascending order, weighted by gas used. Zeroes are returned if the block is empty.
additionalProperties
none JSON
Copy
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"]
]
}