envio 3.0.0-alpha.2 → 3.0.0-alpha.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/README.md +164 -30
  2. package/bin.mjs +49 -0
  3. package/evm.schema.json +79 -169
  4. package/fuel.schema.json +50 -21
  5. package/index.d.ts +578 -1
  6. package/index.js +4 -0
  7. package/package.json +47 -31
  8. package/rescript.json +4 -1
  9. package/src/Batch.res +11 -8
  10. package/src/Batch.res.mjs +11 -9
  11. package/src/ChainFetcher.res +531 -0
  12. package/src/ChainFetcher.res.mjs +339 -0
  13. package/src/ChainManager.res +190 -0
  14. package/src/ChainManager.res.mjs +166 -0
  15. package/src/Change.res +3 -3
  16. package/src/Config.gen.ts +19 -0
  17. package/src/Config.res +725 -25
  18. package/src/Config.res.mjs +692 -26
  19. package/src/{Indexer.res → Ctx.res} +1 -1
  20. package/src/Ecosystem.res +9 -124
  21. package/src/Ecosystem.res.mjs +19 -160
  22. package/src/Env.res +33 -73
  23. package/src/Env.res.mjs +29 -85
  24. package/src/Envio.gen.ts +3 -1
  25. package/src/Envio.res +77 -9
  26. package/src/Envio.res.mjs +39 -1
  27. package/src/EventConfigBuilder.res +408 -0
  28. package/src/EventConfigBuilder.res.mjs +376 -0
  29. package/src/EventProcessing.res +469 -0
  30. package/src/EventProcessing.res.mjs +337 -0
  31. package/src/EvmTypes.gen.ts +6 -0
  32. package/src/EvmTypes.res +1 -0
  33. package/src/FetchState.res +1256 -639
  34. package/src/FetchState.res.mjs +1135 -612
  35. package/src/GlobalState.res +1224 -0
  36. package/src/GlobalState.res.mjs +1291 -0
  37. package/src/GlobalStateManager.res +68 -0
  38. package/src/GlobalStateManager.res.mjs +75 -0
  39. package/src/GlobalStateManager.resi +7 -0
  40. package/src/HandlerLoader.res +89 -0
  41. package/src/HandlerLoader.res.mjs +79 -0
  42. package/src/HandlerRegister.res +357 -0
  43. package/src/HandlerRegister.res.mjs +299 -0
  44. package/src/HandlerRegister.resi +30 -0
  45. package/src/Hasura.res +111 -175
  46. package/src/Hasura.res.mjs +88 -150
  47. package/src/InMemoryStore.res +1 -1
  48. package/src/InMemoryStore.res.mjs +3 -3
  49. package/src/InMemoryTable.res +1 -1
  50. package/src/InMemoryTable.res.mjs +1 -1
  51. package/src/Internal.gen.ts +6 -0
  52. package/src/Internal.res +265 -12
  53. package/src/Internal.res.mjs +115 -1
  54. package/src/LoadLayer.res +444 -0
  55. package/src/LoadLayer.res.mjs +296 -0
  56. package/src/LoadLayer.resi +32 -0
  57. package/src/LogSelection.res +33 -27
  58. package/src/LogSelection.res.mjs +6 -0
  59. package/src/Logging.res +21 -7
  60. package/src/Logging.res.mjs +16 -8
  61. package/src/Main.res +390 -0
  62. package/src/Main.res.mjs +341 -0
  63. package/src/Persistence.res +7 -21
  64. package/src/Persistence.res.mjs +3 -3
  65. package/src/PgStorage.gen.ts +10 -0
  66. package/src/PgStorage.res +116 -69
  67. package/src/PgStorage.res.d.mts +5 -0
  68. package/src/PgStorage.res.mjs +93 -50
  69. package/src/Prometheus.res +294 -224
  70. package/src/Prometheus.res.mjs +353 -340
  71. package/src/ReorgDetection.res +6 -10
  72. package/src/ReorgDetection.res.mjs +6 -6
  73. package/src/SafeCheckpointTracking.res +4 -4
  74. package/src/SafeCheckpointTracking.res.mjs +2 -2
  75. package/src/SimulateItems.res +353 -0
  76. package/src/SimulateItems.res.mjs +335 -0
  77. package/src/Sink.res +4 -2
  78. package/src/Sink.res.mjs +2 -1
  79. package/src/TableIndices.res +0 -1
  80. package/src/TestIndexer.res +913 -0
  81. package/src/TestIndexer.res.mjs +698 -0
  82. package/src/TestIndexerProxyStorage.res +205 -0
  83. package/src/TestIndexerProxyStorage.res.mjs +151 -0
  84. package/src/TopicFilter.res +1 -1
  85. package/src/Types.ts +1 -1
  86. package/src/UserContext.res +424 -0
  87. package/src/UserContext.res.mjs +279 -0
  88. package/src/Utils.res +97 -26
  89. package/src/Utils.res.mjs +91 -44
  90. package/src/bindings/BigInt.res +10 -0
  91. package/src/bindings/BigInt.res.mjs +15 -0
  92. package/src/bindings/ClickHouse.res +120 -23
  93. package/src/bindings/ClickHouse.res.mjs +118 -28
  94. package/src/bindings/DateFns.res +74 -0
  95. package/src/bindings/DateFns.res.mjs +22 -0
  96. package/src/bindings/EventSource.res +11 -2
  97. package/src/bindings/EventSource.res.mjs +8 -1
  98. package/src/bindings/Express.res +1 -0
  99. package/src/bindings/Hrtime.res +14 -1
  100. package/src/bindings/Hrtime.res.mjs +22 -2
  101. package/src/bindings/Hrtime.resi +4 -0
  102. package/src/bindings/Lodash.res +0 -1
  103. package/src/bindings/NodeJs.res +49 -3
  104. package/src/bindings/NodeJs.res.mjs +11 -3
  105. package/src/bindings/Pino.res +24 -10
  106. package/src/bindings/Pino.res.mjs +14 -8
  107. package/src/bindings/Postgres.gen.ts +8 -0
  108. package/src/bindings/Postgres.res +5 -1
  109. package/src/bindings/Postgres.res.d.mts +5 -0
  110. package/src/bindings/PromClient.res +0 -10
  111. package/src/bindings/PromClient.res.mjs +0 -3
  112. package/src/bindings/Vitest.res +144 -0
  113. package/src/bindings/Vitest.res.mjs +9 -0
  114. package/src/bindings/WebSocket.res +27 -0
  115. package/src/bindings/WebSocket.res.mjs +2 -0
  116. package/src/bindings/Yargs.res +8 -0
  117. package/src/bindings/Yargs.res.mjs +2 -0
  118. package/src/db/EntityHistory.res +7 -7
  119. package/src/db/EntityHistory.res.mjs +9 -9
  120. package/src/db/InternalTable.res +59 -111
  121. package/src/db/InternalTable.res.mjs +73 -104
  122. package/src/db/Table.res +27 -8
  123. package/src/db/Table.res.mjs +25 -14
  124. package/src/sources/Evm.res +84 -0
  125. package/src/sources/Evm.res.mjs +105 -0
  126. package/src/sources/EvmChain.res +94 -0
  127. package/src/sources/EvmChain.res.mjs +60 -0
  128. package/src/sources/Fuel.res +19 -34
  129. package/src/sources/Fuel.res.mjs +34 -16
  130. package/src/sources/FuelSDK.res +38 -0
  131. package/src/sources/FuelSDK.res.mjs +29 -0
  132. package/src/sources/HyperFuel.res +2 -2
  133. package/src/sources/HyperFuel.resi +1 -1
  134. package/src/sources/HyperFuelClient.res +2 -2
  135. package/src/sources/HyperFuelSource.res +35 -13
  136. package/src/sources/HyperFuelSource.res.mjs +26 -16
  137. package/src/sources/HyperSync.res +61 -60
  138. package/src/sources/HyperSync.res.mjs +53 -67
  139. package/src/sources/HyperSync.resi +6 -4
  140. package/src/sources/HyperSyncClient.res +29 -2
  141. package/src/sources/HyperSyncClient.res.mjs +9 -0
  142. package/src/sources/HyperSyncHeightStream.res +76 -118
  143. package/src/sources/HyperSyncHeightStream.res.mjs +68 -75
  144. package/src/sources/HyperSyncSource.res +122 -143
  145. package/src/sources/HyperSyncSource.res.mjs +106 -121
  146. package/src/sources/Rpc.res +86 -14
  147. package/src/sources/Rpc.res.mjs +101 -9
  148. package/src/sources/RpcSource.res +731 -364
  149. package/src/sources/RpcSource.res.mjs +845 -410
  150. package/src/sources/RpcWebSocketHeightStream.res +181 -0
  151. package/src/sources/RpcWebSocketHeightStream.res.mjs +196 -0
  152. package/src/sources/SimulateSource.res +59 -0
  153. package/src/sources/SimulateSource.res.mjs +50 -0
  154. package/src/sources/Source.res +7 -5
  155. package/src/sources/SourceManager.res +358 -221
  156. package/src/sources/SourceManager.res.mjs +346 -171
  157. package/src/sources/SourceManager.resi +17 -6
  158. package/src/sources/Svm.res +81 -0
  159. package/src/sources/Svm.res.mjs +90 -0
  160. package/src/tui/Tui.res +247 -0
  161. package/src/tui/Tui.res.mjs +337 -0
  162. package/src/tui/bindings/Ink.res +371 -0
  163. package/src/tui/bindings/Ink.res.mjs +72 -0
  164. package/src/tui/bindings/Style.res +123 -0
  165. package/src/tui/bindings/Style.res.mjs +2 -0
  166. package/src/tui/components/BufferedProgressBar.res +40 -0
  167. package/src/tui/components/BufferedProgressBar.res.mjs +57 -0
  168. package/src/tui/components/CustomHooks.res +122 -0
  169. package/src/tui/components/CustomHooks.res.mjs +179 -0
  170. package/src/tui/components/Messages.res +41 -0
  171. package/src/tui/components/Messages.res.mjs +75 -0
  172. package/src/tui/components/SyncETA.res +174 -0
  173. package/src/tui/components/SyncETA.res.mjs +263 -0
  174. package/src/tui/components/TuiData.res +47 -0
  175. package/src/tui/components/TuiData.res.mjs +34 -0
  176. package/svm.schema.json +112 -0
  177. package/bin.js +0 -48
  178. package/src/EventRegister.res +0 -241
  179. package/src/EventRegister.res.mjs +0 -240
  180. package/src/EventRegister.resi +0 -30
  181. package/src/bindings/Ethers.gen.ts +0 -14
  182. package/src/bindings/Ethers.res +0 -204
  183. package/src/bindings/Ethers.res.mjs +0 -130
  184. /package/src/{Indexer.res.mjs → Ctx.res.mjs} +0 -0
