envio 3.3.0-alpha.3 → 3.3.0-alpha.5

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 (53) hide show
  1. package/evm.schema.json +10 -0
  2. package/package.json +7 -7
  3. package/src/Batch.res.mjs +1 -1
  4. package/src/Bin.res +3 -0
  5. package/src/Bin.res.mjs +4 -0
  6. package/src/ChainFetching.res +1 -3
  7. package/src/ChainFetching.res.mjs +3 -3
  8. package/src/ChainState.res +44 -19
  9. package/src/ChainState.res.mjs +25 -23
  10. package/src/ChainState.resi +3 -3
  11. package/src/Config.res +3 -0
  12. package/src/Config.res.mjs +3 -1
  13. package/src/Core.res +0 -3
  14. package/src/Ecosystem.res +0 -4
  15. package/src/EventConfigBuilder.res +3 -0
  16. package/src/EventConfigBuilder.res.mjs +7 -1
  17. package/src/FetchState.res +73 -160
  18. package/src/FetchState.res.mjs +120 -222
  19. package/src/IndexingAddresses.res +105 -0
  20. package/src/IndexingAddresses.res.mjs +100 -0
  21. package/src/IndexingAddresses.resi +32 -0
  22. package/src/Internal.res +5 -0
  23. package/src/Main.res +21 -24
  24. package/src/Main.res.mjs +21 -20
  25. package/src/Metrics.res +33 -0
  26. package/src/Metrics.res.mjs +39 -0
  27. package/src/Prometheus.res +2 -20
  28. package/src/Prometheus.res.mjs +83 -95
  29. package/src/SimulateItems.res +4 -0
  30. package/src/TestIndexer.res +43 -17
  31. package/src/TestIndexer.res.mjs +16 -9
  32. package/src/bindings/Viem.res +0 -41
  33. package/src/bindings/Viem.res.mjs +1 -43
  34. package/src/sources/Evm.res +17 -39
  35. package/src/sources/Evm.res.mjs +8 -40
  36. package/src/sources/EvmChain.res +3 -1
  37. package/src/sources/EvmChain.res.mjs +2 -1
  38. package/src/sources/EvmRpcClient.res +36 -5
  39. package/src/sources/EvmRpcClient.res.mjs +7 -4
  40. package/src/sources/Fuel.res +0 -2
  41. package/src/sources/Fuel.res.mjs +0 -1
  42. package/src/sources/HyperSyncClient.res +0 -35
  43. package/src/sources/HyperSyncClient.res.mjs +1 -8
  44. package/src/sources/Rpc.res +15 -47
  45. package/src/sources/Rpc.res.mjs +25 -56
  46. package/src/sources/RpcSource.res +30 -73
  47. package/src/sources/RpcSource.res.mjs +24 -73
  48. package/src/sources/SourceManager.res +1 -1
  49. package/src/sources/SourceManager.res.mjs +1 -1
  50. package/src/sources/Svm.res +10 -17
  51. package/src/sources/Svm.res.mjs +6 -18
  52. package/src/sources/TransactionStore.res +98 -76
  53. package/src/sources/TransactionStore.res.mjs +49 -35
@@ -224,7 +224,7 @@ let getSuggestedBlockIntervalFromExn = {
224
224
  }
225
225
 
226
226
  type eventBatchQuery = {
227
- logs: array<Rpc.GetLogs.log>,
227
+ items: array<EvmRpcClient.rpcEventItem>,
228
228
  latestFetchedBlockInfo: blockInfo,
229
229
  }
230
230
 
