envio 3.0.0-alpha-main-clickhouse-sink → 3.0.0-alpha.0

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 (100) hide show
  1. package/bin.js +5 -3
  2. package/evm.schema.json +23 -6
  3. package/fuel.schema.json +17 -5
  4. package/index.d.ts +0 -27
  5. package/index.js +9 -6
  6. package/package.json +11 -7
  7. package/rescript.json +4 -3
  8. package/src/{Address.res.js → Address.res.mjs} +7 -6
  9. package/src/{Batch.res.js → Batch.res.mjs} +19 -18
  10. package/src/{ChainMap.res.js → ChainMap.res.mjs} +20 -19
  11. package/src/{Config.res.js → Config.res.mjs} +11 -10
  12. package/src/Envio.gen.ts +2 -15
  13. package/src/Envio.res +0 -36
  14. package/src/{Envio.res.js → Envio.res.mjs} +5 -16
  15. package/src/{ErrorHandling.res.js → ErrorHandling.res.mjs} +10 -9
  16. package/src/EventRegister.res +7 -0
  17. package/src/{EventRegister.res.js → EventRegister.res.mjs} +29 -18
  18. package/src/EventRegister.resi +1 -0
  19. package/src/{EventUtils.res.js → EventUtils.res.mjs} +10 -9
  20. package/src/{EvmTypes.res.js → EvmTypes.res.mjs} +5 -4
  21. package/src/{FetchState.res.js → FetchState.res.mjs} +44 -43
  22. package/src/{Hasura.res.js → Hasura.res.mjs} +25 -24
  23. package/src/{InMemoryStore.res.js → InMemoryStore.res.mjs} +19 -18
  24. package/src/{InMemoryTable.res.js → InMemoryTable.res.mjs} +21 -20
  25. package/src/Internal.gen.ts +1 -3
  26. package/src/Internal.res +9 -2
  27. package/src/{Internal.res.js → Internal.res.mjs} +21 -11
  28. package/src/{LazyLoader.res.js → LazyLoader.res.mjs} +14 -13
  29. package/src/{LoadManager.res.js → LoadManager.res.mjs} +11 -10
  30. package/src/{LogSelection.res.js → LogSelection.res.mjs} +14 -13
  31. package/src/{Logging.res.js → Logging.res.mjs} +37 -36
  32. package/src/{Persistence.res.js → Persistence.res.mjs} +22 -21
  33. package/src/{PgStorage.res.js → PgStorage.res.mjs} +58 -57
  34. package/src/Platform.res +4 -5
  35. package/src/{Platform.res.js → Platform.res.mjs} +10 -10
  36. package/src/{Prometheus.res.js → Prometheus.res.mjs} +66 -65
  37. package/src/{ReorgDetection.res.js → ReorgDetection.res.mjs} +12 -11
  38. package/src/{SafeCheckpointTracking.res.js → SafeCheckpointTracking.res.mjs} +6 -5
  39. package/src/{Sink.res.js → Sink.res.mjs} +6 -5
  40. package/src/{TableIndices.res.js → TableIndices.res.mjs} +8 -7
  41. package/src/{Throttler.res.js → Throttler.res.mjs} +7 -6
  42. package/src/{Time.res.js → Time.res.mjs} +8 -7
  43. package/src/{TopicFilter.res.js → TopicFilter.res.mjs} +18 -17
  44. package/src/Utils.res +40 -0
  45. package/src/{Utils.res.js → Utils.res.mjs} +68 -34
  46. package/src/bindings/BigDecimal.gen.ts +2 -2
  47. package/src/bindings/BigDecimal.res +5 -5
  48. package/src/bindings/BigDecimal.res.d.mts +5 -0
  49. package/src/bindings/{BigDecimal.res.js → BigDecimal.res.mjs} +10 -9
  50. package/src/bindings/BigInt.gen.ts +2 -2
  51. package/src/bindings/BigInt.res.d.mts +5 -0
  52. package/src/bindings/{BigInt.res.js → BigInt.res.mjs} +25 -24
  53. package/src/bindings/ClickHouse.res +2 -2
  54. package/src/bindings/{ClickHouse.res.js → ClickHouse.res.mjs} +22 -21
  55. package/src/bindings/Ethers.gen.ts +2 -2
  56. package/src/bindings/Ethers.res.d.mts +5 -0
  57. package/src/bindings/{Ethers.res.js → Ethers.res.mjs} +18 -17
  58. package/src/bindings/{Hrtime.res.js → Hrtime.res.mjs} +13 -12
  59. package/src/bindings/{Lodash.res.js → Lodash.res.mjs} +4 -3
  60. package/src/bindings/NodeJs.res +13 -1
  61. package/src/bindings/NodeJs.res.mjs +48 -0
  62. package/src/bindings/Pino.res +4 -4
  63. package/src/bindings/{Pino.res.js → Pino.res.mjs} +16 -15
  64. package/src/bindings/Postgres.res +2 -2
  65. package/src/bindings/{Postgres.res.js → Postgres.res.mjs} +4 -3
  66. package/src/bindings/{PromClient.res.js → PromClient.res.mjs} +6 -5
  67. package/src/bindings/{Promise.res.js → Promise.res.mjs} +6 -5
  68. package/src/bindings/{SDSL.res.js → SDSL.res.mjs} +3 -2
  69. package/src/bindings/{Viem.res.js → Viem.res.mjs} +9 -8
  70. package/src/bindings/vendored-lodash-fns.js +3 -35
  71. package/src/db/{EntityHistory.res.js → EntityHistory.res.mjs} +21 -20
  72. package/src/db/InternalTable.gen.ts +2 -2
  73. package/src/db/InternalTable.res +0 -2
  74. package/src/db/{InternalTable.res.js → InternalTable.res.mjs} +19 -19
  75. package/src/db/{Schema.res.js → Schema.res.mjs} +10 -9
  76. package/src/db/{Table.res.js → Table.res.mjs} +34 -33
  77. package/src/sources/{EventRouter.res.js → EventRouter.res.mjs} +17 -16
  78. package/src/sources/{Fuel.res.js → Fuel.res.mjs} +6 -5
  79. package/src/sources/{HyperFuel.res.js → HyperFuel.res.mjs} +14 -13
  80. package/src/sources/{HyperFuelClient.res.js → HyperFuelClient.res.mjs} +7 -6
  81. package/src/sources/{HyperFuelSource.res.js → HyperFuelSource.res.mjs} +28 -27
  82. package/src/sources/{HyperSync.res.js → HyperSync.res.mjs} +21 -20
  83. package/src/sources/HyperSyncClient.gen.ts +1 -1
  84. package/src/sources/HyperSyncClient.res +78 -20
  85. package/src/sources/{HyperSyncClient.res.js → HyperSyncClient.res.mjs} +32 -15
  86. package/src/sources/{HyperSyncJsonApi.res.js → HyperSyncJsonApi.res.mjs} +10 -9
  87. package/src/sources/HyperSyncSource.res +77 -9
  88. package/src/sources/{HyperSyncSource.res.js → HyperSyncSource.res.mjs} +99 -38
  89. package/src/sources/{Rpc.res.js → Rpc.res.mjs} +16 -15
  90. package/src/sources/{RpcSource.res.js → RpcSource.res.mjs} +40 -39
  91. package/src/sources/Source.res +1 -1
  92. package/src/sources/{Source.res.js → Source.res.mjs} +4 -3
  93. package/src/sources/SourceManager.res +12 -1
  94. package/src/sources/{SourceManager.res.js → SourceManager.res.mjs} +32 -21
  95. package/src/sources/vendored-fuel-abi-coder.js +94 -149
  96. package/src/vendored/{Rest.res.js → Rest.res.mjs} +12 -11
  97. package/src/bindings/NodeJs.res.js +0 -35
  98. /package/src/{Change.res.js → Change.res.mjs} +0 -0
  99. /package/src/{Indexer.res.js → Indexer.res.mjs} +0 -0
  100. /package/src/bindings/{Express.res.js → Express.res.mjs} +0 -0
