envio 3.0.0-alpha.2 → 3.0.0-alpha.3
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/evm.schema.json +44 -33
- package/fuel.schema.json +32 -21
- package/index.d.ts +1 -0
- package/package.json +7 -6
- package/src/Batch.res.mjs +1 -1
- package/src/Benchmark.res +394 -0
- package/src/Benchmark.res.mjs +398 -0
- package/src/ChainFetcher.res +459 -0
- package/src/ChainFetcher.res.mjs +281 -0
- package/src/ChainManager.res +179 -0
- package/src/ChainManager.res.mjs +139 -0
- package/src/Config.res +15 -1
- package/src/Config.res.mjs +27 -4
- package/src/Ecosystem.res +9 -124
- package/src/Ecosystem.res.mjs +19 -160
- package/src/Env.res +0 -1
- package/src/Env.res.mjs +0 -3
- package/src/Envio.gen.ts +9 -1
- package/src/Envio.res +12 -9
- package/src/EventProcessing.res +476 -0
- package/src/EventProcessing.res.mjs +341 -0
- package/src/FetchState.res +54 -29
- package/src/FetchState.res.mjs +62 -35
- package/src/GlobalState.res +1169 -0
- package/src/GlobalState.res.mjs +1196 -0
- package/src/Internal.res +2 -1
- package/src/LoadLayer.res +444 -0
- package/src/LoadLayer.res.mjs +296 -0
- package/src/LoadLayer.resi +32 -0
- package/src/Prometheus.res +8 -8
- package/src/Prometheus.res.mjs +10 -10
- package/src/ReorgDetection.res +6 -10
- package/src/ReorgDetection.res.mjs +6 -6
- package/src/UserContext.res +356 -0
- package/src/UserContext.res.mjs +238 -0
- package/src/bindings/DateFns.res +71 -0
- package/src/bindings/DateFns.res.mjs +22 -0
- package/src/sources/Evm.res +87 -0
- package/src/sources/Evm.res.mjs +105 -0
- package/src/sources/EvmChain.res +95 -0
- package/src/sources/EvmChain.res.mjs +61 -0
- package/src/sources/Fuel.res +19 -34
- package/src/sources/Fuel.res.mjs +34 -16
- package/src/sources/FuelSDK.res +37 -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 +8 -8
- package/src/sources/HyperFuelSource.res.mjs +5 -5
- package/src/sources/HyperSyncSource.res +5 -5
- package/src/sources/HyperSyncSource.res.mjs +5 -5
- package/src/sources/RpcSource.res +4 -4
- package/src/sources/RpcSource.res.mjs +3 -3
- package/src/sources/Solana.res +59 -0
- package/src/sources/Solana.res.mjs +79 -0
- package/src/sources/Source.res +2 -2
- package/src/sources/SourceManager.res +24 -32
- package/src/sources/SourceManager.res.mjs +20 -20
- package/src/sources/SourceManager.resi +4 -5
package/evm.schema.json
CHANGED
|
@@ -15,17 +15,6 @@
|
|
|
15
15
|
"description": "Name of the project",
|
|
16
16
|
"type": "string"
|
|
17
17
|
},
|
|
18
|
-
"ecosystem": {
|
|
19
|
-
"description": "Ecosystem of the project.",
|
|
20
|
-
"anyOf": [
|
|
21
|
-
{
|
|
22
|
-
"$ref": "#/$defs/EcosystemTag"
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"type": "null"
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
},
|
|
29
18
|
"schema": {
|
|
30
19
|
"description": "Custom path to schema.graphql file",
|
|
31
20
|
"type": [
|
|
@@ -40,6 +29,33 @@
|
|
|
40
29
|
"null"
|
|
41
30
|
]
|
|
42
31
|
},
|
|
32
|
+
"handlers": {
|
|
33
|
+
"description": "Optional relative path to handlers directory for auto-loading. Defaults to 'src/handlers' if not specified.",
|
|
34
|
+
"type": [
|
|
35
|
+
"string",
|
|
36
|
+
"null"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"full_batch_size": {
|
|
40
|
+
"description": "Target number of events to be processed per batch. Set it to smaller number if you have many Effect API calls which are slow to resolve and can't be batched. (Default: 5000)",
|
|
41
|
+
"type": [
|
|
42
|
+
"integer",
|
|
43
|
+
"null"
|
|
44
|
+
],
|
|
45
|
+
"format": "uint64",
|
|
46
|
+
"minimum": 0
|
|
47
|
+
},
|
|
48
|
+
"ecosystem": {
|
|
49
|
+
"description": "Ecosystem of the project.",
|
|
50
|
+
"anyOf": [
|
|
51
|
+
{
|
|
52
|
+
"$ref": "#/$defs/EcosystemTag"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"type": "null"
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
},
|
|
43
59
|
"contracts": {
|
|
44
60
|
"description": "Global contract definitions that must contain all definitions except addresses. You can share a single handler/abi/event definitions for contracts across multiple chains.",
|
|
45
61
|
"type": [
|
|
@@ -54,7 +70,7 @@
|
|
|
54
70
|
"description": "Configuration of the blockchain chains that the project is deployed on.",
|
|
55
71
|
"type": "array",
|
|
56
72
|
"items": {
|
|
57
|
-
"$ref": "#/$defs/
|
|
73
|
+
"$ref": "#/$defs/Chain"
|
|
58
74
|
}
|
|
59
75
|
},
|
|
60
76
|
"multichain": {
|
|
@@ -121,13 +137,6 @@
|
|
|
121
137
|
"type": "null"
|
|
122
138
|
}
|
|
123
139
|
]
|
|
124
|
-
},
|
|
125
|
-
"handlers": {
|
|
126
|
-
"description": "Optional relative path to handlers directory for auto-loading. Defaults to 'src/handlers' if not specified.",
|
|
127
|
-
"type": [
|
|
128
|
-
"string",
|
|
129
|
-
"null"
|
|
130
|
-
]
|
|
131
140
|
}
|
|
132
141
|
},
|
|
133
142
|
"additionalProperties": false,
|
|
@@ -301,17 +310,17 @@
|
|
|
301
310
|
"mixHash"
|
|
302
311
|
]
|
|
303
312
|
},
|
|
304
|
-
"
|
|
313
|
+
"Chain": {
|
|
305
314
|
"type": "object",
|
|
306
315
|
"properties": {
|
|
307
316
|
"id": {
|
|
308
|
-
"description": "The public blockchain
|
|
317
|
+
"description": "The public blockchain chain ID.",
|
|
309
318
|
"type": "integer",
|
|
310
319
|
"format": "uint64",
|
|
311
320
|
"minimum": 0
|
|
312
321
|
},
|
|
313
322
|
"rpc_config": {
|
|
314
|
-
"description": "RPC configuration for utilizing as the
|
|
323
|
+
"description": "RPC configuration for utilizing as the chain's data-source. Typically optional for chains with HyperSync support, which is highly recommended. HyperSync dramatically enhances performance, providing up to a 1000x speed boost over traditional RPC.",
|
|
315
324
|
"anyOf": [
|
|
316
325
|
{
|
|
317
326
|
"$ref": "#/$defs/RpcConfig"
|
|
@@ -322,10 +331,10 @@
|
|
|
322
331
|
]
|
|
323
332
|
},
|
|
324
333
|
"rpc": {
|
|
325
|
-
"description": "RPC configuration for your indexer. If not specified otherwise, for
|
|
334
|
+
"description": "RPC configuration for your indexer. If not specified otherwise, for chains supported by HyperSync, RPC serves as a fallback for added reliability. For others, it acts as the primary data-source. HyperSync offers significant performance improvements, up to a 1000x faster than traditional RPC.",
|
|
326
335
|
"anyOf": [
|
|
327
336
|
{
|
|
328
|
-
"$ref": "#/$defs/
|
|
337
|
+
"$ref": "#/$defs/RpcSelection"
|
|
329
338
|
},
|
|
330
339
|
{
|
|
331
340
|
"type": "null"
|
|
@@ -343,7 +352,7 @@
|
|
|
343
352
|
}
|
|
344
353
|
]
|
|
345
354
|
},
|
|
346
|
-
"
|
|
355
|
+
"max_reorg_depth": {
|
|
347
356
|
"description": "The number of blocks from the head that the indexer should account for in case of reorgs.",
|
|
348
357
|
"type": [
|
|
349
358
|
"integer",
|
|
@@ -367,18 +376,20 @@
|
|
|
367
376
|
"minimum": 0
|
|
368
377
|
},
|
|
369
378
|
"contracts": {
|
|
370
|
-
"description": "All the contracts that should be indexed on the given
|
|
371
|
-
"type":
|
|
379
|
+
"description": "All the contracts that should be indexed on the given chain",
|
|
380
|
+
"type": [
|
|
381
|
+
"array",
|
|
382
|
+
"null"
|
|
383
|
+
],
|
|
372
384
|
"items": {
|
|
373
|
-
"$ref": "#/$defs/
|
|
385
|
+
"$ref": "#/$defs/ChainContract_for_ContractConfig"
|
|
374
386
|
}
|
|
375
387
|
}
|
|
376
388
|
},
|
|
377
389
|
"additionalProperties": false,
|
|
378
390
|
"required": [
|
|
379
391
|
"id",
|
|
380
|
-
"start_block"
|
|
381
|
-
"contracts"
|
|
392
|
+
"start_block"
|
|
382
393
|
]
|
|
383
394
|
},
|
|
384
395
|
"RpcConfig": {
|
|
@@ -466,7 +477,7 @@
|
|
|
466
477
|
"url"
|
|
467
478
|
]
|
|
468
479
|
},
|
|
469
|
-
"
|
|
480
|
+
"RpcSelection": {
|
|
470
481
|
"anyOf": [
|
|
471
482
|
{
|
|
472
483
|
"type": "string"
|
|
@@ -594,7 +605,7 @@
|
|
|
594
605
|
"url"
|
|
595
606
|
]
|
|
596
607
|
},
|
|
597
|
-
"
|
|
608
|
+
"ChainContract_for_ContractConfig": {
|
|
598
609
|
"type": "object",
|
|
599
610
|
"properties": {
|
|
600
611
|
"name": {
|
|
@@ -606,7 +617,7 @@
|
|
|
606
617
|
"$ref": "#/$defs/Addresses"
|
|
607
618
|
},
|
|
608
619
|
"start_block": {
|
|
609
|
-
"description": "The block at which the indexer should start ingesting data for this specific contract. If not specified, uses the
|
|
620
|
+
"description": "The block at which the indexer should start ingesting data for this specific contract. If not specified, uses the chain start_block. Can be greater than the chain start_block for more specific indexing.",
|
|
610
621
|
"type": [
|
|
611
622
|
"integer",
|
|
612
623
|
"null"
|
package/fuel.schema.json
CHANGED
|
@@ -15,10 +15,6 @@
|
|
|
15
15
|
"description": "Name of the project",
|
|
16
16
|
"type": "string"
|
|
17
17
|
},
|
|
18
|
-
"ecosystem": {
|
|
19
|
-
"description": "Ecosystem of the project.",
|
|
20
|
-
"$ref": "#/$defs/EcosystemTag"
|
|
21
|
-
},
|
|
22
18
|
"schema": {
|
|
23
19
|
"description": "Custom path to schema.graphql file",
|
|
24
20
|
"type": [
|
|
@@ -33,6 +29,26 @@
|
|
|
33
29
|
"null"
|
|
34
30
|
]
|
|
35
31
|
},
|
|
32
|
+
"handlers": {
|
|
33
|
+
"description": "Optional relative path to handlers directory for auto-loading. Defaults to 'src/handlers' if not specified.",
|
|
34
|
+
"type": [
|
|
35
|
+
"string",
|
|
36
|
+
"null"
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"full_batch_size": {
|
|
40
|
+
"description": "Target number of events to be processed per batch. Set it to smaller number if you have many Effect API calls which are slow to resolve and can't be batched. (Default: 5000)",
|
|
41
|
+
"type": [
|
|
42
|
+
"integer",
|
|
43
|
+
"null"
|
|
44
|
+
],
|
|
45
|
+
"format": "uint64",
|
|
46
|
+
"minimum": 0
|
|
47
|
+
},
|
|
48
|
+
"ecosystem": {
|
|
49
|
+
"description": "Ecosystem of the project.",
|
|
50
|
+
"$ref": "#/$defs/EcosystemTag"
|
|
51
|
+
},
|
|
36
52
|
"contracts": {
|
|
37
53
|
"description": "Global contract definitions that must contain all definitions except addresses. You can share a single handler/abi/event definitions for contracts across multiple chains.",
|
|
38
54
|
"type": [
|
|
@@ -47,7 +63,7 @@
|
|
|
47
63
|
"description": "Configuration of the blockchain chains that the project is deployed on.",
|
|
48
64
|
"type": "array",
|
|
49
65
|
"items": {
|
|
50
|
-
"$ref": "#/$defs/
|
|
66
|
+
"$ref": "#/$defs/Chain"
|
|
51
67
|
}
|
|
52
68
|
},
|
|
53
69
|
"raw_events": {
|
|
@@ -56,13 +72,6 @@
|
|
|
56
72
|
"boolean",
|
|
57
73
|
"null"
|
|
58
74
|
]
|
|
59
|
-
},
|
|
60
|
-
"handlers": {
|
|
61
|
-
"description": "Optional relative path to handlers directory for auto-loading. Defaults to 'src/handlers' if not specified.",
|
|
62
|
-
"type": [
|
|
63
|
-
"string",
|
|
64
|
-
"null"
|
|
65
|
-
]
|
|
66
75
|
}
|
|
67
76
|
},
|
|
68
77
|
"additionalProperties": false,
|
|
@@ -152,11 +161,11 @@
|
|
|
152
161
|
"call"
|
|
153
162
|
]
|
|
154
163
|
},
|
|
155
|
-
"
|
|
164
|
+
"Chain": {
|
|
156
165
|
"type": "object",
|
|
157
166
|
"properties": {
|
|
158
167
|
"id": {
|
|
159
|
-
"description": "Public chain
|
|
168
|
+
"description": "Public chain id",
|
|
160
169
|
"type": "integer",
|
|
161
170
|
"format": "uint64",
|
|
162
171
|
"minimum": 0
|
|
@@ -188,18 +197,20 @@
|
|
|
188
197
|
]
|
|
189
198
|
},
|
|
190
199
|
"contracts": {
|
|
191
|
-
"description": "All the contracts that should be indexed on the given
|
|
192
|
-
"type":
|
|
200
|
+
"description": "All the contracts that should be indexed on the given chain",
|
|
201
|
+
"type": [
|
|
202
|
+
"array",
|
|
203
|
+
"null"
|
|
204
|
+
],
|
|
193
205
|
"items": {
|
|
194
|
-
"$ref": "#/$defs/
|
|
206
|
+
"$ref": "#/$defs/ChainContract_for_ContractConfig"
|
|
195
207
|
}
|
|
196
208
|
}
|
|
197
209
|
},
|
|
198
210
|
"additionalProperties": false,
|
|
199
211
|
"required": [
|
|
200
212
|
"id",
|
|
201
|
-
"start_block"
|
|
202
|
-
"contracts"
|
|
213
|
+
"start_block"
|
|
203
214
|
]
|
|
204
215
|
},
|
|
205
216
|
"HyperfuelConfig": {
|
|
@@ -215,7 +226,7 @@
|
|
|
215
226
|
"url"
|
|
216
227
|
]
|
|
217
228
|
},
|
|
218
|
-
"
|
|
229
|
+
"ChainContract_for_ContractConfig": {
|
|
219
230
|
"type": "object",
|
|
220
231
|
"properties": {
|
|
221
232
|
"name": {
|
|
@@ -227,7 +238,7 @@
|
|
|
227
238
|
"$ref": "#/$defs/Addresses"
|
|
228
239
|
},
|
|
229
240
|
"start_block": {
|
|
230
|
-
"description": "The block at which the indexer should start ingesting data for this specific contract. If not specified, uses the
|
|
241
|
+
"description": "The block at which the indexer should start ingesting data for this specific contract. If not specified, uses the chain start_block. Can be greater than the chain start_block for more specific indexing.",
|
|
231
242
|
"type": [
|
|
232
243
|
"integer",
|
|
233
244
|
"null"
|
package/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envio",
|
|
3
|
-
"version": "v3.0.0-alpha.
|
|
3
|
+
"version": "v3.0.0-alpha.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
|
|
6
6
|
"bin": "./bin.js",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
"node": ">=22.0.0"
|
|
30
30
|
},
|
|
31
31
|
"optionalDependencies": {
|
|
32
|
-
"envio-linux-x64": "v3.0.0-alpha.
|
|
33
|
-
"envio-linux-arm64": "v3.0.0-alpha.
|
|
34
|
-
"envio-darwin-x64": "v3.0.0-alpha.
|
|
35
|
-
"envio-darwin-arm64": "v3.0.0-alpha.
|
|
32
|
+
"envio-linux-x64": "v3.0.0-alpha.3",
|
|
33
|
+
"envio-linux-arm64": "v3.0.0-alpha.3",
|
|
34
|
+
"envio-darwin-x64": "v3.0.0-alpha.3",
|
|
35
|
+
"envio-darwin-arm64": "v3.0.0-alpha.3"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@clickhouse/client": "1.12.1",
|
|
@@ -48,7 +48,8 @@
|
|
|
48
48
|
"rescript-schema": "9.3.4",
|
|
49
49
|
"viem": "2.21.0",
|
|
50
50
|
"rescript-envsafe": "5.0.0",
|
|
51
|
-
"dotenv": "16.4.5"
|
|
51
|
+
"dotenv": "16.4.5",
|
|
52
|
+
"date-fns": "3.3.1"
|
|
52
53
|
},
|
|
53
54
|
"files": [
|
|
54
55
|
"bin.js",
|
package/src/Batch.res.mjs
CHANGED
|
@@ -80,7 +80,7 @@ function getProgressedChainsById(chainsBeforeBatch, batchSizePerChain, progressB
|
|
|
80
80
|
var progressedChain;
|
|
81
81
|
if (batchSize !== undefined) {
|
|
82
82
|
var leftItems = fetchState.buffer.slice(batchSize);
|
|
83
|
-
progressedChain = getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAfterBatch, FetchState.updateInternal(fetchState, undefined, undefined, undefined, leftItems, undefined), batchSize);
|
|
83
|
+
progressedChain = getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAfterBatch, FetchState.updateInternal(fetchState, undefined, undefined, undefined, leftItems, undefined, undefined), batchSize);
|
|
84
84
|
} else {
|
|
85
85
|
progressedChain = getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAfterBatch, chainBeforeBatch.fetchState, 0);
|
|
86
86
|
}
|