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.
- package/README.md +164 -30
- package/bin.mjs +49 -0
- package/evm.schema.json +79 -169
- package/fuel.schema.json +50 -21
- package/index.d.ts +578 -1
- package/index.js +4 -0
- package/package.json +47 -31
- package/rescript.json +4 -1
- package/src/Batch.res +11 -8
- package/src/Batch.res.mjs +11 -9
- package/src/ChainFetcher.res +531 -0
- package/src/ChainFetcher.res.mjs +339 -0
- package/src/ChainManager.res +190 -0
- package/src/ChainManager.res.mjs +166 -0
- package/src/Change.res +3 -3
- package/src/Config.gen.ts +19 -0
- package/src/Config.res +725 -25
- package/src/Config.res.mjs +692 -26
- package/src/{Indexer.res → Ctx.res} +1 -1
- package/src/Ecosystem.res +9 -124
- package/src/Ecosystem.res.mjs +19 -160
- package/src/Env.res +33 -73
- package/src/Env.res.mjs +29 -85
- package/src/Envio.gen.ts +3 -1
- package/src/Envio.res +77 -9
- package/src/Envio.res.mjs +39 -1
- package/src/EventConfigBuilder.res +408 -0
- package/src/EventConfigBuilder.res.mjs +376 -0
- package/src/EventProcessing.res +469 -0
- package/src/EventProcessing.res.mjs +337 -0
- package/src/EvmTypes.gen.ts +6 -0
- package/src/EvmTypes.res +1 -0
- package/src/FetchState.res +1256 -639
- package/src/FetchState.res.mjs +1135 -612
- package/src/GlobalState.res +1224 -0
- package/src/GlobalState.res.mjs +1291 -0
- package/src/GlobalStateManager.res +68 -0
- package/src/GlobalStateManager.res.mjs +75 -0
- package/src/GlobalStateManager.resi +7 -0
- package/src/HandlerLoader.res +89 -0
- package/src/HandlerLoader.res.mjs +79 -0
- package/src/HandlerRegister.res +357 -0
- package/src/HandlerRegister.res.mjs +299 -0
- package/src/HandlerRegister.resi +30 -0
- package/src/Hasura.res +111 -175
- package/src/Hasura.res.mjs +88 -150
- package/src/InMemoryStore.res +1 -1
- package/src/InMemoryStore.res.mjs +3 -3
- package/src/InMemoryTable.res +1 -1
- package/src/InMemoryTable.res.mjs +1 -1
- package/src/Internal.gen.ts +6 -0
- package/src/Internal.res +265 -12
- package/src/Internal.res.mjs +115 -1
- package/src/LoadLayer.res +444 -0
- package/src/LoadLayer.res.mjs +296 -0
- package/src/LoadLayer.resi +32 -0
- package/src/LogSelection.res +33 -27
- package/src/LogSelection.res.mjs +6 -0
- package/src/Logging.res +21 -7
- package/src/Logging.res.mjs +16 -8
- package/src/Main.res +390 -0
- package/src/Main.res.mjs +341 -0
- package/src/Persistence.res +7 -21
- package/src/Persistence.res.mjs +3 -3
- package/src/PgStorage.gen.ts +10 -0
- package/src/PgStorage.res +116 -69
- package/src/PgStorage.res.d.mts +5 -0
- package/src/PgStorage.res.mjs +93 -50
- package/src/Prometheus.res +294 -224
- package/src/Prometheus.res.mjs +353 -340
- package/src/ReorgDetection.res +6 -10
- package/src/ReorgDetection.res.mjs +6 -6
- package/src/SafeCheckpointTracking.res +4 -4
- package/src/SafeCheckpointTracking.res.mjs +2 -2
- package/src/SimulateItems.res +353 -0
- package/src/SimulateItems.res.mjs +335 -0
- package/src/Sink.res +4 -2
- package/src/Sink.res.mjs +2 -1
- package/src/TableIndices.res +0 -1
- package/src/TestIndexer.res +913 -0
- package/src/TestIndexer.res.mjs +698 -0
- package/src/TestIndexerProxyStorage.res +205 -0
- package/src/TestIndexerProxyStorage.res.mjs +151 -0
- package/src/TopicFilter.res +1 -1
- package/src/Types.ts +1 -1
- package/src/UserContext.res +424 -0
- package/src/UserContext.res.mjs +279 -0
- package/src/Utils.res +97 -26
- package/src/Utils.res.mjs +91 -44
- package/src/bindings/BigInt.res +10 -0
- package/src/bindings/BigInt.res.mjs +15 -0
- package/src/bindings/ClickHouse.res +120 -23
- package/src/bindings/ClickHouse.res.mjs +118 -28
- package/src/bindings/DateFns.res +74 -0
- package/src/bindings/DateFns.res.mjs +22 -0
- package/src/bindings/EventSource.res +11 -2
- package/src/bindings/EventSource.res.mjs +8 -1
- package/src/bindings/Express.res +1 -0
- package/src/bindings/Hrtime.res +14 -1
- package/src/bindings/Hrtime.res.mjs +22 -2
- package/src/bindings/Hrtime.resi +4 -0
- package/src/bindings/Lodash.res +0 -1
- package/src/bindings/NodeJs.res +49 -3
- package/src/bindings/NodeJs.res.mjs +11 -3
- package/src/bindings/Pino.res +24 -10
- package/src/bindings/Pino.res.mjs +14 -8
- package/src/bindings/Postgres.gen.ts +8 -0
- package/src/bindings/Postgres.res +5 -1
- package/src/bindings/Postgres.res.d.mts +5 -0
- package/src/bindings/PromClient.res +0 -10
- package/src/bindings/PromClient.res.mjs +0 -3
- package/src/bindings/Vitest.res +144 -0
- package/src/bindings/Vitest.res.mjs +9 -0
- package/src/bindings/WebSocket.res +27 -0
- package/src/bindings/WebSocket.res.mjs +2 -0
- package/src/bindings/Yargs.res +8 -0
- package/src/bindings/Yargs.res.mjs +2 -0
- package/src/db/EntityHistory.res +7 -7
- package/src/db/EntityHistory.res.mjs +9 -9
- package/src/db/InternalTable.res +59 -111
- package/src/db/InternalTable.res.mjs +73 -104
- package/src/db/Table.res +27 -8
- package/src/db/Table.res.mjs +25 -14
- package/src/sources/Evm.res +84 -0
- package/src/sources/Evm.res.mjs +105 -0
- package/src/sources/EvmChain.res +94 -0
- package/src/sources/EvmChain.res.mjs +60 -0
- package/src/sources/Fuel.res +19 -34
- package/src/sources/Fuel.res.mjs +34 -16
- package/src/sources/FuelSDK.res +38 -0
- package/src/sources/FuelSDK.res.mjs +29 -0
- package/src/sources/HyperFuel.res +2 -2
- package/src/sources/HyperFuel.resi +1 -1
- package/src/sources/HyperFuelClient.res +2 -2
- package/src/sources/HyperFuelSource.res +35 -13
- package/src/sources/HyperFuelSource.res.mjs +26 -16
- package/src/sources/HyperSync.res +61 -60
- package/src/sources/HyperSync.res.mjs +53 -67
- package/src/sources/HyperSync.resi +6 -4
- package/src/sources/HyperSyncClient.res +29 -2
- package/src/sources/HyperSyncClient.res.mjs +9 -0
- package/src/sources/HyperSyncHeightStream.res +76 -118
- package/src/sources/HyperSyncHeightStream.res.mjs +68 -75
- package/src/sources/HyperSyncSource.res +122 -143
- package/src/sources/HyperSyncSource.res.mjs +106 -121
- package/src/sources/Rpc.res +86 -14
- package/src/sources/Rpc.res.mjs +101 -9
- package/src/sources/RpcSource.res +731 -364
- package/src/sources/RpcSource.res.mjs +845 -410
- package/src/sources/RpcWebSocketHeightStream.res +181 -0
- package/src/sources/RpcWebSocketHeightStream.res.mjs +196 -0
- package/src/sources/SimulateSource.res +59 -0
- package/src/sources/SimulateSource.res.mjs +50 -0
- package/src/sources/Source.res +7 -5
- package/src/sources/SourceManager.res +358 -221
- package/src/sources/SourceManager.res.mjs +346 -171
- package/src/sources/SourceManager.resi +17 -6
- package/src/sources/Svm.res +81 -0
- package/src/sources/Svm.res.mjs +90 -0
- package/src/tui/Tui.res +247 -0
- package/src/tui/Tui.res.mjs +337 -0
- package/src/tui/bindings/Ink.res +371 -0
- package/src/tui/bindings/Ink.res.mjs +72 -0
- package/src/tui/bindings/Style.res +123 -0
- package/src/tui/bindings/Style.res.mjs +2 -0
- package/src/tui/components/BufferedProgressBar.res +40 -0
- package/src/tui/components/BufferedProgressBar.res.mjs +57 -0
- package/src/tui/components/CustomHooks.res +122 -0
- package/src/tui/components/CustomHooks.res.mjs +179 -0
- package/src/tui/components/Messages.res +41 -0
- package/src/tui/components/Messages.res.mjs +75 -0
- package/src/tui/components/SyncETA.res +174 -0
- package/src/tui/components/SyncETA.res.mjs +263 -0
- package/src/tui/components/TuiData.res +47 -0
- package/src/tui/components/TuiData.res.mjs +34 -0
- package/svm.schema.json +112 -0
- package/bin.js +0 -48
- package/src/EventRegister.res +0 -241
- package/src/EventRegister.res.mjs +0 -240
- package/src/EventRegister.resi +0 -30
- package/src/bindings/Ethers.gen.ts +0 -14
- package/src/bindings/Ethers.res +0 -204
- package/src/bindings/Ethers.res.mjs +0 -130
- /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
|
-
|
|
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 =
|
|
568
|
+
type checkpointId = bigint
|
|
316
569
|
|
|
317
570
|
type reorgCheckpoint = {
|
|
318
571
|
@as("id")
|
|
319
|
-
checkpointId:
|
|
572
|
+
checkpointId: bigint,
|
|
320
573
|
@as("chain_id")
|
|
321
574
|
chainId: int,
|
|
322
575
|
@as("block_number")
|
package/src/Internal.res.mjs
CHANGED
|
@@ -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
|
-
/*
|
|
172
|
+
/* evmBlockFieldSchema Not a pure module */
|