@@ -8,6 +8,7 @@ let startRegistration: (
8
8
  ~multichain: Config.multichain,
9
9
  ~preloadHandlers: bool,
10
10
  ) => unit
11
+ let isPendingRegistration: unit => bool
11
12
  let finishRegistration: unit => registrations
12
13
 
13
14
  type t
@@ -1,9 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var $$BigInt = require("./bindings/BigInt.res.js");
5
- var Js_exn = require("rescript/lib/js/js_exn.js");
6
- var Caml_obj = require("rescript/lib/js/caml_obj.js");
3
+ import * as $$BigInt from "./bindings/BigInt.res.mjs";
4
+ import * as Js_exn from "rescript/lib/es6/js_exn.js";
5
+ import * as Caml_obj from "rescript/lib/es6/caml_obj.js";
7
6
 
8
7
  function getOrderedBatchItemComparator(item) {
9
8
  if (item.kind === 0) {
@@ -34,9 +33,11 @@ function getEventIdKeyString(chainId, eventId) {
34
33
  return chainIdStr + "_" + eventId;
35
34
  }
36
35
 
37
- exports.getOrderedBatchItemComparator = getOrderedBatchItemComparator;
38
- exports.isEarlier = isEarlier;
39
- exports.isEarlierUnordered = isEarlierUnordered;
40
- exports.packEventIndex = packEventIndex;
41
- exports.getEventIdKeyString = getEventIdKeyString;
36
+ export {
37
+ getOrderedBatchItemComparator ,
38
+ isEarlier ,
39
+ isEarlierUnordered ,
40
+ packEventIndex ,
41
+ getEventIdKeyString ,
42
+ }
42
43
  /* BigInt Not a pure module */
@@ -1,7 +1,6 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
3
+ import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
5
4
 
6
5
  var schema = S$RescriptSchema.setName(S$RescriptSchema.string, "EVM.Hex");
7
6
 
@@ -11,6 +10,8 @@ var Hex = {
11
10
 
12
11
  var Abi = {};
13
12
 
14
- exports.Hex = Hex;
15
- exports.Abi = Abi;
13
+ export {
14
+ Hex ,
15
+ Abi ,
16
+ }
16
17
  /* schema Not a pure module */
@@ -1,19 +1,18 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Caml = require("rescript/lib/js/caml.js");
5
- var Utils = require("./Utils.res.js");
6
- var Js_exn = require("rescript/lib/js/js_exn.js");
7
- var Js_dict = require("rescript/lib/js/js_dict.js");
8
- var Js_math = require("rescript/lib/js/js_math.js");
9
- var Logging = require("./Logging.res.js");
10
- var Belt_Int = require("rescript/lib/js/belt_Int.js");
11
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
12
- var Caml_int32 = require("rescript/lib/js/caml_int32.js");
13
- var Prometheus = require("./Prometheus.res.js");
14
- var Belt_Option = require("rescript/lib/js/belt_Option.js");
15
- var Belt_Result = require("rescript/lib/js/belt_Result.js");
16
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
3
+ import * as Caml from "rescript/lib/es6/caml.js";
4
+ import * as Utils from "./Utils.res.mjs";
5
+ import * as Js_exn from "rescript/lib/es6/js_exn.js";
6
+ import * as Js_dict from "rescript/lib/es6/js_dict.js";
7
+ import * as Js_math from "rescript/lib/es6/js_math.js";
8
+ import * as Logging from "./Logging.res.mjs";
9
+ import * as Belt_Int from "rescript/lib/es6/belt_Int.js";
10
+ import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
11
+ import * as Caml_int32 from "rescript/lib/es6/caml_int32.js";
12
+ import * as Prometheus from "./Prometheus.res.mjs";
13
+ import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
14
+ import * as Belt_Result from "rescript/lib/es6/belt_Result.js";
15
+ import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
17
16
 
18
17
  function mergeIntoPartition(p, target, maxAddrInPartition) {
19
18
  if (!p.selection.dependsOnAddresses) {
@@ -1048,33 +1047,35 @@ function getUnorderedMultichainProgressBlockNumberAt(fetchState, index) {
1048
1047
 
1049
1048
  var blockItemLogIndex = 16777216;
1050
1049
 
1051
- exports.mergeIntoPartition = mergeIntoPartition;
1052
- exports.bufferBlockNumber = bufferBlockNumber;
1053
- exports.bufferBlock = bufferBlock;
1054
- exports.compareBufferItem = compareBufferItem;
1055
- exports.blockItemLogIndex = blockItemLogIndex;
1056
- exports.updateInternal = updateInternal;
1057
- exports.numAddresses = numAddresses;
1058
- exports.warnDifferentContractType = warnDifferentContractType;
1059
- exports.registerDynamicContracts = registerDynamicContracts;
1060
- exports.UnexpectedPartitionNotFound = UnexpectedPartitionNotFound;
1061
- exports.UnexpectedMergeQueryResponse = UnexpectedMergeQueryResponse;
1062
- exports.handleQueryResult = handleQueryResult;
1063
- exports.makePartitionQuery = makePartitionQuery;
1064
- exports.startFetchingQueries = startFetchingQueries;
1065
- exports.addressesByContractNameCount = addressesByContractNameCount;
1066
- exports.addressesByContractNameGetAll = addressesByContractNameGetAll;
1067
- exports.isFullPartition = isFullPartition;
1068
- exports.getNextQuery = getNextQuery;
1069
- exports.getTimestampAt = getTimestampAt;
1070
- exports.hasReadyItem = hasReadyItem;
1071
- exports.getReadyItemsCount = getReadyItemsCount;
1072
- exports.make = make;
1073
- exports.bufferSize = bufferSize;
1074
- exports.rollbackPartition = rollbackPartition;
1075
- exports.rollback = rollback;
1076
- exports.isActivelyIndexing = isActivelyIndexing;
1077
- exports.isReadyToEnterReorgThreshold = isReadyToEnterReorgThreshold;
1078
- exports.sortForUnorderedBatch = sortForUnorderedBatch;
1079
- exports.getUnorderedMultichainProgressBlockNumberAt = getUnorderedMultichainProgressBlockNumberAt;
1050
+ export {
1051
+ mergeIntoPartition ,
1052
+ bufferBlockNumber ,
1053
+ bufferBlock ,
1054
+ compareBufferItem ,
1055
+ blockItemLogIndex ,
1056
+ updateInternal ,
1057
+ numAddresses ,
1058
+ warnDifferentContractType ,
1059
+ registerDynamicContracts ,
1060
+ UnexpectedPartitionNotFound ,
1061
+ UnexpectedMergeQueryResponse ,
1062
+ handleQueryResult ,
1063
+ makePartitionQuery ,
1064
+ startFetchingQueries ,
1065
+ addressesByContractNameCount ,
1066
+ addressesByContractNameGetAll ,
1067
+ isFullPartition ,
1068
+ getNextQuery ,
1069
+ getTimestampAt ,
1070
+ hasReadyItem ,
1071
+ getReadyItemsCount ,
1072
+ make ,
1073
+ bufferSize ,
1074
+ rollbackPartition ,
1075
+ rollback ,
1076
+ isActivelyIndexing ,
1077
+ isReadyToEnterReorgThreshold ,
1078
+ sortForUnorderedBatch ,
1079
+ getUnorderedMultichainProgressBlockNumberAt ,
1080
+ }
1080
1081
  /* Utils Not a pure module */
@@ -1,15 +1,14 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Rest = require("./vendored/Rest.res.js");
5
- var Table = require("./db/Table.res.js");
6
- var Utils = require("./Utils.res.js");
7
- var Schema = require("./db/Schema.res.js");
8
- var Logging = require("./Logging.res.js");
9
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
10
- var InternalTable = require("./db/InternalTable.res.js");
11
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
12
- var Caml_js_exceptions = require("rescript/lib/js/caml_js_exceptions.js");
3
+ import * as Rest from "./vendored/Rest.res.mjs";
4
+ import * as Table from "./db/Table.res.mjs";
5
+ import * as Utils from "./Utils.res.mjs";
6
+ import * as Schema from "./db/Schema.res.mjs";
7
+ import * as Logging from "./Logging.res.mjs";
8
+ import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
9
+ import * as InternalTable from "./db/InternalTable.res.mjs";
10
+ import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
11
+ import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
13
12
 
14
13
  function auth(s) {
15
14
  return {
@@ -296,18 +295,20 @@ async function trackDatabase(endpoint, auth, pgSchema, userEntities, aggregateEn
296
295
  return await executeBulkKeepGoing(endpoint, auth, allOperations);
297
296
  }
298
297
 
299
- exports.auth = auth;
300
- exports.responses = responses;
301
- exports.clearMetadataRoute = clearMetadataRoute;
302
- exports.trackTablesRoute = trackTablesRoute;
303
- exports.createSelectPermissionRoute = createSelectPermissionRoute;
304
- exports.rawBodyRoute = rawBodyRoute;
305
- exports.bulkKeepGoingRoute = bulkKeepGoingRoute;
306
- exports.bulkKeepGoingErrorsSchema = bulkKeepGoingErrorsSchema;
307
- exports.clearHasuraMetadata = clearHasuraMetadata;
308
- exports.trackTables = trackTables;
309
- exports.createSelectPermissionOperation = createSelectPermissionOperation;
310
- exports.createEntityRelationshipOperation = createEntityRelationshipOperation;
311
- exports.executeBulkKeepGoing = executeBulkKeepGoing;
312
- exports.trackDatabase = trackDatabase;
298
+ export {
299
+ auth ,
300
+ responses ,
301
+ clearMetadataRoute ,
302
+ trackTablesRoute ,
303
+ createSelectPermissionRoute ,
304
+ rawBodyRoute ,
305
+ bulkKeepGoingRoute ,
306
+ bulkKeepGoingErrorsSchema ,
307
+ clearHasuraMetadata ,
308
+ trackTables ,
309
+ createSelectPermissionOperation ,
310
+ createEntityRelationshipOperation ,
311
+ executeBulkKeepGoing ,
312
+ trackDatabase ,
313
+ }
313
314
  /* bulkKeepGoingErrorsSchema Not a pure module */
@@ -1,15 +1,14 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var $$Array = require("rescript/lib/js/array.js");
5
- var Utils = require("./Utils.res.js");
6
- var Js_dict = require("rescript/lib/js/js_dict.js");
7
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
8
- var EventUtils = require("./EventUtils.res.js");
9
- var ErrorHandling = require("./ErrorHandling.res.js");
10
- var InMemoryTable = require("./InMemoryTable.res.js");
11
- var InternalTable = require("./db/InternalTable.res.js");
12
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
3
+ import * as $$Array from "rescript/lib/es6/array.js";
4
+ import * as Utils from "./Utils.res.mjs";
5
+ import * as Js_dict from "rescript/lib/es6/js_dict.js";
6
+ import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
7
+ import * as EventUtils from "./EventUtils.res.mjs";
8
+ import * as ErrorHandling from "./ErrorHandling.res.mjs";
9
+ import * as InMemoryTable from "./InMemoryTable.res.mjs";
10
+ import * as InternalTable from "./db/InternalTable.res.mjs";
11
+ import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
13
12
 
14
13
  function hashRawEventsKey(key) {
15
14
  return EventUtils.getEventIdKeyString(key.chainId, key.eventId);
@@ -150,12 +149,14 @@ function setBatchDcs(inMemoryStore, batch, shouldSaveHistory) {
150
149
  }
151
150
  }
152
151
 
153
- exports.hashRawEventsKey = hashRawEventsKey;
154
- exports.EntityTables = EntityTables;
155
- exports.make = make$1;
156
- exports.clone = clone$1;
157
- exports.getEffectInMemTable = getEffectInMemTable;
158
- exports.getInMemTable = getInMemTable;
159
- exports.isRollingBack = isRollingBack;
160
- exports.setBatchDcs = setBatchDcs;
152
+ export {
153
+ hashRawEventsKey ,
154
+ EntityTables ,
155
+ make$1 as make,
156
+ clone$1 as clone,
157
+ getEffectInMemTable ,
158
+ getInMemTable ,
159
+ isRollingBack ,
160
+ setBatchDcs ,
161
+ }
161
162
  /* Utils Not a pure module */
@@ -1,16 +1,15 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Utils = require("./Utils.res.js");
5
- var Js_exn = require("rescript/lib/js/js_exn.js");
6
- var Lodash = require("./bindings/Lodash.res.js");
7
- var Js_dict = require("rescript/lib/js/js_dict.js");
8
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
9
- var Belt_Option = require("rescript/lib/js/belt_Option.js");
10
- var Caml_option = require("rescript/lib/js/caml_option.js");
11
- var TableIndices = require("./TableIndices.res.js");
12
- var ErrorHandling = require("./ErrorHandling.res.js");
13
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
3
+ import * as Utils from "./Utils.res.mjs";
4
+ import * as Js_exn from "rescript/lib/es6/js_exn.js";
5
+ import * as Lodash from "./bindings/Lodash.res.mjs";
6
+ import * as Js_dict from "rescript/lib/es6/js_dict.js";
7
+ import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
8
+ import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
9
+ import * as Caml_option from "rescript/lib/es6/caml_option.js";
10
+ import * as TableIndices from "./TableIndices.res.mjs";
11
+ import * as ErrorHandling from "./ErrorHandling.res.mjs";
12
+ import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
14
13
 
15
14
  function make(hash) {
16
15
  return {
@@ -357,13 +356,15 @@ var Entity = {
357
356
  clone: clone$1
358
357
  };
359
358
 
360
- exports.make = make;
361
- exports.set = set;
362
- exports.setByHash = setByHash;
363
- exports.hasByHash = hasByHash;
364
- exports.getUnsafeByHash = getUnsafeByHash;
365
- exports.get = get;
366
- exports.values = values;
367
- exports.clone = clone;
368
- exports.Entity = Entity;
359
+ export {
360
+ make ,
361
+ set ,
362
+ setByHash ,
363
+ hasByHash ,
364
+ getUnsafeByHash ,
365
+ get ,
366
+ values ,
367
+ clone ,
368
+ Entity ,
369
+ }
369
370
  /* Utils Not a pure module */
@@ -7,7 +7,7 @@ import type {GenericContractRegister as $$genericContractRegister} from './Types
7
7
 
8
8
  import type {Invalid as $$noEventFilters} from './Types.ts';
9
9
 
10
- import type {t as Address_t} from './Address.gen';
10
+ import type {t as Address_t} from './Address.gen.js';
11
11
 
12
12
  export type genericEvent<params,block,transaction> = {
13
13
  readonly params: params;
@@ -42,8 +42,6 @@ export type entityHandlerContext<entity> = {
42
42
  readonly deleteUnsafe: (_1:string) => void
43
43
  };
44
44
 
45
- export type chainInfo = { readonly isReady: boolean };
46
-
47
45
  export type genericHandlerWithLoader<loader,handler,eventFilters> = {
48
46
  readonly loader: loader;
49
47
  readonly handler: handler;
package/src/Internal.res CHANGED
@@ -54,11 +54,11 @@ type entityHandlerContext<'entity> = {
54
54
  deleteUnsafe: string => unit,
55
55
  }
56
56
 
57
- @genType
58
57
  type chainInfo = {
58
+ id: int,
59
59
  // true when the chain has completed initial sync and is processing live events
60
60
  // false during historical synchronization
61
- isReady: bool,
61
+ isLive: bool,
62
62
  }
63
63
 
64
64
  type chains = dict<chainInfo>
@@ -67,6 +67,7 @@ type loaderReturn
67
67
  type handlerContext = private {
68
68
  isPreload: bool,
69
69
  chains: chains,
70
+ chain: chainInfo,
70
71
  }
71
72
  type handlerArgs = {
72
73
  event: event,
@@ -209,6 +210,12 @@ external getItemBlockNumber: item => int = "blockNumber"
209
210
  @get
210
211
  external getItemLogIndex: item => int = "logIndex"
211
212
 
213
+ let getItemChainId = item =>
214
+ switch item {
215
+ | Event({chain}) => chain->ChainMap.Chain.toChainId
216
+ | Block({onBlockConfig: {chainId}}) => chainId
217
+ }
218
+
212
219
  @get
213
220
  external getItemDcs: item => option<dcs> = "dcs"
214
221
  @set
@@ -1,10 +1,17 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Table = require("./db/Table.res.js");
5
- var $$BigInt = require("./bindings/BigInt.res.js");
6
- var Address = require("./Address.res.js");
7
- var S$RescriptSchema = require("rescript-schema/src/S.res.js");
3
+ import * as Table from "./db/Table.res.mjs";
4
+ import * as $$BigInt from "./bindings/BigInt.res.mjs";
5
+ import * as Address from "./Address.res.mjs";
6
+ import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
7
+
8
+ function getItemChainId(item) {
9
+ if (item.kind === 0) {
10
+ return item.chain;
11
+ } else {
12
+ return item.onBlockConfig.chainId;
13
+ }
14
+ }
8
15
 
9
16
  var fuelSupplyParamsSchema = S$RescriptSchema.schema(function (s) {
10
17
  return {
@@ -39,10 +46,13 @@ function makeCacheTable(effectName) {
39
46
  ]);
40
47
  }
41
48
 
42
- exports.fuelSupplyParamsSchema = fuelSupplyParamsSchema;
43
- exports.fuelTransferParamsSchema = fuelTransferParamsSchema;
44
- exports.cacheTablePrefix = cacheTablePrefix;
45
- exports.cacheOutputSchema = cacheOutputSchema;
46
- exports.effectCacheItemRowsSchema = effectCacheItemRowsSchema;
47
- exports.makeCacheTable = makeCacheTable;
49
+ export {
50
+ getItemChainId ,
51
+ fuelSupplyParamsSchema ,
52
+ fuelTransferParamsSchema ,
53
+ cacheTablePrefix ,
54
+ cacheOutputSchema ,
55
+ effectCacheItemRowsSchema ,
56
+ makeCacheTable ,
57
+ }
48
58
  /* fuelSupplyParamsSchema Not a pure module */
@@ -1,12 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Utils = require("./Utils.res.js");
5
- var JsSdsl = require("js-sdsl");
6
- var Belt_Option = require("rescript/lib/js/belt_Option.js");
7
- var Caml_option = require("rescript/lib/js/caml_option.js");
8
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
9
- var Caml_js_exceptions = require("rescript/lib/js/caml_js_exceptions.js");
3
+ import * as Utils from "./Utils.res.mjs";
4
+ import * as JsSdsl from "js-sdsl";
5
+ import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
6
+ import * as Caml_option from "rescript/lib/es6/caml_option.js";
7
+ import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
8
+ import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
10
9
 
11
10
  var LoaderTimeout = /* @__PURE__ */Caml_exceptions.create("LazyLoader.LoaderTimeout");
12
11
 
@@ -108,10 +107,12 @@ function get(am, k) {
108
107
  return promise;
109
108
  }
110
109
 
111
- exports.LoaderTimeout = LoaderTimeout;
112
- exports.make = make;
113
- exports.deleteKey = deleteKey;
114
- exports.timeoutAfter = timeoutAfter;
115
- exports.loadNext = loadNext;
116
- exports.get = get;
110
+ export {
111
+ LoaderTimeout ,
112
+ make ,
113
+ deleteKey ,
114
+ timeoutAfter ,
115
+ loadNext ,
116
+ get ,
117
+ }
117
118
  /* Utils Not a pure module */
@@ -1,9 +1,8 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Utils = require("./Utils.res.js");
5
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
6
- var Caml_js_exceptions = require("rescript/lib/js/caml_js_exceptions.js");
3
+ import * as Utils from "./Utils.res.mjs";
4
+ import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
5
+ import * as Caml_js_exceptions from "rescript/lib/es6/caml_js_exceptions.js";
7
6
 
8
7
  var Call = {};
9
8
 
@@ -123,10 +122,12 @@ function call(loadManager, input, key, load, hasher, shouldGroup, hasInMemory, g
123
122
  return promise;
124
123
  }
125
124
 
126
- exports.Call = Call;
127
- exports.Group = Group;
128
- exports.make = make;
129
- exports.schedule = schedule;
130
- exports.noopHasher = noopHasher;
131
- exports.call = call;
125
+ export {
126
+ Call ,
127
+ Group ,
128
+ make ,
129
+ schedule ,
130
+ noopHasher ,
131
+ call ,
132
+ }
132
133
  /* Utils Not a pure module */
@@ -1,12 +1,11 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Utils = require("./Utils.res.js");
5
- var Js_exn = require("rescript/lib/js/js_exn.js");
6
- var Belt_Array = require("rescript/lib/js/belt_Array.js");
7
- var Belt_Option = require("rescript/lib/js/belt_Option.js");
8
- var Caml_option = require("rescript/lib/js/caml_option.js");
9
- var Caml_exceptions = require("rescript/lib/js/caml_exceptions.js");
3
+ import * as Utils from "./Utils.res.mjs";
4
+ import * as Js_exn from "rescript/lib/es6/js_exn.js";
5
+ import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
6
+ import * as Belt_Option from "rescript/lib/es6/belt_Option.js";
7
+ import * as Caml_option from "rescript/lib/es6/caml_option.js";
8
+ import * as Caml_exceptions from "rescript/lib/es6/caml_exceptions.js";
10
9
 
11
10
  var MissingRequiredTopic0 = /* @__PURE__ */Caml_exceptions.create("LogSelection.MissingRequiredTopic0");
12
11
 
@@ -194,10 +193,12 @@ function parseEventFiltersOrThrow(eventFilters, sighash, params, topic1Opt, topi
194
193
  };
195
194
  }
196
195
 
197
- exports.MissingRequiredTopic0 = MissingRequiredTopic0;
198
- exports.makeTopicSelection = makeTopicSelection;
199
- exports.hasFilters = hasFilters;
200
- exports.compressTopicSelections = compressTopicSelections;
201
- exports.make = make;
202
- exports.parseEventFiltersOrThrow = parseEventFiltersOrThrow;
196
+ export {
197
+ MissingRequiredTopic0 ,
198
+ makeTopicSelection ,
199
+ hasFilters ,
200
+ compressTopicSelections ,
201
+ make ,
202
+ parseEventFiltersOrThrow ,
203
+ }
203
204
  /* Utils Not a pure module */
@@ -1,13 +1,12 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
- 'use strict';
3
2
 
4
- var Pino = require("./bindings/Pino.res.js");
5
- var Pino$1 = require("pino");
6
- var Utils = require("./Utils.res.js");
7
- var Js_exn = require("rescript/lib/js/js_exn.js");
8
- var Js_dict = require("rescript/lib/js/js_dict.js");
9
- var Caml_obj = require("rescript/lib/js/caml_obj.js");
10
- var Caml_option = require("rescript/lib/js/caml_option.js");
3
+ import * as Pino from "./bindings/Pino.res.mjs";
4
+ import * as Pino$1 from "pino";
5
+ import * as Utils from "./Utils.res.mjs";
6
+ import * as Js_exn from "rescript/lib/es6/js_exn.js";
7
+ import * as Js_dict from "rescript/lib/es6/js_dict.js";
8
+ import * as Caml_obj from "rescript/lib/es6/caml_obj.js";
9
+ import * as Caml_option from "rescript/lib/es6/caml_option.js";
11
10
 
12
11
  var logLevels = Js_dict.fromArray([
13
12
  [
@@ -75,14 +74,14 @@ function makeLogger(logStrategy, logFilePath, defaultFileLogLevel, userLogLevel)
75
74
  switch (logStrategy) {
76
75
  case "ecs-file" :
77
76
  var newrecord = Caml_obj.obj_dup(Pino.ECS.make());
78
- return Pino$1((newrecord.customLevels = logLevels, newrecord), Pino$1.transport(pinoFile));
77
+ return Pino$1.pino((newrecord.customLevels = logLevels, newrecord), Pino$1.transport(pinoFile));
79
78
  case "ecs-console" :
80
79
  var newrecord$1 = Caml_obj.obj_dup(Pino.ECS.make());
81
- return Pino$1((newrecord$1.customLevels = logLevels, newrecord$1.level = userLogLevel, newrecord$1));
80
+ return Pino$1.pino((newrecord$1.customLevels = logLevels, newrecord$1.level = userLogLevel, newrecord$1));
82
81
  case "ecs-console-multistream" :
83
82
  return makeMultiStreamLogger(undefined, Pino.ECS.make());
84
83
  case "file-only" :
85
- return Pino$1({
84
+ return Pino$1.pino({
86
85
  level: defaultFileLogLevel,
87
86
  customLevels: logLevels
88
87
  }, Pino$1.transport(pinoFile));
@@ -262,29 +261,31 @@ function getUserLogger(item) {
262
261
  };
263
262
  }
264
263
 
265
- exports.logLevels = logLevels;
266
- exports.makeLogger = makeLogger;
267
- exports.setLogger = setLogger;
268
- exports.getLogger = getLogger;
269
- exports.setLogLevel = setLogLevel;
270
- exports.trace = trace;
271
- exports.debug = debug;
272
- exports.info = info;
273
- exports.warn = warn;
274
- exports.error = error;
275
- exports.errorWithExn = errorWithExn;
276
- exports.fatal = fatal;
277
- exports.childTrace = childTrace;
278
- exports.childDebug = childDebug;
279
- exports.childInfo = childInfo;
280
- exports.childWarn = childWarn;
281
- exports.childError = childError;
282
- exports.childErrorWithExn = childErrorWithExn;
283
- exports.childFatal = childFatal;
284
- exports.createChild = createChild;
285
- exports.createChildFrom = createChildFrom;
286
- exports.getItemLogger = getItemLogger;
287
- exports.logForItem = logForItem;
288
- exports.noopLogger = noopLogger;
289
- exports.getUserLogger = getUserLogger;
264
+ export {
265
+ logLevels ,
266
+ makeLogger ,
267
+ setLogger ,
268
+ getLogger ,
269
+ setLogLevel ,
270
+ trace ,
271
+ debug ,
272
+ info ,
273
+ warn ,
274
+ error ,
275
+ errorWithExn ,
276
+ fatal ,
277
+ childTrace ,
278
+ childDebug ,
279
+ childInfo ,
280
+ childWarn ,
281
+ childError ,
282
+ childErrorWithExn ,
283
+ childFatal ,
284
+ createChild ,
285
+ createChildFrom ,
286
+ getItemLogger ,
287
+ logForItem ,
288
+ noopLogger ,
289
+ getUserLogger ,
290
+ }
290
291
  /* logLevels Not a pure module */