envio 3.0.2 → 3.1.0-rc.1

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 (101) hide show
  1. package/README.md +0 -1
  2. package/evm.schema.json +15 -8
  3. package/fuel.schema.json +19 -12
  4. package/index.d.ts +0 -2
  5. package/package.json +6 -7
  6. package/rescript.json +1 -1
  7. package/src/Batch.res +4 -214
  8. package/src/Batch.res.mjs +6 -165
  9. package/src/ChainFetcher.res +12 -28
  10. package/src/ChainFetcher.res.mjs +8 -17
  11. package/src/ChainManager.res +10 -9
  12. package/src/ChainManager.res.mjs +6 -10
  13. package/src/Config.res +9 -25
  14. package/src/Config.res.mjs +17 -27
  15. package/src/Core.res +7 -0
  16. package/src/Ctx.res +1 -0
  17. package/src/Env.res +0 -8
  18. package/src/Env.res.mjs +0 -6
  19. package/src/EventConfigBuilder.res +13 -123
  20. package/src/EventConfigBuilder.res.mjs +6 -73
  21. package/src/EventProcessing.res +5 -29
  22. package/src/EventProcessing.res.mjs +11 -20
  23. package/src/EventUtils.res +0 -27
  24. package/src/EventUtils.res.mjs +0 -24
  25. package/src/FetchState.res +2 -15
  26. package/src/FetchState.res.mjs +3 -18
  27. package/src/GlobalState.res +26 -39
  28. package/src/GlobalState.res.mjs +12 -40
  29. package/src/HandlerLoader.res +6 -5
  30. package/src/HandlerLoader.res.mjs +27 -9
  31. package/src/HandlerRegister.res +1 -12
  32. package/src/HandlerRegister.res.mjs +1 -6
  33. package/src/HandlerRegister.resi +1 -1
  34. package/src/Hasura.res +96 -32
  35. package/src/Hasura.res.mjs +93 -38
  36. package/src/InMemoryStore.res +205 -45
  37. package/src/InMemoryStore.res.mjs +157 -40
  38. package/src/InMemoryTable.res +165 -249
  39. package/src/InMemoryTable.res.mjs +156 -227
  40. package/src/Internal.res +10 -34
  41. package/src/Internal.res.mjs +9 -3
  42. package/src/LoadLayer.res +5 -5
  43. package/src/LoadLayer.res.mjs +5 -5
  44. package/src/LogSelection.res +15 -19
  45. package/src/LogSelection.res.mjs +5 -6
  46. package/src/Main.res +4 -6
  47. package/src/Main.res.mjs +26 -15
  48. package/src/Persistence.res +7 -132
  49. package/src/Persistence.res.mjs +1 -102
  50. package/src/PgStorage.res +57 -40
  51. package/src/PgStorage.res.mjs +60 -34
  52. package/src/ReorgDetection.res +35 -58
  53. package/src/ReorgDetection.res.mjs +21 -29
  54. package/src/SimulateItems.res.mjs +21 -3
  55. package/src/Sink.res +2 -2
  56. package/src/Sink.res.mjs +1 -1
  57. package/src/TableIndices.res +9 -2
  58. package/src/TableIndices.res.mjs +7 -1
  59. package/src/TestIndexer.res +53 -60
  60. package/src/TestIndexer.res.mjs +77 -63
  61. package/src/TestIndexerProxyStorage.res +4 -14
  62. package/src/TestIndexerProxyStorage.res.mjs +1 -5
  63. package/src/UserContext.res +2 -4
  64. package/src/UserContext.res.mjs +4 -5
  65. package/src/Utils.res +0 -2
  66. package/src/Utils.res.mjs +0 -3
  67. package/src/bindings/ClickHouse.res +45 -38
  68. package/src/bindings/ClickHouse.res.mjs +16 -17
  69. package/src/bindings/Vitest.res +3 -0
  70. package/src/db/InternalTable.res +59 -18
  71. package/src/db/InternalTable.res.mjs +82 -51
  72. package/src/db/Table.res +9 -2
  73. package/src/db/Table.res.mjs +10 -7
  74. package/src/sources/EnvioApiClient.res +15 -0
  75. package/src/sources/EnvioApiClient.res.mjs +24 -0
  76. package/src/sources/EvmChain.res +32 -10
  77. package/src/sources/EvmChain.res.mjs +31 -5
  78. package/src/sources/HyperFuelSource.res +15 -58
  79. package/src/sources/HyperFuelSource.res.mjs +20 -39
  80. package/src/sources/HyperSync.res +54 -100
  81. package/src/sources/HyperSync.res.mjs +67 -96
  82. package/src/sources/HyperSync.resi +4 -22
  83. package/src/sources/HyperSyncClient.res +70 -247
  84. package/src/sources/HyperSyncClient.res.mjs +47 -46
  85. package/src/sources/HyperSyncSource.res +94 -166
  86. package/src/sources/HyperSyncSource.res.mjs +100 -127
  87. package/src/sources/RpcSource.res +43 -22
  88. package/src/sources/RpcSource.res.mjs +50 -35
  89. package/src/sources/SimulateSource.res +1 -7
  90. package/src/sources/SimulateSource.res.mjs +1 -7
  91. package/src/sources/Source.res +10 -1
  92. package/src/sources/Source.res.mjs +3 -0
  93. package/src/sources/SourceManager.res +177 -8
  94. package/src/sources/SourceManager.res.mjs +141 -3
  95. package/src/sources/SourceManager.resi +19 -0
  96. package/src/tui/Tui.res +44 -6
  97. package/src/tui/Tui.res.mjs +56 -8
  98. package/src/tui/components/TuiData.res +3 -0
  99. package/svm.schema.json +11 -4
  100. package/src/sources/HyperSyncJsonApi.res +0 -390
  101. package/src/sources/HyperSyncJsonApi.res.mjs +0 -237