package/src/Internal.res CHANGED
@@ -2,8 +2,262 @@ type eventParams
2
2
  type eventBlock
3
3
  type eventTransaction
4
4
 
5
+ // Field name variants for type-safe field selection.
6
+ // @unboxed compiles to plain strings at runtime, matching JS property names.
7
+ @unboxed
8
+ type evmBlockField =
9
+ | @as("number") Number
10
+ | @as("timestamp") Timestamp
11
+ | @as("hash") Hash
12
+ | @as("parentHash") ParentHash
13
+ | @as("nonce") Nonce
14
+ | @as("sha3Uncles") Sha3Uncles
15
+ | @as("logsBloom") LogsBloom
16
+ | @as("transactionsRoot") TransactionsRoot
17
+ | @as("stateRoot") StateRoot
18
+ | @as("receiptsRoot") ReceiptsRoot
19
+ | @as("miner") Miner
20
+ | @as("difficulty") Difficulty
21
+ | @as("totalDifficulty") TotalDifficulty
22
+ | @as("extraData") ExtraData
23
+ | @as("size") Size
24
+ | @as("gasLimit") GasLimit
25
+ | @as("gasUsed") GasUsed
26
+ | @as("uncles") Uncles
27
+ | @as("baseFeePerGas") BaseFeePerGas
28
+ | @as("blobGasUsed") BlobGasUsed
29
+ | @as("excessBlobGas") ExcessBlobGas
30
+ | @as("parentBeaconBlockRoot") ParentBeaconBlockRoot
31
+ | @as("withdrawalsRoot") WithdrawalsRoot
32
+ | @as("l1BlockNumber") L1BlockNumber
33
+ | @as("sendCount") SendCount
34
+ | @as("sendRoot") SendRoot
35
+ | @as("mixHash") MixHash
36
+
37
+ @unboxed
38
+ type evmTransactionField =
39
+ | @as("transactionIndex") TransactionIndex
40
+ | @as("hash") Hash
41
+ | @as("from") From
42
+ | @as("to") To
43
+ | @as("gas") Gas
44
+ | @as("gasPrice") GasPrice
45
+ | @as("maxPriorityFeePerGas") MaxPriorityFeePerGas
46
+ | @as("maxFeePerGas") MaxFeePerGas
47
+ | @as("cumulativeGasUsed") CumulativeGasUsed
48
+ | @as("effectiveGasPrice") EffectiveGasPrice
49
+ | @as("gasUsed") GasUsed
50
+ | @as("input") Input
51
+ | @as("nonce") Nonce
52
+ | @as("value") Value
53
+ | @as("v") V
54
+ | @as("r") R
55
+ | @as("s") S
56
+ | @as("contractAddress") ContractAddress
57
+ | @as("logsBloom") LogsBloom
58
+ | @as("root") Root
59
+ | @as("status") Status
60
+ | @as("yParity") YParity
61
+ | @as("accessList") AccessList
62
+ | @as("maxFeePerBlobGas") MaxFeePerBlobGas
63
+ | @as("blobVersionedHashes") BlobVersionedHashes
64
+ | @as("type") Type
65
+ | @as("l1Fee") L1Fee
66
+ | @as("l1GasPrice") L1GasPrice
67
+ | @as("l1GasUsed") L1GasUsed
68
+ | @as("l1FeeScalar") L1FeeScalar
69
+ | @as("gasUsedForL1") GasUsedForL1
70
+ | @as("authorizationList") AuthorizationList
71
+
72
+ let allEvmBlockFields: array<evmBlockField> = [
73
+ Number,
74
+ Timestamp,
75
+ Hash,
76
+ ParentHash,
77
+ Nonce,
78
+ Sha3Uncles,
79
+ LogsBloom,
80
+ TransactionsRoot,
81
+ StateRoot,
82
+ ReceiptsRoot,
83
+ Miner,
84
+ Difficulty,
85
+ TotalDifficulty,
86
+ ExtraData,
87
+ Size,
88
+ GasLimit,
89
+ GasUsed,
90
+ Uncles,
91
+ BaseFeePerGas,
92
+ BlobGasUsed,
93
+ ExcessBlobGas,
94
+ ParentBeaconBlockRoot,
95
+ WithdrawalsRoot,
96
+ L1BlockNumber,
97
+ SendCount,
98
+ SendRoot,
99
+ MixHash,
100
+ ]
101
+ let evmBlockFieldSchema = S.enum(allEvmBlockFields)
102
+
103
+ let allEvmTransactionFields: array<evmTransactionField> = [
104
+ TransactionIndex,
105
+ Hash,
106
+ From,
107
+ To,
108
+ Gas,
109
+ GasPrice,
110
+ MaxPriorityFeePerGas,
111
+ MaxFeePerGas,
112
+ CumulativeGasUsed,
113
+ EffectiveGasPrice,
114
+ GasUsed,
115
+ Input,
116
+ Nonce,
117
+ Value,
118
+ V,
119
+ R,
120
+ S,
121
+ ContractAddress,
122
+ LogsBloom,
123
+ Root,
124
+ Status,
125
+ YParity,
126
+ AccessList,
127
+ MaxFeePerBlobGas,
128
+ BlobVersionedHashes,
129
+ Type,
130
+ L1Fee,
131
+ L1GasPrice,
132
+ L1GasUsed,
133
+ L1FeeScalar,
134
+ GasUsedForL1,
135
+ AuthorizationList,
136
+ ]
137
+ let evmTransactionFieldSchema = S.enum(allEvmTransactionFields)
138
+
139
+ // Static sets of nullable field names — used by RpcSource and HyperSyncSource to wrap schemas with S.nullable
140
+ let evmNullableBlockFields = Utils.Set.fromArray(
141
+ (
142
+ [
143
+ Nonce,
144
+ Difficulty,
145
+ TotalDifficulty,
146
+ Uncles,
147
+ BaseFeePerGas,
148
+ BlobGasUsed,
149
+ ExcessBlobGas,
150
+ ParentBeaconBlockRoot,
151
+ WithdrawalsRoot,
152
+ L1BlockNumber,
153
+ SendCount,
154
+ SendRoot,
155
+ MixHash,
156
+ ]: array<evmBlockField>
157
+ ),
158
+ )
159
+ let evmNullableTransactionFields = Utils.Set.fromArray(
160
+ (
161
+ [
162
+ GasPrice,
163
+ V,
164
+ R,
165
+ S,
166
+ YParity,
167
+ MaxPriorityFeePerGas,
168
+ MaxFeePerGas,
169
+ MaxFeePerBlobGas,
170
+ BlobVersionedHashes,
171
+ ContractAddress,
172
+ Root,
173
+ Status,
174
+ L1Fee,
175
+ L1GasPrice,
176
+ L1GasUsed,
177
+ L1FeeScalar,
178
+ GasUsedForL1,
179
+ From,
180
+ To,
181
+ Type,
182
+ ]: array<evmTransactionField>
183
+ ),
184
+ )
185
+
186
+ type evmBlockInput = {
187
+ number?: int,
188
+ timestamp?: int,
189
+ hash?: string,
190
+ parentHash?: string,
191
+ nonce?: bigint,
192
+ sha3Uncles?: string,
193
+ logsBloom?: string,
194
+ transactionsRoot?: string,
195
+ stateRoot?: string,
196
+ receiptsRoot?: string,
197
+ miner?: Address.t,
198
+ difficulty?: bigint,
199
+ totalDifficulty?: bigint,
200
+ extraData?: string,
201
+ size?: bigint,
202
+ gasLimit?: bigint,
203
+ gasUsed?: bigint,
204
+ uncles?: array<string>,
205
+ baseFeePerGas?: bigint,
206
+ blobGasUsed?: bigint,
207
+ excessBlobGas?: bigint,
208
+ parentBeaconBlockRoot?: string,
209
+ withdrawalsRoot?: string,
210
+ l1BlockNumber?: int,
211
+ sendCount?: string,
212
+ sendRoot?: string,
213
+ mixHash?: string,
214
+ }
215
+
216
+ type evmTransactionInput = {
217
+ from?: Address.t,
218
+ to?: Address.t,
219
+ gas?: bigint,
220
+ gasPrice?: bigint,
221
+ hash?: string,
222
+ input?: string,
223
+ nonce?: bigint,
224
+ transactionIndex?: int,
225
+ value?: bigint,
226
+ // Signature fields - optional for ZKSync EIP-712 compatibility
227
+ v?: string,
228
+ r?: string,
229
+ s?: string,
230
+ yParity?: string,
231
+ // EIP-1559 fields
232
+ maxPriorityFeePerGas?: bigint,
233
+ maxFeePerGas?: bigint,
234
+ // EIP-4844 blob fields
235
+ maxFeePerBlobGas?: bigint,
236
+ blobVersionedHashes?: array<string>,
237
+ // Receipt fields (from joined transaction receipts)
238
+ cumulativeGasUsed?: bigint,
239
+ effectiveGasPrice?: bigint,
240
+ gasUsed?: bigint,
241
+ contractAddress?: string,
242
+ logsBloom?: string,
243
+ @as("type")
244
+ type_?: int,
245
+ root?: string,
246
+ status?: int,
247
+ accessList?: Js.Json.t,
248
+ // L2 specific fields (Optimism, Arbitrum, etc.)
249
+ l1Fee?: bigint,
250
+ l1GasPrice?: bigint,
251
+ l1GasUsed?: bigint,
252
+ l1FeeScalar?: float,
253
+ gasUsedForL1?: bigint,
254
+ authorizationList?: Js.Json.t,
255
+ }
256
+
5
257
  @genType
