Skip to content

Commit 422f7b6

Browse files
authored
feat(docs): RPC Methods
1 parent cbb8284 commit 422f7b6

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

RPC_Methods.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
title: JSON RPC Methods for L1/L2 Gas Est.
3+
description: Assorted RPC Methods for Gas Estimiation for L1 and L2's
4+
---
5+
6+
> [!WARNING]
7+
> Under Construction
8+
9+
## `eth_feeHistory`
10+
11+
### Parameters
12+
13+
- `blockCount`: (integer) Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. If blocks in the specified block range are not available, then only the fee history for available blocks is returned.
14+
- `newestBlock`: (string) Integer representing the highest number block of the requested range, or one of the string tags `latest`, `earliest`, or `pending`.
15+
- `array` of `integers`: (optional) A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.
16+
17+
## Returns
18+
19+
- `oldestBlock`: Lowest number block of the returned range expressed as a hexadecimal number.
20+
- `baseFeePerGas`: An array of block base fees per gas, including an extra block value. The extra value is the next block after the newest block in the returned range. Returns zeroes for blocks created before [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559).
21+
- `gasUsedRatio`: An array of block gas used ratios. These are calculated as the ratio of `gasUsed` and `gasLimit`.
22+
- `reward`: An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.
23+
24+
25+
26+
#### Ethereum
27+
28+
```jsonc
29+
{
30+
"jsonrpc": "2.0",
31+
"result": {
32+
"baseFeePerGas": [
33+
"0x3da8e7618",
34+
"0x3e1ba3b1b",
35+
"0x3dfd72b90",
36+
"0x3d64eee76",
37+
"0x3d4da2da0",
38+
"0x3ccbcac6b"
39+
],
40+
"gasUsedRatio": [
41+
0.5290747666666666,
42+
0.49240453333333334,
43+
0.4615576,
44+
0.49407083333333335,
45+
0.4669053
46+
],
47+
"oldestBlock": "0xfab8ac",
48+
"reward": [
49+
[
50+
"0x59682f00",
51+
"0x59682f00"
52+
],
53+
[
54+
"0x59682f00",
55+
"0x59682f00"
56+
],
57+
[
58+
"0x3b9aca00",
59+
"0x59682f00"
60+
],
61+
[
62+
"0x510b0870",
63+
"0x59682f00"
64+
],
65+
[
66+
"0x3b9aca00",
67+
"0x59682f00"
68+
]
69+
]
70+
},
71+
"id": 0
72+
}
73+
```
74+
75+
### Optimism
76+
77+
```jsonc
78+
{
79+
"jsonrpc": "2.0",
80+
"id": 1,
81+
"result": {
82+
"baseFeePerGas": [
83+
"0x648d7b",
84+
"0x643d9d",
85+
"0x64434e",
86+
"0x644f34",
87+
"0x643033",
88+
"0x645f0d",
89+
"0x642570",
90+
"0x641205",
91+
"0x655826",
92+
"0x659001",
93+
"0x65b3b0"
94+
],
95+
"gasUsedRatio": [
96+
0.037383566666666666,
97+
0.1759079,
98+
0.18598443333333334,
99+
0.11635633333333334,
100+
0.24277953333333332,
101+
0.0732412,
102+
0.13510776666666666,
103+
0.697108,
104+
0.25637576666666667,
105+
0.2238549
106+
],
107+
"oldestBlock": "0x70f7b5e"
108+
}
109+
}
110+
```

0 commit comments

Comments
 (0)