@ensnode/ensnode-sdk 0.0.0-next-20260106001025 → 0.0.0-next-20260108092445

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
@@ -54,6 +54,7 @@ __export(index_exports, {
54
54
  LruCache: () => LruCache,
55
55
  NFTMintStatuses: () => NFTMintStatuses,
56
56
  NFTTransferTypes: () => NFTTransferTypes,
57
+ NODE_ANY: () => NODE_ANY,
57
58
  NameTokenOwnershipTypes: () => NameTokenOwnershipTypes,
58
59
  NameTokensResponseCodes: () => NameTokensResponseCodes,
59
60
  NameTokensResponseErrorCodes: () => NameTokensResponseErrorCodes,
@@ -63,6 +64,7 @@ __export(index_exports, {
63
64
  RECORDS_PER_PAGE_DEFAULT: () => RECORDS_PER_PAGE_DEFAULT,
64
65
  RECORDS_PER_PAGE_MAX: () => RECORDS_PER_PAGE_MAX,
65
66
  ROOT_NODE: () => ROOT_NODE,
67
+ ROOT_RESOURCE: () => ROOT_RESOURCE,
66
68
  ReferrerDetailResponseCodes: () => ReferrerDetailResponseCodes,
67
69
  ReferrerLeaderboardPageResponseCodes: () => ReferrerLeaderboardPageResponseCodes,
68
70
  RegistrarActionTypes: () => RegistrarActionTypes,
@@ -126,15 +128,20 @@ __export(index_exports, {
126
128
  deserializedNameTokensResponse: () => deserializedNameTokensResponse,
127
129
  durationBetween: () => durationBetween,
128
130
  encodeLabelHash: () => encodeLabelHash,
131
+ encodedLabelToLabelhash: () => encodedLabelToLabelhash,
129
132
  evmChainIdToCoinType: () => evmChainIdToCoinType,
130
133
  formatAccountId: () => formatAccountId,
131
134
  formatAssetId: () => formatAssetId,
132
135
  formatNFTTransferEventMetadata: () => formatNFTTransferEventMetadata,
133
136
  getBasenamesSubregistryId: () => getBasenamesSubregistryId,
134
137
  getBasenamesSubregistryManagedName: () => getBasenamesSubregistryManagedName,
138
+ getCanonicalId: () => getCanonicalId,
135
139
  getCurrencyInfo: () => getCurrencyInfo,
136
140
  getDatasourceContract: () => getDatasourceContract,
137
141
  getENSRootChainId: () => import_datasources2.getENSRootChainId,
142
+ getENSv1Registry: () => getENSv1Registry,
143
+ getENSv2RootRegistry: () => getENSv2RootRegistry,
144
+ getENSv2RootRegistryId: () => getENSv2RootRegistryId,
138
145
  getEthnamesSubregistryId: () => getEthnamesSubregistryId,
139
146
  getEthnamesSubregistryManagedName: () => getEthnamesSubregistryManagedName,
140
147
  getLatestIndexedBlockRef: () => getLatestIndexedBlockRef,
@@ -151,16 +158,33 @@ __export(index_exports, {
151
158
  getTimestampForHighestOmnichainKnownBlock: () => getTimestampForHighestOmnichainKnownBlock,
152
159
  getTimestampForLowestOmnichainStartBlock: () => getTimestampForLowestOmnichainStartBlock,
153
160
  hasNullByte: () => hasNullByte,
161
+ interpretAddress: () => interpretAddress,
162
+ interpretAddressRecordValue: () => interpretAddressRecordValue,
163
+ interpretNameRecordValue: () => interpretNameRecordValue,
164
+ interpretTextRecordKey: () => interpretTextRecordKey,
165
+ interpretTextRecordValue: () => interpretTextRecordValue,
166
+ interpretTokenIdAsLabelHash: () => interpretTokenIdAsLabelHash,
167
+ interpretTokenIdAsNode: () => interpretTokenIdAsNode,
154
168
  interpretedLabelsToInterpretedName: () => interpretedLabelsToInterpretedName,
169
+ interpretedNameToInterpretedLabels: () => interpretedNameToInterpretedLabels,
170
+ interpretedNameToLabelHashPath: () => interpretedNameToLabelHashPath,
171
+ isENSv1Registry: () => isENSv1Registry,
172
+ isENSv2RootRegistry: () => isENSv2RootRegistry,
155
173
  isEncodedLabelHash: () => isEncodedLabelHash,
156
174
  isHttpProtocol: () => isHttpProtocol,
175
+ isInterpetedLabel: () => isInterpetedLabel,
176
+ isInterpretedName: () => isInterpretedName,
157
177
  isLabelHash: () => isLabelHash,
158
178
  isNormalizedLabel: () => isNormalizedLabel,
159
179
  isNormalizedName: () => isNormalizedName,
180
+ isPccFuseSet: () => isPccFuseSet,
160
181
  isPriceCurrencyEqual: () => isPriceCurrencyEqual,
161
182
  isPriceEqual: () => isPriceEqual,
162
183
  isRegistrarActionPricingAvailable: () => isRegistrarActionPricingAvailable,
163
184
  isRegistrarActionReferralAvailable: () => isRegistrarActionReferralAvailable,
185
+ isRegistrationExpired: () => isRegistrationExpired,
186
+ isRegistrationFullyExpired: () => isRegistrationFullyExpired,
187
+ isRegistrationInGracePeriod: () => isRegistrationInGracePeriod,
164
188
  isResolvedIdentity: () => isResolvedIdentity,
165
189
  isSelectionEmpty: () => isSelectionEmpty,
166
190
  isSubgraphCompatible: () => isSubgraphCompatible,
@@ -170,7 +194,20 @@ __export(index_exports, {
170
194
  literalLabelToInterpretedLabel: () => literalLabelToInterpretedLabel,
171
195
  literalLabelsToInterpretedName: () => literalLabelsToInterpretedName,
172
196
  literalLabelsToLiteralName: () => literalLabelsToLiteralName,
197
+ makeContractMatcher: () => makeContractMatcher,
173
198
  makeENSApiPublicConfigSchema: () => makeENSApiPublicConfigSchema,
199
+ makeENSv1DomainId: () => makeENSv1DomainId,
200
+ makeENSv2DomainId: () => makeENSv2DomainId,
201
+ makeLatestRegistrationId: () => makeLatestRegistrationId,
202
+ makeLatestRenewalId: () => makeLatestRenewalId,
203
+ makePermissionsId: () => makePermissionsId,
204
+ makePermissionsResourceId: () => makePermissionsResourceId,
205
+ makePermissionsUserId: () => makePermissionsUserId,
206
+ makeRegistrationId: () => makeRegistrationId,
207
+ makeRegistryId: () => makeRegistryId,
208
+ makeRenewalId: () => makeRenewalId,
209
+ makeResolverId: () => makeResolverId,
210
+ makeResolverRecordsId: () => makeResolverRecordsId,
174
211
  makeSubdomainNode: () => makeSubdomainNode,
175
212
  maybeGetDatasourceContract: () => maybeGetDatasourceContract,
176
213
  nameTokensPrerequisites: () => nameTokensPrerequisites,
@@ -225,7 +262,7 @@ var import_v46 = require("zod/v4");
225
262
  var import_v45 = require("zod/v4");
226
263
 
227
264
  // src/ensindexer/config/zod-schemas.ts
228
- var import_v43 = __toESM(require("zod/v4"), 1);
265
+ var import_v43 = require("zod/v4");
229
266
 
230
267
  // src/shared/account-id.ts
231
268
  var import_viem = require("viem");
@@ -297,7 +334,7 @@ var import_v42 = require("zod/v4");
297
334
  // src/shared/zod-schemas.ts
298
335
  var import_caip = require("caip");
299
336
  var import_viem8 = require("viem");
300
- var import_v4 = __toESM(require("zod/v4"), 1);
337
+ var import_v4 = require("zod/v4");
301
338
 
302
339
  // src/ens/index.ts
303
340
  var import_datasources2 = require("@ensnode/datasources");
@@ -329,6 +366,8 @@ var ETH_NODE = (0, import_viem2.namehash)("eth");
329
366
  var BASENAMES_NODE = (0, import_viem2.namehash)("base.eth");
330
367
  var LINEANAMES_NODE = (0, import_viem2.namehash)("linea.eth");
331
368
  var ADDR_REVERSE_NODE = (0, import_viem2.namehash)("addr.reverse");
369
+ var NODE_ANY = import_viem2.zeroHash;
370
+ var ROOT_RESOURCE = 0n;
332
371
 
333
372
  // src/ens/dns-encoded-name.ts
334
373
  var import_viem3 = require("viem");
@@ -377,6 +416,10 @@ function isEncodedLabelHash(maybeEncodedLabelHash) {
377
416
  return expectedFormatting && includesLabelHash;
378
417
  }
379
418
 
419
+ // src/ens/fuses.ts
420
+ var PARENT_CANNOT_CONTROL = 65536;
421
+ var isPccFuseSet = (fuses) => (fuses & PARENT_CANNOT_CONTROL) === PARENT_CANNOT_CONTROL;
422
+
380
423
  // src/ens/is-normalized.ts
381
424
  var import_ens = require("viem/ens");
382
425
  function isNormalizedName(name) {
@@ -547,7 +590,7 @@ function addPrices(...prices) {
547
590
  );
548
591
  }
549
592
 
550
- // src/shared/reinterpretation.ts
593
+ // src/shared/interpretation/reinterpretation.ts
551
594
  var import_viem7 = require("viem");
552
595
  function reinterpretLabel(label) {
553
596
  if (label === "") {
@@ -568,14 +611,14 @@ function reinterpretName(name) {
568
611
  }
569
612
 
570
613
  // src/shared/zod-schemas.ts
571
- var makeFiniteNonNegativeNumberSchema = (valueLabel = "Value") => import_v4.default.number({
614
+ var makeFiniteNonNegativeNumberSchema = (valueLabel = "Value") => import_v4.z.number({
572
615
  // NOTE: Zod's implementation of `number` automatically rejects NaN and Infinity values.
573
616
  // and therefore the finite check is implicit.
574
617
  error: `${valueLabel} must be a finite number.`
575
618
  }).nonnegative({
576
619
  error: `${valueLabel} must be a non-negative number (>=0).`
577
620
  });
578
- var makeIntegerSchema = (valueLabel = "Value") => import_v4.default.int({
621
+ var makeIntegerSchema = (valueLabel = "Value") => import_v4.z.int({
579
622
  error: `${valueLabel} must be an integer.`
580
623
  });
581
624
  var makePositiveIntegerSchema = (valueLabel = "Value") => makeIntegerSchema(valueLabel).positive({
@@ -584,12 +627,12 @@ var makePositiveIntegerSchema = (valueLabel = "Value") => makeIntegerSchema(valu
584
627
  var makeNonNegativeIntegerSchema = (valueLabel = "Value") => makeIntegerSchema(valueLabel).nonnegative({
585
628
  error: `${valueLabel} must be a non-negative integer (>=0).`
586
629
  });
587
- var makeDurationSchema = (valueLabel = "Value") => import_v4.default.coerce.number({
630
+ var makeDurationSchema = (valueLabel = "Value") => import_v4.z.coerce.number({
588
631
  error: `${valueLabel} must be a number.`
589
632
  }).pipe(makeNonNegativeIntegerSchema(valueLabel));
590
633
  var makeChainIdSchema = (valueLabel = "Chain ID") => makePositiveIntegerSchema(valueLabel).transform((val) => val);
591
- var makeChainIdStringSchema = (valueLabel = "Chain ID String") => import_v4.default.string({ error: `${valueLabel} must be a string representing a chain ID.` }).pipe(import_v4.default.coerce.number({ error: `${valueLabel} must represent a positive integer (>0).` })).pipe(makeChainIdSchema(`The numeric value represented by ${valueLabel}`));
592
- var makeLowercaseAddressSchema = (valueLabel = "EVM address") => import_v4.default.string().check((ctx) => {
634
+ var makeChainIdStringSchema = (valueLabel = "Chain ID String") => import_v4.z.string({ error: `${valueLabel} must be a string representing a chain ID.` }).pipe(import_v4.z.coerce.number({ error: `${valueLabel} must represent a positive integer (>0).` })).pipe(makeChainIdSchema(`The numeric value represented by ${valueLabel}`));
635
+ var makeLowercaseAddressSchema = (valueLabel = "EVM address") => import_v4.z.string().check((ctx) => {
593
636
  if (!(0, import_viem8.isAddress)(ctx.value)) {
594
637
  ctx.issues.push({
595
638
  code: "custom",
@@ -598,14 +641,14 @@ var makeLowercaseAddressSchema = (valueLabel = "EVM address") => import_v4.defau
598
641
  });
599
642
  }
600
643
  }).transform((val) => asLowerCaseAddress(val));
601
- var makeDatetimeSchema = (valueLabel = "Datetime string") => import_v4.default.iso.datetime({ error: `${valueLabel} must be a string in ISO 8601 format.` }).transform((v) => new Date(v));
644
+ var makeDatetimeSchema = (valueLabel = "Datetime string") => import_v4.z.iso.datetime({ error: `${valueLabel} must be a string in ISO 8601 format.` }).transform((v) => new Date(v));
602
645
  var makeUnixTimestampSchema = (valueLabel = "Timestamp") => makeIntegerSchema(valueLabel);
603
- var makeUrlSchema = (valueLabel = "Value") => import_v4.default.url({
646
+ var makeUrlSchema = (valueLabel = "Value") => import_v4.z.url({
604
647
  error: `${valueLabel} must be a valid URL string (e.g., http://localhost:8080 or https://example.com).`,
605
648
  abort: true
606
649
  }).transform((v) => new URL(v));
607
650
  var makeBlockNumberSchema = (valueLabel = "Block number") => makeNonNegativeIntegerSchema(valueLabel);
608
- var makeBlockrangeSchema = (valueLabel = "Value") => import_v4.default.strictObject(
651
+ var makeBlockrangeSchema = (valueLabel = "Value") => import_v4.z.strictObject(
609
652
  {
610
653
  startBlock: makeBlockNumberSchema(`${valueLabel}.startBlock`).optional(),
611
654
  endBlock: makeBlockNumberSchema(`${valueLabel}.endBlock`).optional()
@@ -622,7 +665,7 @@ var makeBlockrangeSchema = (valueLabel = "Value") => import_v4.default.strictObj
622
665
  },
623
666
  { error: `${valueLabel}: startBlock must be before or equal to endBlock` }
624
667
  );
625
- var makeBlockRefSchema = (valueLabel = "Value") => import_v4.default.strictObject(
668
+ var makeBlockRefSchema = (valueLabel = "Value") => import_v4.z.strictObject(
626
669
  {
627
670
  timestamp: makeUnixTimestampSchema(`${valueLabel}.timestamp`),
628
671
  number: makeBlockNumberSchema(`${valueLabel}.number`)
@@ -631,35 +674,35 @@ var makeBlockRefSchema = (valueLabel = "Value") => import_v4.default.strictObjec
631
674
  error: `${valueLabel} must be a valid BlockRef object.`
632
675
  }
633
676
  );
634
- var makeENSNamespaceIdSchema = (valueLabel = "ENSNamespaceId") => import_v4.default.enum(import_datasources.ENSNamespaceIds, {
677
+ var makeENSNamespaceIdSchema = (valueLabel = "ENSNamespaceId") => import_v4.z.enum(import_datasources.ENSNamespaceIds, {
635
678
  error() {
636
679
  return `Invalid ${valueLabel}. Supported ENS namespace IDs are: ${Object.keys(import_datasources.ENSNamespaceIds).join(", ")}`;
637
680
  }
638
681
  });
639
- var makePriceAmountSchema = (valueLabel = "Amount") => import_v4.default.coerce.bigint({
682
+ var makePriceAmountSchema = (valueLabel = "Amount") => import_v4.z.coerce.bigint({
640
683
  error: `${valueLabel} must represent a bigint.`
641
684
  }).nonnegative({
642
685
  error: `${valueLabel} must not be negative.`
643
686
  });
644
- var makePriceCurrencySchema = (currency, valueLabel = "Price Currency") => import_v4.default.strictObject({
687
+ var makePriceCurrencySchema = (currency, valueLabel = "Price Currency") => import_v4.z.strictObject({
645
688
  amount: makePriceAmountSchema(`${valueLabel} amount`),
646
- currency: import_v4.default.literal(currency, {
689
+ currency: import_v4.z.literal(currency, {
647
690
  error: `${valueLabel} currency must be set to '${currency}'.`
648
691
  })
649
692
  });
650
693
  var makePriceEthSchema = (valueLabel = "Price ETH") => makePriceCurrencySchema(CurrencyIds.ETH, valueLabel).transform((v) => v);
651
- var makeAccountIdSchema = (valueLabel = "AccountId") => import_v4.default.strictObject({
694
+ var makeAccountIdSchema = (valueLabel = "AccountId") => import_v4.z.strictObject({
652
695
  chainId: makeChainIdSchema(`${valueLabel} chain ID`),
653
696
  address: makeLowercaseAddressSchema(`${valueLabel} address`)
654
697
  });
655
- var makeAccountIdStringSchema = (valueLabel = "Account ID String") => import_v4.default.coerce.string().transform((v) => {
698
+ var makeAccountIdStringSchema = (valueLabel = "Account ID String") => import_v4.z.coerce.string().transform((v) => {
656
699
  const result = new import_caip.AccountId(v);
657
700
  return {
658
701
  chainId: Number(result.chainId.reference),
659
702
  address: result.address
660
703
  };
661
704
  }).pipe(makeAccountIdSchema(valueLabel));
662
- var makeHexStringSchema = (options, valueLabel = "String representation of bytes array") => import_v4.default.string().check(function invariant_isHexEncoded(ctx) {
705
+ var makeHexStringSchema = (options, valueLabel = "String representation of bytes array") => import_v4.z.string().check(function invariant_isHexEncoded(ctx) {
663
706
  if (!(0, import_viem8.isHex)(ctx.value)) {
664
707
  ctx.issues.push({
665
708
  code: "custom",
@@ -680,7 +723,7 @@ var makeHexStringSchema = (options, valueLabel = "String representation of bytes
680
723
  });
681
724
  var makeNodeSchema = (valueLabel = "Node") => makeHexStringSchema({ bytesCount: 32 }, valueLabel);
682
725
  var makeTransactionHashSchema = (valueLabel = "Transaction hash") => makeHexStringSchema({ bytesCount: 32 }, valueLabel);
683
- var makeReinterpretedNameSchema = (valueLabel = "Reinterpreted Name") => import_v4.default.string().transform((v) => v).check((ctx) => {
726
+ var makeReinterpretedNameSchema = (valueLabel = "Reinterpreted Name") => import_v4.z.string().transform((v) => v).check((ctx) => {
684
727
  try {
685
728
  reinterpretName(ctx.value);
686
729
  } catch (error) {
@@ -943,12 +986,60 @@ var getDatasourceContract = (namespaceId, datasourceName, contractName) => {
943
986
  }
944
987
  return contract;
945
988
  };
989
+ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
990
+ const a = maybeGetDatasourceContract(namespace, datasourceName, contractName);
991
+ return a && accountIdEqual(a, b);
992
+ };
946
993
 
947
- // src/shared/labelhash.ts
994
+ // src/shared/interpretation/interpret-address.ts
948
995
  var import_viem9 = require("viem");
949
- var labelhashLiteralLabel = (label) => (0, import_viem9.keccak256)((0, import_viem9.stringToBytes)(label));
996
+ var interpretAddress = (owner) => (0, import_viem9.isAddressEqual)(import_viem9.zeroAddress, owner) ? null : owner;
997
+
998
+ // src/shared/interpretation/interpret-record-values.ts
999
+ var import_viem10 = require("viem");
1000
+
1001
+ // src/shared/null-bytes.ts
1002
+ var hasNullByte = (value) => value.indexOf("\0") !== -1;
1003
+ var stripNullBytes = (value) => value.replaceAll("\0", "");
1004
+
1005
+ // src/shared/interpretation/interpret-record-values.ts
1006
+ function interpretNameRecordValue(value) {
1007
+ if (value === "") return null;
1008
+ if (!isNormalizedName(value)) return null;
1009
+ return value;
1010
+ }
1011
+ function interpretAddressRecordValue(value) {
1012
+ if (hasNullByte(value)) return null;
1013
+ if (value === "") return null;
1014
+ if (value === "0x") return null;
1015
+ if (!(0, import_viem10.isAddress)(value)) return value;
1016
+ if ((0, import_viem10.isAddressEqual)(value, import_viem10.zeroAddress)) return null;
1017
+ return asLowerCaseAddress(value);
1018
+ }
1019
+ function interpretTextRecordKey(key) {
1020
+ if (hasNullByte(key)) return null;
1021
+ if (key === "") return null;
1022
+ return key;
1023
+ }
1024
+ function interpretTextRecordValue(value) {
1025
+ if (hasNullByte(value)) return null;
1026
+ if (value === "") return null;
1027
+ return value;
1028
+ }
1029
+
1030
+ // src/shared/interpretation/interpret-tokenid.ts
1031
+ var interpretTokenIdAsLabelHash = (tokenId) => uint256ToHex32(tokenId);
1032
+ var interpretTokenIdAsNode = (tokenId) => uint256ToHex32(tokenId);
950
1033
 
951
- // src/shared/interpretation.ts
1034
+ // src/shared/interpretation/interpreted-names-and-labels.ts
1035
+ var import_viem12 = require("viem");
1036
+ var import_ens5 = require("viem/ens");
1037
+
1038
+ // src/shared/labelhash.ts
1039
+ var import_viem11 = require("viem");
1040
+ var labelhashLiteralLabel = (label) => (0, import_viem11.keccak256)((0, import_viem11.stringToBytes)(label));
1041
+
1042
+ // src/shared/interpretation/interpreted-names-and-labels.ts
952
1043
  function literalLabelToInterpretedLabel(label) {
953
1044
  if (isNormalizedLabel(label)) return label;
954
1045
  return encodeLabelHash(labelhashLiteralLabel(label));
@@ -962,10 +1053,39 @@ function interpretedLabelsToInterpretedName(labels) {
962
1053
  function literalLabelsToLiteralName(labels) {
963
1054
  return labels.join(".");
964
1055
  }
965
-
966
- // src/shared/null-bytes.ts
967
- var hasNullByte = (value) => value.indexOf("\0") !== -1;
968
- var stripNullBytes = (value) => value.replaceAll("\0", "");
1056
+ function interpretedNameToInterpretedLabels(name) {
1057
+ return name.split(".");
1058
+ }
1059
+ function encodedLabelToLabelhash(label) {
1060
+ if (label.length !== 66) return null;
1061
+ if (label.indexOf("[") !== 0) return null;
1062
+ if (label.indexOf("]") !== 65) return null;
1063
+ const hash = `0x${label.slice(1, 65)}`;
1064
+ if (!(0, import_viem12.isHex)(hash)) return null;
1065
+ return hash;
1066
+ }
1067
+ function isInterpetedLabel(label) {
1068
+ if (label.startsWith("[")) {
1069
+ const labelHash = encodedLabelToLabelhash(label);
1070
+ if (labelHash === null) return false;
1071
+ }
1072
+ return isNormalizedLabel(label);
1073
+ }
1074
+ function isInterpretedName(name) {
1075
+ return name.split(".").every(isInterpetedLabel);
1076
+ }
1077
+ function interpretedNameToLabelHashPath(name) {
1078
+ return interpretedNameToInterpretedLabels(name).map((label) => {
1079
+ if (!isInterpetedLabel(label)) {
1080
+ throw new Error(
1081
+ `Invariant(interpretedNameToLabelHashPath): Expected InterpretedLabel, received '${label}'.`
1082
+ );
1083
+ }
1084
+ const maybeLabelHash = encodedLabelToLabelhash(label);
1085
+ if (maybeLabelHash !== null) return maybeLabelHash;
1086
+ return (0, import_ens5.labelhash)(label);
1087
+ }).toReversed();
1088
+ }
969
1089
 
970
1090
  // src/shared/numbers.ts
971
1091
  function bigIntToNumber(n) {
@@ -982,6 +1102,14 @@ function bigIntToNumber(n) {
982
1102
  return Number(n);
983
1103
  }
984
1104
 
1105
+ // src/shared/root-registry.ts
1106
+ var import_datasources4 = require("@ensnode/datasources");
1107
+ var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources4.DatasourceNames.ENSRoot, "ENSv1Registry");
1108
+ var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
1109
+ var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources4.DatasourceNames.ENSRoot, "RootRegistry");
1110
+ var getENSv2RootRegistryId = (namespace) => makeRegistryId(getENSv2RootRegistry(namespace));
1111
+ var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
1112
+
985
1113
  // src/shared/serialize.ts
986
1114
  var import_caip2 = require("caip");
987
1115
  function serializeChainId(chainId) {
@@ -1008,6 +1136,23 @@ function formatAccountId(accountId) {
1008
1136
  address: accountId.address
1009
1137
  }).toLowerCase();
1010
1138
  }
1139
+ function formatAssetId({
1140
+ assetNamespace,
1141
+ contract: { chainId, address },
1142
+ tokenId
1143
+ }) {
1144
+ return import_caip2.AssetId.format({
1145
+ chainId: { namespace: "eip155", reference: chainId.toString() },
1146
+ assetName: { namespace: assetNamespace, reference: address },
1147
+ tokenId: uint256ToHex32(tokenId)
1148
+ }).toLowerCase();
1149
+ }
1150
+
1151
+ // src/shared/types.ts
1152
+ var AssetNamespaces = {
1153
+ ERC721: "erc721",
1154
+ ERC1155: "erc1155"
1155
+ };
1011
1156
 
1012
1157
  // src/shared/url.ts
1013
1158
  function isHttpProtocol(url) {
@@ -1018,7 +1163,7 @@ function isWebSocketProtocol(url) {
1018
1163
  }
1019
1164
 
1020
1165
  // src/ensindexer/config/is-subgraph-compatible.ts
1021
- var import_datasources4 = require("@ensnode/datasources");
1166
+ var import_datasources5 = require("@ensnode/datasources");
1022
1167
 
1023
1168
  // src/ensindexer/config/types.ts
1024
1169
  var PluginName = /* @__PURE__ */ ((PluginName2) => {
@@ -1029,6 +1174,7 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
1029
1174
  PluginName2["ProtocolAcceleration"] = "protocol-acceleration";
1030
1175
  PluginName2["Registrars"] = "registrars";
1031
1176
  PluginName2["TokenScope"] = "tokenscope";
1177
+ PluginName2["ENSv2"] = "ensv2";
1032
1178
  return PluginName2;
1033
1179
  })(PluginName || {});
1034
1180
 
@@ -1037,7 +1183,7 @@ function isSubgraphCompatible(config) {
1037
1183
  const onlySubgraphPluginActivated = config.plugins.length === 1 && config.plugins[0] === "subgraph" /* Subgraph */;
1038
1184
  const isSubgraphLabelSet = config.labelSet.labelSetId === "subgraph" && config.labelSet.labelSetVersion === 0;
1039
1185
  const isEnsTestEnvLabelSet = config.labelSet.labelSetId === "ens-test-env" && config.labelSet.labelSetVersion === 0;
1040
- const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === import_datasources4.ENSNamespaceIds.EnsTestEnv && isEnsTestEnvLabelSet;
1186
+ const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === import_datasources5.ENSNamespaceIds.EnsTestEnv && isEnsTestEnvLabelSet;
1041
1187
  return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
1042
1188
  }
1043
1189
 
@@ -1054,26 +1200,26 @@ function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
1054
1200
  }
1055
1201
 
1056
1202
  // src/ensindexer/config/zod-schemas.ts
1057
- var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.default.array(makeChainIdSchema(valueLabel), {
1203
+ var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.z.array(makeChainIdSchema(valueLabel), {
1058
1204
  error: `${valueLabel} must be an array.`
1059
1205
  }).min(1, { error: `${valueLabel} list must include at least one element.` }).transform((v) => new Set(v));
1060
- var makePluginsListSchema = (valueLabel = "Plugins") => import_v43.default.array(import_v43.default.string(), {
1206
+ var makePluginsListSchema = (valueLabel = "Plugins") => import_v43.z.array(import_v43.z.string(), {
1061
1207
  error: `${valueLabel} must be a list of strings.`
1062
1208
  }).min(1, {
1063
1209
  error: `${valueLabel} must be a list of strings with at least one string value`
1064
1210
  }).refine((arr) => arr.length === uniq(arr).length, {
1065
1211
  error: `${valueLabel} cannot contain duplicate values.`
1066
1212
  });
1067
- var makeDatabaseSchemaNameSchema = (valueLabel = "Database schema name") => import_v43.default.string({ error: `${valueLabel} must be a string` }).trim().nonempty({
1213
+ var makeDatabaseSchemaNameSchema = (valueLabel = "Database schema name") => import_v43.z.string({ error: `${valueLabel} must be a string` }).trim().nonempty({
1068
1214
  error: `${valueLabel} is required and must be a non-empty string.`
1069
1215
  });
1070
1216
  var makeLabelSetIdSchema = (valueLabel) => {
1071
- return import_v43.default.string({ error: `${valueLabel} must be a string` }).min(1, { error: `${valueLabel} must be 1-50 characters long` }).max(50, { error: `${valueLabel} must be 1-50 characters long` }).regex(/^[a-z-]+$/, {
1217
+ return import_v43.z.string({ error: `${valueLabel} must be a string` }).min(1, { error: `${valueLabel} must be 1-50 characters long` }).max(50, { error: `${valueLabel} must be 1-50 characters long` }).regex(/^[a-z-]+$/, {
1072
1218
  error: `${valueLabel} can only contain lowercase letters (a-z) and hyphens (-)`
1073
1219
  });
1074
1220
  };
1075
1221
  var makeLabelSetVersionSchema = (valueLabel) => {
1076
- return import_v43.default.coerce.number({ error: `${valueLabel} must be an integer.` }).pipe(makeNonNegativeIntegerSchema(valueLabel));
1222
+ return import_v43.z.coerce.number({ error: `${valueLabel} must be an integer.` }).pipe(makeNonNegativeIntegerSchema(valueLabel));
1077
1223
  };
1078
1224
  var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
1079
1225
  let valueLabelLabelSetId = valueLabel;
@@ -1085,13 +1231,13 @@ var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
1085
1231
  valueLabelLabelSetId = `${valueLabel}.labelSetId`;
1086
1232
  valueLabelLabelSetVersion = `${valueLabel}.labelSetVersion`;
1087
1233
  }
1088
- return import_v43.default.object({
1234
+ return import_v43.z.object({
1089
1235
  labelSetId: makeLabelSetIdSchema(valueLabelLabelSetId),
1090
1236
  labelSetVersion: makeLabelSetVersionSchema(valueLabelLabelSetVersion)
1091
1237
  });
1092
1238
  };
1093
- var makeNonEmptyStringSchema = (valueLabel = "Value") => import_v43.default.string().nonempty({ error: `${valueLabel} must be a non-empty string.` });
1094
- var makeENSIndexerVersionInfoSchema = (valueLabel = "Value") => import_v43.default.strictObject(
1239
+ var makeNonEmptyStringSchema = (valueLabel = "Value") => import_v43.z.string().nonempty({ error: `${valueLabel} must be a non-empty string.` });
1240
+ var makeENSIndexerVersionInfoSchema = (valueLabel = "Value") => import_v43.z.strictObject(
1095
1241
  {
1096
1242
  nodejs: makeNonEmptyStringSchema(),
1097
1243
  ponder: makeNonEmptyStringSchema(),
@@ -1115,10 +1261,10 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
1115
1261
  });
1116
1262
  }
1117
1263
  }
1118
- var makeENSIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") => import_v43.default.object({
1264
+ var makeENSIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") => import_v43.z.object({
1119
1265
  labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
1120
1266
  indexedChainIds: makeIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
1121
- isSubgraphCompatible: import_v43.default.boolean({ error: `${valueLabel}.isSubgraphCompatible` }),
1267
+ isSubgraphCompatible: import_v43.z.boolean({ error: `${valueLabel}.isSubgraphCompatible` }),
1122
1268
  namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
1123
1269
  plugins: makePluginsListSchema(`${valueLabel}.plugins`),
1124
1270
  databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
@@ -1182,7 +1328,7 @@ ${(0, import_v47.prettifyError)(parsed.error)}
1182
1328
  }
1183
1329
 
1184
1330
  // src/ensindexer/config/label-utils.ts
1185
- var import_viem10 = require("viem");
1331
+ var import_viem13 = require("viem");
1186
1332
  function labelHashToBytes(labelHash) {
1187
1333
  try {
1188
1334
  if (labelHash.length !== 66) {
@@ -1194,7 +1340,7 @@ function labelHashToBytes(labelHash) {
1194
1340
  if (!labelHash.startsWith("0x")) {
1195
1341
  throw new Error("Labelhash must be 0x-prefixed");
1196
1342
  }
1197
- const bytes = (0, import_viem10.hexToBytes)(labelHash);
1343
+ const bytes = (0, import_viem13.hexToBytes)(labelHash);
1198
1344
  if (bytes.length !== 32) {
1199
1345
  throw new Error(`Invalid labelHash length ${bytes.length} bytes (expected 32)`);
1200
1346
  }
@@ -1290,7 +1436,7 @@ function serializeENSIndexerPublicConfig(config) {
1290
1436
  var import_v49 = require("zod/v4");
1291
1437
 
1292
1438
  // src/ensindexer/indexing-status/zod-schemas.ts
1293
- var import_v48 = __toESM(require("zod/v4"), 1);
1439
+ var import_v48 = require("zod/v4");
1294
1440
 
1295
1441
  // src/ensindexer/indexing-status/types.ts
1296
1442
  var ChainIndexingConfigTypeIds = {
@@ -1716,7 +1862,7 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
1716
1862
  ctx.issues.push({
1717
1863
  code: "custom",
1718
1864
  input: ctx.value,
1719
- message: `'snapshotTime' must be greater than or equal to the "highest known block timestamp" (${highestKnownBlockTimestamp})`
1865
+ message: `'snapshotTime' (${snapshotTime}) must be greater than or equal to the "highest known block timestamp" (${highestKnownBlockTimestamp})`
1720
1866
  });
1721
1867
  }
1722
1868
  }
@@ -1746,52 +1892,52 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
1746
1892
  }
1747
1893
 
1748
1894
  // src/ensindexer/indexing-status/zod-schemas.ts
1749
- var makeChainIndexingConfigSchema = (valueLabel = "Value") => import_v48.default.discriminatedUnion("configType", [
1750
- import_v48.default.strictObject({
1751
- configType: import_v48.default.literal(ChainIndexingConfigTypeIds.Indefinite),
1895
+ var makeChainIndexingConfigSchema = (valueLabel = "Value") => import_v48.z.discriminatedUnion("configType", [
1896
+ import_v48.z.strictObject({
1897
+ configType: import_v48.z.literal(ChainIndexingConfigTypeIds.Indefinite),
1752
1898
  startBlock: makeBlockRefSchema(valueLabel)
1753
1899
  }),
1754
- import_v48.default.strictObject({
1755
- configType: import_v48.default.literal(ChainIndexingConfigTypeIds.Definite),
1900
+ import_v48.z.strictObject({
1901
+ configType: import_v48.z.literal(ChainIndexingConfigTypeIds.Definite),
1756
1902
  startBlock: makeBlockRefSchema(valueLabel),
1757
1903
  endBlock: makeBlockRefSchema(valueLabel)
1758
1904
  })
1759
1905
  ]);
1760
- var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v48.default.strictObject({
1761
- chainStatus: import_v48.default.literal(ChainIndexingStatusIds.Queued),
1906
+ var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v48.z.strictObject({
1907
+ chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Queued),
1762
1908
  config: makeChainIndexingConfigSchema(valueLabel)
1763
1909
  }).check(invariant_chainSnapshotQueuedBlocks);
1764
- var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v48.default.strictObject({
1765
- chainStatus: import_v48.default.literal(ChainIndexingStatusIds.Backfill),
1910
+ var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v48.z.strictObject({
1911
+ chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Backfill),
1766
1912
  config: makeChainIndexingConfigSchema(valueLabel),
1767
1913
  latestIndexedBlock: makeBlockRefSchema(valueLabel),
1768
1914
  backfillEndBlock: makeBlockRefSchema(valueLabel)
1769
1915
  }).check(invariant_chainSnapshotBackfillBlocks);
1770
- var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => import_v48.default.strictObject({
1771
- chainStatus: import_v48.default.literal(ChainIndexingStatusIds.Completed),
1772
- config: import_v48.default.strictObject({
1773
- configType: import_v48.default.literal(ChainIndexingConfigTypeIds.Definite),
1916
+ var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => import_v48.z.strictObject({
1917
+ chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Completed),
1918
+ config: import_v48.z.strictObject({
1919
+ configType: import_v48.z.literal(ChainIndexingConfigTypeIds.Definite),
1774
1920
  startBlock: makeBlockRefSchema(valueLabel),
1775
1921
  endBlock: makeBlockRefSchema(valueLabel)
1776
1922
  }),
1777
1923
  latestIndexedBlock: makeBlockRefSchema(valueLabel)
1778
1924
  }).check(invariant_chainSnapshotCompletedBlocks);
1779
- var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => import_v48.default.strictObject({
1780
- chainStatus: import_v48.default.literal(ChainIndexingStatusIds.Following),
1781
- config: import_v48.default.strictObject({
1782
- configType: import_v48.default.literal(ChainIndexingConfigTypeIds.Indefinite),
1925
+ var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => import_v48.z.strictObject({
1926
+ chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Following),
1927
+ config: import_v48.z.strictObject({
1928
+ configType: import_v48.z.literal(ChainIndexingConfigTypeIds.Indefinite),
1783
1929
  startBlock: makeBlockRefSchema(valueLabel)
1784
1930
  }),
1785
1931
  latestIndexedBlock: makeBlockRefSchema(valueLabel),
1786
1932
  latestKnownBlock: makeBlockRefSchema(valueLabel)
1787
1933
  }).check(invariant_chainSnapshotFollowingBlocks);
1788
- var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v48.default.discriminatedUnion("chainStatus", [
1934
+ var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v48.z.discriminatedUnion("chainStatus", [
1789
1935
  makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
1790
1936
  makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
1791
1937
  makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
1792
1938
  makeChainIndexingStatusSnapshotFollowingSchema(valueLabel)
1793
1939
  ]);
1794
- var makeChainIndexingStatusesSchema = (valueLabel = "Value") => import_v48.default.record(makeChainIdStringSchema(), makeChainIndexingStatusSnapshotSchema(valueLabel), {
1940
+ var makeChainIndexingStatusesSchema = (valueLabel = "Value") => import_v48.z.record(makeChainIdStringSchema(), makeChainIndexingStatusSnapshotSchema(valueLabel), {
1795
1941
  error: "Chains indexing statuses must be an object mapping valid chain IDs to their indexing status snapshots."
1796
1942
  }).transform((serializedChainsIndexingStatus) => {
1797
1943
  const chainsIndexingStatus = /* @__PURE__ */ new Map();
@@ -1800,29 +1946,29 @@ var makeChainIndexingStatusesSchema = (valueLabel = "Value") => import_v48.defau
1800
1946
  }
1801
1947
  return chainsIndexingStatus;
1802
1948
  });
1803
- var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v48.default.strictObject({
1804
- omnichainStatus: import_v48.default.literal(OmnichainIndexingStatusIds.Unstarted),
1949
+ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v48.z.strictObject({
1950
+ omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Unstarted),
1805
1951
  chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainSnapshotUnstartedHasValidChains).transform((chains) => chains),
1806
1952
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1807
1953
  });
1808
- var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v48.default.strictObject({
1809
- omnichainStatus: import_v48.default.literal(OmnichainIndexingStatusIds.Backfill),
1954
+ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v48.z.strictObject({
1955
+ omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Backfill),
1810
1956
  chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotBackfillHasValidChains).transform(
1811
1957
  (chains) => chains
1812
1958
  ),
1813
1959
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1814
1960
  });
1815
- var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v48.default.strictObject({
1816
- omnichainStatus: import_v48.default.literal(OmnichainIndexingStatusIds.Completed),
1961
+ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v48.z.strictObject({
1962
+ omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Completed),
1817
1963
  chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotCompletedHasValidChains).transform((chains) => chains),
1818
1964
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1819
1965
  });
1820
- var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v48.default.strictObject({
1821
- omnichainStatus: import_v48.default.literal(OmnichainIndexingStatusIds.Following),
1966
+ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v48.z.strictObject({
1967
+ omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Following),
1822
1968
  chains: makeChainIndexingStatusesSchema(valueLabel),
1823
1969
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1824
1970
  });
1825
- var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v48.default.discriminatedUnion("omnichainStatus", [
1971
+ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v48.z.discriminatedUnion("omnichainStatus", [
1826
1972
  makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
1827
1973
  makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
1828
1974
  makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
@@ -1830,16 +1976,16 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
1830
1976
  ]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
1831
1977
  invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
1832
1978
  ).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
1833
- var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v48.default.strictObject({
1834
- strategy: import_v48.default.literal(CrossChainIndexingStrategyIds.Omnichain),
1979
+ var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v48.z.strictObject({
1980
+ strategy: import_v48.z.literal(CrossChainIndexingStrategyIds.Omnichain),
1835
1981
  slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
1836
1982
  snapshotTime: makeUnixTimestampSchema(valueLabel),
1837
1983
  omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
1838
1984
  }).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
1839
- var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v48.default.discriminatedUnion("strategy", [
1985
+ var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v48.z.discriminatedUnion("strategy", [
1840
1986
  makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
1841
1987
  ]);
1842
- var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v48.default.strictObject({
1988
+ var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v48.z.strictObject({
1843
1989
  projectedAt: makeUnixTimestampSchema(valueLabel),
1844
1990
  worstCaseDistance: makeDurationSchema(valueLabel),
1845
1991
  snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
@@ -2042,22 +2188,21 @@ function serializeIndexingStatusResponse(response) {
2042
2188
  var import_v416 = require("zod/v4");
2043
2189
 
2044
2190
  // src/api/name-tokens/zod-schemas.ts
2045
- var import_viem14 = require("viem");
2191
+ var import_viem17 = require("viem");
2046
2192
  var import_v415 = __toESM(require("zod/v4"), 1);
2047
2193
 
2048
2194
  // src/tokenscope/assets.ts
2049
- var import_caip4 = require("caip");
2050
- var import_viem13 = require("viem");
2195
+ var import_viem16 = require("viem");
2051
2196
  var import_v413 = require("zod/v4");
2052
2197
 
2053
2198
  // src/tokenscope/zod-schemas.ts
2054
2199
  var import_caip3 = require("caip");
2055
- var import_viem12 = require("viem");
2200
+ var import_viem15 = require("viem");
2056
2201
  var import_v412 = __toESM(require("zod/v4"), 1);
2057
2202
 
2058
2203
  // src/tokenscope/name-token.ts
2059
- var import_viem11 = require("viem");
2060
- var import_datasources5 = require("@ensnode/datasources");
2204
+ var import_viem14 = require("viem");
2205
+ var import_datasources6 = require("@ensnode/datasources");
2061
2206
  var NameTokenOwnershipTypes = {
2062
2207
  /**
2063
2208
  * Name Token is owned by NameWrapper account.
@@ -2088,12 +2233,12 @@ function serializeNameToken(nameToken) {
2088
2233
  function getNameWrapperAccounts(namespaceId) {
2089
2234
  const ethnamesNameWrapperAccount = getDatasourceContract(
2090
2235
  namespaceId,
2091
- import_datasources5.DatasourceNames.ENSRoot,
2236
+ import_datasources6.DatasourceNames.ENSRoot,
2092
2237
  "NameWrapper"
2093
2238
  );
2094
2239
  const lineanamesNameWrapperAccount = maybeGetDatasourceContract(
2095
2240
  namespaceId,
2096
- import_datasources5.DatasourceNames.Lineanames,
2241
+ import_datasources6.DatasourceNames.Lineanames,
2097
2242
  "NameWrapper"
2098
2243
  );
2099
2244
  const nameWrapperAccounts = [
@@ -2116,7 +2261,7 @@ function getNameTokenOwnership(namespaceId, name, owner) {
2116
2261
  owner
2117
2262
  };
2118
2263
  }
2119
- if ((0, import_viem11.isAddressEqual)(owner.address, import_viem11.zeroAddress)) {
2264
+ if ((0, import_viem14.isAddressEqual)(owner.address, import_viem14.zeroAddress)) {
2120
2265
  return {
2121
2266
  ownershipType: NameTokenOwnershipTypes.Burned,
2122
2267
  owner
@@ -2171,7 +2316,7 @@ var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_
2171
2316
  }, makeAssetIdSchema(valueLabel));
2172
2317
  function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
2173
2318
  const ownership = ctx.value;
2174
- if (ctx.value.owner.address === import_viem12.zeroAddress) {
2319
+ if (ctx.value.owner.address === import_viem15.zeroAddress) {
2175
2320
  ctx.issues.push({
2176
2321
  code: "custom",
2177
2322
  input: ctx.value,
@@ -2197,7 +2342,7 @@ var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Un
2197
2342
  }).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
2198
2343
  function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
2199
2344
  const ownership = ctx.value;
2200
- if (ctx.value.owner.address !== import_viem12.zeroAddress) {
2345
+ if (ctx.value.owner.address !== import_viem15.zeroAddress) {
2201
2346
  ctx.issues.push({
2202
2347
  code: "custom",
2203
2348
  input: ctx.value,
@@ -2218,10 +2363,6 @@ var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => im
2218
2363
  });
2219
2364
 
2220
2365
  // src/tokenscope/assets.ts
2221
- var AssetNamespaces = {
2222
- ERC721: "erc721",
2223
- ERC1155: "erc1155"
2224
- };
2225
2366
  function serializeAssetId(assetId) {
2226
2367
  return {
2227
2368
  assetNamespace: assetId.assetNamespace,
@@ -2239,14 +2380,6 @@ ${(0, import_v413.prettifyError)(parsed.error)}
2239
2380
  }
2240
2381
  return parsed.data;
2241
2382
  }
2242
- function formatAssetId(assetId) {
2243
- const { assetNamespace, contract, tokenId } = serializeAssetId(assetId);
2244
- return import_caip4.AssetId.format({
2245
- chainId: { namespace: "eip155", reference: contract.chainId.toString() },
2246
- assetName: { namespace: assetNamespace, reference: contract.address },
2247
- tokenId
2248
- }).toLowerCase();
2249
- }
2250
2383
  function parseAssetId(maybeAssetId, valueLabel) {
2251
2384
  const schema = makeAssetIdStringSchema(valueLabel);
2252
2385
  const parsed = schema.safeParse(maybeAssetId);
@@ -2275,13 +2408,13 @@ var NFTMintStatuses = {
2275
2408
  Burned: "burned"
2276
2409
  };
2277
2410
  var formatNFTTransferEventMetadata = (metadata) => {
2278
- const serializedAssetId = serializeAssetId(metadata.nft);
2411
+ const assetIdString = formatAssetId(metadata.nft);
2279
2412
  return [
2280
2413
  `Event: ${metadata.eventHandlerName}`,
2281
2414
  `Chain ID: ${metadata.chainId}`,
2282
2415
  `Block Number: ${metadata.blockNumber}`,
2283
2416
  `Transaction Hash: ${metadata.transactionHash}`,
2284
- `NFT: ${serializedAssetId}`
2417
+ `NFT: ${assetIdString}`
2285
2418
  ].map((line) => ` - ${line}`).join("\n");
2286
2419
  };
2287
2420
  var NFTTransferTypes = {
@@ -2387,11 +2520,11 @@ var NFTTransferTypes = {
2387
2520
  };
2388
2521
  var getNFTTransferType = (from, to, allowMintedRemint, metadata, currentlyIndexedOwner) => {
2389
2522
  const isIndexed = currentlyIndexedOwner !== void 0;
2390
- const isIndexedAsMinted = isIndexed && !(0, import_viem13.isAddressEqual)(currentlyIndexedOwner, import_viem13.zeroAddress);
2391
- const isMint = (0, import_viem13.isAddressEqual)(from, import_viem13.zeroAddress);
2392
- const isBurn = (0, import_viem13.isAddressEqual)(to, import_viem13.zeroAddress);
2393
- const isSelfTransfer = (0, import_viem13.isAddressEqual)(from, to);
2394
- if (isIndexed && !(0, import_viem13.isAddressEqual)(currentlyIndexedOwner, from)) {
2523
+ const isIndexedAsMinted = isIndexed && !(0, import_viem16.isAddressEqual)(currentlyIndexedOwner, import_viem16.zeroAddress);
2524
+ const isMint = (0, import_viem16.isAddressEqual)(from, import_viem16.zeroAddress);
2525
+ const isBurn = (0, import_viem16.isAddressEqual)(to, import_viem16.zeroAddress);
2526
+ const isSelfTransfer = (0, import_viem16.isAddressEqual)(from, to);
2527
+ if (isIndexed && !(0, import_viem16.isAddressEqual)(currentlyIndexedOwner, from)) {
2395
2528
  if (isMint && allowMintedRemint) {
2396
2529
  } else {
2397
2530
  throw new Error(
@@ -2524,7 +2657,7 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
2524
2657
  accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
2525
2658
  }).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
2526
2659
  const { name, domainId } = ctx.value;
2527
- if ((0, import_viem14.namehash)(name) !== domainId) {
2660
+ if ((0, import_viem17.namehash)(name) !== domainId) {
2528
2661
  ctx.issues.push({
2529
2662
  code: "custom",
2530
2663
  input: ctx.value,
@@ -2676,37 +2809,37 @@ function serializeNameTokensResponse(response) {
2676
2809
  var import_v420 = require("zod/v4");
2677
2810
 
2678
2811
  // src/api/registrar-actions/zod-schemas.ts
2679
- var import_ens7 = require("viem/ens");
2812
+ var import_ens10 = require("viem/ens");
2680
2813
  var import_v419 = __toESM(require("zod/v4"), 1);
2681
2814
 
2682
2815
  // ../ens-referrals/src/address.ts
2683
- var import_viem15 = require("viem");
2816
+ var import_viem18 = require("viem");
2684
2817
 
2685
2818
  // ../ens-referrals/src/encoding.ts
2686
- var import_viem16 = require("viem");
2819
+ var import_viem19 = require("viem");
2687
2820
  var ENCODED_REFERRER_BYTE_OFFSET = 12;
2688
2821
  var ENCODED_REFERRER_BYTE_LENGTH = 32;
2689
- var EXPECTED_ENCODED_REFERRER_PADDING = (0, import_viem16.pad)("0x", {
2822
+ var EXPECTED_ENCODED_REFERRER_PADDING = (0, import_viem19.pad)("0x", {
2690
2823
  size: ENCODED_REFERRER_BYTE_OFFSET,
2691
2824
  dir: "left"
2692
2825
  });
2693
- var ZERO_ENCODED_REFERRER = (0, import_viem16.pad)("0x", {
2826
+ var ZERO_ENCODED_REFERRER = (0, import_viem19.pad)("0x", {
2694
2827
  size: ENCODED_REFERRER_BYTE_LENGTH,
2695
2828
  dir: "left"
2696
2829
  });
2697
2830
  function decodeEncodedReferrer(encodedReferrer) {
2698
- if ((0, import_viem16.size)(encodedReferrer) !== ENCODED_REFERRER_BYTE_LENGTH) {
2831
+ if ((0, import_viem19.size)(encodedReferrer) !== ENCODED_REFERRER_BYTE_LENGTH) {
2699
2832
  throw new Error(
2700
2833
  `Encoded referrer value must be represented by ${ENCODED_REFERRER_BYTE_LENGTH} bytes.`
2701
2834
  );
2702
2835
  }
2703
- const padding = (0, import_viem16.slice)(encodedReferrer, 0, ENCODED_REFERRER_BYTE_OFFSET);
2836
+ const padding = (0, import_viem19.slice)(encodedReferrer, 0, ENCODED_REFERRER_BYTE_OFFSET);
2704
2837
  if (padding !== EXPECTED_ENCODED_REFERRER_PADDING) {
2705
- return import_viem16.zeroAddress;
2838
+ return import_viem19.zeroAddress;
2706
2839
  }
2707
- const decodedReferrer = (0, import_viem16.slice)(encodedReferrer, ENCODED_REFERRER_BYTE_OFFSET);
2840
+ const decodedReferrer = (0, import_viem19.slice)(encodedReferrer, ENCODED_REFERRER_BYTE_OFFSET);
2708
2841
  try {
2709
- return (0, import_viem16.getAddress)(decodedReferrer);
2842
+ return (0, import_viem19.getAddress)(decodedReferrer);
2710
2843
  } catch {
2711
2844
  throw new Error(`Decoded referrer value must be a valid EVM address.`);
2712
2845
  }
@@ -2716,7 +2849,7 @@ function decodeEncodedReferrer(encodedReferrer) {
2716
2849
  var REFERRERS_PER_LEADERBOARD_PAGE_MAX = 100;
2717
2850
 
2718
2851
  // ../ens-referrals/src/link.ts
2719
- var import_viem17 = require("viem");
2852
+ var import_viem20 = require("viem");
2720
2853
 
2721
2854
  // ../ens-referrals/src/referrer-detail.ts
2722
2855
  var ReferrerDetailTypeIds = {
@@ -2731,7 +2864,7 @@ var ReferrerDetailTypeIds = {
2731
2864
  };
2732
2865
 
2733
2866
  // src/registrars/zod-schemas.ts
2734
- var import_v417 = __toESM(require("zod/v4"), 1);
2867
+ var import_v417 = require("zod/v4");
2735
2868
 
2736
2869
  // src/registrars/registrar-action.ts
2737
2870
  var RegistrarActionTypes = {
@@ -2772,11 +2905,11 @@ function serializeRegistrarAction(registrarAction) {
2772
2905
  }
2773
2906
 
2774
2907
  // src/registrars/zod-schemas.ts
2775
- var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v417.default.object({
2908
+ var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v417.z.object({
2776
2909
  subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
2777
2910
  node: makeNodeSchema(`${valueLabel} Node`)
2778
2911
  });
2779
- var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v417.default.object({
2912
+ var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v417.z.object({
2780
2913
  subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
2781
2914
  node: makeNodeSchema(`${valueLabel} Node`),
2782
2915
  expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
@@ -2792,18 +2925,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
2792
2925
  });
2793
2926
  }
2794
2927
  }
2795
- var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v417.default.union([
2928
+ var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v417.z.union([
2796
2929
  // pricing available
2797
- import_v417.default.object({
2930
+ import_v417.z.object({
2798
2931
  baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
2799
2932
  premium: makePriceEthSchema(`${valueLabel} Premium`),
2800
2933
  total: makePriceEthSchema(`${valueLabel} Total`)
2801
2934
  }).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
2802
2935
  // pricing unknown
2803
- import_v417.default.object({
2804
- baseCost: import_v417.default.null(),
2805
- premium: import_v417.default.null(),
2806
- total: import_v417.default.null()
2936
+ import_v417.z.object({
2937
+ baseCost: import_v417.z.null(),
2938
+ premium: import_v417.z.null(),
2939
+ total: import_v417.z.null()
2807
2940
  }).transform((v) => v)
2808
2941
  ]);
2809
2942
  function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
@@ -2826,9 +2959,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
2826
2959
  });
2827
2960
  }
2828
2961
  }
2829
- var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v417.default.union([
2962
+ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v417.z.union([
2830
2963
  // referral available
2831
- import_v417.default.object({
2964
+ import_v417.z.object({
2832
2965
  encodedReferrer: makeHexStringSchema(
2833
2966
  { bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
2834
2967
  `${valueLabel} Encoded Referrer`
@@ -2836,9 +2969,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
2836
2969
  decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
2837
2970
  }).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
2838
2971
  // referral not applicable
2839
- import_v417.default.object({
2840
- encodedReferrer: import_v417.default.null(),
2841
- decodedReferrer: import_v417.default.null()
2972
+ import_v417.z.object({
2973
+ encodedReferrer: import_v417.z.null(),
2974
+ decodedReferrer: import_v417.z.null()
2842
2975
  })
2843
2976
  ]);
2844
2977
  function invariant_eventIdsInitialElementIsTheActionId(ctx) {
@@ -2851,9 +2984,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
2851
2984
  });
2852
2985
  }
2853
2986
  }
2854
- var EventIdSchema = import_v417.default.string().nonempty();
2855
- var EventIdsSchema = import_v417.default.array(EventIdSchema).min(1).transform((v) => v);
2856
- var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v417.default.object({
2987
+ var EventIdSchema = import_v417.z.string().nonempty();
2988
+ var EventIdsSchema = import_v417.z.array(EventIdSchema).min(1).transform((v) => v);
2989
+ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v417.z.object({
2857
2990
  id: EventIdSchema,
2858
2991
  incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
2859
2992
  registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
@@ -2867,12 +3000,12 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
2867
3000
  eventIds: EventIdsSchema
2868
3001
  }).check(invariant_eventIdsInitialElementIsTheActionId);
2869
3002
  var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
2870
- type: import_v417.default.literal(RegistrarActionTypes.Registration)
3003
+ type: import_v417.z.literal(RegistrarActionTypes.Registration)
2871
3004
  });
2872
3005
  var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
2873
- type: import_v417.default.literal(RegistrarActionTypes.Renewal)
3006
+ type: import_v417.z.literal(RegistrarActionTypes.Renewal)
2874
3007
  });
2875
- var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v417.default.discriminatedUnion("type", [
3008
+ var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v417.z.discriminatedUnion("type", [
2876
3009
  makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
2877
3010
  makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
2878
3011
  ]);
@@ -2962,7 +3095,7 @@ var RegistrarActionsResponseCodes = {
2962
3095
  function invariant_registrationLifecycleNodeMatchesName(ctx) {
2963
3096
  const { name, action } = ctx.value;
2964
3097
  const expectedNode = action.registrationLifecycle.node;
2965
- const actualNode = (0, import_ens7.namehash)(name);
3098
+ const actualNode = (0, import_ens10.namehash)(name);
2966
3099
  if (actualNode !== expectedNode) {
2967
3100
  ctx.issues.push({
2968
3101
  code: "custom",
@@ -3118,11 +3251,11 @@ var registrarActionsPrerequisites = Object.freeze({
3118
3251
  });
3119
3252
 
3120
3253
  // src/registrars/basenames-subregistry.ts
3121
- var import_datasources6 = require("@ensnode/datasources");
3254
+ var import_datasources7 = require("@ensnode/datasources");
3122
3255
  function getBasenamesSubregistryId(namespace) {
3123
- const datasource = (0, import_datasources6.maybeGetDatasource)(namespace, import_datasources6.DatasourceNames.Basenames);
3256
+ const datasource = (0, import_datasources7.maybeGetDatasource)(namespace, import_datasources7.DatasourceNames.Basenames);
3124
3257
  if (!datasource) {
3125
- throw new Error(`Datasource not found for ${namespace} ${import_datasources6.DatasourceNames.Basenames}`);
3258
+ throw new Error(`Datasource not found for ${namespace} ${import_datasources7.DatasourceNames.Basenames}`);
3126
3259
  }
3127
3260
  const address = datasource.contracts.BaseRegistrar?.address;
3128
3261
  if (address === void 0 || Array.isArray(address)) {
@@ -3135,12 +3268,11 @@ function getBasenamesSubregistryId(namespace) {
3135
3268
  }
3136
3269
  function getBasenamesSubregistryManagedName(namespaceId) {
3137
3270
  switch (namespaceId) {
3138
- case import_datasources6.ENSNamespaceIds.Mainnet:
3271
+ case import_datasources7.ENSNamespaceIds.Mainnet:
3139
3272
  return "base.eth";
3140
- case import_datasources6.ENSNamespaceIds.Sepolia:
3273
+ case import_datasources7.ENSNamespaceIds.Sepolia:
3141
3274
  return "basetest.eth";
3142
- case import_datasources6.ENSNamespaceIds.Holesky:
3143
- case import_datasources6.ENSNamespaceIds.EnsTestEnv:
3275
+ case import_datasources7.ENSNamespaceIds.EnsTestEnv:
3144
3276
  throw new Error(
3145
3277
  `No registrar managed name is known for the 'basenames' subregistry within the "${namespaceId}" namespace.`
3146
3278
  );
@@ -3148,11 +3280,11 @@ function getBasenamesSubregistryManagedName(namespaceId) {
3148
3280
  }
3149
3281
 
3150
3282
  // src/registrars/ethnames-subregistry.ts
3151
- var import_datasources7 = require("@ensnode/datasources");
3283
+ var import_datasources8 = require("@ensnode/datasources");
3152
3284
  function getEthnamesSubregistryId(namespace) {
3153
- const datasource = (0, import_datasources7.maybeGetDatasource)(namespace, import_datasources7.DatasourceNames.ENSRoot);
3285
+ const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, import_datasources8.DatasourceNames.ENSRoot);
3154
3286
  if (!datasource) {
3155
- throw new Error(`Datasource not found for ${namespace} ${import_datasources7.DatasourceNames.ENSRoot}`);
3287
+ throw new Error(`Datasource not found for ${namespace} ${import_datasources8.DatasourceNames.ENSRoot}`);
3156
3288
  }
3157
3289
  const address = datasource.contracts.BaseRegistrar?.address;
3158
3290
  if (address === void 0 || Array.isArray(address)) {
@@ -3165,20 +3297,19 @@ function getEthnamesSubregistryId(namespace) {
3165
3297
  }
3166
3298
  function getEthnamesSubregistryManagedName(namespaceId) {
3167
3299
  switch (namespaceId) {
3168
- case import_datasources7.ENSNamespaceIds.Mainnet:
3169
- case import_datasources7.ENSNamespaceIds.Sepolia:
3170
- case import_datasources7.ENSNamespaceIds.Holesky:
3171
- case import_datasources7.ENSNamespaceIds.EnsTestEnv:
3300
+ case import_datasources8.ENSNamespaceIds.Mainnet:
3301
+ case import_datasources8.ENSNamespaceIds.Sepolia:
3302
+ case import_datasources8.ENSNamespaceIds.EnsTestEnv:
3172
3303
  return "eth";
3173
3304
  }
3174
3305
  }
3175
3306
 
3176
3307
  // src/registrars/lineanames-subregistry.ts
3177
- var import_datasources8 = require("@ensnode/datasources");
3308
+ var import_datasources9 = require("@ensnode/datasources");
3178
3309
  function getLineanamesSubregistryId(namespace) {
3179
- const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, import_datasources8.DatasourceNames.Lineanames);
3310
+ const datasource = (0, import_datasources9.maybeGetDatasource)(namespace, import_datasources9.DatasourceNames.Lineanames);
3180
3311
  if (!datasource) {
3181
- throw new Error(`Datasource not found for ${namespace} ${import_datasources8.DatasourceNames.Lineanames}`);
3312
+ throw new Error(`Datasource not found for ${namespace} ${import_datasources9.DatasourceNames.Lineanames}`);
3182
3313
  }
3183
3314
  const address = datasource.contracts.BaseRegistrar?.address;
3184
3315
  if (address === void 0 || Array.isArray(address)) {
@@ -3191,18 +3322,32 @@ function getLineanamesSubregistryId(namespace) {
3191
3322
  }
3192
3323
  function getLineanamesSubregistryManagedName(namespaceId) {
3193
3324
  switch (namespaceId) {
3194
- case import_datasources8.ENSNamespaceIds.Mainnet:
3325
+ case import_datasources9.ENSNamespaceIds.Mainnet:
3195
3326
  return "linea.eth";
3196
- case import_datasources8.ENSNamespaceIds.Sepolia:
3327
+ case import_datasources9.ENSNamespaceIds.Sepolia:
3197
3328
  return "linea-sepolia.eth";
3198
- case import_datasources8.ENSNamespaceIds.Holesky:
3199
- case import_datasources8.ENSNamespaceIds.EnsTestEnv:
3329
+ case import_datasources9.ENSNamespaceIds.EnsTestEnv:
3200
3330
  throw new Error(
3201
3331
  `No registrar managed name is known for the 'Lineanames' subregistry within the "${namespaceId}" namespace.`
3202
3332
  );
3203
3333
  }
3204
3334
  }
3205
3335
 
3336
+ // src/registrars/registration-expiration.ts
3337
+ function isRegistrationExpired(info, now) {
3338
+ if (info.expiry == null) return false;
3339
+ return info.expiry <= now;
3340
+ }
3341
+ function isRegistrationFullyExpired(info, now) {
3342
+ if (info.expiry == null) return false;
3343
+ return now >= info.expiry + (info.gracePeriod ?? 0n);
3344
+ }
3345
+ function isRegistrationInGracePeriod(info, now) {
3346
+ if (info.expiry == null) return false;
3347
+ if (info.gracePeriod == null) return false;
3348
+ return info.expiry <= now && info.expiry + info.gracePeriod > now;
3349
+ }
3350
+
3206
3351
  // src/api/registrar-actions/serialize.ts
3207
3352
  function serializeNamedRegistrarAction({
3208
3353
  action,
@@ -4314,8 +4459,32 @@ var ENSNodeClient = class _ENSNodeClient {
4314
4459
  }
4315
4460
  };
4316
4461
 
4462
+ // src/ensv2/ids-lib.ts
4463
+ var import_viem21 = require("viem");
4464
+ var makeRegistryId = (accountId) => formatAccountId(accountId);
4465
+ var makeENSv1DomainId = (node) => node;
4466
+ var makeENSv2DomainId = (registry, canonicalId) => formatAssetId({
4467
+ assetNamespace: AssetNamespaces.ERC1155,
4468
+ contract: registry,
4469
+ tokenId: canonicalId
4470
+ });
4471
+ var maskLower32Bits = (num) => num ^ num & 0xffffffffn;
4472
+ var getCanonicalId = (input) => {
4473
+ if (typeof input === "bigint") return maskLower32Bits(input);
4474
+ return getCanonicalId((0, import_viem21.hexToBigInt)(input));
4475
+ };
4476
+ var makePermissionsId = (contract) => formatAccountId(contract);
4477
+ var makePermissionsResourceId = (contract, resource) => `${makePermissionsId(contract)}/${resource}`;
4478
+ var makePermissionsUserId = (contract, resource, user) => `${makePermissionsId(contract)}/${resource}/${user}`;
4479
+ var makeResolverId = (contract) => formatAccountId(contract);
4480
+ var makeResolverRecordsId = (resolver, node) => `${makeResolverId(resolver)}/${node}`;
4481
+ var makeLatestRegistrationId = (domainId) => `${domainId}/latest`;
4482
+ var makeRegistrationId = (domainId, index = 0) => `${domainId}/${index}`;
4483
+ var makeLatestRenewalId = (domainId, registrationIndex) => `${makeRegistrationId(domainId, registrationIndex)}/latest`;
4484
+ var makeRenewalId = (domainId, registrationIndex, index = 0) => `${makeRegistrationId(domainId, registrationIndex)}/${index}`;
4485
+
4317
4486
  // src/identity/identity.ts
4318
- var import_datasources9 = require("@ensnode/datasources");
4487
+ var import_datasources10 = require("@ensnode/datasources");
4319
4488
 
4320
4489
  // src/identity/types.ts
4321
4490
  var ResolutionStatusIds = {
@@ -4342,7 +4511,7 @@ var ResolutionStatusIds = {
4342
4511
  function buildUnresolvedIdentity(address, namespaceId, chainId) {
4343
4512
  return {
4344
4513
  resolutionStatus: ResolutionStatusIds.Unresolved,
4345
- chainId: chainId ?? (0, import_datasources9.getENSRootChainId)(namespaceId),
4514
+ chainId: chainId ?? (0, import_datasources10.getENSRootChainId)(namespaceId),
4346
4515
  address
4347
4516
  };
4348
4517
  }
@@ -4352,13 +4521,13 @@ function isResolvedIdentity(identity) {
4352
4521
 
4353
4522
  // src/resolution/ensip19-chainid.ts
4354
4523
  var import_chains = require("viem/chains");
4355
- var import_datasources10 = require("@ensnode/datasources");
4524
+ var import_datasources11 = require("@ensnode/datasources");
4356
4525
  var getResolvePrimaryNameChainIdParam = (chainId, namespaceId) => {
4357
- const ensRootChainId = (0, import_datasources10.getENSRootChainId)(namespaceId);
4526
+ const ensRootChainId = (0, import_datasources11.getENSRootChainId)(namespaceId);
4358
4527
  return chainId === ensRootChainId ? import_chains.mainnet.id : chainId;
4359
4528
  };
4360
4529
  var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
4361
- return chainId === DEFAULT_EVM_CHAIN_ID ? (0, import_datasources10.getENSRootChainId)(namespaceId) : chainId;
4530
+ return chainId === DEFAULT_EVM_CHAIN_ID ? (0, import_datasources11.getENSRootChainId)(namespaceId) : chainId;
4362
4531
  };
4363
4532
 
4364
4533
  // src/resolution/resolver-records-selection.ts