@@ -234,10 +234,10 @@ let getNextPage = (
234
234
  ~fromBlock,
235
235
  ~toBlock,
236
236
  ~addresses,
237
- ~topicQuery,
237
+ ~topicQuery: Rpc.GetLogs.topicQuery,
238
238
  ~loadBlock,
239
239
  ~syncConfig as sc: Config.sourceSync,
240
- ~client,
240
+ ~rpcClient: EvmRpcClient.t,
241
241
  ~mutSuggestedBlockIntervals,
242
242
  ~partitionId,
243
243
  ~sourceName,
@@ -253,17 +253,20 @@ let getNextPage = (
253
253
 
254
254
  let latestFetchedBlockPromise = loadBlock(toBlock)
255
255
  Prometheus.SourceRequestCount.increment(~sourceName, ~chainId, ~method="eth_getLogs")
256
- let logsPromise = Rpc.getLogs(
257
- ~client,
258
- ~param={
259
- address: ?addresses,
260
- topics: topicQuery,
261
- fromBlock,
262
- toBlock,
263
- },
264
- )->Promise.then(async logs => {
256
+ let logsPromise = rpcClient.getLogs({
257
+ fromBlock,
258
+ toBlock,
259
+ ?addresses,
260
+ topics: topicQuery->Array.map(filter =>
261
+ switch filter {
262
+ | Rpc.GetLogs.Null => Nullable.null
263
+ | Single(topic) => Nullable.make([topic])
264
+ | Multiple(topics) => Nullable.make(topics)
265
+ }
266
+ ),
267
+ })->Promise.then(async items => {
265
268
  {
266
- logs,
269
+ items,
267
270
  latestFetchedBlockInfo: await latestFetchedBlockPromise,
268
271
  }
269
272
  })
@@ -855,6 +858,7 @@ type options = {
855
858
  allEventParams: array<HyperSyncClient.Decoder.eventParamsInput>,
856
859
  lowercaseAddresses: bool,
857
860
  ws?: string,
861
+ headers?: dict<string>,
858
862
  }
859
863
 
860
864
  let make = (
@@ -867,6 +871,7 @@ let make = (
867
871
  allEventParams,
868
872
  lowercaseAddresses,
869
873
  ?ws,
874
+ ?headers,
870
875
  }: options,
871
876
  ): t => {
872
877
  let chainId = chain->ChainMap.Chain.toChainId
@@ -883,8 +888,13 @@ let make = (
883
888
 
884
889
  let mutSuggestedBlockIntervals = Dict.make()
885
890
 
886
- let client = Rpc.makeClient(url)
887
- let rpcClient = EvmRpcClient.make(~url)
891
+ let client = Rpc.makeClient(url, ~headers?)
892
+ let rpcClient = EvmRpcClient.make(
893
+ ~url,
894
+ ~allEventParams,
895
+ ~checksumAddresses=!lowercaseAddresses,
896
+ ~headers?,
897
+ )
888
898
 
889
899
  let makeTransactionLoader = () =>
890
900
  LazyLoader.make(
@@ -1000,36 +1010,6 @@ let make = (
1000
1010
  ~lowercaseAddresses,
1001
1011
  )
1002
1012
 
1003
- let convertLogToHyperSyncEvent = (log: Rpc.GetLogs.log): HyperSyncClient.ResponseTypes.event => {
1004
- let hyperSyncLog: HyperSyncClient.ResponseTypes.log = {
1005
- removed: log.removed,
1006
- index: log.logIndex,
1007
- transactionIndex: log.transactionIndex,
1008
- transactionHash: log.transactionHash,
1009
- blockHash: log.blockHash,
1010
- blockNumber: log.blockNumber,
1011
- address: log.address,
1012
- data: log.data,
1013
- topics: log.topics->(Utils.magic: array<string> => array<Nullable.t<EvmTypes.Hex.t>>),
1014
- }
1015
- {log: hyperSyncLog}
1016
- }
1017
-
1018
- let hscDecoder: ref<option<HyperSyncClient.Decoder.tWithParams>> = ref(None)
1019
- let getHscDecoder = () => {
1020
- switch hscDecoder.contents {
1021
- | Some(decoder) => decoder
1022
- | None => {
1023
- let decoder = HyperSyncClient.Decoder.fromParams(
1024
- allEventParams,
1025
- ~checksumAddresses=!lowercaseAddresses,
1026
- )
1027
- hscDecoder := Some(decoder)
1028
- decoder
1029
- }
1030
- }
1031
- }
1032
-
1033
1013
  let getItemsOrThrow = async (
1034
1014
  ~fromBlock,
1035
1015
  ~toBlock,
@@ -1073,7 +1053,7 @@ let make = (
1073
1053
  let {getLogSelectionOrThrow} = getSelectionConfig(selection)
1074
1054
  let {addresses, topicQuery} = getLogSelectionOrThrow(~addressesByContractName)
1075
1055
 
1076
- let {logs, latestFetchedBlockInfo} = await getNextPage(
1056
+ let {items, latestFetchedBlockInfo} = await getNextPage(
1077
1057
  ~fromBlock,
1078
1058
  ~toBlock=suggestedToBlock,
1079
1059
  ~addresses,
@@ -1083,7 +1063,7 @@ let make = (
1083
1063
  ->LazyLoader.get(blockNumber)
1084
1064
  ->Promise.thenResolve(parseBlockInfo),
1085
1065
  ~syncConfig,
1086
- ~client,
1066
+ ~rpcClient,
1087
1067
  ~mutSuggestedBlockIntervals,
1088
1068
  ~partitionId,
1089
1069
  ~sourceName=name,
@@ -1110,31 +1090,8 @@ let make = (
1110
1090
  )
1111
1091
  }
1112
1092
 
1113
- // Convert RPC logs to HyperSync events
1114
- let hyperSyncEvents = logs->Array.map(convertLogToHyperSyncEvent)
1115
-
1116
- // Decode using HyperSyncClient decoder
1117
- let parsedEvents = try await getHscDecoder().decodeLogs(hyperSyncEvents) catch {
1118
- | exn =>
1119
- throw(
1120
- Source.GetItemsError(
1121
- FailedGettingItems({
1122
- exn,
1123
- attemptedToBlock: toBlock,
1124
- retry: ImpossibleForTheQuery({
1125
- message: "Failed to parse events using hypersync client decoder. Please double-check your ABI.",
1126
- }),
1127
- }),
1128
- ),
1129
- )
1130
- }
1131
-
1132
- let parsedQueueItems = await logs
1133
- ->Array.zip(parsedEvents)
1134
- ->Array.filterMap(((
1135
- log: Rpc.GetLogs.log,
1136
- maybeDecodedEvent: Nullable.t<dict<Internal.eventParams>>,
1137
- )) => {
1093
+ let parsedQueueItems = await items
1094
+ ->Array.filterMap(({log, params: maybeDecodedEvent}: EvmRpcClient.rpcEventItem) => {
1138
1095
  let topic0 = log.topics[0]->Option.getOr("0x0")
1139
1096
  let routedAddress = if lowercaseAddresses {
1140
1097
  log.address->Address.Evm.fromAddressLowercaseOrThrow
@@ -1242,7 +1199,7 @@ let make = (
1242
1199
  | Some(b) => pushBlockInfo(b)
1243
1200
  | None => ()
1244
1201
  }
1245
- logs->Array.forEach(log =>
1202
+ items->Array.forEach(({log}) =>
1246
1203
  blockHashes
1247
1204
  ->Array.push({ReorgDetection.blockNumber: log.blockNumber, blockHash: log.blockHash})
1248
1205
  ->ignore
@@ -21,7 +21,6 @@ import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.js";
21
21
  import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
22
22
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
23
23
  import * as Stdlib_Promise from "@rescript/runtime/lib/es6/Stdlib_Promise.js";
24
- import * as HyperSyncClient from "./HyperSyncClient.res.mjs";
25
24
  import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
26
25
  import * as S$RescriptSchema from "rescript-schema/src/S.res.mjs";
27
26
  import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.js";
@@ -221,20 +220,28 @@ function getSuggestedBlockIntervalFromExn(exn) {
221
220
 
222
221
  let maxSuggestedBlockIntervalKey = "max";
223
222
 
224
- function getNextPage(fromBlock, toBlock, addresses, topicQuery, loadBlock, sc, client, mutSuggestedBlockIntervals, partitionId, sourceName, chainId) {
223
+ function getNextPage(fromBlock, toBlock, addresses, topicQuery, loadBlock, sc, rpcClient, mutSuggestedBlockIntervals, partitionId, sourceName, chainId) {
225
224
  let queryTimoutPromise = Time.resolvePromiseAfterDelay(sc.queryTimeoutMillis).then(() => Promise.reject({
226
225
  RE_EXN_ID: QueryTimout,
227
226
  _1: `Query took longer than ` + (sc.queryTimeoutMillis / 1000 | 0).toString() + ` seconds`
228
227
  }));
229
228
  let latestFetchedBlockPromise = loadBlock(toBlock);
230
229
  Prometheus.SourceRequestCount.increment(sourceName, chainId, "eth_getLogs");
231
- let logsPromise = Rpc.getLogs(client, {
230
+ let logsPromise = rpcClient.getLogs({
232
231
  fromBlock: fromBlock,
233
232
  toBlock: toBlock,
234
- address: addresses,
235
- topics: topicQuery
236
- }).then(async logs => ({
237
- logs: logs,
233
+ addresses: addresses,
234
+ topics: topicQuery.map(filter => {
235
+ if (filter === null) {
236
+ return null;
237
+ } else if (typeof filter === "string") {
238
+ return [filter];
239
+ } else {
240
+ return filter;
241
+ }
242
+ })
243
+ }).then(async items => ({
244
+ items: items,
238
245
  latestFetchedBlockInfo: await latestFetchedBlockPromise
239
246
  }));
240
247
  return Stdlib_Promise.$$catch(Promise.race([
@@ -918,8 +925,8 @@ function makeThrowingGetEventTransaction(getTransactionJson, getReceiptJson, low
918
925
  }
919
926
 
920
927
  function make(param) {
928
+ let headers = param.headers;
921
929
  let lowercaseAddresses = param.lowercaseAddresses;
922
- let allEventParams = param.allEventParams;
923
930
  let eventRouter = param.eventRouter;
924
931
  let chain = param.chain;
925
932
  let url = param.url;
@@ -929,8 +936,8 @@ function make(param) {
929
936
  let name = `RPC (` + urlHost + `)`;
930
937
  let getSelectionConfig = memoGetSelectionConfig(chain);
931
938
  let mutSuggestedBlockIntervals = {};
932
- let client = Rpc.makeClient(url);
933
- let rpcClient = EvmRpcClient.make(url, undefined);
939
+ let client = Rpc.makeClient(url, headers);
940
+ let rpcClient = EvmRpcClient.make(url, !lowercaseAddresses, undefined, headers, param.allEventParams);
934
941
  let makeTransactionLoader = () => LazyLoader.make(transactionHash => {
935
942
  Prometheus.SourceRequestCount.increment(name, chain, "eth_getTransactionByHash");
936
943
  return Rest.fetch(Rpc.GetTransactionByHash.rawRoute, transactionHash, client);
@@ -998,43 +1005,6 @@ function make(param) {
998
1005
  Error: new Error()
999
1006
  };
1000
1007
  }, lowercaseAddresses);
1001
- let convertLogToHyperSyncEvent = log => {
1002
- let hyperSyncLog_removed = log.removed;
1003
- let hyperSyncLog_logIndex = log.logIndex;
1004
- let hyperSyncLog_transactionIndex = log.transactionIndex;
1005
- let hyperSyncLog_transactionHash = log.transactionHash;
1006
- let hyperSyncLog_blockHash = log.blockHash;
1007
- let hyperSyncLog_blockNumber = log.blockNumber;
1008
- let hyperSyncLog_address = Primitive_option.some(log.address);
1009
- let hyperSyncLog_data = log.data;
1010
- let hyperSyncLog_topics = log.topics;
1011
- let hyperSyncLog = {
1012
- removed: hyperSyncLog_removed,
1013
- logIndex: hyperSyncLog_logIndex,
1014
- transactionIndex: hyperSyncLog_transactionIndex,
1015
- transactionHash: hyperSyncLog_transactionHash,
1016
- blockHash: hyperSyncLog_blockHash,
1017
- blockNumber: hyperSyncLog_blockNumber,
1018
- address: hyperSyncLog_address,
1019
- data: hyperSyncLog_data,
1020
- topics: hyperSyncLog_topics
1021
- };
1022
- return {
1023
- log: hyperSyncLog
1024
- };
1025
- };
1026
- let hscDecoder = {
1027
- contents: undefined
1028
- };
1029
- let getHscDecoder = () => {
1030
- let decoder = hscDecoder.contents;
1031
- if (decoder !== undefined) {
1032
- return decoder;
1033
- }
1034
- let decoder$1 = HyperSyncClient.Decoder.fromParams(allEventParams, !lowercaseAddresses);
1035
- hscDecoder.contents = decoder$1;
1036
- return decoder$1;
1037
- };
1038
1008
  let getItemsOrThrow = async (fromBlock, toBlock, addressesByContractName, contractNameByAddress, knownHeight, partitionId, selection, retry, param) => {
1039
1009
  let startFetchingBatchTimeRef = Performance.now();
1040
1010
  let maxSuggestedBlockInterval = mutSuggestedBlockIntervals[maxSuggestedBlockIntervalKey];
@@ -1044,42 +1014,22 @@ function make(param) {
1044
1014
  let firstBlockParentPromise = fromBlock > 0 ? LazyLoader.get(blockLoader.contents, fromBlock - 1 | 0).then(json => parseBlockInfo(json)) : Promise.resolve(undefined);
1045
1015
  let match = getSelectionConfig(selection);
1046
1016
  let match$1 = match.getLogSelectionOrThrow(addressesByContractName);
1047
- let match$2 = await getNextPage(fromBlock, suggestedToBlock, match$1.addresses, match$1.topicQuery, blockNumber => LazyLoader.get(blockLoader.contents, blockNumber).then(parseBlockInfo), syncConfig, client, mutSuggestedBlockIntervals, partitionId, name, chain);
1017
+ let match$2 = await getNextPage(fromBlock, suggestedToBlock, match$1.addresses, match$1.topicQuery, blockNumber => LazyLoader.get(blockLoader.contents, blockNumber).then(parseBlockInfo), syncConfig, rpcClient, mutSuggestedBlockIntervals, partitionId, name, chain);
1048
1018
  let latestFetchedBlockInfo = match$2.latestFetchedBlockInfo;
1049
- let logs = match$2.logs;
1019
+ let items = match$2.items;
1050
1020
  let executedBlockInterval = (suggestedToBlock - fromBlock | 0) + 1 | 0;
1051
1021
  if (executedBlockInterval >= suggestedBlockInterval && !(maxSuggestedBlockIntervalKey in mutSuggestedBlockIntervals)) {
1052
1022
  mutSuggestedBlockIntervals[partitionId] = Primitive_int.min(executedBlockInterval + syncConfig.accelerationAdditive | 0, syncConfig.intervalCeiling);
1053
1023
  }
1054
- let hyperSyncEvents = logs.map(convertLogToHyperSyncEvent);
1055
- let parsedEvents;
1056
- try {
1057
- parsedEvents = await getHscDecoder().decodeLogs(hyperSyncEvents);
1058
- } catch (raw_exn) {
1059
- let exn = Primitive_exceptions.internalToException(raw_exn);
1060
- throw {
1061
- RE_EXN_ID: Source.GetItemsError,
1062
- _1: {
1063
- TAG: "FailedGettingItems",
1064
- exn: exn,
1065
- attemptedToBlock: toBlock$1,
1066
- retry: {
1067
- TAG: "ImpossibleForTheQuery",
1068
- message: "Failed to parse events using hypersync client decoder. Please double-check your ABI."
1069
- }
1070
- },
1071
- Error: new Error()
1072
- };
1073
- }
1074
- let parsedQueueItems = await Promise.all(Stdlib_Array.filterMap(Stdlib_Array.zip(logs, parsedEvents), param => {
1075
- let log = param[0];
1024
+ let parsedQueueItems = await Promise.all(Stdlib_Array.filterMap(items, param => {
1025
+ let log = param.log;
1076
1026
  let topic0 = Stdlib_Option.getOr(log.topics[0], "0x0");
1077
1027
  let routedAddress = lowercaseAddresses ? Address.Evm.fromAddressLowercaseOrThrow(log.address) : Address.Evm.fromAddressOrThrow(log.address);
1078
1028
  let eventConfig = EventRouter.get(eventRouter, EventRouter.getEvmEventId(topic0, log.topics.length), routedAddress, contractNameByAddress);
1079
1029
  if (eventConfig === undefined) {
1080
1030
  return;
1081
1031
  }
1082
- let decoded = Stdlib_Option.flatMap(Primitive_option.fromNullable(param[1]), __x => __x[eventConfig.contractName]);
1032
+ let decoded = Stdlib_Option.flatMap(Primitive_option.fromNullable(param.params), __x => __x[eventConfig.contractName]);
1083
1033
  if (decoded === undefined) {
1084
1034
  return;
1085
1035
  }
@@ -1165,7 +1115,8 @@ function make(param) {
1165
1115
  if (optFirstBlockParent !== undefined) {
1166
1116
  pushBlockInfo(optFirstBlockParent);
1167
1117
  }
1168
- logs.forEach(log => {
1118
+ items.forEach(param => {
1119
+ let log = param.log;
1169
1120
  blockHashes.push({
1170
1121
  blockHash: log.blockHash,
1171
1122
  blockNumber: log.blockNumber
@@ -676,7 +676,7 @@ let executeQuery = async (
676
676
  ~fromBlock=query.fromBlock,
677
677
  ~toBlock,
678
678
  ~addressesByContractName=query.addressesByContractName,
679
- ~contractNameByAddress=query.contractNameByAddress,
679
+ ~contractNameByAddress=query.addressesByContractName->FetchState.deriveContractNameByAddress,
680
680
  ~partitionId=query.partitionId,
681
681
  ~knownHeight,
682
682
  ~selection=query.selection,
@@ -500,7 +500,7 @@ async function executeQuery(sourceManager, query, knownHeight, isRealtime) {
500
500
  retry: retry
501
501
  });
502
502
  try {
503
- let response = await source.getItemsOrThrow(query.fromBlock, toBlock, query.addressesByContractName, query.contractNameByAddress, knownHeight, query.partitionId, query.selection, retry, logger$2);
503
+ let response = await source.getItemsOrThrow(query.fromBlock, toBlock, query.addressesByContractName, FetchState.deriveContractNameByAddress(query.addressesByContractName), knownHeight, query.partitionId, query.selection, retry, logger$2);
504
504
  sourceState.lastFailedAt = undefined;
505
505
  responseRef = response;
506
506
  } catch (raw_error) {
@@ -4,23 +4,17 @@ let cleanUpRawEventFieldsInPlace: JSON.t => unit = %raw(`fields => {
4
4
  delete fields.time
5
5
  }`)
6
6
 
7
- // Ordered transaction field names. The index of each is the field code shared
8
- // with the Rust store (`SvmTxField`) keep this order in sync.
9
- let transactionFields = [
10
- "transactionIndex",
11
- "signatures",
12
- "feePayer",
13
- "success",
14
- "err",
15
- "fee",
16
- "computeUnitsConsumed",
17
- "accountKeys",
18
- "recentBlockhash",
19
- "version",
20
- "tokenBalances",
21
- ]
7
+ // Ordered transaction field names, the field codes shared with the Rust store
8
+ // (`SvmTxField`). Derived from the typed field list so the two can't drift;
9
+ // `Internal.allSvmTransactionFields` is pinned to the Rust ordinal order by a test.
10
+ let transactionFields =
11
+ Internal.allSvmTransactionFields->(
12
+ Utils.magic: array<Internal.svmTransactionField> => array<string>
13
+ )
22
14
 
23
- let transactionFieldMask = TransactionStore.makeMaskFn(transactionFields)
15
+ // One instruction's selected transaction fields → store selection bitmask.
16
+ // Computed per event at config build and cached on the event config.
17
+ let eventTransactionFieldMask = TransactionStore.makeMaskFn(transactionFields)
24
18
 
25
19
  let make = (~logger: Pino.t): Ecosystem.t => {
26
20
  name: Svm,
@@ -36,7 +30,6 @@ let make = (~logger: Pino.t): Ecosystem.t => {
36
30
  // parse. The schema is a no-op object that always surfaces `None`.
37
31
  onEventBlockFilterSchema: S.object(_ => None),
38
32
  logger,
39
- transactionFieldMask,
40
33
  toEvent: eventItem => eventItem.payload->(Utils.magic: Internal.eventPayload => Internal.event),
41
34
  toEventLogger: eventItem => {
42
35
  let instruction =
@@ -4,6 +4,7 @@ import * as Rpc from "./Rpc.res.mjs";
4
4
  import * as Rest from "../vendored/Rest.res.mjs";
5
5
  import * as Utils from "../Utils.res.mjs";
6
6
  import * as Logging from "../Logging.res.mjs";
7
+ import * as Internal from "../Internal.res.mjs";
7
8
  import * as Prometheus from "../Prometheus.res.mjs";
8
9
  import * as Performance from "../bindings/Performance.res.mjs";
9
10
  import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
@@ -16,21 +17,7 @@ let cleanUpRawEventFieldsInPlace = (fields => {
16
17
  delete fields.time
17
18
  });
18
19
 
19
- let transactionFields = [
20
- "transactionIndex",
21
- "signatures",
22
- "feePayer",
23
- "success",
24
- "err",
25
- "fee",
26
- "computeUnitsConsumed",
27
- "accountKeys",
28
- "recentBlockhash",
29
- "version",
30
- "tokenBalances"
31
- ];
32
-
33
- let transactionFieldMask = TransactionStore.makeMaskFn(transactionFields);
20
+ let eventTransactionFieldMask = TransactionStore.makeMaskFn(Internal.allSvmTransactionFields);
34
21
 
35
22
  function make(logger) {
36
23
  return {
@@ -44,7 +31,6 @@ function make(logger) {
44
31
  onEventBlockFilterSchema: S$RescriptSchema.object(param => {}),
45
32
  logger: logger,
46
33
  toEvent: eventItem => eventItem.payload,
47
- transactionFieldMask: transactionFieldMask,
48
34
  toEventLogger: eventItem => {
49
35
  let instruction = eventItem.payload;
50
36
  return Logging.createChildFrom(logger, {
@@ -94,12 +80,14 @@ function makeRPCSource(chain, rpc, sourceForOpt) {
94
80
  };
95
81
  }
96
82
 
83
+ let transactionFields = Internal.allSvmTransactionFields;
84
+
97
85
  export {
98
86
  cleanUpRawEventFieldsInPlace,
99
87
  transactionFields,
100
- transactionFieldMask,
88
+ eventTransactionFieldMask,
101
89
  make,
102
90
  GetFinalizedSlot,
103
91
  makeRPCSource,
104
92
  }
105
- /* transactionFieldMask Not a pure module */
93
+ /* eventTransactionFieldMask Not a pure module */