@ensnode/ensnode-sdk 0.0.0-next-20260120123821 → 0.0.0-next-20260121181125

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
@@ -41,6 +41,8 @@ __export(index_exports, {
41
41
  ClientError: () => ClientError,
42
42
  CrossChainIndexingStrategyIds: () => CrossChainIndexingStrategyIds,
43
43
  CurrencyIds: () => CurrencyIds,
44
+ DEFAULT_ENSNODE_API_URL_MAINNET: () => DEFAULT_ENSNODE_API_URL_MAINNET,
45
+ DEFAULT_ENSNODE_API_URL_SEPOLIA: () => DEFAULT_ENSNODE_API_URL_SEPOLIA,
44
46
  DEFAULT_EVM_CHAIN_ID: () => DEFAULT_EVM_CHAIN_ID,
45
47
  DEFAULT_EVM_COIN_TYPE: () => DEFAULT_EVM_COIN_TYPE,
46
48
  ENCODED_REFERRER_BYTE_LENGTH: () => ENCODED_REFERRER_BYTE_LENGTH,
@@ -138,6 +140,7 @@ __export(index_exports, {
138
140
  getCanonicalId: () => getCanonicalId,
139
141
  getCurrencyInfo: () => getCurrencyInfo,
140
142
  getDatasourceContract: () => getDatasourceContract,
143
+ getDefaultEnsNodeUrl: () => getDefaultEnsNodeUrl,
141
144
  getENSRootChainId: () => import_datasources2.getENSRootChainId,
142
145
  getENSv1Registry: () => getENSv1Registry,
143
146
  getENSv2RootRegistry: () => getENSv2RootRegistry,
@@ -3407,13 +3410,30 @@ var ClientError = class _ClientError extends Error {
3407
3410
  }
3408
3411
  };
3409
3412
 
3413
+ // src/deployments.ts
3414
+ var import_datasources10 = require("@ensnode/datasources");
3415
+ var DEFAULT_ENSNODE_API_URL_MAINNET = "https://api.alpha.ensnode.io";
3416
+ var DEFAULT_ENSNODE_API_URL_SEPOLIA = "https://api.alpha-sepolia.ensnode.io";
3417
+ var getDefaultEnsNodeUrl = (namespace) => {
3418
+ const effectiveNamespace = namespace ?? import_datasources10.ENSNamespaceIds.Mainnet;
3419
+ switch (effectiveNamespace) {
3420
+ case import_datasources10.ENSNamespaceIds.Mainnet:
3421
+ return new URL(DEFAULT_ENSNODE_API_URL_MAINNET);
3422
+ case import_datasources10.ENSNamespaceIds.Sepolia:
3423
+ return new URL(DEFAULT_ENSNODE_API_URL_SEPOLIA);
3424
+ default:
3425
+ throw new Error(
3426
+ `ENSNamespaceId ${effectiveNamespace} does not have a default ENSNode URL defined`
3427
+ );
3428
+ }
3429
+ };
3430
+
3410
3431
  // src/client.ts
3411
- var DEFAULT_ENSNODE_API_URL = "https://api.alpha.ensnode.io";
3412
3432
  var ENSNodeClient = class _ENSNodeClient {
3413
3433
  options;
3414
3434
  static defaultOptions() {
3415
3435
  return {
3416
- url: new URL(DEFAULT_ENSNODE_API_URL)
3436
+ url: getDefaultEnsNodeUrl()
3417
3437
  };
3418
3438
  }
3419
3439
  constructor(options = {}) {
@@ -3900,7 +3920,7 @@ var makeLatestRenewalId = (domainId, registrationIndex) => `${makeRegistrationId
3900
3920
  var makeRenewalId = (domainId, registrationIndex, index = 0) => `${makeRegistrationId(domainId, registrationIndex)}/${index}`;
3901
3921
 
3902
3922
  // src/identity/identity.ts
3903
- var import_datasources10 = require("@ensnode/datasources");
3923
+ var import_datasources11 = require("@ensnode/datasources");
3904
3924
 
3905
3925
  // src/identity/types.ts
3906
3926
  var ResolutionStatusIds = {
@@ -3927,7 +3947,7 @@ var ResolutionStatusIds = {
3927
3947
  function buildUnresolvedIdentity(address, namespaceId, chainId) {
3928
3948
  return {
3929
3949
  resolutionStatus: ResolutionStatusIds.Unresolved,
3930
- chainId: chainId ?? (0, import_datasources10.getENSRootChainId)(namespaceId),
3950
+ chainId: chainId ?? (0, import_datasources11.getENSRootChainId)(namespaceId),
3931
3951
  address
3932
3952
  };
3933
3953
  }
@@ -3937,13 +3957,13 @@ function isResolvedIdentity(identity) {
3937
3957
 
3938
3958
  // src/resolution/ensip19-chainid.ts
3939
3959
  var import_chains = require("viem/chains");
3940
- var import_datasources11 = require("@ensnode/datasources");
3960
+ var import_datasources12 = require("@ensnode/datasources");
3941
3961
  var getResolvePrimaryNameChainIdParam = (chainId, namespaceId) => {
3942
- const ensRootChainId = (0, import_datasources11.getENSRootChainId)(namespaceId);
3962
+ const ensRootChainId = (0, import_datasources12.getENSRootChainId)(namespaceId);
3943
3963
  return chainId === ensRootChainId ? import_chains.mainnet.id : chainId;
3944
3964
  };
3945
3965
  var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
3946
- return chainId === DEFAULT_EVM_CHAIN_ID ? (0, import_datasources11.getENSRootChainId)(namespaceId) : chainId;
3966
+ return chainId === DEFAULT_EVM_CHAIN_ID ? (0, import_datasources12.getENSRootChainId)(namespaceId) : chainId;
3947
3967
  };
3948
3968
 
3949
3969
  // src/resolution/resolver-records-selection.ts