@ensnode/ensnode-sdk 1.15.2 → 1.17.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.
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ENSNamespaceId, DatasourceName } from '@ensnode/datasources';
2
2
  export { ENSNamespaceId, ENSNamespaceIds, getENSRootChainId } from '@ensnode/datasources';
3
- import { E as EnsRainbowPublicConfig, a as EnsIndexerPublicConfig, b as EnsIndexerVersionInfo, T as TheGraphFallback, U as Unvalidated, B as BlockNumber, c as BlockRef, L as LabelSetId, d as LabelSetVersion, e as EnsRainbowClientLabelSet, f as EnsRainbowServerLabelSet, P as PluginName, m as makeErrorResponseSchema, R as RegistrarAction, S as SerializedRegistrarAction, D as Datetime, g as PriceDai, h as PriceEnsTokens, i as PriceEth, j as PriceUsdc, k as Price, l as SerializedPrice, n as SerializedPriceDai, o as SerializedPriceEnsTokens, p as SerializedPriceEth, q as SerializedPriceUsdc } from './namespace-specific-value-BBZET9O0.cjs';
4
- export { C as CurrencyAmount, r as CurrencyId, s as CurrencyIds, t as CurrencyInfo, u as DeepPartial, v as ENCODED_REFERRER_BYTE_LENGTH, w as ENCODED_REFERRER_BYTE_OFFSET, x as ENSIndexerPublicConfig, y as ENSIndexerVersionInfo, z as EXPECTED_ENCODED_REFERRER_PADDING, A as EncodedReferrer, F as EnsRainbowVersionInfo, N as NamespaceSpecificValue, G as RegistrarActionEventId, H as RegistrarActionPricing, I as RegistrarActionPricingAvailable, J as RegistrarActionPricingUnknown, K as RegistrarActionReferral, M as RegistrarActionReferralAvailable, O as RegistrarActionReferralNotApplicable, Q as RegistrarActionType, V as RegistrarActionTypes, W as RegistrationLifecycle, X as RegistrationLifecycleStage, Y as RequiredAndNotNull, Z as RequiredAndNull, _ as RpcUrl, $ as SerializedCurrencyAmount, a0 as SerializedRegistrarActionPricing, a1 as SerializedRegistrarActionPricingAvailable, a2 as SerializedRegistrarActionPricingUnknown, a3 as Subregistry, a4 as TheGraphCannotFallbackReason, a5 as TheGraphCannotFallbackReasonSchema, a6 as TheGraphFallbackSchema, a7 as ZERO_ENCODED_REFERRER, a8 as addPrices, a9 as buildEncodedReferrer, aa as decodeEncodedReferrer, ab as getCurrencyInfo, ac as getNamespaceSpecificValue, ad as interpretAddress, ae as interpretAddressRecordValue, af as interpretContenthashValue, ag as interpretDnszonehashValue, ah as interpretNameRecordValue, ai as interpretPubkeyValue, aj as interpretTextRecordKey, ak as interpretTextRecordValue, al as isPriceCurrencyEqual, am as isPriceEqual, an as isRegistrarActionPricingAvailable, ao as isRegistrarActionReferralAvailable, ap as makeENSApiPublicConfigSchema, aq as makeEnsApiPublicConfigSchema, ar as makeSerializedEnsApiPublicConfigSchema, as as maxPrice, at as minPrice, au as parseDai, av as parseEnsTokens, aw as parseEth, ax as parseUsdc, ay as priceDai, az as priceEnsTokens, aA as priceEth, aB as priceUsdc, aC as scalePrice, aD as serializeRegistrarAction, aE as serializeRegistrarActionPricing, aF as subtractPrice } from './namespace-specific-value-BBZET9O0.cjs';
3
+ import { E as EnsRainbowPublicConfig, a as EnsIndexerPublicConfig, b as EnsIndexerVersionInfo, T as TheGraphFallback, U as Unvalidated, B as BlockNumber, c as BlockRef, L as LabelSetId, d as LabelSetVersion, e as EnsRainbowClientLabelSet, f as EnsRainbowServerLabelSet, P as PluginName, m as makeErrorResponseSchema, R as RegistrarAction, S as SerializedRegistrarAction, D as Datetime, g as PriceDai, h as PriceEnsTokens, i as PriceEth, j as PriceUsdc, k as Price, l as SerializedPrice, n as SerializedPriceDai, o as SerializedPriceEnsTokens, p as SerializedPriceEth, q as SerializedPriceUsdc } from './namespace-specific-value-C9XIUp1F.cjs';
4
+ export { C as CurrencyAmount, r as CurrencyId, s as CurrencyIds, t as CurrencyInfo, u as DeepPartial, v as ENCODED_REFERRER_BYTE_LENGTH, w as ENCODED_REFERRER_BYTE_OFFSET, x as ENSIndexerPublicConfig, y as ENSIndexerVersionInfo, z as EXPECTED_ENCODED_REFERRER_PADDING, A as EncodedReferrer, F as EnsRainbowVersionInfo, N as NamespaceSpecificValue, G as RegistrarActionEventId, H as RegistrarActionPricing, I as RegistrarActionPricingAvailable, J as RegistrarActionPricingUnknown, K as RegistrarActionReferral, M as RegistrarActionReferralAvailable, O as RegistrarActionReferralNotApplicable, Q as RegistrarActionType, V as RegistrarActionTypes, W as RegistrationLifecycle, X as RegistrationLifecycleStage, Y as RequiredAndNotNull, Z as RequiredAndNull, _ as RpcUrl, $ as SerializedCurrencyAmount, a0 as SerializedRegistrarActionPricing, a1 as SerializedRegistrarActionPricingAvailable, a2 as SerializedRegistrarActionPricingUnknown, a3 as Subregistry, a4 as TheGraphCannotFallbackReason, a5 as TheGraphCannotFallbackReasonSchema, a6 as TheGraphFallbackSchema, a7 as ZERO_ENCODED_REFERRER, a8 as addPrices, a9 as buildEncodedReferrer, aa as decodeEncodedReferrer, ab as getCurrencyInfo, ac as getNamespaceSpecificValue, ad as interpretAddress, ae as interpretAddressRecordValue, af as interpretContenthashValue, ag as interpretDnszonehashValue, ah as interpretMetadataKey, ai as interpretNameRecordValue, aj as interpretPubkeyValue, ak as interpretTextRecordKey, al as interpretTextRecordValue, am as isPriceCurrencyEqual, an as isPriceEqual, ao as isRegistrarActionPricingAvailable, ap as isRegistrarActionReferralAvailable, aq as makeENSApiPublicConfigSchema, ar as makeEnsApiPublicConfigSchema, as as makeSerializedEnsApiPublicConfigSchema, at as maxPrice, au as minPrice, av as parseDai, aw as parseEnsTokens, ax as parseEth, ay as parseUsdc, az as priceDai, aA as priceEnsTokens, aB as priceEth, aC as priceUsdc, aD as scalePrice, aE as serializeRegistrarAction, aF as serializeRegistrarActionPricing, aG as subtractPrice } from './namespace-specific-value-C9XIUp1F.cjs';
5
5
  import * as enssdk from 'enssdk';