6
258
  type genericEvent<'params, 'block, 'transaction> = {
259
+ contractName: string,
260
+ eventName: string,
7
261
  params: 'params,
8
262
  chainId: int,
9
263
  srcAddress: Address.t,
@@ -65,7 +319,6 @@ type chains = dict<chainInfo>
65
319
  type loaderReturn
66
320
  type handlerContext = private {
67
321
  isPreload: bool,
68
- chains: chains,
69
322
  chain: chainInfo,
70
323
  }
71
324
  type handlerArgs = {
@@ -99,6 +352,7 @@ type eventConfig = private {
99
352
  handler: option<handler>,
100
353
  contractRegister: option<contractRegister>,
101
354
  paramsRawEventSchema: S.schema<eventParams>,
355
+ simulateParamsSchema: S.schema<eventParams>,
102
356
  }
103
357
 
104
358
  type fuelEventKind =
@@ -107,6 +361,7 @@ type fuelEventKind =
107
361
  | Burn
108
362
  | Transfer
109
363
  | Call
364
+ @genType.opaque
110
365
  type fuelEventConfig = {
111
366
  ...eventConfig,
112
367
  kind: fuelEventKind,
@@ -128,12 +383,13 @@ type eventFiltersArgs = {chainId: int, addresses: array<Address.t>}
128
383
  type eventFilters =
129
384
  Static(array<topicSelection>) | Dynamic(array<Address.t> => array<topicSelection>)
130
385
 
386
+ @genType.opaque
131
387
  type evmEventConfig = {
132
388
  ...eventConfig,
133
389
  getEventFiltersOrThrow: ChainMap.Chain.t => eventFilters,
134
- blockSchema: S.schema<eventBlock>,
135
- transactionSchema: S.schema<eventTransaction>,
136
390
  convertHyperSyncEventArgs: HyperSyncClient.Decoder.decodedEvent => eventParams,
391
+ selectedBlockFields: Utils.Set.t<evmBlockField>,
392
+ selectedTransactionFields: Utils.Set.t<evmTransactionField>,
137
393
  }
138
394
  type evmContractConfig = {
139
395
  name: string,
@@ -169,7 +425,8 @@ type eventItem = private {
169
425
  type blockEvent
170
426
 
171
427
  type onBlockArgs = {
172
- block: blockEvent,
428
+ slot?: int,
429
+ block?: blockEvent,
173
430
  context: handlerContext,
174
431
  }
175
432
 
@@ -243,19 +500,15 @@ let fuelTransferParamsSchema = S.schema(s => {
243
500
  amount: s.matches(BigInt.schema),
244
501
  })
245
502
 
503
+ type multichain = | @as("ordered") Ordered | @as("unordered") Unordered
504
+
246
505
  type entity = private {id: string}
247
- type clickHouseSetUpdatesCache = {
248
- tableName: string,
249
- convertOrThrow: Change.t<entity> => Js.Json.t,
250
- }
251
506
  type genericEntityConfig<'entity> = {
252
507
  name: string,
253
508
  index: int,
254
509
  schema: S.t<'entity>,
255
510
  rowsSchema: S.t<array<'entity>>,
256
511
  table: Table.table,
257
- mutable clickHouseSetUpdatesCache?: clickHouseSetUpdatesCache,
258
- mutable pgEntityHistoryCache?: EntityHistory.pgEntityHistory<'entity>,
259
512
  }
260
513
  type entityConfig = genericEntityConfig<entity>
261
514
  external fromGenericEntityConfig: genericEntityConfig<'entity> => entityConfig = "%identity"
@@ -312,11 +565,11 @@ let makeCacheTable = (~effectName) => {
312
565
  @genType.import(("./Types.ts", "Invalid"))
313
566
  type noEventFilters
314
567
 
315
- type checkpointId = float
568
+ type checkpointId = bigint
316
569
 
317
570
  type reorgCheckpoint = {
318
571
  @as("id")
319
- checkpointId: float,
572
+ checkpointId: bigint,
320
573
  @as("chain_id")
321
574
  chainId: int,
322
575
  @as("block_number")
@@ -5,6 +5,114 @@ import * as $$BigInt from "./bindings/BigInt.res.mjs";
5
5
  import * as Address from "./Address.res.mjs";
6
6
  import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
7
7
 
8
+ var allEvmBlockFields = [
9
+ "number",
10
+ "timestamp",
11
+ "hash",
12
+ "parentHash",
13
+ "nonce",
14
+ "sha3Uncles",
15
+ "logsBloom",
16
+ "transactionsRoot",
17
+ "stateRoot",
18
+ "receiptsRoot",
19
+ "miner",
20
+ "difficulty",
21
+ "totalDifficulty",
22
+ "extraData",
23
+ "size",
24
+ "gasLimit",
25
+ "gasUsed",
26
+ "uncles",
27
+ "baseFeePerGas",
28
+ "blobGasUsed",
29
+ "excessBlobGas",
30
+ "parentBeaconBlockRoot",
31
+ "withdrawalsRoot",
32
+ "l1BlockNumber",
33
+ "sendCount",
34
+ "sendRoot",
35
+ "mixHash"
36
+ ];
37
+
38
+ var evmBlockFieldSchema = S$RescriptSchema.$$enum(allEvmBlockFields);
39
+
40
+ var allEvmTransactionFields = [
41
+ "transactionIndex",
42
+ "hash",
43
+ "from",
44
+ "to",
45
+ "gas",
46
+ "gasPrice",
47
+ "maxPriorityFeePerGas",
48
+ "maxFeePerGas",
49
+ "cumulativeGasUsed",
50
+ "effectiveGasPrice",
51
+ "gasUsed",
52
+ "input",
53
+ "nonce",
54
+ "value",
55
+ "v",
56
+ "r",
57
+ "s",
58
+ "contractAddress",
59
+ "logsBloom",
60
+ "root",
61
+ "status",
62
+ "yParity",
63
+ "accessList",
64
+ "maxFeePerBlobGas",
65
+ "blobVersionedHashes",
66
+ "type",
67
+ "l1Fee",
68
+ "l1GasPrice",
69
+ "l1GasUsed",
70
+ "l1FeeScalar",
71
+ "gasUsedForL1",
72
+ "authorizationList"
73
+ ];
74
+
75
+ var evmTransactionFieldSchema = S$RescriptSchema.$$enum(allEvmTransactionFields);
76
+
77
+ var evmNullableBlockFields = new Set([
78
+ "nonce",
79
+ "difficulty",
80
+ "totalDifficulty",
81
+ "uncles",
82
+ "baseFeePerGas",
83
+ "blobGasUsed",
84
+ "excessBlobGas",
85
+ "parentBeaconBlockRoot",
86
+ "withdrawalsRoot",
87
+ "l1BlockNumber",
88
+ "sendCount",
89
+ "sendRoot",
90
+ "mixHash"
91
+ ]);
92
+
93
+ var evmNullableTransactionFields = new Set([
94
+ "gasPrice",
95
+ "v",
96
+ "r",
97
+ "s",
98
+ "yParity",
99
+ "maxPriorityFeePerGas",
100
+ "maxFeePerGas",
101
+ "maxFeePerBlobGas",
102
+ "blobVersionedHashes",
103
+ "contractAddress",
104
+ "root",
105
+ "status",
106
+ "l1Fee",
107
+ "l1GasPrice",
108
+ "l1GasUsed",
109
+ "l1FeeScalar",
110
+ "gasUsedForL1",
111
+ "from",
112
+ "to",
113
+ "type"
114
+ ]);
115
+
8
116
  function getItemChainId(item) {
9
117
  if (item.kind === 0) {
10
118
  return item.chain;
@@ -47,6 +155,12 @@ function makeCacheTable(effectName) {
47
155
  }
48
156
 
49
157
  export {
158
+ allEvmBlockFields ,
159
+ evmBlockFieldSchema ,
160
+ allEvmTransactionFields ,
161
+ evmTransactionFieldSchema ,
162
+ evmNullableBlockFields ,
163
+ evmNullableTransactionFields ,
50
164
  getItemChainId ,
51
165
  fuelSupplyParamsSchema ,
52
166
  fuelTransferParamsSchema ,
@@ -55,4 +169,4 @@ export {
55
169
  effectCacheItemRowsSchema ,
56
170
  makeCacheTable ,
57
171
  }
58
- /* fuelSupplyParamsSchema Not a pure module */
172
+ /* evmBlockFieldSchema Not a pure module */