@@ -1,237 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Utils from "../Utils.res.mjs";
4
- import * as Address from "../Address.res.mjs";
5
- import * as EvmTypes from "../EvmTypes.res.mjs";
6
- import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
7
-
8
- let blockFieldOptionsSchema = S$RescriptSchema.$$enum([
9
- "number",
10
- "hash",
11
- "parent_hash",
12
- "nonce",
13
- "sha3_uncles",
14
- "logs_bloom",
15
- "transactions_root",
16
- "state_root",
17
- "receipts_root",
18
- "miner",
19
- "difficulty",
20
- "total_difficulty",
21
- "extra_data",
22
- "size",
23
- "gas_limit",
24
- "gas_used",
25
- "timestamp",
26
- "uncles",
27
- "base_fee_per_gas"
28
- ]);
29
-
30
- let blockFieldSelectionSchema = S$RescriptSchema.array(blockFieldOptionsSchema);
31
-
32
- let transactionFieldOptionsSchema = S$RescriptSchema.$$enum([
33
- "block_hash",
34
- "block_number",
35
- "from",
36
- "gas",
37
- "gas_price",
38
- "hash",
39
- "input",
40
- "nonce",
41
- "to",
42
- "transaction_index",
43
- "value",
44
- "v",
45
- "r",
46
- "s",
47
- "max_priority_fee_per_gas",
48
- "max_fee_per_gas",
49
- "chain_id",
50
- "cumulative_gas_used",
51
- "effective_gas_price",
52
- "gas_used",
53
- "contract_address",
54
- "logs_bloom",
55
- "type",
56
- "root",
57
- "status",
58
- "sighash"
59
- ]);
60
-
61
- let transactionFieldSelectionSchema = S$RescriptSchema.array(transactionFieldOptionsSchema);
62
-
63
- let logFieldOptionsSchema = S$RescriptSchema.$$enum([
64
- "removed",
65
- "log_index",
66
- "transaction_index",
67
- "transaction_hash",
68
- "block_hash",
69
- "block_number",
70
- "address",
71
- "data",
72
- "topic0",
73
- "topic1",
74
- "topic2",
75
- "topic3"
76
- ]);
77
-
78
- let logFieldSelectionSchema = S$RescriptSchema.array(logFieldOptionsSchema);
79
-
80
- let fieldSelectionSchema = S$RescriptSchema.object(s => ({
81
- block: s.f("block", S$RescriptSchema.option(blockFieldSelectionSchema)),
82
- transaction: s.f("transaction", S$RescriptSchema.option(transactionFieldSelectionSchema)),
83
- log: s.f("log", S$RescriptSchema.option(logFieldSelectionSchema))
84
- }));
85
-
86
- let logParamsSchema = S$RescriptSchema.object(s => ({
87
- address: s.f("address", S$RescriptSchema.option(S$RescriptSchema.array(Address.schema))),
88
- topics: s.f("topics", S$RescriptSchema.array(S$RescriptSchema.array(EvmTypes.Hex.schema)))
89
- }));
90
-
91
- let transactionParamsSchema = S$RescriptSchema.object(s => ({
92
- from: s.f("from", S$RescriptSchema.option(S$RescriptSchema.array(Address.schema))),
93
- to: s.f("to", S$RescriptSchema.option(S$RescriptSchema.array(Address.schema))),
94
- sighash: s.f("sighash", S$RescriptSchema.option(S$RescriptSchema.array(S$RescriptSchema.string)))
95
- }));
96
-
97
- let postQueryBodySchema = S$RescriptSchema.object(s => ({
98
- fromBlock: s.f("from_block", S$RescriptSchema.int),
99
- toBlockExclusive: s.f("to_block", S$RescriptSchema.option(S$RescriptSchema.int)),
100
- logs: s.f("logs", S$RescriptSchema.option(S$RescriptSchema.array(logParamsSchema))),
101
- transactions: s.f("transactions", S$RescriptSchema.option(S$RescriptSchema.array(transactionParamsSchema))),
102
- fieldSelection: s.f("field_selection", fieldSelectionSchema),
103
- maxNumLogs: s.f("max_num_logs", S$RescriptSchema.option(S$RescriptSchema.int)),
104
- includeAllBlocks: s.f("include_all_blocks", S$RescriptSchema.option(S$RescriptSchema.bool))
105
- }));
106
-
107
- let QueryTypes = {
108
- blockFieldOptionsSchema: blockFieldOptionsSchema,
109
- blockFieldSelectionSchema: blockFieldSelectionSchema,
110
- transactionFieldOptionsSchema: transactionFieldOptionsSchema,
111
- transactionFieldSelectionSchema: transactionFieldSelectionSchema,
112
- logFieldOptionsSchema: logFieldOptionsSchema,
113
- logFieldSelectionSchema: logFieldSelectionSchema,
114
- fieldSelectionSchema: fieldSelectionSchema,
115
- logParamsSchema: logParamsSchema,
116
- transactionParamsSchema: transactionParamsSchema,
117
- postQueryBodySchema: postQueryBodySchema
118
- };
119
-
120
- let blockDataSchema = S$RescriptSchema.object(s => ({
121
- number: s.f("number", S$RescriptSchema.option(S$RescriptSchema.int)),
122
- hash: s.f("hash", S$RescriptSchema.option(S$RescriptSchema.string)),
123
- parentHash: s.f("parent_hash", S$RescriptSchema.option(S$RescriptSchema.string)),
124
- nonce: s.f("nonce", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.int))),
125
- sha3Uncles: s.f("sha3_uncles", S$RescriptSchema.option(S$RescriptSchema.string)),
126
- logsBloom: s.f("logs_bloom", S$RescriptSchema.option(S$RescriptSchema.string)),
127
- transactionsRoot: s.f("transactions_root", S$RescriptSchema.option(S$RescriptSchema.string)),
128
- stateRoot: s.f("state_root", S$RescriptSchema.option(S$RescriptSchema.string)),
129
- receiptsRoot: s.f("receipts_root", S$RescriptSchema.option(S$RescriptSchema.string)),
130
- miner: s.f("miner", S$RescriptSchema.option(S$RescriptSchema.string)),
131
- difficulty: s.f("difficulty", S$RescriptSchema.option(S$RescriptSchema.$$null(Utils.$$BigInt.schema))),
132
- totalDifficulty: s.f("total_difficulty", S$RescriptSchema.option(S$RescriptSchema.$$null(Utils.$$BigInt.schema))),
133
- extraData: s.f("extra_data", S$RescriptSchema.option(S$RescriptSchema.string)),
134
- size: s.f("size", S$RescriptSchema.option(Utils.$$BigInt.schema)),
135
- gasLimit: s.f("gas_limit", S$RescriptSchema.option(Utils.$$BigInt.schema)),
136
- gasUsed: s.f("gas_used", S$RescriptSchema.option(Utils.$$BigInt.schema)),
137
- timestamp: s.f("timestamp", S$RescriptSchema.option(Utils.$$BigInt.schema)),
138
- uncles: s.f("unclus", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
139
- baseFeePerGas: s.f("base_fee_per_gas", S$RescriptSchema.option(S$RescriptSchema.$$null(Utils.$$BigInt.schema)))
140
- }));
141
-
142
- let transactionDataSchema = S$RescriptSchema.object(s => ({
143
- blockHash: s.f("block_hash", S$RescriptSchema.option(S$RescriptSchema.string)),
144
- blockNumber: s.f("block_number", S$RescriptSchema.option(S$RescriptSchema.int)),
145
- from: s.f("from", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
146
- gas: s.f("gas", S$RescriptSchema.option(Utils.$$BigInt.schema)),
147
- gasPrice: s.f("gas_price", S$RescriptSchema.option(S$RescriptSchema.$$null(Utils.$$BigInt.schema))),
148
- hash: s.f("hash", S$RescriptSchema.option(S$RescriptSchema.string)),
149
- input: s.f("input", S$RescriptSchema.option(S$RescriptSchema.string)),
150
- nonce: s.f("nonce", S$RescriptSchema.option(S$RescriptSchema.int)),
151
- to: s.f("to", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
152
- transactionIndex: s.f("transaction_index", S$RescriptSchema.option(S$RescriptSchema.int)),
153
- value: s.f("value", S$RescriptSchema.option(Utils.$$BigInt.schema)),
154
- v: s.f("v", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
155
- r: s.f("r", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
156
- s: s.f("s", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
157
- maxPriorityFeePerGas: s.f("max_priority_fee_per_gas", S$RescriptSchema.option(S$RescriptSchema.$$null(Utils.$$BigInt.schema))),
158
- maxFeePerGas: s.f("max_fee_per_gas", S$RescriptSchema.option(S$RescriptSchema.$$null(Utils.$$BigInt.schema))),
159
- chainId: s.f("chain_id", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.int))),
160
- cumulativeGasUsed: s.f("cumulative_gas_used", S$RescriptSchema.option(Utils.$$BigInt.schema)),
161
- effectiveGasPrice: s.f("effective_gas_price", S$RescriptSchema.option(Utils.$$BigInt.schema)),
162
- gasUsed: s.f("gas_used", S$RescriptSchema.option(Utils.$$BigInt.schema)),
163
- contractAddress: s.f("contract_address", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
164
- logsBoom: s.f("logs_bloom", S$RescriptSchema.option(S$RescriptSchema.string)),
165
- type_: s.f("type", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.int))),
166
- root: s.f("root", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string))),
167
- status: s.f("status", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.int))),
168
- sighash: s.f("sighash", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.string)))
169
- }));
170
-
171
- let logDataSchema = S$RescriptSchema.object(s => ({
172
- removed: s.f("removed", S$RescriptSchema.option(S$RescriptSchema.$$null(S$RescriptSchema.bool))),
173
- index: s.f("log_index", S$RescriptSchema.option(S$RescriptSchema.int)),
174
- transactionIndex: s.f("transaction_index", S$RescriptSchema.option(S$RescriptSchema.int)),
175
- transactionHash: s.f("transaction_hash", S$RescriptSchema.option(S$RescriptSchema.string)),
176
- blockHash: s.f("block_hash", S$RescriptSchema.option(S$RescriptSchema.string)),
177
- blockNumber: s.f("block_number", S$RescriptSchema.option(S$RescriptSchema.int)),
178
- address: s.f("address", S$RescriptSchema.option(S$RescriptSchema.string)),
179
- data: s.f("data", S$RescriptSchema.option(S$RescriptSchema.string)),
180
- topic0: s.f("topic0", S$RescriptSchema.option(S$RescriptSchema.$$null(EvmTypes.Hex.schema))),
181
- topic1: s.f("topic1", S$RescriptSchema.option(S$RescriptSchema.$$null(EvmTypes.Hex.schema))),
182
- topic2: s.f("topic2", S$RescriptSchema.option(S$RescriptSchema.$$null(EvmTypes.Hex.schema))),
183
- topic3: s.f("topic3", S$RescriptSchema.option(S$RescriptSchema.$$null(EvmTypes.Hex.schema)))
184
- }));
185
-
186
- let dataSchema = S$RescriptSchema.object(s => ({
187
- blocks: s.f("blocks", S$RescriptSchema.option(S$RescriptSchema.array(blockDataSchema))),
188
- transactions: s.f("transactions", S$RescriptSchema.option(S$RescriptSchema.array(transactionDataSchema))),
189
- logs: s.f("logs", S$RescriptSchema.option(S$RescriptSchema.array(logDataSchema)))
190
- }));
191
-
192
- let queryResponseSchema = S$RescriptSchema.object(s => ({
193
- data: s.f("data", S$RescriptSchema.array(dataSchema)),
194
- archiveHeight: s.f("archive_height", S$RescriptSchema.int),
195
- nextBlock: s.f("next_block", S$RescriptSchema.int),
196
- totalTime: s.f("total_execution_time", S$RescriptSchema.int)
197
- }));
198
-
199
- let ResponseTypes = {
200
- blockDataSchema: blockDataSchema,
201
- transactionDataSchema: transactionDataSchema,
202
- logDataSchema: logDataSchema,
203
- dataSchema: dataSchema,
204
- queryResponseSchema: queryResponseSchema
205
- };
206
-
207
- function queryRoute() {
208
- return {
209
- method: "POST",
210
- path: "/query",
211
- input: s => ({
212
- query: s.body(postQueryBodySchema),
213
- token: s.auth("Bearer")
214
- }),
215
- responses: [s => s.data(queryResponseSchema)]
216
- };
217
- }
218
-
219
- function heightRoute() {
220
- return {
221
- method: "GET",
222
- path: "/height",
223
- input: s => s.auth("Bearer"),
224
- responses: [s => s.data(S$RescriptSchema.union([
225
- S$RescriptSchema.object(s => (s.f("height", S$RescriptSchema.int))),
226
- S$RescriptSchema.shape(S$RescriptSchema.string, s => (s))
227
- ]))]
228
- };
229
- }
230
-
231
- export {
232
- QueryTypes,
233
- ResponseTypes,
234
- queryRoute,
235
- heightRoute,
236
- }
237
- /* blockFieldOptionsSchema Not a pure module */