@ensnode/ensnode-sdk 1.16.0 → 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
 
@@ -4155,11 +4156,11 @@ function hasBackfillCompleted(indexingStatus) {
4155
4156
 
4156
4157
  // src/omnigraph-api/prerequisites.ts
4157
4158
  function hasOmnigraphApiConfigSupport(config) {
4158
- 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 */);
4159
4160
  if (supported) return { supported };
4160
4161
  return {
4161
4162
  supported: false,
4162
- 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.`
4163
4164
  };
4164
4165
  }
4165
4166
  function hasOmnigraphApiIndexingStatusSupport(indexingStatus) {
@@ -4173,7 +4174,7 @@ function isRegistrationExpired(info, now) {
4173
4174
  }
4174
4175
  function isRegistrationFullyExpired(info, now) {
4175
4176
  if (info.expiry == null) return false;
4176
- return now >= info.expiry + (info.gracePeriod ?? 0n);
4177
+ return now > info.expiry + (info.gracePeriod ?? 0n);
4177
4178
  }
4178
4179
  function isRegistrationInGracePeriod(info, now) {
4179
4180
  if (info.expiry == null) return false;
@@ -4549,7 +4550,7 @@ var TtlCache = class {
4549
4550
  import {
4550
4551
  maybeGetDatasource as maybeGetDatasource2
4551
4552
  } from "@ensnode/datasources";
4552
- function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDatasourceNames) {
4553
+ function buildIndexedBlockranges(namespace, chainEndBlocks, pluginsDatasourceNames) {
4553
4554
  const indexedBlockranges = /* @__PURE__ */ new Map();
4554
4555
  for (const [, datasourceNames] of pluginsDatasourceNames) {
4555
4556
  for (const datasourceName of datasourceNames) {
@@ -4557,14 +4558,19 @@ function buildIndexedBlockranges(namespace, globalBlockrangeEndBlock, pluginsDat
4557
4558
  if (!datasource) continue;
4558
4559
  const datasourceChainId = datasource.chain.id;
4559
4560
  const datasourceContracts = Object.values(datasource.contracts);
4561
+ const chainEndBlock = chainEndBlocks.get(datasourceChainId);
4560
4562
  for (const datasourceContract of datasourceContracts) {
4561
4563
  const currentChainIndexedBlockrange = indexedBlockranges.get(datasourceChainId);
4562
- if (typeof globalBlockrangeEndBlock === "number" && datasourceContract.startBlock > globalBlockrangeEndBlock) {
4564
+ if (typeof chainEndBlock === "number" && datasourceContract.startBlock > chainEndBlock) {
4563
4565
  continue;
4564
4566
  }
4567
+ const effectiveEndBlock = Math.min(
4568
+ datasourceContract.endBlock ?? Infinity,
4569
+ chainEndBlock ?? Infinity
4570
+ );
4565
4571
  const contractIndexedBlockrange = buildBlockNumberRange(
4566
4572
  datasourceContract.startBlock,
4567
- datasourceContract.endBlock ?? globalBlockrangeEndBlock
4573
+ Number.isFinite(effectiveEndBlock) ? effectiveEndBlock : void 0
4568
4574
  );
4569
4575
  const indexedBlockrange = currentChainIndexedBlockrange ? mergeBlockNumberRanges(currentChainIndexedBlockrange, contractIndexedBlockrange) : contractIndexedBlockrange;
4570
4576
  if (indexedBlockrange.rangeType !== RangeTypeIds.LeftBounded && indexedBlockrange.rangeType !== RangeTypeIds.Bounded) {
@@ -4609,6 +4615,10 @@ function interpretTextRecordKey(key) {
4609
4615
  if (key === "") return null;
4610
4616
  return key;
4611
4617
  }
4618
+ function interpretMetadataKey(key) {
4619
+ if (hasNullByte(key)) return null;
4620
+ return key;
4621
+ }
4612
4622
  function interpretTextRecordValue(value) {
4613
4623
  if (hasNullByte(value)) return null;
4614
4624
  if (value === "") return null;
@@ -5021,6 +5031,7 @@ export {
5021
5031
  interpretAddressRecordValue,
5022
5032
  interpretContenthashValue,
5023
5033
  interpretDnszonehashValue,
5034
+ interpretMetadataKey,
5024
5035
  interpretNameRecordValue,
5025
5036
  interpretPubkeyValue,
5026
5037
  interpretTextRecordKey,