@ensnode/ensnode-sdk 0.0.0-next-20260619181925 → 0.0.0-next-20260619183944

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/dist/index.d.cts CHANGED
@@ -3539,7 +3539,7 @@ declare const uniq: <T>(arr: T[]) => T[];
3539
3539
  *
3540
3540
  * Useful for presenting a clear view of the indexed blockranges across chains.
3541
3541
  */
3542
- declare function buildIndexedBlockranges(namespace: ENSNamespaceId, globalBlockrangeEndBlock: BlockNumberRange["endBlock"], pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3542
+ declare function buildIndexedBlockranges(namespace: ENSNamespaceId, chainEndBlocks: ReadonlyMap<ChainId, number>, pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3543
3543
 
3544
3544
  /**
3545
3545
  * Gets the AccountId for the contract in the specified namespace, datasource, and
package/dist/index.d.ts CHANGED
@@ -3539,7 +3539,7 @@ declare const uniq: <T>(arr: T[]) => T[];
3539
3539
  *
3540
3540
  * Useful for presenting a clear view of the indexed blockranges across chains.
3541
3541
  */
3542
- declare function buildIndexedBlockranges(namespace: ENSNamespaceId, globalBlockrangeEndBlock: BlockNumberRange["endBlock"], pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3542
+ declare function buildIndexedBlockranges(namespace: ENSNamespaceId, chainEndBlocks: ReadonlyMap<ChainId, number>, pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3543
3543
 
3544
3544
  /**
3545
3545
  * Gets the AccountId for the contract in the specified namespace, datasource, and
package/dist/index.js CHANGED
@@ -4549,7 +4549,7 @@ var TtlCache = class {
4549
4549
  import {
4550
4550
  maybeGetDatasource as maybeGetDatasource2
4551
4551
  } from "@ensnode/datasources";
4552
- function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDatasourceNames) {
4552
+ function buildIndexedBlockranges(namespace, chainEndBlocks, pluginsDatasourceNames) {
4553
4553
  const indexedBlockranges = /* @__PURE__ */ new Map();
4554
4554
  for (const [, datasourceNames] of pluginsDatasourceNames) {
4555
4555
  for (const datasourceName of datasourceNames) {
@@ -4557,14 +4557,19 @@ function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDat
4557
4557
  if (!datasource) continue;
4558
4558
  const datasourceChainId = datasource.chain.id;
4559
4559
  const datasourceContracts = Object.values(datasource.contracts);
4560
+ const chainEndBlock = chainEndBlocks.get(datasourceChainId);
4560
4561
  for (const datasourceContract of datasourceContracts) {
4561
4562
  const currentChainIndexedBlockrange = indexedBlockranges.get(datasourceChainId);
4562
- if (typeof globalBlockrangeEndBlock === "number" && datasourceContract.startBlock > globalBlockrangeEndBlock) {
4563
+ if (typeof chainEndBlock === "number" && datasourceContract.startBlock > chainEndBlock) {
4563
4564
  continue;
4564
4565
  }
4566
+ const effectiveEndBlock = Math.min(
4567
+ datasourceContract.endBlock ?? Infinity,
4568
+ chainEndBlock ?? Infinity
4569
+ );
4565
4570
  const contractIndexedBlockrange = buildBlockNumberRange(
4566
4571
  datasourceContract.startBlock,
4567
- datasourceContract.endBlock ?? globalBlockrangeEndBlock
4572
+ Number.isFinite(effectiveEndBlock) ? effectiveEndBlock : void 0
4568
4573
  );
4569
4574
  const indexedBlockrange = currentChainIndexedBlockrange ? mergeBlockNumberRanges(currentChainIndexedBlockrange, contractIndexedBlockrange) : contractIndexedBlockrange;
4570
4575
  if (indexedBlockrange.rangeType !== RangeTypeIds.LeftBounded && indexedBlockrange.rangeType !== RangeTypeIds.Bounded) {