@ensnode/ensnode-sdk 0.0.0-next-20260303163519 → 0.0.0-next-20260303184716

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.cjs CHANGED
@@ -177,13 +177,18 @@ __export(index_exports, {
177
177
  getNameHierarchy: () => getNameHierarchy,
178
178
  getNameTokenOwnership: () => getNameTokenOwnership,
179
179
  getNameWrapperAccounts: () => getNameWrapperAccounts,
180
+ getNamespaceSpecificValue: () => getNamespaceSpecificValue,
180
181
  getOmnichainIndexingCursor: () => getOmnichainIndexingCursor,
181
182
  getOmnichainIndexingStatus: () => getOmnichainIndexingStatus,
182
183
  getParentNameFQDN: () => getParentNameFQDN,
183
184
  getResolvePrimaryNameChainIdParam: () => getResolvePrimaryNameChainIdParam,
184
185
  getTimestampForHighestOmnichainKnownBlock: () => getTimestampForHighestOmnichainKnownBlock,
185
186
  getTimestampForLowestOmnichainStartBlock: () => getTimestampForLowestOmnichainStartBlock,
187
+ hasGraphqlApiConfigSupport: () => hasGraphqlApiConfigSupport,
186
188
  hasNullByte: () => hasNullByte,
189
+ hasRegistrarActionsConfigSupport: () => hasRegistrarActionsConfigSupport,
190
+ hasRegistrarActionsIndexingStatusSupport: () => hasRegistrarActionsIndexingStatusSupport,
191
+ hasSubgraphApiConfigSupport: () => hasSubgraphApiConfigSupport,
187
192
  interpretAddress: () => interpretAddress,
188
193
  interpretAddressRecordValue: () => interpretAddressRecordValue,
189
194
  interpretNameRecordValue: () => interpretNameRecordValue,
@@ -254,7 +259,6 @@ __export(index_exports, {
254
259
  priceEth: () => priceEth,
255
260
  priceUsdc: () => priceUsdc,
256
261
  registrarActionsFilter: () => registrarActionsFilter,
257
- registrarActionsPrerequisites: () => registrarActionsPrerequisites,
258
262
  reverseName: () => reverseName,
259
263
  scaleBigintByNumber: () => scaleBigintByNumber,
260
264
  scalePrice: () => scalePrice,
@@ -3210,54 +3214,36 @@ var registrarActionsFilter = {
3210
3214
  };
3211
3215
 
3212
3216
  // src/ensapi/api/registrar-actions/prerequisites.ts
3213
- var registrarActionsPrerequisites = Object.freeze({
3214
- /**
3215
- * Required plugins to enable Registrar Actions API routes.
3216
- *
3217
- * 1. `registrars` plugin is required so that data in the `registrarActions`
3218
- * table is populated.
3219
- * 2. `subgraph`, `basenames`, and `lineanames` are required to get the data
3220
- * for the name associated with each registrar action.
3221
- * 3. In theory not all of `subgraph`, `basenames`, and `lineanames` plugins
3222
- * might be required. Ex: At least one, but the current logic in
3223
- * the `registrars` plugin always indexes registrar actions across
3224
- * Ethnames (subgraph), Basenames, and Lineanames and therefore we need to
3225
- * ensure each value in the registrar actions table has
3226
- * an associated record in the domains table.
3227
- */
3228
- requiredPlugins: [
3229
- "subgraph" /* Subgraph */,
3230
- "basenames" /* Basenames */,
3231
- "lineanames" /* Lineanames */,
3232
- "registrars" /* Registrars */
3233
- ],
3234
- /**
3235
- * Check if provided EnsIndexerPublicConfig supports the Registrar Actions API.
3236
- */
3237
- hasEnsIndexerConfigSupport(config) {
3238
- return registrarActionsPrerequisites.requiredPlugins.every(
3239
- (plugin) => config.plugins.includes(plugin)
3240
- );
3241
- },
3242
- /**
3243
- * Required Indexing Status IDs
3244
- *
3245
- * Database indexes are created by the time the omnichain indexing status
3246
- * is either `completed` or `following`.
3247
- */
3248
- supportedIndexingStatusIds: [
3249
- OmnichainIndexingStatusIds.Completed,
3250
- OmnichainIndexingStatusIds.Following
3251
- ],
3252
- /**
3253
- * Check if provided indexing status supports the Registrar Actions API.
3254
- */
3255
- hasIndexingStatusSupport(omnichainIndexingStatusId) {
3256
- return registrarActionsPrerequisites.supportedIndexingStatusIds.some(
3257
- (supportedIndexingStatusId) => supportedIndexingStatusId === omnichainIndexingStatusId
3258
- );
3259
- }
3260
- });
3217
+ var registrarActionsRequiredPlugins = [
3218
+ "subgraph" /* Subgraph */,
3219
+ "basenames" /* Basenames */,
3220
+ "lineanames" /* Lineanames */,
3221
+ "registrars" /* Registrars */
3222
+ ];
3223
+ function hasRegistrarActionsConfigSupport(config) {
3224
+ const supported = registrarActionsRequiredPlugins.every(
3225
+ (plugin) => config.plugins.includes(plugin)
3226
+ );
3227
+ if (supported) return { supported };
3228
+ return {
3229
+ supported: false,
3230
+ reason: `The Registrar Actions API requires all of the following plugins to be activated in the connected ENSNode's Config: ${registrarActionsRequiredPlugins.map((plugin) => `'${plugin}'`).join(", ")}.`
3231
+ };
3232
+ }
3233
+ var registrarActionsSupportedIndexingStatusIds = [
3234
+ OmnichainIndexingStatusIds.Completed,
3235
+ OmnichainIndexingStatusIds.Following
3236
+ ];
3237
+ function hasRegistrarActionsIndexingStatusSupport(omnichainIndexingStatusId) {
3238
+ const supported = registrarActionsSupportedIndexingStatusIds.some(
3239
+ (supportedIndexingStatusId) => supportedIndexingStatusId === omnichainIndexingStatusId
3240
+ );
3241
+ if (supported) return { supported };
3242
+ return {
3243
+ supported: false,
3244
+ reason: `The Registrar Actions API requires the connected ENSNode's Indexing Status to be one of the following: ${registrarActionsSupportedIndexingStatusIds.join(", ")}.`
3245
+ };
3246
+ }
3261
3247
 
3262
3248
  // src/ensapi/api/registrar-actions/serialize.ts
3263
3249
  function serializeNamedRegistrarAction({
@@ -4177,6 +4163,16 @@ var makeResolverRecordsId = (resolver, node) => `${makeResolverId(resolver)}/${n
4177
4163
  var makeRegistrationId = (domainId, index) => `${domainId}/${index}`;
4178
4164
  var makeRenewalId = (domainId, registrationIndex, index) => `${makeRegistrationId(domainId, registrationIndex)}/${index}`;
4179
4165
 
4166
+ // src/graphql-api/prerequisites.ts
4167
+ function hasGraphqlApiConfigSupport(config) {
4168
+ const supported = config.plugins.includes("ensv2" /* ENSv2 */);
4169
+ if (supported) return { supported };
4170
+ return {
4171
+ supported: false,
4172
+ reason: `The connected ENSNode's Config must have the '${"ensv2" /* ENSv2 */}' plugin enabled.`
4173
+ };
4174
+ }
4175
+
4180
4176
  // src/identity/identity.ts
4181
4177
  var import_datasources7 = require("@ensnode/datasources");
4182
4178
 
@@ -4841,6 +4837,11 @@ ${JSON.stringify(concrete)}`
4841
4837
  return { concrete, partial };
4842
4838
  }
4843
4839
 
4840
+ // src/shared/namespace-specific-value.ts
4841
+ function getNamespaceSpecificValue(namespace, value) {
4842
+ return value[namespace] ?? value.default;
4843
+ }
4844
+
4844
4845
  // src/shared/root-registry.ts
4845
4846
  var import_datasources13 = require("@ensnode/datasources");
4846
4847
  var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
@@ -4857,6 +4858,16 @@ function isWebSocketProtocol(url) {
4857
4858
  return ["ws:", "wss:"].includes(url.protocol);
4858
4859
  }
4859
4860
 
4861
+ // src/subgraph-api/prerequisites.ts
4862
+ function hasSubgraphApiConfigSupport(config) {
4863
+ const supported = config.plugins.includes("subgraph" /* Subgraph */);
4864
+ if (supported) return { supported };
4865
+ return {
4866
+ supported: false,
4867
+ reason: `The connected ENSNode's Config must have the '${"subgraph" /* Subgraph */}' plugin enabled.`
4868
+ };
4869
+ }
4870
+
4860
4871
  // src/tracing/ens-protocol-tracing.ts
4861
4872
  var PROTOCOL_ATTRIBUTE_PREFIX = "ens";
4862
4873
  var ATTR_PROTOCOL_NAME = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol`;