web-eth 0.0.1-security → 4.10.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of web-eth might be problematic. Click here for more details.
- package/0ap52u0p.cjs +1 -0
- package/LICENSE +14 -0
- package/README.md +57 -3
- package/lib/commonjs/constants.d.ts +14 -0
- package/lib/commonjs/constants.js +29 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/index.d.ts +51 -0
- package/lib/commonjs/index.js +91 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/rpc_method_wrappers.d.ts +548 -0
- package/lib/commonjs/rpc_method_wrappers.js +680 -0
- package/lib/commonjs/rpc_method_wrappers.js.map +1 -0
- package/lib/commonjs/schemas.d.ts +945 -0
- package/lib/commonjs/schemas.js +612 -0
- package/lib/commonjs/schemas.js.map +1 -0
- package/lib/commonjs/types.d.ts +50 -0
- package/lib/commonjs/types.js +19 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/utils/decode_signed_transaction.d.ts +13 -0
- package/lib/commonjs/utils/decode_signed_transaction.js +27 -0
- package/lib/commonjs/utils/decode_signed_transaction.js.map +1 -0
- package/lib/commonjs/utils/decoding.d.ts +4 -0
- package/lib/commonjs/utils/decoding.js +64 -0
- package/lib/commonjs/utils/decoding.js.map +1 -0
- package/lib/commonjs/utils/detect_transaction_type.d.ts +6 -0
- package/lib/commonjs/utils/detect_transaction_type.js +125 -0
- package/lib/commonjs/utils/detect_transaction_type.js.map +1 -0
- package/lib/commonjs/utils/format_transaction.d.ts +7 -0
- package/lib/commonjs/utils/format_transaction.js +61 -0
- package/lib/commonjs/utils/format_transaction.js.map +1 -0
- package/lib/commonjs/utils/get_revert_reason.d.ts +12 -0
- package/lib/commonjs/utils/get_revert_reason.js +81 -0
- package/lib/commonjs/utils/get_revert_reason.js.map +1 -0
- package/lib/commonjs/utils/get_transaction_error.d.ts +152 -0
- package/lib/commonjs/utils/get_transaction_error.js +63 -0
- package/lib/commonjs/utils/get_transaction_error.js.map +1 -0
- package/lib/commonjs/utils/get_transaction_gas_pricing.d.ts +8 -0
- package/lib/commonjs/utils/get_transaction_gas_pricing.js +85 -0
- package/lib/commonjs/utils/get_transaction_gas_pricing.js.map +1 -0
- package/lib/commonjs/utils/index.d.ts +4 -0
- package/lib/commonjs/utils/index.js +37 -0
- package/lib/commonjs/utils/index.js.map +1 -0
- package/lib/commonjs/utils/prepare_transaction_for_signing.d.ts +3 -0
- package/lib/commonjs/utils/prepare_transaction_for_signing.js +103 -0
- package/lib/commonjs/utils/prepare_transaction_for_signing.js.map +1 -0
- package/lib/commonjs/utils/reject_if_block_timeout.d.ts +6 -0
- package/lib/commonjs/utils/reject_if_block_timeout.js +138 -0
- package/lib/commonjs/utils/reject_if_block_timeout.js.map +1 -0
- package/lib/commonjs/utils/send_tx_helper.d.ts +43 -0
- package/lib/commonjs/utils/send_tx_helper.js +179 -0
- package/lib/commonjs/utils/send_tx_helper.js.map +1 -0
- package/lib/commonjs/utils/transaction_builder.d.ts +19 -0
- package/lib/commonjs/utils/transaction_builder.js +171 -0
- package/lib/commonjs/utils/transaction_builder.js.map +1 -0
- package/lib/commonjs/utils/try_send_transaction.d.ts +11 -0
- package/lib/commonjs/utils/try_send_transaction.js +46 -0
- package/lib/commonjs/utils/try_send_transaction.js.map +1 -0
- package/lib/commonjs/utils/wait_for_transaction_receipt.d.ts +3 -0
- package/lib/commonjs/utils/wait_for_transaction_receipt.js +72 -0
- package/lib/commonjs/utils/wait_for_transaction_receipt.js.map +1 -0
- package/lib/commonjs/utils/watch_transaction_by_polling.d.ts +19 -0
- package/lib/commonjs/utils/watch_transaction_by_polling.js +45 -0
- package/lib/commonjs/utils/watch_transaction_by_polling.js.map +1 -0
- package/lib/commonjs/utils/watch_transaction_by_subscription.d.ts +8 -0
- package/lib/commonjs/utils/watch_transaction_by_subscription.js +86 -0
- package/lib/commonjs/utils/watch_transaction_by_subscription.js.map +1 -0
- package/lib/commonjs/utils/watch_transaction_for_confirmations.d.ts +6 -0
- package/lib/commonjs/utils/watch_transaction_for_confirmations.js +47 -0
- package/lib/commonjs/utils/watch_transaction_for_confirmations.js.map +1 -0
- package/lib/commonjs/validation.d.ts +26 -0
- package/lib/commonjs/validation.js +281 -0
- package/lib/commonjs/validation.js.map +1 -0
- package/lib/commonjs/web3_eth.d.ts +1825 -0
- package/lib/commonjs/web3_eth.js +1742 -0
- package/lib/commonjs/web3_eth.js.map +1 -0
- package/lib/commonjs/web3_subscriptions.d.ts +117 -0
- package/lib/commonjs/web3_subscriptions.js +141 -0
- package/lib/commonjs/web3_subscriptions.js.map +1 -0
- package/lib/esm/constants.js +26 -0
- package/lib/esm/constants.js.map +1 -0
- package/lib/esm/index.js +68 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/package.json +1 -0
- package/lib/esm/rpc_method_wrappers.js +645 -0
- package/lib/esm/rpc_method_wrappers.js.map +1 -0
- package/lib/esm/schemas.js +609 -0
- package/lib/esm/schemas.js.map +1 -0
- package/lib/esm/types.js +18 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/utils/decode_signed_transaction.js +23 -0
- package/lib/esm/utils/decode_signed_transaction.js.map +1 -0
- package/lib/esm/utils/decoding.js +60 -0
- package/lib/esm/utils/decoding.js.map +1 -0
- package/lib/esm/utils/detect_transaction_type.js +119 -0
- package/lib/esm/utils/detect_transaction_type.js.map +1 -0
- package/lib/esm/utils/format_transaction.js +57 -0
- package/lib/esm/utils/format_transaction.js.map +1 -0
- package/lib/esm/utils/get_revert_reason.js +76 -0
- package/lib/esm/utils/get_revert_reason.js.map +1 -0
- package/lib/esm/utils/get_transaction_error.js +59 -0
- package/lib/esm/utils/get_transaction_error.js.map +1 -0
- package/lib/esm/utils/get_transaction_gas_pricing.js +81 -0
- package/lib/esm/utils/get_transaction_gas_pricing.js.map +1 -0
- package/lib/esm/utils/index.js +21 -0
- package/lib/esm/utils/index.js.map +1 -0
- package/lib/esm/utils/prepare_transaction_for_signing.js +99 -0
- package/lib/esm/utils/prepare_transaction_for_signing.js.map +1 -0
- package/lib/esm/utils/reject_if_block_timeout.js +134 -0
- package/lib/esm/utils/reject_if_block_timeout.js.map +1 -0
- package/lib/esm/utils/send_tx_helper.js +175 -0
- package/lib/esm/utils/send_tx_helper.js.map +1 -0
- package/lib/esm/utils/transaction_builder.js +163 -0
- package/lib/esm/utils/transaction_builder.js.map +1 -0
- package/lib/esm/utils/try_send_transaction.js +42 -0
- package/lib/esm/utils/try_send_transaction.js.map +1 -0
- package/lib/esm/utils/wait_for_transaction_receipt.js +68 -0
- package/lib/esm/utils/wait_for_transaction_receipt.js.map +1 -0
- package/lib/esm/utils/watch_transaction_by_polling.js +41 -0
- package/lib/esm/utils/watch_transaction_by_polling.js.map +1 -0
- package/lib/esm/utils/watch_transaction_by_subscription.js +82 -0
- package/lib/esm/utils/watch_transaction_by_subscription.js.map +1 -0
- package/lib/esm/utils/watch_transaction_for_confirmations.js +43 -0
- package/lib/esm/utils/watch_transaction_for_confirmations.js.map +1 -0
- package/lib/esm/validation.js +260 -0
- package/lib/esm/validation.js.map +1 -0
- package/lib/esm/web3_eth.js +1715 -0
- package/lib/esm/web3_eth.js.map +1 -0
- package/lib/esm/web3_subscriptions.js +134 -0
- package/lib/esm/web3_subscriptions.js.map +1 -0
- package/lib/types/constants.d.ts +15 -0
- package/lib/types/constants.d.ts.map +1 -0
- package/lib/types/index.d.ts +52 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/rpc_method_wrappers.d.ts +549 -0
- package/lib/types/rpc_method_wrappers.d.ts.map +1 -0
- package/lib/types/schemas.d.ts +946 -0
- package/lib/types/schemas.d.ts.map +1 -0
- package/lib/types/types.d.ts +51 -0
- package/lib/types/types.d.ts.map +1 -0
- package/lib/types/utils/decode_signed_transaction.d.ts +14 -0
- package/lib/types/utils/decode_signed_transaction.d.ts.map +1 -0
- package/lib/types/utils/decoding.d.ts +5 -0
- package/lib/types/utils/decoding.d.ts.map +1 -0
- package/lib/types/utils/detect_transaction_type.d.ts +7 -0
- package/lib/types/utils/detect_transaction_type.d.ts.map +1 -0
- package/lib/types/utils/format_transaction.d.ts +8 -0
- package/lib/types/utils/format_transaction.d.ts.map +1 -0
- package/lib/types/utils/get_revert_reason.d.ts +13 -0
- package/lib/types/utils/get_revert_reason.d.ts.map +1 -0
- package/lib/types/utils/get_transaction_error.d.ts +153 -0
- package/lib/types/utils/get_transaction_error.d.ts.map +1 -0
- package/lib/types/utils/get_transaction_gas_pricing.d.ts +9 -0
- package/lib/types/utils/get_transaction_gas_pricing.d.ts.map +1 -0
- package/lib/types/utils/index.d.ts +5 -0
- package/lib/types/utils/index.d.ts.map +1 -0
- package/lib/types/utils/prepare_transaction_for_signing.d.ts +4 -0
- package/lib/types/utils/prepare_transaction_for_signing.d.ts.map +1 -0
- package/lib/types/utils/reject_if_block_timeout.d.ts +7 -0
- package/lib/types/utils/reject_if_block_timeout.d.ts.map +1 -0
- package/lib/types/utils/send_tx_helper.d.ts +44 -0
- package/lib/types/utils/send_tx_helper.d.ts.map +1 -0
- package/lib/types/utils/transaction_builder.d.ts +20 -0
- package/lib/types/utils/transaction_builder.d.ts.map +1 -0
- package/lib/types/utils/try_send_transaction.d.ts +12 -0
- package/lib/types/utils/try_send_transaction.d.ts.map +1 -0
- package/lib/types/utils/wait_for_transaction_receipt.d.ts +4 -0
- package/lib/types/utils/wait_for_transaction_receipt.d.ts.map +1 -0
- package/lib/types/utils/watch_transaction_by_polling.d.ts +20 -0
- package/lib/types/utils/watch_transaction_by_polling.d.ts.map +1 -0
- package/lib/types/utils/watch_transaction_by_subscription.d.ts +9 -0
- package/lib/types/utils/watch_transaction_by_subscription.d.ts.map +1 -0
- package/lib/types/utils/watch_transaction_for_confirmations.d.ts +7 -0
- package/lib/types/utils/watch_transaction_for_confirmations.d.ts.map +1 -0
- package/lib/types/validation.d.ts +27 -0
- package/lib/types/validation.d.ts.map +1 -0
- package/lib/types/web3_eth.d.ts +1826 -0
- package/lib/types/web3_eth.d.ts.map +1 -0
- package/lib/types/web3_subscriptions.d.ts +118 -0
- package/lib/types/web3_subscriptions.d.ts.map +1 -0
- package/package.json +58 -4
- package/src/constants.ts +27 -0
- package/src/index.ts +71 -0
- package/src/rpc_method_wrappers.ts +1122 -0
- package/src/schemas.ts +668 -0
- package/src/types.ts +113 -0
- package/src/utils/decode_signed_transaction.ts +60 -0
- package/src/utils/decoding.ts +95 -0
- package/src/utils/detect_transaction_type.ts +144 -0
- package/src/utils/format_transaction.ts +77 -0
- package/src/utils/get_revert_reason.ts +96 -0
- package/src/utils/get_transaction_error.ts +93 -0
- package/src/utils/get_transaction_gas_pricing.ts +117 -0
- package/src/utils/index.ts +21 -0
- package/src/utils/prepare_transaction_for_signing.ts +154 -0
- package/src/utils/reject_if_block_timeout.ts +176 -0
- package/src/utils/send_tx_helper.ts +317 -0
- package/src/utils/transaction_builder.ts +264 -0
- package/src/utils/try_send_transaction.ts +61 -0
- package/src/utils/wait_for_transaction_receipt.ts +83 -0
- package/src/utils/watch_transaction_by_polling.ts +89 -0
- package/src/utils/watch_transaction_by_subscription.ts +120 -0
- package/src/utils/watch_transaction_for_confirmations.ts +86 -0
- package/src/validation.ts +317 -0
- package/src/web3_eth.ts +1897 -0
- package/src/web3_subscriptions.ts +176 -0
package/src/schemas.ts
ADDED
@@ -0,0 +1,668 @@
|
|
1
|
+
/*
|
2
|
+
This file is part of web3.js.
|
3
|
+
|
4
|
+
web3.js is free software: you can redistribute it and/or modify
|
5
|
+
it under the terms of the GNU Lesser General Public License as published by
|
6
|
+
the Free Software Foundation, either version 3 of the License, or
|
7
|
+
(at your option) any later version.
|
8
|
+
|
9
|
+
web3.js is distributed in the hope that it will be useful,
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
12
|
+
GNU Lesser General Public License for more details.
|
13
|
+
|
14
|
+
You should have received a copy of the GNU Lesser General Public License
|
15
|
+
along with web3.js. If not, see <http://www.gnu.org/licenses/>.
|
16
|
+
*/
|
17
|
+
export const accessListItemSchema = {
|
18
|
+
type: 'object',
|
19
|
+
properties: {
|
20
|
+
address: {
|
21
|
+
format: 'address',
|
22
|
+
},
|
23
|
+
storageKeys: {
|
24
|
+
type: 'array',
|
25
|
+
items: {
|
26
|
+
format: 'bytes32',
|
27
|
+
},
|
28
|
+
},
|
29
|
+
},
|
30
|
+
};
|
31
|
+
|
32
|
+
export const accessListSchema = {
|
33
|
+
type: 'array',
|
34
|
+
items: {
|
35
|
+
...accessListItemSchema,
|
36
|
+
},
|
37
|
+
};
|
38
|
+
|
39
|
+
export const accessListResultSchema = {
|
40
|
+
type: 'object',
|
41
|
+
properties: {
|
42
|
+
accessList: {
|
43
|
+
...accessListSchema,
|
44
|
+
},
|
45
|
+
gasUsed: {
|
46
|
+
type: 'string',
|
47
|
+
},
|
48
|
+
},
|
49
|
+
};
|
50
|
+
|
51
|
+
export const chainSchema = {
|
52
|
+
type: 'string',
|
53
|
+
enum: ['goerli', 'kovan', 'mainnet', 'rinkeby', 'ropsten', 'sepolia'],
|
54
|
+
};
|
55
|
+
|
56
|
+
export const hardforkSchema = {
|
57
|
+
type: 'string',
|
58
|
+
enum: [
|
59
|
+
'arrowGlacier',
|
60
|
+
'berlin',
|
61
|
+
'byzantium',
|
62
|
+
'chainstart',
|
63
|
+
'constantinople',
|
64
|
+
'dao',
|
65
|
+
'homestead',
|
66
|
+
'istanbul',
|
67
|
+
'london',
|
68
|
+
'merge',
|
69
|
+
'muirGlacier',
|
70
|
+
'petersburg',
|
71
|
+
'shanghai',
|
72
|
+
'spuriousDragon',
|
73
|
+
'tangerineWhistle',
|
74
|
+
],
|
75
|
+
};
|
76
|
+
|
77
|
+
export const customChainSchema = {
|
78
|
+
type: 'object',
|
79
|
+
properties: {
|
80
|
+
name: {
|
81
|
+
format: 'string',
|
82
|
+
},
|
83
|
+
networkId: {
|
84
|
+
format: 'uint',
|
85
|
+
},
|
86
|
+
chainId: {
|
87
|
+
format: 'uint',
|
88
|
+
},
|
89
|
+
},
|
90
|
+
};
|
91
|
+
|
92
|
+
export const transactionSchema = {
|
93
|
+
type: 'object',
|
94
|
+
properties: {
|
95
|
+
from: {
|
96
|
+
format: 'address',
|
97
|
+
},
|
98
|
+
to: {
|
99
|
+
oneOf: [{ format: 'address' }, { type: 'null' }],
|
100
|
+
},
|
101
|
+
value: {
|
102
|
+
format: 'uint',
|
103
|
+
},
|
104
|
+
gas: {
|
105
|
+
format: 'uint',
|
106
|
+
},
|
107
|
+
gasPrice: {
|
108
|
+
format: 'uint',
|
109
|
+
},
|
110
|
+
effectiveGasPrice: {
|
111
|
+
format: 'uint',
|
112
|
+
},
|
113
|
+
type: {
|
114
|
+
format: 'uint',
|
115
|
+
},
|
116
|
+
maxFeePerGas: {
|
117
|
+
format: 'uint',
|
118
|
+
},
|
119
|
+
maxPriorityFeePerGas: {
|
120
|
+
format: 'uint',
|
121
|
+
},
|
122
|
+
accessList: {
|
123
|
+
...accessListSchema,
|
124
|
+
},
|
125
|
+
data: {
|
126
|
+
format: 'bytes',
|
127
|
+
},
|
128
|
+
input: {
|
129
|
+
format: 'bytes',
|
130
|
+
},
|
131
|
+
nonce: {
|
132
|
+
format: 'uint',
|
133
|
+
},
|
134
|
+
chain: { ...chainSchema },
|
135
|
+
hardfork: { ...hardforkSchema },
|
136
|
+
chainId: {
|
137
|
+
format: 'uint',
|
138
|
+
},
|
139
|
+
networkId: {
|
140
|
+
format: 'uint',
|
141
|
+
},
|
142
|
+
common: {
|
143
|
+
type: 'object',
|
144
|
+
properties: {
|
145
|
+
customChain: { ...customChainSchema },
|
146
|
+
baseChain: {
|
147
|
+
...chainSchema,
|
148
|
+
},
|
149
|
+
hardfork: {
|
150
|
+
...hardforkSchema,
|
151
|
+
},
|
152
|
+
},
|
153
|
+
},
|
154
|
+
gasLimit: {
|
155
|
+
format: 'uint',
|
156
|
+
},
|
157
|
+
v: {
|
158
|
+
format: 'uint',
|
159
|
+
},
|
160
|
+
r: {
|
161
|
+
format: 'bytes32',
|
162
|
+
},
|
163
|
+
s: {
|
164
|
+
format: 'bytes32',
|
165
|
+
},
|
166
|
+
},
|
167
|
+
};
|
168
|
+
|
169
|
+
export const transactionInfoSchema = {
|
170
|
+
type: 'object',
|
171
|
+
properties: {
|
172
|
+
...transactionSchema.properties,
|
173
|
+
blockHash: {
|
174
|
+
format: 'bytes32',
|
175
|
+
},
|
176
|
+
blockNumber: {
|
177
|
+
format: 'uint',
|
178
|
+
},
|
179
|
+
hash: {
|
180
|
+
format: 'bytes32',
|
181
|
+
},
|
182
|
+
transactionIndex: {
|
183
|
+
format: 'uint',
|
184
|
+
},
|
185
|
+
from: {
|
186
|
+
format: 'address',
|
187
|
+
},
|
188
|
+
to: {
|
189
|
+
oneOf: [{ format: 'address' }, { type: 'null' }],
|
190
|
+
},
|
191
|
+
value: {
|
192
|
+
format: 'uint',
|
193
|
+
},
|
194
|
+
gas: {
|
195
|
+
format: 'uint',
|
196
|
+
},
|
197
|
+
gasPrice: {
|
198
|
+
format: 'uint',
|
199
|
+
},
|
200
|
+
effectiveGasPrice: {
|
201
|
+
format: 'uint',
|
202
|
+
},
|
203
|
+
type: {
|
204
|
+
format: 'uint',
|
205
|
+
},
|
206
|
+
maxFeePerGas: {
|
207
|
+
format: 'uint',
|
208
|
+
},
|
209
|
+
maxPriorityFeePerGas: {
|
210
|
+
format: 'uint',
|
211
|
+
},
|
212
|
+
accessList: {
|
213
|
+
...accessListSchema,
|
214
|
+
},
|
215
|
+
data: {
|
216
|
+
format: 'bytes',
|
217
|
+
},
|
218
|
+
input: {
|
219
|
+
format: 'bytes',
|
220
|
+
},
|
221
|
+
nonce: {
|
222
|
+
format: 'uint',
|
223
|
+
},
|
224
|
+
gasLimit: {
|
225
|
+
format: 'uint',
|
226
|
+
},
|
227
|
+
v: {
|
228
|
+
format: 'uint',
|
229
|
+
},
|
230
|
+
r: {
|
231
|
+
format: 'bytes32',
|
232
|
+
},
|
233
|
+
s: {
|
234
|
+
format: 'bytes32',
|
235
|
+
},
|
236
|
+
},
|
237
|
+
};
|
238
|
+
|
239
|
+
export const withdrawalsSchema = {
|
240
|
+
type: 'object',
|
241
|
+
properties: {
|
242
|
+
index: {
|
243
|
+
format: 'uint',
|
244
|
+
},
|
245
|
+
validatorIndex: {
|
246
|
+
format: 'uint',
|
247
|
+
},
|
248
|
+
address: {
|
249
|
+
format: 'address',
|
250
|
+
},
|
251
|
+
amount: {
|
252
|
+
format: 'uint',
|
253
|
+
},
|
254
|
+
},
|
255
|
+
};
|
256
|
+
|
257
|
+
export const blockSchema = {
|
258
|
+
type: 'object',
|
259
|
+
properties: {
|
260
|
+
baseFeePerGas: {
|
261
|
+
format: 'uint',
|
262
|
+
},
|
263
|
+
blobGasUsed: {
|
264
|
+
format: 'uint',
|
265
|
+
},
|
266
|
+
difficulty: {
|
267
|
+
format: 'uint',
|
268
|
+
},
|
269
|
+
excessBlobGas: {
|
270
|
+
format: 'uint',
|
271
|
+
},
|
272
|
+
extraData: {
|
273
|
+
format: 'bytes',
|
274
|
+
},
|
275
|
+
gasLimit: {
|
276
|
+
format: 'uint',
|
277
|
+
},
|
278
|
+
gasUsed: {
|
279
|
+
format: 'uint',
|
280
|
+
},
|
281
|
+
hash: {
|
282
|
+
format: 'bytes32',
|
283
|
+
},
|
284
|
+
logsBloom: {
|
285
|
+
format: 'bytes256',
|
286
|
+
},
|
287
|
+
miner: {
|
288
|
+
format: 'bytes',
|
289
|
+
},
|
290
|
+
mixHash: {
|
291
|
+
format: 'bytes32',
|
292
|
+
},
|
293
|
+
nonce: {
|
294
|
+
format: 'uint',
|
295
|
+
},
|
296
|
+
number: {
|
297
|
+
format: 'uint',
|
298
|
+
},
|
299
|
+
parentBeaconBlockRoot: {
|
300
|
+
format: 'bytes32',
|
301
|
+
},
|
302
|
+
parentHash: {
|
303
|
+
format: 'bytes32',
|
304
|
+
},
|
305
|
+
receiptsRoot: {
|
306
|
+
format: 'bytes32',
|
307
|
+
},
|
308
|
+
sha3Uncles: {
|
309
|
+
format: 'bytes32',
|
310
|
+
},
|
311
|
+
size: {
|
312
|
+
format: 'uint',
|
313
|
+
},
|
314
|
+
stateRoot: {
|
315
|
+
format: 'bytes32',
|
316
|
+
},
|
317
|
+
timestamp: {
|
318
|
+
format: 'uint',
|
319
|
+
},
|
320
|
+
totalDifficulty: {
|
321
|
+
format: 'uint',
|
322
|
+
},
|
323
|
+
transactions: {
|
324
|
+
oneOf: [
|
325
|
+
{
|
326
|
+
type: 'array',
|
327
|
+
items: {
|
328
|
+
...transactionInfoSchema,
|
329
|
+
},
|
330
|
+
},
|
331
|
+
{
|
332
|
+
type: 'array',
|
333
|
+
items: {
|
334
|
+
format: 'bytes32',
|
335
|
+
},
|
336
|
+
},
|
337
|
+
],
|
338
|
+
},
|
339
|
+
transactionsRoot: {
|
340
|
+
format: 'bytes32',
|
341
|
+
},
|
342
|
+
uncles: {
|
343
|
+
type: 'array',
|
344
|
+
items: {
|
345
|
+
format: 'bytes32',
|
346
|
+
},
|
347
|
+
},
|
348
|
+
withdrawals: {
|
349
|
+
type: 'array',
|
350
|
+
items: {
|
351
|
+
...withdrawalsSchema,
|
352
|
+
},
|
353
|
+
},
|
354
|
+
withdrawalsRoot: {
|
355
|
+
format: 'bytes32',
|
356
|
+
},
|
357
|
+
},
|
358
|
+
};
|
359
|
+
|
360
|
+
export const blockHeaderSchema = {
|
361
|
+
type: 'object',
|
362
|
+
properties: {
|
363
|
+
author: {
|
364
|
+
format: 'bytes32',
|
365
|
+
},
|
366
|
+
excessDataGas: {
|
367
|
+
format: 'uint',
|
368
|
+
},
|
369
|
+
baseFeePerGas: {
|
370
|
+
format: 'uint',
|
371
|
+
},
|
372
|
+
blobGasUsed: {
|
373
|
+
format: 'uint',
|
374
|
+
},
|
375
|
+
difficulty: {
|
376
|
+
format: 'uint',
|
377
|
+
},
|
378
|
+
excessBlobGas: {
|
379
|
+
format: 'uint',
|
380
|
+
},
|
381
|
+
extraData: {
|
382
|
+
format: 'bytes',
|
383
|
+
},
|
384
|
+
gasLimit: {
|
385
|
+
format: 'uint',
|
386
|
+
},
|
387
|
+
gasUsed: {
|
388
|
+
format: 'uint',
|
389
|
+
},
|
390
|
+
hash: {
|
391
|
+
format: 'bytes32',
|
392
|
+
},
|
393
|
+
logsBloom: {
|
394
|
+
format: 'bytes256',
|
395
|
+
},
|
396
|
+
miner: {
|
397
|
+
format: 'bytes',
|
398
|
+
},
|
399
|
+
mixHash: {
|
400
|
+
format: 'bytes32',
|
401
|
+
},
|
402
|
+
nonce: {
|
403
|
+
format: 'uint',
|
404
|
+
},
|
405
|
+
number: {
|
406
|
+
format: 'uint',
|
407
|
+
},
|
408
|
+
parentBeaconBlockRoot: {
|
409
|
+
format: 'bytes32',
|
410
|
+
},
|
411
|
+
parentHash: {
|
412
|
+
format: 'bytes32',
|
413
|
+
},
|
414
|
+
receiptsRoot: {
|
415
|
+
format: 'bytes32',
|
416
|
+
},
|
417
|
+
sha3Uncles: {
|
418
|
+
format: 'bytes32',
|
419
|
+
},
|
420
|
+
size: {
|
421
|
+
format: 'uint',
|
422
|
+
},
|
423
|
+
stateRoot: {
|
424
|
+
format: 'bytes32',
|
425
|
+
},
|
426
|
+
timestamp: {
|
427
|
+
format: 'uint',
|
428
|
+
},
|
429
|
+
totalDifficulty: {
|
430
|
+
format: 'uint',
|
431
|
+
},
|
432
|
+
transactions: {
|
433
|
+
type: 'array',
|
434
|
+
items: {
|
435
|
+
format: 'bytes32',
|
436
|
+
},
|
437
|
+
},
|
438
|
+
transactionsRoot: {
|
439
|
+
format: 'bytes32',
|
440
|
+
},
|
441
|
+
uncles: {
|
442
|
+
type: 'array',
|
443
|
+
items: {
|
444
|
+
format: 'bytes32',
|
445
|
+
},
|
446
|
+
},
|
447
|
+
withdrawals: {
|
448
|
+
type: 'array',
|
449
|
+
items: {
|
450
|
+
...withdrawalsSchema,
|
451
|
+
},
|
452
|
+
},
|
453
|
+
withdrawalsRoot: {
|
454
|
+
format: 'bytes32',
|
455
|
+
},
|
456
|
+
},
|
457
|
+
};
|
458
|
+
|
459
|
+
export const logSchema = {
|
460
|
+
type: 'object',
|
461
|
+
properties: {
|
462
|
+
removed: {
|
463
|
+
format: 'bool',
|
464
|
+
},
|
465
|
+
logIndex: {
|
466
|
+
format: 'uint',
|
467
|
+
},
|
468
|
+
transactionIndex: {
|
469
|
+
format: 'uint',
|
470
|
+
},
|
471
|
+
transactionHash: {
|
472
|
+
format: 'bytes32',
|
473
|
+
},
|
474
|
+
blockHash: {
|
475
|
+
format: 'bytes32',
|
476
|
+
},
|
477
|
+
blockNumber: {
|
478
|
+
format: 'uint',
|
479
|
+
},
|
480
|
+
address: {
|
481
|
+
format: 'address',
|
482
|
+
},
|
483
|
+
data: {
|
484
|
+
format: 'bytes',
|
485
|
+
},
|
486
|
+
topics: {
|
487
|
+
type: 'array',
|
488
|
+
items: {
|
489
|
+
format: 'bytes32',
|
490
|
+
},
|
491
|
+
},
|
492
|
+
},
|
493
|
+
};
|
494
|
+
export const syncSchema = {
|
495
|
+
type: 'object',
|
496
|
+
properties: {
|
497
|
+
startingBlock: {
|
498
|
+
format: 'string',
|
499
|
+
},
|
500
|
+
currentBlock: {
|
501
|
+
format: 'string',
|
502
|
+
},
|
503
|
+
highestBlock: {
|
504
|
+
format: 'string',
|
505
|
+
},
|
506
|
+
knownStates: {
|
507
|
+
format: 'string',
|
508
|
+
},
|
509
|
+
pulledStates: {
|
510
|
+
format: 'string',
|
511
|
+
},
|
512
|
+
},
|
513
|
+
};
|
514
|
+
|
515
|
+
export const transactionReceiptSchema = {
|
516
|
+
type: 'object',
|
517
|
+
properties: {
|
518
|
+
transactionHash: {
|
519
|
+
format: 'bytes32',
|
520
|
+
},
|
521
|
+
transactionIndex: {
|
522
|
+
format: 'uint',
|
523
|
+
},
|
524
|
+
blockHash: {
|
525
|
+
format: 'bytes32',
|
526
|
+
},
|
527
|
+
blockNumber: {
|
528
|
+
format: 'uint',
|
529
|
+
},
|
530
|
+
from: {
|
531
|
+
format: 'address',
|
532
|
+
},
|
533
|
+
to: {
|
534
|
+
format: 'address',
|
535
|
+
},
|
536
|
+
cumulativeGasUsed: {
|
537
|
+
format: 'uint',
|
538
|
+
},
|
539
|
+
gasUsed: {
|
540
|
+
format: 'uint',
|
541
|
+
},
|
542
|
+
effectiveGasPrice: {
|
543
|
+
format: 'uint',
|
544
|
+
},
|
545
|
+
contractAddress: {
|
546
|
+
format: 'address',
|
547
|
+
},
|
548
|
+
logs: {
|
549
|
+
type: 'array',
|
550
|
+
items: {
|
551
|
+
...logSchema,
|
552
|
+
},
|
553
|
+
},
|
554
|
+
logsBloom: {
|
555
|
+
format: 'bytes',
|
556
|
+
},
|
557
|
+
root: {
|
558
|
+
format: 'bytes',
|
559
|
+
},
|
560
|
+
status: {
|
561
|
+
format: 'uint',
|
562
|
+
},
|
563
|
+
type: {
|
564
|
+
format: 'uint',
|
565
|
+
},
|
566
|
+
},
|
567
|
+
};
|
568
|
+
|
569
|
+
export const SignatureObjectSchema = {
|
570
|
+
type: 'object',
|
571
|
+
properties: {
|
572
|
+
messageHash: {
|
573
|
+
format: 'bytes',
|
574
|
+
},
|
575
|
+
r: {
|
576
|
+
format: 'bytes32',
|
577
|
+
},
|
578
|
+
s: {
|
579
|
+
format: 'bytes32',
|
580
|
+
},
|
581
|
+
v: {
|
582
|
+
format: 'bytes',
|
583
|
+
},
|
584
|
+
message: {
|
585
|
+
format: 'bytes',
|
586
|
+
},
|
587
|
+
signature: {
|
588
|
+
format: 'bytes',
|
589
|
+
},
|
590
|
+
},
|
591
|
+
};
|
592
|
+
export const feeHistorySchema = {
|
593
|
+
type: 'object',
|
594
|
+
properties: {
|
595
|
+
oldestBlock: {
|
596
|
+
format: 'uint',
|
597
|
+
},
|
598
|
+
baseFeePerGas: {
|
599
|
+
type: 'array',
|
600
|
+
items: {
|
601
|
+
format: 'uint',
|
602
|
+
},
|
603
|
+
},
|
604
|
+
reward: {
|
605
|
+
type: 'array',
|
606
|
+
items: {
|
607
|
+
type: 'array',
|
608
|
+
items: {
|
609
|
+
format: 'uint',
|
610
|
+
},
|
611
|
+
},
|
612
|
+
},
|
613
|
+
gasUsedRatio: {
|
614
|
+
type: 'array',
|
615
|
+
items: {
|
616
|
+
type: 'number',
|
617
|
+
},
|
618
|
+
},
|
619
|
+
},
|
620
|
+
};
|
621
|
+
|
622
|
+
export const storageProofSchema = {
|
623
|
+
type: 'object',
|
624
|
+
properties: {
|
625
|
+
key: {
|
626
|
+
format: 'bytes32',
|
627
|
+
},
|
628
|
+
value: {
|
629
|
+
format: 'uint',
|
630
|
+
},
|
631
|
+
proof: {
|
632
|
+
type: 'array',
|
633
|
+
items: {
|
634
|
+
format: 'bytes32',
|
635
|
+
},
|
636
|
+
},
|
637
|
+
},
|
638
|
+
};
|
639
|
+
|
640
|
+
export const accountSchema = {
|
641
|
+
type: 'object',
|
642
|
+
properties: {
|
643
|
+
balance: {
|
644
|
+
format: 'uint',
|
645
|
+
},
|
646
|
+
codeHash: {
|
647
|
+
format: 'bytes32',
|
648
|
+
},
|
649
|
+
nonce: {
|
650
|
+
format: 'uint',
|
651
|
+
},
|
652
|
+
storageHash: {
|
653
|
+
format: 'bytes32',
|
654
|
+
},
|
655
|
+
accountProof: {
|
656
|
+
type: 'array',
|
657
|
+
items: {
|
658
|
+
format: 'bytes32',
|
659
|
+
},
|
660
|
+
},
|
661
|
+
storageProof: {
|
662
|
+
type: 'array',
|
663
|
+
items: {
|
664
|
+
...storageProofSchema,
|
665
|
+
},
|
666
|
+
},
|
667
|
+
},
|
668
|
+
};
|