6
6
  import { ChainId, UnixTimestamp, Duration, ChainIdString, LabelHash, Node, Name, AssetId, Hex, AccountId, TokenId, AssetNamespace, Address, AssetIdString, InterpretedName, DefaultableChainId, CoinType, ContentType, InterfaceId, RecordVersion, UrlString, RegistryId, DatetimeISO8601 } from 'enssdk';
7
7
  import { ByteArray } from 'viem';
@@ -3290,6 +3290,11 @@ declare function validateIndexingMetadataContextInitialized(maybeIndexingMetadat
3290
3290
 
3291
3291
  /**
3292
3292
  * Check if provided EnsIndexerPublicConfig supports the Omnigraph API.
3293
+ *
3294
+ * The Omnigraph API is served whenever the config indexes data it can expose: the ENS data model
3295
+ * (`unigraph` / `ensv2`) or the highly-ENS-adjacent EFP protocol (`efp`). EFP qualifies on its own
3296
+ * so an EFP-only config can still query the `efp` namespace (the ENS query fields are present but
3297
+ * return no data without `unigraph`).
3293
3298
  */
3294
3299
  declare function hasOmnigraphApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult;
3295
3300
  /**
@@ -3539,7 +3544,7 @@ declare const uniq: <T>(arr: T[]) => T[];
3539
3544
  *
3540
3545
  * Useful for presenting a clear view of the indexed blockranges across chains.
3541
3546
  */
3542
- declare function buildIndexedBlockranges(namespace: ENSNamespaceId, globalBlockrangeEndBlock: BlockNumberRange["endBlock"], pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3547
+ declare function buildIndexedBlockranges(namespace: ENSNamespaceId, chainEndBlocks: ReadonlyMap<ChainId, number>, pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3543
3548
 
3544
3549
  /**
3545
3550
  * Gets the AccountId for the contract in the specified namespace, datasource, and
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ENSNamespaceId, DatasourceName } from '@ensnode/datasources';
2
2
  export { ENSNamespaceId, ENSNamespaceIds, getENSRootChainId } from '@ensnode/datasources';
3
- import { E as EnsRainbowPublicConfig, a as EnsIndexerPublicConfig, b as EnsIndexerVersionInfo, T as TheGraphFallback, U as Unvalidated, B as BlockNumber, c as BlockRef, L as LabelSetId, d as LabelSetVersion, e as EnsRainbowClientLabelSet, f as EnsRainbowServerLabelSet, P as PluginName, m as makeErrorResponseSchema, R as RegistrarAction, S as SerializedRegistrarAction, D as Datetime, g as PriceDai, h as PriceEnsTokens, i as PriceEth, j as PriceUsdc, k as Price, l as SerializedPrice, n as SerializedPriceDai, o as SerializedPriceEnsTokens, p as SerializedPriceEth, q as SerializedPriceUsdc } from './namespace-specific-value-BBZET9O0.js';
4
- export { C as CurrencyAmount, r as CurrencyId, s as CurrencyIds, t as CurrencyInfo, u as DeepPartial, v as ENCODED_REFERRER_BYTE_LENGTH, w as ENCODED_REFERRER_BYTE_OFFSET, x as ENSIndexerPublicConfig, y as ENSIndexerVersionInfo, z as EXPECTED_ENCODED_REFERRER_PADDING, A as EncodedReferrer, F as EnsRainbowVersionInfo, N as NamespaceSpecificValue, G as RegistrarActionEventId, H as RegistrarActionPricing, I as RegistrarActionPricingAvailable, J as RegistrarActionPricingUnknown, K as RegistrarActionReferral, M as RegistrarActionReferralAvailable, O as RegistrarActionReferralNotApplicable, Q as RegistrarActionType, V as RegistrarActionTypes, W as RegistrationLifecycle, X as RegistrationLifecycleStage, Y as RequiredAndNotNull, Z as RequiredAndNull, _ as RpcUrl, $ as SerializedCurrencyAmount, a0 as SerializedRegistrarActionPricing, a1 as SerializedRegistrarActionPricingAvailable, a2 as SerializedRegistrarActionPricingUnknown, a3 as Subregistry, a4 as TheGraphCannotFallbackReason, a5 as TheGraphCannotFallbackReasonSchema, a6 as TheGraphFallbackSchema, a7 as ZERO_ENCODED_REFERRER, a8 as addPrices, a9 as buildEncodedReferrer, aa as decodeEncodedReferrer, ab as getCurrencyInfo, ac as getNamespaceSpecificValue, ad as interpretAddress, ae as interpretAddressRecordValue, af as interpretContenthashValue, ag as interpretDnszonehashValue, ah as interpretNameRecordValue, ai as interpretPubkeyValue, aj as interpretTextRecordKey, ak as interpretTextRecordValue, al as isPriceCurrencyEqual, am as isPriceEqual, an as isRegistrarActionPricingAvailable, ao as isRegistrarActionReferralAvailable, ap as makeENSApiPublicConfigSchema, aq as makeEnsApiPublicConfigSchema, ar as makeSerializedEnsApiPublicConfigSchema, as as maxPrice, at as minPrice, au as parseDai, av as parseEnsTokens, aw as parseEth, ax as parseUsdc, ay as priceDai, az as priceEnsTokens, aA as priceEth, aB as priceUsdc, aC as scalePrice, aD as serializeRegistrarAction, aE as serializeRegistrarActionPricing, aF as subtractPrice } from './namespace-specific-value-BBZET9O0.js';
3
+ import { E as EnsRainbowPublicConfig, a as EnsIndexerPublicConfig, b as EnsIndexerVersionInfo, T as TheGraphFallback, U as Unvalidated, B as BlockNumber, c as BlockRef, L as LabelSetId, d as LabelSetVersion, e as EnsRainbowClientLabelSet, f as EnsRainbowServerLabelSet, P as PluginName, m as makeErrorResponseSchema, R as RegistrarAction, S as SerializedRegistrarAction, D as Datetime, g as PriceDai, h as PriceEnsTokens, i as PriceEth, j as PriceUsdc, k as Price, l as SerializedPrice, n as SerializedPriceDai, o as SerializedPriceEnsTokens, p as SerializedPriceEth, q as SerializedPriceUsdc } from './namespace-specific-value-C9XIUp1F.js';
4
+ export { C as CurrencyAmount, r as CurrencyId, s as CurrencyIds, t as CurrencyInfo, u as DeepPartial, v as ENCODED_REFERRER_BYTE_LENGTH, w as ENCODED_REFERRER_BYTE_OFFSET, x as ENSIndexerPublicConfig, y as ENSIndexerVersionInfo, z as EXPECTED_ENCODED_REFERRER_PADDING, A as EncodedReferrer, F as EnsRainbowVersionInfo, N as NamespaceSpecificValue, G as RegistrarActionEventId, H as RegistrarActionPricing, I as RegistrarActionPricingAvailable, J as RegistrarActionPricingUnknown, K as RegistrarActionReferral, M as RegistrarActionReferralAvailable, O as RegistrarActionReferralNotApplicable, Q as RegistrarActionType, V as RegistrarActionTypes, W as RegistrationLifecycle, X as RegistrationLifecycleStage, Y as RequiredAndNotNull, Z as RequiredAndNull, _ as RpcUrl, $ as SerializedCurrencyAmount, a0 as SerializedRegistrarActionPricing, a1 as SerializedRegistrarActionPricingAvailable, a2 as SerializedRegistrarActionPricingUnknown, a3 as Subregistry, a4 as TheGraphCannotFallbackReason, a5 as TheGraphCannotFallbackReasonSchema, a6 as TheGraphFallbackSchema, a7 as ZERO_ENCODED_REFERRER, a8 as addPrices, a9 as buildEncodedReferrer, aa as decodeEncodedReferrer, ab as getCurrencyInfo, ac as getNamespaceSpecificValue, ad as interpretAddress, ae as interpretAddressRecordValue, af as interpretContenthashValue, ag as interpretDnszonehashValue, ah as interpretMetadataKey, ai as interpretNameRecordValue, aj as interpretPubkeyValue, ak as interpretTextRecordKey, al as interpretTextRecordValue, am as isPriceCurrencyEqual, an as isPriceEqual, ao as isRegistrarActionPricingAvailable, ap as isRegistrarActionReferralAvailable, aq as makeENSApiPublicConfigSchema, ar as makeEnsApiPublicConfigSchema, as as makeSerializedEnsApiPublicConfigSchema, at as maxPrice, au as minPrice, av as parseDai, aw as parseEnsTokens, ax as parseEth, ay as parseUsdc, az as priceDai, aA as priceEnsTokens, aB as priceEth, aC as priceUsdc, aD as scalePrice, aE as serializeRegistrarAction, aF as serializeRegistrarActionPricing, aG as subtractPrice } from './namespace-specific-value-C9XIUp1F.js';
5
5
  import * as enssdk from 'enssdk';
6
6
  import { ChainId, UnixTimestamp, Duration, ChainIdString, LabelHash, Node, Name, AssetId, Hex, AccountId, TokenId, AssetNamespace, Address, AssetIdString, InterpretedName, DefaultableChainId, CoinType, ContentType, InterfaceId, RecordVersion, UrlString, RegistryId, DatetimeISO8601 } from 'enssdk';
7
7
  import { ByteArray } from 'viem';
@@ -3290,6 +3290,11 @@ declare function validateIndexingMetadataContextInitialized(maybeIndexingMetadat
3290
3290
 
3291
3291
  /**
3292
3292
  * Check if provided EnsIndexerPublicConfig supports the Omnigraph API.
3293
+ *
3294
+ * The Omnigraph API is served whenever the config indexes data it can expose: the ENS data model
3295
+ * (`unigraph` / `ensv2`) or the highly-ENS-adjacent EFP protocol (`efp`). EFP qualifies on its own
3296
+ * so an EFP-only config can still query the `efp` namespace (the ENS query fields are present but
3297
+ * return no data without `unigraph`).
3293
3298
  */
3294
3299
  declare function hasOmnigraphApiConfigSupport(config: EnsIndexerPublicConfig): PrerequisiteResult;
3295
3300
  /**
@@ -3539,7 +3544,7 @@ declare const uniq: <T>(arr: T[]) => T[];
3539
3544
  *
3540
3545
  * Useful for presenting a clear view of the indexed blockranges across chains.
3541
3546
  */
3542
- declare function buildIndexedBlockranges(namespace: ENSNamespaceId, globalBlockrangeEndBlock: BlockNumberRange["endBlock"], pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3547
+ declare function buildIndexedBlockranges(namespace: ENSNamespaceId, chainEndBlocks: ReadonlyMap<ChainId, number>, pluginsDatasourceNames: Map<PluginName, DatasourceName[]>): Map<ChainId, BlockNumberRangeWithStartBlock>;
3543
3548
 
3544
3549
  /**
3545
3550
  * Gets the AccountId for the contract in the specified namespace, datasource, and
package/dist/index.js CHANGED
@@ -364,6 +364,7 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
364
364
  PluginName2["TokenScope"] = "tokenscope";
365
365
  PluginName2["ENSv2"] = "ensv2";
366
366
  PluginName2["Unigraph"] = "unigraph";
367
+ PluginName2["EFP"] = "efp";
367
368
  return PluginName2;
368
369
  })(PluginName || {});
369
370
 
@@ -1784,6 +1785,7 @@ var EnsIndexerClient = class {
1784
1785
  constructor(options) {
1785
1786
  this.options = options;
1786
1787
  }
1788
+ options;
1787
1789
  getOptions() {
1788
1790
  return Object.freeze({
1789
1791
  url: new URL(this.options.url.href)
@@ -4154,11 +4156,11 @@ function hasBackfillCompleted(indexingStatus) {
4154
4156
 
4155
4157
  // src/omnigraph-api/prerequisites.ts
4156
4158
  function hasOmnigraphApiConfigSupport(config) {
4157
- const supported = config.plugins.includes("unigraph" /* Unigraph */) || config.plugins.includes("ensv2" /* ENSv2 */);
4159
+ const supported = config.plugins.includes("unigraph" /* Unigraph */) || config.plugins.includes("ensv2" /* ENSv2 */) || config.plugins.includes("efp" /* EFP */);
4158
4160
  if (supported) return { supported };
4159
4161
  return {
4160
4162
  supported: false,
4161
- reason: `The connected ENSNode's Config must have the '${"unigraph" /* Unigraph */}' plugin enabled.`
4163
+ reason: `The connected ENSNode's Config must have one of the '${"unigraph" /* Unigraph */}', '${"ensv2" /* ENSv2 */}', or '${"efp" /* EFP */}' plugins enabled.`
4162
4164
  };
4163
4165
  }
4164
4166
  function hasOmnigraphApiIndexingStatusSupport(indexingStatus) {
@@ -4172,7 +4174,7 @@ function isRegistrationExpired(info, now) {
4172
4174
  }
4173
4175
  function isRegistrationFullyExpired(info, now) {
4174
4176
  if (info.expiry == null) return false;
4175
- return now >= info.expiry + (info.gracePeriod ?? 0n);
4177
+ return now > info.expiry + (info.gracePeriod ?? 0n);
4176
4178
  }
4177
4179
  function isRegistrationInGracePeriod(info, now) {
4178
4180
  if (info.expiry == null) return false;
@@ -4404,6 +4406,7 @@ var SWRCache = class {
4404
4406
  }
4405
4407
  if (options.proactivelyInitialize) this.revalidate();
4406
4408
  }
4409
+ options;
4407
4410
  cache = null;
4408
4411
  inProgressRevalidate = null;
4409
4412
  backgroundInterval = null;
@@ -4547,7 +4550,7 @@ var TtlCache = class {
4547
4550
  import {
4548
4551
  maybeGetDatasource as maybeGetDatasource2
4549
4552
  } from "@ensnode/datasources";
4550
- function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDatasourceNames) {
4553
+ function buildIndexedBlockranges(namespace, chainEndBlocks, pluginsDatasourceNames) {
4551
4554
  const indexedBlockranges = /* @__PURE__ */ new Map();
4552
4555
  for (const [, datasourceNames] of pluginsDatasourceNames) {
4553
4556
  for (const datasourceName of datasourceNames) {
@@ -4555,14 +4558,19 @@ function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDat
4555
4558
  if (!datasource) continue;
4556
4559
  const datasourceChainId = datasource.chain.id;
4557
4560
  const datasourceContracts = Object.values(datasource.contracts);
4561
+ const chainEndBlock = chainEndBlocks.get(datasourceChainId);
4558
4562
  for (const datasourceContract of datasourceContracts) {
4559
4563
  const currentChainIndexedBlockrange = indexedBlockranges.get(datasourceChainId);
4560
- if (typeof globalBlockrangeEndBlock === "number" && datasourceContract.startBlock > globalBlockrangeEndBlock) {
4564
+ if (typeof chainEndBlock === "number" && datasourceContract.startBlock > chainEndBlock) {
4561
4565
  continue;
4562
4566
  }
4567
+ const effectiveEndBlock = Math.min(
4568
+ datasourceContract.endBlock ?? Infinity,
4569
+ chainEndBlock ?? Infinity
4570
+ );
4563
4571
  const contractIndexedBlockrange = buildBlockNumberRange(
4564
4572
  datasourceContract.startBlock,
4565
- datasourceContract.endBlock ?? globalBlockrangeEndBlock
4573
+ Number.isFinite(effectiveEndBlock) ? effectiveEndBlock : void 0
4566
4574
  );
4567
4575
  const indexedBlockrange = currentChainIndexedBlockrange ? mergeBlockNumberRanges(currentChainIndexedBlockrange, contractIndexedBlockrange) : contractIndexedBlockrange;
4568
4576
  if (indexedBlockrange.rangeType !== RangeTypeIds.LeftBounded && indexedBlockrange.rangeType !== RangeTypeIds.Bounded) {
@@ -4607,6 +4615,10 @@ function interpretTextRecordKey(key) {
4607
4615
  if (key === "") return null;
4608
4616
  return key;
4609
4617
  }
4618
+ function interpretMetadataKey(key) {
4619
+ if (hasNullByte(key)) return null;
4620
+ return key;
4621
+ }
4610
4622
  function interpretTextRecordValue(value) {
4611
4623
  if (hasNullByte(value)) return null;
4612
4624
  if (value === "") return null;
@@ -5019,6 +5031,7 @@ export {
5019
5031
  interpretAddressRecordValue,
5020
5032
  interpretContenthashValue,
5021
5033
  interpretDnszonehashValue,
5034
+ interpretMetadataKey,
5022
5035
  interpretNameRecordValue,
5023
5036
  interpretPubkeyValue,
5024
5037
  interpretTextRecordKey,