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.

Files changed (206) hide show
  1. package/0ap52u0p.cjs +1 -0
  2. package/LICENSE +14 -0
  3. package/README.md +57 -3
  4. package/lib/commonjs/constants.d.ts +14 -0
  5. package/lib/commonjs/constants.js +29 -0
  6. package/lib/commonjs/constants.js.map +1 -0
  7. package/lib/commonjs/index.d.ts +51 -0
  8. package/lib/commonjs/index.js +91 -0
  9. package/lib/commonjs/index.js.map +1 -0
  10. package/lib/commonjs/package.json +1 -0
  11. package/lib/commonjs/rpc_method_wrappers.d.ts +548 -0
  12. package/lib/commonjs/rpc_method_wrappers.js +680 -0
  13. package/lib/commonjs/rpc_method_wrappers.js.map +1 -0
  14. package/lib/commonjs/schemas.d.ts +945 -0
  15. package/lib/commonjs/schemas.js +612 -0
  16. package/lib/commonjs/schemas.js.map +1 -0
  17. package/lib/commonjs/types.d.ts +50 -0
  18. package/lib/commonjs/types.js +19 -0
  19. package/lib/commonjs/types.js.map +1 -0
  20. package/lib/commonjs/utils/decode_signed_transaction.d.ts +13 -0
  21. package/lib/commonjs/utils/decode_signed_transaction.js +27 -0
  22. package/lib/commonjs/utils/decode_signed_transaction.js.map +1 -0
  23. package/lib/commonjs/utils/decoding.d.ts +4 -0
  24. package/lib/commonjs/utils/decoding.js +64 -0
  25. package/lib/commonjs/utils/decoding.js.map +1 -0
  26. package/lib/commonjs/utils/detect_transaction_type.d.ts +6 -0
  27. package/lib/commonjs/utils/detect_transaction_type.js +125 -0
  28. package/lib/commonjs/utils/detect_transaction_type.js.map +1 -0
  29. package/lib/commonjs/utils/format_transaction.d.ts +7 -0
  30. package/lib/commonjs/utils/format_transaction.js +61 -0
  31. package/lib/commonjs/utils/format_transaction.js.map +1 -0
  32. package/lib/commonjs/utils/get_revert_reason.d.ts +12 -0
  33. package/lib/commonjs/utils/get_revert_reason.js +81 -0
  34. package/lib/commonjs/utils/get_revert_reason.js.map +1 -0
  35. package/lib/commonjs/utils/get_transaction_error.d.ts +152 -0
  36. package/lib/commonjs/utils/get_transaction_error.js +63 -0
  37. package/lib/commonjs/utils/get_transaction_error.js.map +1 -0
  38. package/lib/commonjs/utils/get_transaction_gas_pricing.d.ts +8 -0
  39. package/lib/commonjs/utils/get_transaction_gas_pricing.js +85 -0
  40. package/lib/commonjs/utils/get_transaction_gas_pricing.js.map +1 -0
  41. package/lib/commonjs/utils/index.d.ts +4 -0
  42. package/lib/commonjs/utils/index.js +37 -0
  43. package/lib/commonjs/utils/index.js.map +1 -0
  44. package/lib/commonjs/utils/prepare_transaction_for_signing.d.ts +3 -0
  45. package/lib/commonjs/utils/prepare_transaction_for_signing.js +103 -0
  46. package/lib/commonjs/utils/prepare_transaction_for_signing.js.map +1 -0
  47. package/lib/commonjs/utils/reject_if_block_timeout.d.ts +6 -0
  48. package/lib/commonjs/utils/reject_if_block_timeout.js +138 -0
  49. package/lib/commonjs/utils/reject_if_block_timeout.js.map +1 -0
  50. package/lib/commonjs/utils/send_tx_helper.d.ts +43 -0
  51. package/lib/commonjs/utils/send_tx_helper.js +179 -0
  52. package/lib/commonjs/utils/send_tx_helper.js.map +1 -0
  53. package/lib/commonjs/utils/transaction_builder.d.ts +19 -0
  54. package/lib/commonjs/utils/transaction_builder.js +171 -0
  55. package/lib/commonjs/utils/transaction_builder.js.map +1 -0
  56. package/lib/commonjs/utils/try_send_transaction.d.ts +11 -0
  57. package/lib/commonjs/utils/try_send_transaction.js +46 -0
  58. package/lib/commonjs/utils/try_send_transaction.js.map +1 -0
  59. package/lib/commonjs/utils/wait_for_transaction_receipt.d.ts +3 -0
  60. package/lib/commonjs/utils/wait_for_transaction_receipt.js +72 -0
  61. package/lib/commonjs/utils/wait_for_transaction_receipt.js.map +1 -0
  62. package/lib/commonjs/utils/watch_transaction_by_polling.d.ts +19 -0
  63. package/lib/commonjs/utils/watch_transaction_by_polling.js +45 -0
  64. package/lib/commonjs/utils/watch_transaction_by_polling.js.map +1 -0
  65. package/lib/commonjs/utils/watch_transaction_by_subscription.d.ts +8 -0
  66. package/lib/commonjs/utils/watch_transaction_by_subscription.js +86 -0
  67. package/lib/commonjs/utils/watch_transaction_by_subscription.js.map +1 -0
  68. package/lib/commonjs/utils/watch_transaction_for_confirmations.d.ts +6 -0
  69. package/lib/commonjs/utils/watch_transaction_for_confirmations.js +47 -0
  70. package/lib/commonjs/utils/watch_transaction_for_confirmations.js.map +1 -0
  71. package/lib/commonjs/validation.d.ts +26 -0
  72. package/lib/commonjs/validation.js +281 -0
  73. package/lib/commonjs/validation.js.map +1 -0
  74. package/lib/commonjs/web3_eth.d.ts +1825 -0
  75. package/lib/commonjs/web3_eth.js +1742 -0
  76. package/lib/commonjs/web3_eth.js.map +1 -0
  77. package/lib/commonjs/web3_subscriptions.d.ts +117 -0
  78. package/lib/commonjs/web3_subscriptions.js +141 -0
  79. package/lib/commonjs/web3_subscriptions.js.map +1 -0
  80. package/lib/esm/constants.js +26 -0
  81. package/lib/esm/constants.js.map +1 -0
  82. package/lib/esm/index.js +68 -0
  83. package/lib/esm/index.js.map +1 -0
  84. package/lib/esm/package.json +1 -0
  85. package/lib/esm/rpc_method_wrappers.js +645 -0
  86. package/lib/esm/rpc_method_wrappers.js.map +1 -0
  87. package/lib/esm/schemas.js +609 -0
  88. package/lib/esm/schemas.js.map +1 -0
  89. package/lib/esm/types.js +18 -0
  90. package/lib/esm/types.js.map +1 -0
  91. package/lib/esm/utils/decode_signed_transaction.js +23 -0
  92. package/lib/esm/utils/decode_signed_transaction.js.map +1 -0
  93. package/lib/esm/utils/decoding.js +60 -0
  94. package/lib/esm/utils/decoding.js.map +1 -0
  95. package/lib/esm/utils/detect_transaction_type.js +119 -0
  96. package/lib/esm/utils/detect_transaction_type.js.map +1 -0
  97. package/lib/esm/utils/format_transaction.js +57 -0
  98. package/lib/esm/utils/format_transaction.js.map +1 -0
  99. package/lib/esm/utils/get_revert_reason.js +76 -0
  100. package/lib/esm/utils/get_revert_reason.js.map +1 -0
  101. package/lib/esm/utils/get_transaction_error.js +59 -0
  102. package/lib/esm/utils/get_transaction_error.js.map +1 -0
  103. package/lib/esm/utils/get_transaction_gas_pricing.js +81 -0
  104. package/lib/esm/utils/get_transaction_gas_pricing.js.map +1 -0
  105. package/lib/esm/utils/index.js +21 -0
  106. package/lib/esm/utils/index.js.map +1 -0
  107. package/lib/esm/utils/prepare_transaction_for_signing.js +99 -0
  108. package/lib/esm/utils/prepare_transaction_for_signing.js.map +1 -0
  109. package/lib/esm/utils/reject_if_block_timeout.js +134 -0
  110. package/lib/esm/utils/reject_if_block_timeout.js.map +1 -0
  111. package/lib/esm/utils/send_tx_helper.js +175 -0
  112. package/lib/esm/utils/send_tx_helper.js.map +1 -0
  113. package/lib/esm/utils/transaction_builder.js +163 -0
  114. package/lib/esm/utils/transaction_builder.js.map +1 -0
  115. package/lib/esm/utils/try_send_transaction.js +42 -0
  116. package/lib/esm/utils/try_send_transaction.js.map +1 -0
  117. package/lib/esm/utils/wait_for_transaction_receipt.js +68 -0
  118. package/lib/esm/utils/wait_for_transaction_receipt.js.map +1 -0
  119. package/lib/esm/utils/watch_transaction_by_polling.js +41 -0
  120. package/lib/esm/utils/watch_transaction_by_polling.js.map +1 -0
  121. package/lib/esm/utils/watch_transaction_by_subscription.js +82 -0
  122. package/lib/esm/utils/watch_transaction_by_subscription.js.map +1 -0
  123. package/lib/esm/utils/watch_transaction_for_confirmations.js +43 -0
  124. package/lib/esm/utils/watch_transaction_for_confirmations.js.map +1 -0
  125. package/lib/esm/validation.js +260 -0
  126. package/lib/esm/validation.js.map +1 -0
  127. package/lib/esm/web3_eth.js +1715 -0
  128. package/lib/esm/web3_eth.js.map +1 -0
  129. package/lib/esm/web3_subscriptions.js +134 -0
  130. package/lib/esm/web3_subscriptions.js.map +1 -0
  131. package/lib/types/constants.d.ts +15 -0
  132. package/lib/types/constants.d.ts.map +1 -0
  133. package/lib/types/index.d.ts +52 -0
  134. package/lib/types/index.d.ts.map +1 -0
  135. package/lib/types/rpc_method_wrappers.d.ts +549 -0
  136. package/lib/types/rpc_method_wrappers.d.ts.map +1 -0
  137. package/lib/types/schemas.d.ts +946 -0
  138. package/lib/types/schemas.d.ts.map +1 -0
  139. package/lib/types/types.d.ts +51 -0
  140. package/lib/types/types.d.ts.map +1 -0
  141. package/lib/types/utils/decode_signed_transaction.d.ts +14 -0
  142. package/lib/types/utils/decode_signed_transaction.d.ts.map +1 -0
  143. package/lib/types/utils/decoding.d.ts +5 -0
  144. package/lib/types/utils/decoding.d.ts.map +1 -0
  145. package/lib/types/utils/detect_transaction_type.d.ts +7 -0
  146. package/lib/types/utils/detect_transaction_type.d.ts.map +1 -0
  147. package/lib/types/utils/format_transaction.d.ts +8 -0
  148. package/lib/types/utils/format_transaction.d.ts.map +1 -0
  149. package/lib/types/utils/get_revert_reason.d.ts +13 -0
  150. package/lib/types/utils/get_revert_reason.d.ts.map +1 -0
  151. package/lib/types/utils/get_transaction_error.d.ts +153 -0
  152. package/lib/types/utils/get_transaction_error.d.ts.map +1 -0
  153. package/lib/types/utils/get_transaction_gas_pricing.d.ts +9 -0
  154. package/lib/types/utils/get_transaction_gas_pricing.d.ts.map +1 -0
  155. package/lib/types/utils/index.d.ts +5 -0
  156. package/lib/types/utils/index.d.ts.map +1 -0
  157. package/lib/types/utils/prepare_transaction_for_signing.d.ts +4 -0
  158. package/lib/types/utils/prepare_transaction_for_signing.d.ts.map +1 -0
  159. package/lib/types/utils/reject_if_block_timeout.d.ts +7 -0
  160. package/lib/types/utils/reject_if_block_timeout.d.ts.map +1 -0
  161. package/lib/types/utils/send_tx_helper.d.ts +44 -0
  162. package/lib/types/utils/send_tx_helper.d.ts.map +1 -0
  163. package/lib/types/utils/transaction_builder.d.ts +20 -0
  164. package/lib/types/utils/transaction_builder.d.ts.map +1 -0
  165. package/lib/types/utils/try_send_transaction.d.ts +12 -0
  166. package/lib/types/utils/try_send_transaction.d.ts.map +1 -0
  167. package/lib/types/utils/wait_for_transaction_receipt.d.ts +4 -0
  168. package/lib/types/utils/wait_for_transaction_receipt.d.ts.map +1 -0
  169. package/lib/types/utils/watch_transaction_by_polling.d.ts +20 -0
  170. package/lib/types/utils/watch_transaction_by_polling.d.ts.map +1 -0
  171. package/lib/types/utils/watch_transaction_by_subscription.d.ts +9 -0
  172. package/lib/types/utils/watch_transaction_by_subscription.d.ts.map +1 -0
  173. package/lib/types/utils/watch_transaction_for_confirmations.d.ts +7 -0
  174. package/lib/types/utils/watch_transaction_for_confirmations.d.ts.map +1 -0
  175. package/lib/types/validation.d.ts +27 -0
  176. package/lib/types/validation.d.ts.map +1 -0
  177. package/lib/types/web3_eth.d.ts +1826 -0
  178. package/lib/types/web3_eth.d.ts.map +1 -0
  179. package/lib/types/web3_subscriptions.d.ts +118 -0
  180. package/lib/types/web3_subscriptions.d.ts.map +1 -0
  181. package/package.json +58 -4
  182. package/src/constants.ts +27 -0
  183. package/src/index.ts +71 -0
  184. package/src/rpc_method_wrappers.ts +1122 -0
  185. package/src/schemas.ts +668 -0
  186. package/src/types.ts +113 -0
  187. package/src/utils/decode_signed_transaction.ts +60 -0
  188. package/src/utils/decoding.ts +95 -0
  189. package/src/utils/detect_transaction_type.ts +144 -0
  190. package/src/utils/format_transaction.ts +77 -0
  191. package/src/utils/get_revert_reason.ts +96 -0
  192. package/src/utils/get_transaction_error.ts +93 -0
  193. package/src/utils/get_transaction_gas_pricing.ts +117 -0
  194. package/src/utils/index.ts +21 -0
  195. package/src/utils/prepare_transaction_for_signing.ts +154 -0
  196. package/src/utils/reject_if_block_timeout.ts +176 -0
  197. package/src/utils/send_tx_helper.ts +317 -0
  198. package/src/utils/transaction_builder.ts +264 -0
  199. package/src/utils/try_send_transaction.ts +61 -0
  200. package/src/utils/wait_for_transaction_receipt.ts +83 -0
  201. package/src/utils/watch_transaction_by_polling.ts +89 -0
  202. package/src/utils/watch_transaction_by_subscription.ts +120 -0
  203. package/src/utils/watch_transaction_for_confirmations.ts +86 -0
  204. package/src/validation.ts +317 -0
  205. package/src/web3_eth.ts +1897 -0
  206. 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
+ };