@ensnode/ensnode-sdk 1.3.0 → 1.4.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/README.md +1 -10
- package/dist/index.cjs +858 -501
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +621 -253
- package/dist/index.d.ts +621 -253
- package/dist/index.js +783 -424
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
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,
|
|
@@ -219,13 +256,13 @@ __export(index_exports, {
|
|
|
219
256
|
module.exports = __toCommonJS(index_exports);
|
|
220
257
|
|
|
221
258
|
// src/ensapi/config/deserialize.ts
|
|
222
|
-
var
|
|
259
|
+
var import_v46 = require("zod/v4");
|
|
223
260
|
|
|
224
261
|
// src/ensapi/config/zod-schemas.ts
|
|
225
|
-
var
|
|
262
|
+
var import_v45 = require("zod/v4");
|
|
226
263
|
|
|
227
264
|
// src/ensindexer/config/zod-schemas.ts
|
|
228
|
-
var import_v43 =
|
|
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 =
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
592
|
-
var makeLowercaseAddressSchema = (valueLabel = "EVM address") => import_v4.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
687
|
+
var makePriceCurrencySchema = (currency, valueLabel = "Price Currency") => import_v4.z.strictObject({
|
|
645
688
|
amount: makePriceAmountSchema(`${valueLabel} amount`),
|
|
646
|
-
currency: import_v4.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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) {
|
|
@@ -793,181 +836,65 @@ function addDuration(timestamp, duration) {
|
|
|
793
836
|
return deserializeUnixTimestamp(timestamp + duration, "UnixTimestamp");
|
|
794
837
|
}
|
|
795
838
|
|
|
796
|
-
// src/shared/cache/
|
|
797
|
-
var
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
schedule(config) {
|
|
806
|
-
const { revalidate, interval, initialDelay = 0, onError } = config;
|
|
807
|
-
if (this.activeSchedules.has(revalidate)) {
|
|
808
|
-
return revalidate;
|
|
839
|
+
// src/shared/cache/swr-cache.ts
|
|
840
|
+
var SWRCache = class {
|
|
841
|
+
constructor(options) {
|
|
842
|
+
this.options = options;
|
|
843
|
+
if (options.proactiveRevalidationInterval) {
|
|
844
|
+
this.backgroundInterval = setInterval(
|
|
845
|
+
() => this.revalidate(),
|
|
846
|
+
(0, import_date_fns.secondsToMilliseconds)(options.proactiveRevalidationInterval)
|
|
847
|
+
);
|
|
809
848
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
metadata.timeoutId = setTimeout(() => {
|
|
830
|
-
if (this.activeSchedules.has(revalidate)) {
|
|
831
|
-
executeRevalidation().then(() => scheduleNext());
|
|
832
|
-
}
|
|
833
|
-
}, interval);
|
|
834
|
-
};
|
|
835
|
-
if (initialDelay > 0) {
|
|
836
|
-
metadata.timeoutId = setTimeout(() => {
|
|
837
|
-
if (this.activeSchedules.has(revalidate)) {
|
|
838
|
-
executeRevalidation().then(() => scheduleNext());
|
|
849
|
+
if (options.proactivelyInitialize) this.revalidate();
|
|
850
|
+
}
|
|
851
|
+
cache = null;
|
|
852
|
+
inProgressRevalidate = null;
|
|
853
|
+
backgroundInterval = null;
|
|
854
|
+
async revalidate() {
|
|
855
|
+
if (!this.inProgressRevalidate) {
|
|
856
|
+
this.inProgressRevalidate = this.options.fn().then((result) => {
|
|
857
|
+
this.cache = {
|
|
858
|
+
result,
|
|
859
|
+
updatedAt: (0, import_getUnixTime.getUnixTime)(/* @__PURE__ */ new Date())
|
|
860
|
+
};
|
|
861
|
+
}).catch((error) => {
|
|
862
|
+
if (!this.cache) {
|
|
863
|
+
this.cache = {
|
|
864
|
+
// ensure thrown value is always an Error instance
|
|
865
|
+
result: error instanceof Error ? error : new Error(String(error)),
|
|
866
|
+
updatedAt: (0, import_getUnixTime.getUnixTime)(/* @__PURE__ */ new Date())
|
|
867
|
+
};
|
|
839
868
|
}
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
|
|
869
|
+
}).finally(() => {
|
|
870
|
+
this.inProgressRevalidate = null;
|
|
871
|
+
});
|
|
843
872
|
}
|
|
844
|
-
return
|
|
873
|
+
return this.inProgressRevalidate;
|
|
845
874
|
}
|
|
846
875
|
/**
|
|
847
|
-
*
|
|
876
|
+
* Read the most recently cached result from the `SWRCache`.
|
|
848
877
|
*
|
|
849
|
-
* @
|
|
850
|
-
|
|
851
|
-
cancel(revalidate) {
|
|
852
|
-
const metadata = this.activeSchedules.get(revalidate);
|
|
853
|
-
if (!metadata) return;
|
|
854
|
-
if (metadata.timeoutId !== null) {
|
|
855
|
-
clearTimeout(metadata.timeoutId);
|
|
856
|
-
}
|
|
857
|
-
this.activeSchedules.delete(revalidate);
|
|
858
|
-
}
|
|
859
|
-
/**
|
|
860
|
-
* Cancel all active schedules.
|
|
878
|
+
* @returns a `ValueType` that was most recently successfully returned by `fn` or `Error` if `fn`
|
|
879
|
+
* has never successfully returned.
|
|
861
880
|
*/
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
881
|
+
async read() {
|
|
882
|
+
if (!this.cache) await this.revalidate();
|
|
883
|
+
if (!this.cache) throw new Error("never");
|
|
884
|
+
if (durationBetween(this.cache.updatedAt, (0, import_getUnixTime.getUnixTime)(/* @__PURE__ */ new Date())) > this.options.ttl) {
|
|
885
|
+
this.revalidate();
|
|
867
886
|
}
|
|
868
|
-
this.
|
|
869
|
-
}
|
|
870
|
-
/**
|
|
871
|
-
* Get the count of active schedules.
|
|
872
|
-
* Useful for debugging and monitoring.
|
|
873
|
-
*
|
|
874
|
-
* @returns The number of currently active schedules
|
|
875
|
-
*/
|
|
876
|
-
getActiveScheduleCount() {
|
|
877
|
-
return this.activeSchedules.size;
|
|
878
|
-
}
|
|
879
|
-
};
|
|
880
|
-
|
|
881
|
-
// src/shared/cache/swr-cache.ts
|
|
882
|
-
var bgRevalidationScheduler = new BackgroundRevalidationScheduler();
|
|
883
|
-
var SWRCache = class _SWRCache {
|
|
884
|
-
options;
|
|
885
|
-
cache;
|
|
886
|
-
/**
|
|
887
|
-
* Optional promise of the current in-progress attempt to revalidate the `cache`.
|
|
888
|
-
*
|
|
889
|
-
* If null, no revalidation attempt is currently in progress.
|
|
890
|
-
* If not null, identifies the revalidation attempt that is currently in progress.
|
|
891
|
-
*
|
|
892
|
-
* Used to enforce no concurrent revalidation attempts.
|
|
893
|
-
*/
|
|
894
|
-
inProgressRevalidate;
|
|
895
|
-
/**
|
|
896
|
-
* The callback function being managed by `BackgroundRevalidationScheduler`.
|
|
897
|
-
*
|
|
898
|
-
* If null, no background revalidation is scheduled.
|
|
899
|
-
* If not null, identifies the background revalidation that is currently scheduled.
|
|
900
|
-
*
|
|
901
|
-
* Used to enforce no concurrent background revalidation attempts.
|
|
902
|
-
*/
|
|
903
|
-
scheduledBackgroundRevalidate;
|
|
904
|
-
constructor(options) {
|
|
905
|
-
this.cache = null;
|
|
906
|
-
this.inProgressRevalidate = null;
|
|
907
|
-
this.scheduledBackgroundRevalidate = null;
|
|
908
|
-
this.options = options;
|
|
887
|
+
return this.cache.result;
|
|
909
888
|
}
|
|
910
889
|
/**
|
|
911
|
-
*
|
|
912
|
-
*
|
|
913
|
-
* @param options - The {@link SWRCacheOptions} for the SWR cache.
|
|
914
|
-
* @returns a new `SWRCache` instance.
|
|
890
|
+
* Destroys the background revalidation interval, if exists.
|
|
915
891
|
*/
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
892
|
+
destroy() {
|
|
893
|
+
if (this.backgroundInterval) {
|
|
894
|
+
clearInterval(this.backgroundInterval);
|
|
895
|
+
this.backgroundInterval = null;
|
|
920
896
|
}
|
|
921
|
-
return cache;
|
|
922
897
|
}
|
|
923
|
-
revalidate = async () => {
|
|
924
|
-
if (this.inProgressRevalidate) {
|
|
925
|
-
return this.inProgressRevalidate;
|
|
926
|
-
}
|
|
927
|
-
return this.options.fn().then((value) => {
|
|
928
|
-
this.cache = {
|
|
929
|
-
value,
|
|
930
|
-
updatedAt: (0, import_getUnixTime.getUnixTime)(/* @__PURE__ */ new Date())
|
|
931
|
-
};
|
|
932
|
-
return this.cache;
|
|
933
|
-
}).catch(() => {
|
|
934
|
-
return null;
|
|
935
|
-
}).finally(() => {
|
|
936
|
-
this.inProgressRevalidate = null;
|
|
937
|
-
if (this.options.revalidationInterval === void 0) {
|
|
938
|
-
return;
|
|
939
|
-
}
|
|
940
|
-
if (this.scheduledBackgroundRevalidate) {
|
|
941
|
-
bgRevalidationScheduler.cancel(this.scheduledBackgroundRevalidate);
|
|
942
|
-
}
|
|
943
|
-
const backgroundRevalidate = async () => {
|
|
944
|
-
this.revalidate();
|
|
945
|
-
};
|
|
946
|
-
this.scheduledBackgroundRevalidate = bgRevalidationScheduler.schedule({
|
|
947
|
-
revalidate: backgroundRevalidate,
|
|
948
|
-
interval: (0, import_date_fns.secondsToMilliseconds)(this.options.revalidationInterval)
|
|
949
|
-
});
|
|
950
|
-
});
|
|
951
|
-
};
|
|
952
|
-
/**
|
|
953
|
-
* Read the most recently cached `CachedValue` from the `SWRCache`.
|
|
954
|
-
*
|
|
955
|
-
* @returns a `CachedValue` holding a `value` of `ValueType` that was most recently successfully returned by `fn`
|
|
956
|
-
* or `null` if `fn` has never successfully returned and has always thrown an error,
|
|
957
|
-
*/
|
|
958
|
-
readCache = async () => {
|
|
959
|
-
if (!this.cache) {
|
|
960
|
-
this.inProgressRevalidate = this.revalidate();
|
|
961
|
-
return this.inProgressRevalidate;
|
|
962
|
-
}
|
|
963
|
-
if (durationBetween(this.cache.updatedAt, (0, import_getUnixTime.getUnixTime)(/* @__PURE__ */ new Date())) <= this.options.ttl) {
|
|
964
|
-
return this.cache;
|
|
965
|
-
}
|
|
966
|
-
if (!this.inProgressRevalidate) {
|
|
967
|
-
this.inProgressRevalidate = this.revalidate();
|
|
968
|
-
}
|
|
969
|
-
return this.cache;
|
|
970
|
-
};
|
|
971
898
|
};
|
|
972
899
|
|
|
973
900
|
// src/shared/cache/ttl-cache.ts
|
|
@@ -1059,12 +986,60 @@ var getDatasourceContract = (namespaceId, datasourceName, contractName) => {
|
|
|
1059
986
|
}
|
|
1060
987
|
return contract;
|
|
1061
988
|
};
|
|
989
|
+
var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
990
|
+
const a = maybeGetDatasourceContract(namespace, datasourceName, contractName);
|
|
991
|
+
return a && accountIdEqual(a, b);
|
|
992
|
+
};
|
|
1062
993
|
|
|
1063
|
-
// src/shared/
|
|
994
|
+
// src/shared/interpretation/interpret-address.ts
|
|
1064
995
|
var import_viem9 = require("viem");
|
|
1065
|
-
var
|
|
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);
|
|
1033
|
+
|
|
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));
|
|
1066
1041
|
|
|
1067
|
-
// src/shared/interpretation.ts
|
|
1042
|
+
// src/shared/interpretation/interpreted-names-and-labels.ts
|
|
1068
1043
|
function literalLabelToInterpretedLabel(label) {
|
|
1069
1044
|
if (isNormalizedLabel(label)) return label;
|
|
1070
1045
|
return encodeLabelHash(labelhashLiteralLabel(label));
|
|
@@ -1078,10 +1053,39 @@ function interpretedLabelsToInterpretedName(labels) {
|
|
|
1078
1053
|
function literalLabelsToLiteralName(labels) {
|
|
1079
1054
|
return labels.join(".");
|
|
1080
1055
|
}
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
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
|
+
}
|
|
1085
1089
|
|
|
1086
1090
|
// src/shared/numbers.ts
|
|
1087
1091
|
function bigIntToNumber(n) {
|
|
@@ -1098,6 +1102,14 @@ function bigIntToNumber(n) {
|
|
|
1098
1102
|
return Number(n);
|
|
1099
1103
|
}
|
|
1100
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
|
+
|
|
1101
1113
|
// src/shared/serialize.ts
|
|
1102
1114
|
var import_caip2 = require("caip");
|
|
1103
1115
|
function serializeChainId(chainId) {
|
|
@@ -1124,6 +1136,23 @@ function formatAccountId(accountId) {
|
|
|
1124
1136
|
address: accountId.address
|
|
1125
1137
|
}).toLowerCase();
|
|
1126
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
|
+
};
|
|
1127
1156
|
|
|
1128
1157
|
// src/shared/url.ts
|
|
1129
1158
|
function isHttpProtocol(url) {
|
|
@@ -1134,7 +1163,7 @@ function isWebSocketProtocol(url) {
|
|
|
1134
1163
|
}
|
|
1135
1164
|
|
|
1136
1165
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
1137
|
-
var
|
|
1166
|
+
var import_datasources5 = require("@ensnode/datasources");
|
|
1138
1167
|
|
|
1139
1168
|
// src/ensindexer/config/types.ts
|
|
1140
1169
|
var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
@@ -1145,6 +1174,7 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
1145
1174
|
PluginName2["ProtocolAcceleration"] = "protocol-acceleration";
|
|
1146
1175
|
PluginName2["Registrars"] = "registrars";
|
|
1147
1176
|
PluginName2["TokenScope"] = "tokenscope";
|
|
1177
|
+
PluginName2["ENSv2"] = "ensv2";
|
|
1148
1178
|
return PluginName2;
|
|
1149
1179
|
})(PluginName || {});
|
|
1150
1180
|
|
|
@@ -1153,7 +1183,7 @@ function isSubgraphCompatible(config) {
|
|
|
1153
1183
|
const onlySubgraphPluginActivated = config.plugins.length === 1 && config.plugins[0] === "subgraph" /* Subgraph */;
|
|
1154
1184
|
const isSubgraphLabelSet = config.labelSet.labelSetId === "subgraph" && config.labelSet.labelSetVersion === 0;
|
|
1155
1185
|
const isEnsTestEnvLabelSet = config.labelSet.labelSetId === "ens-test-env" && config.labelSet.labelSetVersion === 0;
|
|
1156
|
-
const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace ===
|
|
1186
|
+
const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === import_datasources5.ENSNamespaceIds.EnsTestEnv && isEnsTestEnvLabelSet;
|
|
1157
1187
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
1158
1188
|
}
|
|
1159
1189
|
|
|
@@ -1170,26 +1200,26 @@ function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
|
|
|
1170
1200
|
}
|
|
1171
1201
|
|
|
1172
1202
|
// src/ensindexer/config/zod-schemas.ts
|
|
1173
|
-
var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.
|
|
1203
|
+
var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => import_v43.z.array(makeChainIdSchema(valueLabel), {
|
|
1174
1204
|
error: `${valueLabel} must be an array.`
|
|
1175
1205
|
}).min(1, { error: `${valueLabel} list must include at least one element.` }).transform((v) => new Set(v));
|
|
1176
|
-
var makePluginsListSchema = (valueLabel = "Plugins") => import_v43.
|
|
1206
|
+
var makePluginsListSchema = (valueLabel = "Plugins") => import_v43.z.array(import_v43.z.string(), {
|
|
1177
1207
|
error: `${valueLabel} must be a list of strings.`
|
|
1178
1208
|
}).min(1, {
|
|
1179
1209
|
error: `${valueLabel} must be a list of strings with at least one string value`
|
|
1180
1210
|
}).refine((arr) => arr.length === uniq(arr).length, {
|
|
1181
1211
|
error: `${valueLabel} cannot contain duplicate values.`
|
|
1182
1212
|
});
|
|
1183
|
-
var makeDatabaseSchemaNameSchema = (valueLabel = "Database schema name") => import_v43.
|
|
1213
|
+
var makeDatabaseSchemaNameSchema = (valueLabel = "Database schema name") => import_v43.z.string({ error: `${valueLabel} must be a string` }).trim().nonempty({
|
|
1184
1214
|
error: `${valueLabel} is required and must be a non-empty string.`
|
|
1185
1215
|
});
|
|
1186
1216
|
var makeLabelSetIdSchema = (valueLabel) => {
|
|
1187
|
-
return import_v43.
|
|
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-]+$/, {
|
|
1188
1218
|
error: `${valueLabel} can only contain lowercase letters (a-z) and hyphens (-)`
|
|
1189
1219
|
});
|
|
1190
1220
|
};
|
|
1191
1221
|
var makeLabelSetVersionSchema = (valueLabel) => {
|
|
1192
|
-
return import_v43.
|
|
1222
|
+
return import_v43.z.coerce.number({ error: `${valueLabel} must be an integer.` }).pipe(makeNonNegativeIntegerSchema(valueLabel));
|
|
1193
1223
|
};
|
|
1194
1224
|
var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
|
|
1195
1225
|
let valueLabelLabelSetId = valueLabel;
|
|
@@ -1201,13 +1231,13 @@ var makeFullyPinnedLabelSetSchema = (valueLabel = "Label set") => {
|
|
|
1201
1231
|
valueLabelLabelSetId = `${valueLabel}.labelSetId`;
|
|
1202
1232
|
valueLabelLabelSetVersion = `${valueLabel}.labelSetVersion`;
|
|
1203
1233
|
}
|
|
1204
|
-
return import_v43.
|
|
1234
|
+
return import_v43.z.object({
|
|
1205
1235
|
labelSetId: makeLabelSetIdSchema(valueLabelLabelSetId),
|
|
1206
1236
|
labelSetVersion: makeLabelSetVersionSchema(valueLabelLabelSetVersion)
|
|
1207
1237
|
});
|
|
1208
1238
|
};
|
|
1209
|
-
var makeNonEmptyStringSchema = (valueLabel = "Value") => import_v43.
|
|
1210
|
-
var makeENSIndexerVersionInfoSchema = (valueLabel = "Value") => import_v43.
|
|
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(
|
|
1211
1241
|
{
|
|
1212
1242
|
nodejs: makeNonEmptyStringSchema(),
|
|
1213
1243
|
ponder: makeNonEmptyStringSchema(),
|
|
@@ -1231,30 +1261,39 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
1231
1261
|
});
|
|
1232
1262
|
}
|
|
1233
1263
|
}
|
|
1234
|
-
var makeENSIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") => import_v43.
|
|
1264
|
+
var makeENSIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") => import_v43.z.object({
|
|
1235
1265
|
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
1236
1266
|
indexedChainIds: makeIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
1237
|
-
isSubgraphCompatible: import_v43.
|
|
1267
|
+
isSubgraphCompatible: import_v43.z.boolean({ error: `${valueLabel}.isSubgraphCompatible` }),
|
|
1238
1268
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
1239
1269
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
1240
1270
|
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
1241
1271
|
versionInfo: makeENSIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
1242
1272
|
}).check(invariant_isSubgraphCompatibleRequirements);
|
|
1243
1273
|
|
|
1244
|
-
// src/
|
|
1274
|
+
// src/shared/config/thegraph.ts
|
|
1275
|
+
var import_v44 = require("zod/v4");
|
|
1245
1276
|
var TheGraphCannotFallbackReasonSchema = import_v44.z.enum({
|
|
1246
1277
|
NotSubgraphCompatible: "not-subgraph-compatible",
|
|
1247
1278
|
NoApiKey: "no-api-key",
|
|
1248
1279
|
NoSubgraphUrl: "no-subgraph-url"
|
|
1249
1280
|
});
|
|
1250
|
-
var TheGraphFallbackSchema = import_v44.z.
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1281
|
+
var TheGraphFallbackSchema = import_v44.z.discriminatedUnion("canFallback", [
|
|
1282
|
+
import_v44.z.strictObject({
|
|
1283
|
+
canFallback: import_v44.z.literal(true),
|
|
1284
|
+
url: import_v44.z.string()
|
|
1285
|
+
}),
|
|
1286
|
+
import_v44.z.strictObject({
|
|
1287
|
+
canFallback: import_v44.z.literal(false),
|
|
1288
|
+
reason: TheGraphCannotFallbackReasonSchema
|
|
1289
|
+
})
|
|
1290
|
+
]);
|
|
1291
|
+
|
|
1292
|
+
// src/ensapi/config/zod-schemas.ts
|
|
1254
1293
|
function makeENSApiPublicConfigSchema(valueLabel) {
|
|
1255
1294
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
1256
|
-
return
|
|
1257
|
-
version:
|
|
1295
|
+
return import_v45.z.strictObject({
|
|
1296
|
+
version: import_v45.z.string().min(1, `${label}.version must be a non-empty string`),
|
|
1258
1297
|
theGraphFallback: TheGraphFallbackSchema,
|
|
1259
1298
|
ensIndexerPublicConfig: makeENSIndexerPublicConfigSchema(`${label}.ensIndexerPublicConfig`)
|
|
1260
1299
|
});
|
|
@@ -1266,9 +1305,9 @@ function deserializeENSApiPublicConfig(maybeConfig, valueLabel) {
|
|
|
1266
1305
|
try {
|
|
1267
1306
|
return schema.parse(maybeConfig);
|
|
1268
1307
|
} catch (error) {
|
|
1269
|
-
if (error instanceof
|
|
1308
|
+
if (error instanceof import_v46.ZodError) {
|
|
1270
1309
|
throw new Error(`Cannot deserialize ENSApiPublicConfig:
|
|
1271
|
-
${(0,
|
|
1310
|
+
${(0, import_v46.prettifyError)(error)}
|
|
1272
1311
|
`);
|
|
1273
1312
|
}
|
|
1274
1313
|
throw error;
|
|
@@ -1276,20 +1315,20 @@ ${(0, import_v45.prettifyError)(error)}
|
|
|
1276
1315
|
}
|
|
1277
1316
|
|
|
1278
1317
|
// src/ensindexer/config/deserialize.ts
|
|
1279
|
-
var
|
|
1318
|
+
var import_v47 = require("zod/v4");
|
|
1280
1319
|
function deserializeENSIndexerPublicConfig(maybeConfig, valueLabel) {
|
|
1281
1320
|
const schema = makeENSIndexerPublicConfigSchema(valueLabel);
|
|
1282
1321
|
const parsed = schema.safeParse(maybeConfig);
|
|
1283
1322
|
if (parsed.error) {
|
|
1284
1323
|
throw new Error(`Cannot deserialize ENSIndexerPublicConfig:
|
|
1285
|
-
${(0,
|
|
1324
|
+
${(0, import_v47.prettifyError)(parsed.error)}
|
|
1286
1325
|
`);
|
|
1287
1326
|
}
|
|
1288
1327
|
return parsed.data;
|
|
1289
1328
|
}
|
|
1290
1329
|
|
|
1291
1330
|
// src/ensindexer/config/label-utils.ts
|
|
1292
|
-
var
|
|
1331
|
+
var import_viem13 = require("viem");
|
|
1293
1332
|
function labelHashToBytes(labelHash) {
|
|
1294
1333
|
try {
|
|
1295
1334
|
if (labelHash.length !== 66) {
|
|
@@ -1301,7 +1340,7 @@ function labelHashToBytes(labelHash) {
|
|
|
1301
1340
|
if (!labelHash.startsWith("0x")) {
|
|
1302
1341
|
throw new Error("Labelhash must be 0x-prefixed");
|
|
1303
1342
|
}
|
|
1304
|
-
const bytes = (0,
|
|
1343
|
+
const bytes = (0, import_viem13.hexToBytes)(labelHash);
|
|
1305
1344
|
if (bytes.length !== 32) {
|
|
1306
1345
|
throw new Error(`Invalid labelHash length ${bytes.length} bytes (expected 32)`);
|
|
1307
1346
|
}
|
|
@@ -1394,10 +1433,10 @@ function serializeENSIndexerPublicConfig(config) {
|
|
|
1394
1433
|
}
|
|
1395
1434
|
|
|
1396
1435
|
// src/ensindexer/indexing-status/deserialize.ts
|
|
1397
|
-
var
|
|
1436
|
+
var import_v49 = require("zod/v4");
|
|
1398
1437
|
|
|
1399
1438
|
// src/ensindexer/indexing-status/zod-schemas.ts
|
|
1400
|
-
var
|
|
1439
|
+
var import_v48 = require("zod/v4");
|
|
1401
1440
|
|
|
1402
1441
|
// src/ensindexer/indexing-status/types.ts
|
|
1403
1442
|
var ChainIndexingConfigTypeIds = {
|
|
@@ -1823,7 +1862,7 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1823
1862
|
ctx.issues.push({
|
|
1824
1863
|
code: "custom",
|
|
1825
1864
|
input: ctx.value,
|
|
1826
|
-
message: `'snapshotTime' must be greater than or equal to
|
|
1865
|
+
message: `'snapshotTime' (${snapshotTime}) must be greater than or equal to the "highest known block timestamp" (${highestKnownBlockTimestamp})`
|
|
1827
1866
|
});
|
|
1828
1867
|
}
|
|
1829
1868
|
}
|
|
@@ -1853,52 +1892,52 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
|
|
|
1853
1892
|
}
|
|
1854
1893
|
|
|
1855
1894
|
// src/ensindexer/indexing-status/zod-schemas.ts
|
|
1856
|
-
var makeChainIndexingConfigSchema = (valueLabel = "Value") =>
|
|
1857
|
-
|
|
1858
|
-
configType:
|
|
1895
|
+
var makeChainIndexingConfigSchema = (valueLabel = "Value") => import_v48.z.discriminatedUnion("configType", [
|
|
1896
|
+
import_v48.z.strictObject({
|
|
1897
|
+
configType: import_v48.z.literal(ChainIndexingConfigTypeIds.Indefinite),
|
|
1859
1898
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1860
1899
|
}),
|
|
1861
|
-
|
|
1862
|
-
configType:
|
|
1900
|
+
import_v48.z.strictObject({
|
|
1901
|
+
configType: import_v48.z.literal(ChainIndexingConfigTypeIds.Definite),
|
|
1863
1902
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1864
1903
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1865
1904
|
})
|
|
1866
1905
|
]);
|
|
1867
|
-
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") =>
|
|
1868
|
-
chainStatus:
|
|
1906
|
+
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v48.z.strictObject({
|
|
1907
|
+
chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Queued),
|
|
1869
1908
|
config: makeChainIndexingConfigSchema(valueLabel)
|
|
1870
1909
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1871
|
-
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") =>
|
|
1872
|
-
chainStatus:
|
|
1910
|
+
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v48.z.strictObject({
|
|
1911
|
+
chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Backfill),
|
|
1873
1912
|
config: makeChainIndexingConfigSchema(valueLabel),
|
|
1874
1913
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1875
1914
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1876
1915
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1877
|
-
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") =>
|
|
1878
|
-
chainStatus:
|
|
1879
|
-
config:
|
|
1880
|
-
configType:
|
|
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),
|
|
1881
1920
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1882
1921
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1883
1922
|
}),
|
|
1884
1923
|
latestIndexedBlock: makeBlockRefSchema(valueLabel)
|
|
1885
1924
|
}).check(invariant_chainSnapshotCompletedBlocks);
|
|
1886
|
-
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") =>
|
|
1887
|
-
chainStatus:
|
|
1888
|
-
config:
|
|
1889
|
-
configType:
|
|
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),
|
|
1890
1929
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1891
1930
|
}),
|
|
1892
1931
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1893
1932
|
latestKnownBlock: makeBlockRefSchema(valueLabel)
|
|
1894
1933
|
}).check(invariant_chainSnapshotFollowingBlocks);
|
|
1895
|
-
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1934
|
+
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v48.z.discriminatedUnion("chainStatus", [
|
|
1896
1935
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1897
1936
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1898
1937
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
1899
1938
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel)
|
|
1900
1939
|
]);
|
|
1901
|
-
var makeChainIndexingStatusesSchema = (valueLabel = "Value") =>
|
|
1940
|
+
var makeChainIndexingStatusesSchema = (valueLabel = "Value") => import_v48.z.record(makeChainIdStringSchema(), makeChainIndexingStatusSnapshotSchema(valueLabel), {
|
|
1902
1941
|
error: "Chains indexing statuses must be an object mapping valid chain IDs to their indexing status snapshots."
|
|
1903
1942
|
}).transform((serializedChainsIndexingStatus) => {
|
|
1904
1943
|
const chainsIndexingStatus = /* @__PURE__ */ new Map();
|
|
@@ -1907,29 +1946,29 @@ var makeChainIndexingStatusesSchema = (valueLabel = "Value") => import_v47.defau
|
|
|
1907
1946
|
}
|
|
1908
1947
|
return chainsIndexingStatus;
|
|
1909
1948
|
});
|
|
1910
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1911
|
-
omnichainStatus:
|
|
1949
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v48.z.strictObject({
|
|
1950
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1912
1951
|
chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainSnapshotUnstartedHasValidChains).transform((chains) => chains),
|
|
1913
1952
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1914
1953
|
});
|
|
1915
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1916
|
-
omnichainStatus:
|
|
1954
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v48.z.strictObject({
|
|
1955
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1917
1956
|
chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotBackfillHasValidChains).transform(
|
|
1918
1957
|
(chains) => chains
|
|
1919
1958
|
),
|
|
1920
1959
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1921
1960
|
});
|
|
1922
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1923
|
-
omnichainStatus:
|
|
1961
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v48.z.strictObject({
|
|
1962
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1924
1963
|
chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotCompletedHasValidChains).transform((chains) => chains),
|
|
1925
1964
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1926
1965
|
});
|
|
1927
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1928
|
-
omnichainStatus:
|
|
1966
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v48.z.strictObject({
|
|
1967
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1929
1968
|
chains: makeChainIndexingStatusesSchema(valueLabel),
|
|
1930
1969
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1931
1970
|
});
|
|
1932
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1971
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v48.z.discriminatedUnion("omnichainStatus", [
|
|
1933
1972
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1934
1973
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1935
1974
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1937,16 +1976,16 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1937
1976
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1938
1977
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1939
1978
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1940
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1941
|
-
strategy:
|
|
1979
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v48.z.strictObject({
|
|
1980
|
+
strategy: import_v48.z.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1942
1981
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1943
1982
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1944
1983
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1945
1984
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1946
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1985
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v48.z.discriminatedUnion("strategy", [
|
|
1947
1986
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1948
1987
|
]);
|
|
1949
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") =>
|
|
1988
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v48.z.strictObject({
|
|
1950
1989
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1951
1990
|
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1952
1991
|
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
@@ -1959,7 +1998,7 @@ function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
|
1959
1998
|
if (parsed.error) {
|
|
1960
1999
|
throw new Error(
|
|
1961
2000
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
1962
|
-
${(0,
|
|
2001
|
+
${(0, import_v49.prettifyError)(parsed.error)}
|
|
1963
2002
|
`
|
|
1964
2003
|
);
|
|
1965
2004
|
}
|
|
@@ -1971,7 +2010,7 @@ function deserializeOmnichainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
|
1971
2010
|
if (parsed.error) {
|
|
1972
2011
|
throw new Error(
|
|
1973
2012
|
`Cannot deserialize into OmnichainIndexingStatusSnapshot:
|
|
1974
|
-
${(0,
|
|
2013
|
+
${(0, import_v49.prettifyError)(parsed.error)}
|
|
1975
2014
|
`
|
|
1976
2015
|
);
|
|
1977
2016
|
}
|
|
@@ -1983,7 +2022,7 @@ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel)
|
|
|
1983
2022
|
if (parsed.error) {
|
|
1984
2023
|
throw new Error(
|
|
1985
2024
|
`Cannot deserialize into CrossChainIndexingStatusSnapshot:
|
|
1986
|
-
${(0,
|
|
2025
|
+
${(0, import_v49.prettifyError)(parsed.error)}
|
|
1987
2026
|
`
|
|
1988
2027
|
);
|
|
1989
2028
|
}
|
|
@@ -1995,7 +2034,7 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1995
2034
|
if (parsed.error) {
|
|
1996
2035
|
throw new Error(
|
|
1997
2036
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1998
|
-
${(0,
|
|
2037
|
+
${(0, import_v49.prettifyError)(parsed.error)}
|
|
1999
2038
|
`
|
|
2000
2039
|
);
|
|
2001
2040
|
}
|
|
@@ -2091,10 +2130,10 @@ function serializeConfigResponse(response) {
|
|
|
2091
2130
|
}
|
|
2092
2131
|
|
|
2093
2132
|
// src/api/indexing-status/deserialize.ts
|
|
2094
|
-
var
|
|
2133
|
+
var import_v411 = require("zod/v4");
|
|
2095
2134
|
|
|
2096
2135
|
// src/api/indexing-status/zod-schemas.ts
|
|
2097
|
-
var
|
|
2136
|
+
var import_v410 = __toESM(require("zod/v4"), 1);
|
|
2098
2137
|
|
|
2099
2138
|
// src/api/indexing-status/response.ts
|
|
2100
2139
|
var IndexingStatusResponseCodes = {
|
|
@@ -2109,14 +2148,14 @@ var IndexingStatusResponseCodes = {
|
|
|
2109
2148
|
};
|
|
2110
2149
|
|
|
2111
2150
|
// src/api/indexing-status/zod-schemas.ts
|
|
2112
|
-
var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
2113
|
-
responseCode:
|
|
2151
|
+
var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v410.default.strictObject({
|
|
2152
|
+
responseCode: import_v410.default.literal(IndexingStatusResponseCodes.Ok),
|
|
2114
2153
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2115
2154
|
});
|
|
2116
|
-
var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
2117
|
-
responseCode:
|
|
2155
|
+
var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v410.default.strictObject({
|
|
2156
|
+
responseCode: import_v410.default.literal(IndexingStatusResponseCodes.Error)
|
|
2118
2157
|
});
|
|
2119
|
-
var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2158
|
+
var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v410.default.discriminatedUnion("responseCode", [
|
|
2120
2159
|
makeIndexingStatusResponseOkSchema(valueLabel),
|
|
2121
2160
|
makeIndexingStatusResponseErrorSchema(valueLabel)
|
|
2122
2161
|
]);
|
|
@@ -2126,7 +2165,7 @@ function deserializeIndexingStatusResponse(maybeResponse) {
|
|
|
2126
2165
|
const parsed = makeIndexingStatusResponseSchema().safeParse(maybeResponse);
|
|
2127
2166
|
if (parsed.error) {
|
|
2128
2167
|
throw new Error(`Cannot deserialize IndexingStatusResponse:
|
|
2129
|
-
${(0,
|
|
2168
|
+
${(0, import_v411.prettifyError)(parsed.error)}
|
|
2130
2169
|
`);
|
|
2131
2170
|
}
|
|
2132
2171
|
return parsed.data;
|
|
@@ -2146,25 +2185,24 @@ function serializeIndexingStatusResponse(response) {
|
|
|
2146
2185
|
}
|
|
2147
2186
|
|
|
2148
2187
|
// src/api/name-tokens/deserialize.ts
|
|
2149
|
-
var
|
|
2188
|
+
var import_v416 = require("zod/v4");
|
|
2150
2189
|
|
|
2151
2190
|
// src/api/name-tokens/zod-schemas.ts
|
|
2152
|
-
var
|
|
2153
|
-
var
|
|
2191
|
+
var import_viem17 = require("viem");
|
|
2192
|
+
var import_v415 = __toESM(require("zod/v4"), 1);
|
|
2154
2193
|
|
|
2155
2194
|
// src/tokenscope/assets.ts
|
|
2156
|
-
var
|
|
2157
|
-
var
|
|
2158
|
-
var import_v412 = require("zod/v4");
|
|
2195
|
+
var import_viem16 = require("viem");
|
|
2196
|
+
var import_v413 = require("zod/v4");
|
|
2159
2197
|
|
|
2160
2198
|
// src/tokenscope/zod-schemas.ts
|
|
2161
2199
|
var import_caip3 = require("caip");
|
|
2162
|
-
var
|
|
2163
|
-
var
|
|
2200
|
+
var import_viem15 = require("viem");
|
|
2201
|
+
var import_v412 = __toESM(require("zod/v4"), 1);
|
|
2164
2202
|
|
|
2165
2203
|
// src/tokenscope/name-token.ts
|
|
2166
|
-
var
|
|
2167
|
-
var
|
|
2204
|
+
var import_viem14 = require("viem");
|
|
2205
|
+
var import_datasources6 = require("@ensnode/datasources");
|
|
2168
2206
|
var NameTokenOwnershipTypes = {
|
|
2169
2207
|
/**
|
|
2170
2208
|
* Name Token is owned by NameWrapper account.
|
|
@@ -2195,12 +2233,12 @@ function serializeNameToken(nameToken) {
|
|
|
2195
2233
|
function getNameWrapperAccounts(namespaceId) {
|
|
2196
2234
|
const ethnamesNameWrapperAccount = getDatasourceContract(
|
|
2197
2235
|
namespaceId,
|
|
2198
|
-
|
|
2236
|
+
import_datasources6.DatasourceNames.ENSRoot,
|
|
2199
2237
|
"NameWrapper"
|
|
2200
2238
|
);
|
|
2201
2239
|
const lineanamesNameWrapperAccount = maybeGetDatasourceContract(
|
|
2202
2240
|
namespaceId,
|
|
2203
|
-
|
|
2241
|
+
import_datasources6.DatasourceNames.Lineanames,
|
|
2204
2242
|
"NameWrapper"
|
|
2205
2243
|
);
|
|
2206
2244
|
const nameWrapperAccounts = [
|
|
@@ -2223,7 +2261,7 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2223
2261
|
owner
|
|
2224
2262
|
};
|
|
2225
2263
|
}
|
|
2226
|
-
if ((0,
|
|
2264
|
+
if ((0, import_viem14.isAddressEqual)(owner.address, import_viem14.zeroAddress)) {
|
|
2227
2265
|
return {
|
|
2228
2266
|
ownershipType: NameTokenOwnershipTypes.Burned,
|
|
2229
2267
|
owner
|
|
@@ -2243,12 +2281,26 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2243
2281
|
}
|
|
2244
2282
|
|
|
2245
2283
|
// src/tokenscope/zod-schemas.ts
|
|
2246
|
-
var
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2284
|
+
var tokenIdSchemaSerializable = import_v412.default.string();
|
|
2285
|
+
var tokenIdSchemaNative = import_v412.default.preprocess(
|
|
2286
|
+
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2287
|
+
import_v412.default.bigint().positive()
|
|
2288
|
+
);
|
|
2289
|
+
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2290
|
+
if (serializable) {
|
|
2291
|
+
return tokenIdSchemaSerializable;
|
|
2292
|
+
} else {
|
|
2293
|
+
return tokenIdSchemaNative;
|
|
2294
|
+
}
|
|
2295
|
+
}
|
|
2296
|
+
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2297
|
+
return import_v412.default.object({
|
|
2298
|
+
assetNamespace: import_v412.default.enum(AssetNamespaces),
|
|
2299
|
+
contract: makeAccountIdSchema(valueLabel),
|
|
2300
|
+
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2301
|
+
});
|
|
2302
|
+
};
|
|
2303
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v412.default.preprocess((v) => {
|
|
2252
2304
|
if (typeof v === "string") {
|
|
2253
2305
|
const result = new import_caip3.AssetId(v);
|
|
2254
2306
|
return {
|
|
@@ -2264,7 +2316,7 @@ var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_
|
|
|
2264
2316
|
}, makeAssetIdSchema(valueLabel));
|
|
2265
2317
|
function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
2266
2318
|
const ownership = ctx.value;
|
|
2267
|
-
if (ctx.value.owner.address ===
|
|
2319
|
+
if (ctx.value.owner.address === import_viem15.zeroAddress) {
|
|
2268
2320
|
ctx.issues.push({
|
|
2269
2321
|
code: "custom",
|
|
2270
2322
|
input: ctx.value,
|
|
@@ -2272,25 +2324,25 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2272
2324
|
});
|
|
2273
2325
|
}
|
|
2274
2326
|
}
|
|
2275
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2276
|
-
ownershipType:
|
|
2327
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v412.default.object({
|
|
2328
|
+
ownershipType: import_v412.default.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2277
2329
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2278
2330
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2279
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2280
|
-
ownershipType:
|
|
2331
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v412.default.object({
|
|
2332
|
+
ownershipType: import_v412.default.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2281
2333
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2282
2334
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2283
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2284
|
-
ownershipType:
|
|
2335
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v412.default.object({
|
|
2336
|
+
ownershipType: import_v412.default.literal(NameTokenOwnershipTypes.Burned),
|
|
2285
2337
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2286
2338
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2287
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2288
|
-
ownershipType:
|
|
2339
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v412.default.object({
|
|
2340
|
+
ownershipType: import_v412.default.literal(NameTokenOwnershipTypes.Unknown),
|
|
2289
2341
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2290
2342
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2291
2343
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
2292
2344
|
const ownership = ctx.value;
|
|
2293
|
-
if (ctx.value.owner.address !==
|
|
2345
|
+
if (ctx.value.owner.address !== import_viem15.zeroAddress) {
|
|
2294
2346
|
ctx.issues.push({
|
|
2295
2347
|
code: "custom",
|
|
2296
2348
|
input: ctx.value,
|
|
@@ -2298,23 +2350,19 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2298
2350
|
});
|
|
2299
2351
|
}
|
|
2300
2352
|
}
|
|
2301
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2353
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v412.default.discriminatedUnion("ownershipType", [
|
|
2302
2354
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2303
2355
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2304
2356
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2305
2357
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2306
2358
|
]);
|
|
2307
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema") =>
|
|
2308
|
-
token: makeAssetIdSchema(`${valueLabel}.token
|
|
2359
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v412.default.object({
|
|
2360
|
+
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2309
2361
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2310
|
-
mintStatus:
|
|
2362
|
+
mintStatus: import_v412.default.enum(NFTMintStatuses)
|
|
2311
2363
|
});
|
|
2312
2364
|
|
|
2313
2365
|
// src/tokenscope/assets.ts
|
|
2314
|
-
var AssetNamespaces = {
|
|
2315
|
-
ERC721: "erc721",
|
|
2316
|
-
ERC1155: "erc1155"
|
|
2317
|
-
};
|
|
2318
2366
|
function serializeAssetId(assetId) {
|
|
2319
2367
|
return {
|
|
2320
2368
|
assetNamespace: assetId.assetNamespace,
|
|
@@ -2327,25 +2375,17 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2327
2375
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2328
2376
|
if (parsed.error) {
|
|
2329
2377
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2330
|
-
${(0,
|
|
2378
|
+
${(0, import_v413.prettifyError)(parsed.error)}
|
|
2331
2379
|
`);
|
|
2332
2380
|
}
|
|
2333
2381
|
return parsed.data;
|
|
2334
2382
|
}
|
|
2335
|
-
function formatAssetId(assetId) {
|
|
2336
|
-
const { assetNamespace, contract, tokenId } = serializeAssetId(assetId);
|
|
2337
|
-
return import_caip4.AssetId.format({
|
|
2338
|
-
chainId: { namespace: "eip155", reference: contract.chainId.toString() },
|
|
2339
|
-
assetName: { namespace: assetNamespace, reference: contract.address },
|
|
2340
|
-
tokenId
|
|
2341
|
-
}).toLowerCase();
|
|
2342
|
-
}
|
|
2343
2383
|
function parseAssetId(maybeAssetId, valueLabel) {
|
|
2344
2384
|
const schema = makeAssetIdStringSchema(valueLabel);
|
|
2345
2385
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2346
2386
|
if (parsed.error) {
|
|
2347
2387
|
throw new RangeError(`Cannot parse AssetId:
|
|
2348
|
-
${(0,
|
|
2388
|
+
${(0, import_v413.prettifyError)(parsed.error)}
|
|
2349
2389
|
`);
|
|
2350
2390
|
}
|
|
2351
2391
|
return parsed.data;
|
|
@@ -2368,13 +2408,13 @@ var NFTMintStatuses = {
|
|
|
2368
2408
|
Burned: "burned"
|
|
2369
2409
|
};
|
|
2370
2410
|
var formatNFTTransferEventMetadata = (metadata) => {
|
|
2371
|
-
const
|
|
2411
|
+
const assetIdString = formatAssetId(metadata.nft);
|
|
2372
2412
|
return [
|
|
2373
2413
|
`Event: ${metadata.eventHandlerName}`,
|
|
2374
2414
|
`Chain ID: ${metadata.chainId}`,
|
|
2375
2415
|
`Block Number: ${metadata.blockNumber}`,
|
|
2376
2416
|
`Transaction Hash: ${metadata.transactionHash}`,
|
|
2377
|
-
`NFT: ${
|
|
2417
|
+
`NFT: ${assetIdString}`
|
|
2378
2418
|
].map((line) => ` - ${line}`).join("\n");
|
|
2379
2419
|
};
|
|
2380
2420
|
var NFTTransferTypes = {
|
|
@@ -2480,11 +2520,11 @@ var NFTTransferTypes = {
|
|
|
2480
2520
|
};
|
|
2481
2521
|
var getNFTTransferType = (from, to, allowMintedRemint, metadata, currentlyIndexedOwner) => {
|
|
2482
2522
|
const isIndexed = currentlyIndexedOwner !== void 0;
|
|
2483
|
-
const isIndexedAsMinted = isIndexed && !(0,
|
|
2484
|
-
const isMint = (0,
|
|
2485
|
-
const isBurn = (0,
|
|
2486
|
-
const isSelfTransfer = (0,
|
|
2487
|
-
if (isIndexed && !(0,
|
|
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)) {
|
|
2488
2528
|
if (isMint && allowMintedRemint) {
|
|
2489
2529
|
} else {
|
|
2490
2530
|
throw new Error(
|
|
@@ -2567,10 +2607,10 @@ ${formatNFTTransferEventMetadata(metadata)}`
|
|
|
2567
2607
|
};
|
|
2568
2608
|
|
|
2569
2609
|
// src/api/shared/errors/zod-schemas.ts
|
|
2570
|
-
var
|
|
2571
|
-
var ErrorResponseSchema =
|
|
2572
|
-
message:
|
|
2573
|
-
details:
|
|
2610
|
+
var import_v414 = __toESM(require("zod/v4"), 1);
|
|
2611
|
+
var ErrorResponseSchema = import_v414.default.object({
|
|
2612
|
+
message: import_v414.default.string(),
|
|
2613
|
+
details: import_v414.default.optional(import_v414.default.unknown())
|
|
2574
2614
|
});
|
|
2575
2615
|
|
|
2576
2616
|
// src/api/name-tokens/response.ts
|
|
@@ -2609,33 +2649,39 @@ var NameTokensResponseErrorCodes = {
|
|
|
2609
2649
|
};
|
|
2610
2650
|
|
|
2611
2651
|
// src/api/name-tokens/zod-schemas.ts
|
|
2612
|
-
|
|
2652
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v415.default.object({
|
|
2653
|
+
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2654
|
+
name: makeReinterpretedNameSchema(valueLabel),
|
|
2655
|
+
tokens: import_v415.default.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2656
|
+
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2657
|
+
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2658
|
+
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
2613
2659
|
const { name, domainId } = ctx.value;
|
|
2614
|
-
if ((0,
|
|
2660
|
+
if ((0, import_viem17.namehash)(name) !== domainId) {
|
|
2615
2661
|
ctx.issues.push({
|
|
2616
2662
|
code: "custom",
|
|
2617
2663
|
input: ctx.value,
|
|
2618
2664
|
message: `'name' must be associated with 'domainId': ${domainId}`
|
|
2619
2665
|
});
|
|
2620
2666
|
}
|
|
2621
|
-
}
|
|
2622
|
-
function invariant_nameTokensOwnershipTypeNameWrapperRequiresOwnershipTypeFullyOnchainOrUnknown(ctx) {
|
|
2623
|
-
|
|
2624
|
-
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2667
|
+
}).check(
|
|
2668
|
+
function invariant_nameTokensOwnershipTypeNameWrapperRequiresOwnershipTypeFullyOnchainOrUnknown(ctx) {
|
|
2669
|
+
const { tokens } = ctx.value;
|
|
2670
|
+
const containsOwnershipNameWrapper = tokens.some(
|
|
2671
|
+
(t) => t.ownership.ownershipType === NameTokenOwnershipTypes.NameWrapper
|
|
2672
|
+
);
|
|
2673
|
+
const containsOwnershipFullyOnchainOrUnknown = tokens.some(
|
|
2674
|
+
(t) => t.ownership.ownershipType === NameTokenOwnershipTypes.FullyOnchain || t.ownership.ownershipType === NameTokenOwnershipTypes.Unknown
|
|
2675
|
+
);
|
|
2676
|
+
if (containsOwnershipNameWrapper && !containsOwnershipFullyOnchainOrUnknown) {
|
|
2677
|
+
ctx.issues.push({
|
|
2678
|
+
code: "custom",
|
|
2679
|
+
input: ctx.value,
|
|
2680
|
+
message: `'tokens' must contain name token with ownership type 'fully-onchain' or 'unknown' when name token with ownership type 'namewrapper' in listed`
|
|
2681
|
+
});
|
|
2682
|
+
}
|
|
2636
2683
|
}
|
|
2637
|
-
|
|
2638
|
-
function invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective(ctx) {
|
|
2684
|
+
).check(function invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective(ctx) {
|
|
2639
2685
|
const { tokens } = ctx.value;
|
|
2640
2686
|
const tokensCountWithOwnershipFullyOnchain = tokens.filter(
|
|
2641
2687
|
(t) => t.ownership.ownershipType === NameTokenOwnershipTypes.FullyOnchain
|
|
@@ -2647,49 +2693,46 @@ function invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective(ctx) {
|
|
|
2647
2693
|
message: `'tokens' must contain at most one name token with ownership type 'fully-onchain', current count: ${tokensCountWithOwnershipFullyOnchain}`
|
|
2648
2694
|
});
|
|
2649
2695
|
}
|
|
2650
|
-
}
|
|
2651
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token") => import_v414.default.object({
|
|
2652
|
-
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2653
|
-
name: makeReinterpretedNameSchema(valueLabel),
|
|
2654
|
-
tokens: import_v414.default.array(makeNameTokenSchema(`${valueLabel}.tokens`)).nonempty(),
|
|
2655
|
-
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2656
|
-
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2657
|
-
}).check(invariant_nameIsAssociatedWithDomainId).check(invariant_nameTokensContainAtMostOneWithOwnershipTypeEffective).check(invariant_nameTokensOwnershipTypeNameWrapperRequiresOwnershipTypeFullyOnchainOrUnknown);
|
|
2658
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK") => import_v414.default.strictObject({
|
|
2659
|
-
responseCode: import_v414.default.literal(NameTokensResponseCodes.Ok),
|
|
2660
|
-
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`)
|
|
2661
2696
|
});
|
|
2662
|
-
var
|
|
2663
|
-
responseCode:
|
|
2664
|
-
|
|
2697
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v415.default.strictObject({
|
|
2698
|
+
responseCode: import_v415.default.literal(NameTokensResponseCodes.Ok),
|
|
2699
|
+
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2700
|
+
});
|
|
2701
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v415.default.strictObject({
|
|
2702
|
+
responseCode: import_v415.default.literal(NameTokensResponseCodes.Error),
|
|
2703
|
+
errorCode: import_v415.default.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2665
2704
|
error: ErrorResponseSchema
|
|
2666
2705
|
});
|
|
2667
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2668
|
-
responseCode:
|
|
2669
|
-
errorCode:
|
|
2706
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v415.default.strictObject({
|
|
2707
|
+
responseCode: import_v415.default.literal(NameTokensResponseCodes.Error),
|
|
2708
|
+
errorCode: import_v415.default.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2670
2709
|
error: ErrorResponseSchema
|
|
2671
2710
|
});
|
|
2672
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2673
|
-
responseCode:
|
|
2674
|
-
errorCode:
|
|
2711
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v415.default.strictObject({
|
|
2712
|
+
responseCode: import_v415.default.literal(NameTokensResponseCodes.Error),
|
|
2713
|
+
errorCode: import_v415.default.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2675
2714
|
error: ErrorResponseSchema
|
|
2676
2715
|
});
|
|
2677
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2716
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v415.default.discriminatedUnion("errorCode", [
|
|
2678
2717
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2679
2718
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2680
2719
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2681
2720
|
]);
|
|
2682
|
-
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response") =>
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2721
|
+
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2722
|
+
return import_v415.default.discriminatedUnion("responseCode", [
|
|
2723
|
+
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2724
|
+
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2725
|
+
]);
|
|
2726
|
+
};
|
|
2686
2727
|
|
|
2687
2728
|
// src/api/name-tokens/deserialize.ts
|
|
2688
2729
|
function deserializedNameTokensResponse(maybeResponse) {
|
|
2689
|
-
const parsed = makeNameTokensResponseSchema().safeParse(
|
|
2730
|
+
const parsed = makeNameTokensResponseSchema("Name Tokens Response", false).safeParse(
|
|
2731
|
+
maybeResponse
|
|
2732
|
+
);
|
|
2690
2733
|
if (parsed.error) {
|
|
2691
2734
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2692
|
-
${(0,
|
|
2735
|
+
${(0, import_v416.prettifyError)(parsed.error)}
|
|
2693
2736
|
`);
|
|
2694
2737
|
}
|
|
2695
2738
|
return parsed.data;
|
|
@@ -2763,40 +2806,40 @@ function serializeNameTokensResponse(response) {
|
|
|
2763
2806
|
}
|
|
2764
2807
|
|
|
2765
2808
|
// src/api/registrar-actions/deserialize.ts
|
|
2766
|
-
var
|
|
2809
|
+
var import_v420 = require("zod/v4");
|
|
2767
2810
|
|
|
2768
2811
|
// src/api/registrar-actions/zod-schemas.ts
|
|
2769
|
-
var
|
|
2770
|
-
var
|
|
2812
|
+
var import_ens10 = require("viem/ens");
|
|
2813
|
+
var import_v419 = __toESM(require("zod/v4"), 1);
|
|
2771
2814
|
|
|
2772
2815
|
// ../ens-referrals/src/address.ts
|
|
2773
|
-
var
|
|
2816
|
+
var import_viem18 = require("viem");
|
|
2774
2817
|
|
|
2775
2818
|
// ../ens-referrals/src/encoding.ts
|
|
2776
|
-
var
|
|
2819
|
+
var import_viem19 = require("viem");
|
|
2777
2820
|
var ENCODED_REFERRER_BYTE_OFFSET = 12;
|
|
2778
2821
|
var ENCODED_REFERRER_BYTE_LENGTH = 32;
|
|
2779
|
-
var EXPECTED_ENCODED_REFERRER_PADDING = (0,
|
|
2822
|
+
var EXPECTED_ENCODED_REFERRER_PADDING = (0, import_viem19.pad)("0x", {
|
|
2780
2823
|
size: ENCODED_REFERRER_BYTE_OFFSET,
|
|
2781
2824
|
dir: "left"
|
|
2782
2825
|
});
|
|
2783
|
-
var ZERO_ENCODED_REFERRER = (0,
|
|
2826
|
+
var ZERO_ENCODED_REFERRER = (0, import_viem19.pad)("0x", {
|
|
2784
2827
|
size: ENCODED_REFERRER_BYTE_LENGTH,
|
|
2785
2828
|
dir: "left"
|
|
2786
2829
|
});
|
|
2787
2830
|
function decodeEncodedReferrer(encodedReferrer) {
|
|
2788
|
-
if ((0,
|
|
2831
|
+
if ((0, import_viem19.size)(encodedReferrer) !== ENCODED_REFERRER_BYTE_LENGTH) {
|
|
2789
2832
|
throw new Error(
|
|
2790
2833
|
`Encoded referrer value must be represented by ${ENCODED_REFERRER_BYTE_LENGTH} bytes.`
|
|
2791
2834
|
);
|
|
2792
2835
|
}
|
|
2793
|
-
const padding = (0,
|
|
2836
|
+
const padding = (0, import_viem19.slice)(encodedReferrer, 0, ENCODED_REFERRER_BYTE_OFFSET);
|
|
2794
2837
|
if (padding !== EXPECTED_ENCODED_REFERRER_PADDING) {
|
|
2795
|
-
return
|
|
2838
|
+
return import_viem19.zeroAddress;
|
|
2796
2839
|
}
|
|
2797
|
-
const decodedReferrer = (0,
|
|
2840
|
+
const decodedReferrer = (0, import_viem19.slice)(encodedReferrer, ENCODED_REFERRER_BYTE_OFFSET);
|
|
2798
2841
|
try {
|
|
2799
|
-
return (0,
|
|
2842
|
+
return (0, import_viem19.getAddress)(decodedReferrer);
|
|
2800
2843
|
} catch {
|
|
2801
2844
|
throw new Error(`Decoded referrer value must be a valid EVM address.`);
|
|
2802
2845
|
}
|
|
@@ -2806,7 +2849,7 @@ function decodeEncodedReferrer(encodedReferrer) {
|
|
|
2806
2849
|
var REFERRERS_PER_LEADERBOARD_PAGE_MAX = 100;
|
|
2807
2850
|
|
|
2808
2851
|
// ../ens-referrals/src/link.ts
|
|
2809
|
-
var
|
|
2852
|
+
var import_viem20 = require("viem");
|
|
2810
2853
|
|
|
2811
2854
|
// ../ens-referrals/src/referrer-detail.ts
|
|
2812
2855
|
var ReferrerDetailTypeIds = {
|
|
@@ -2821,7 +2864,7 @@ var ReferrerDetailTypeIds = {
|
|
|
2821
2864
|
};
|
|
2822
2865
|
|
|
2823
2866
|
// src/registrars/zod-schemas.ts
|
|
2824
|
-
var
|
|
2867
|
+
var import_v417 = require("zod/v4");
|
|
2825
2868
|
|
|
2826
2869
|
// src/registrars/registrar-action.ts
|
|
2827
2870
|
var RegistrarActionTypes = {
|
|
@@ -2862,11 +2905,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2862
2905
|
}
|
|
2863
2906
|
|
|
2864
2907
|
// src/registrars/zod-schemas.ts
|
|
2865
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2908
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v417.z.object({
|
|
2866
2909
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2867
2910
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2868
2911
|
});
|
|
2869
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2912
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v417.z.object({
|
|
2870
2913
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2871
2914
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2872
2915
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2882,18 +2925,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2882
2925
|
});
|
|
2883
2926
|
}
|
|
2884
2927
|
}
|
|
2885
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
2928
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v417.z.union([
|
|
2886
2929
|
// pricing available
|
|
2887
|
-
|
|
2930
|
+
import_v417.z.object({
|
|
2888
2931
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2889
2932
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2890
2933
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2891
2934
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2892
2935
|
// pricing unknown
|
|
2893
|
-
|
|
2894
|
-
baseCost:
|
|
2895
|
-
premium:
|
|
2896
|
-
total:
|
|
2936
|
+
import_v417.z.object({
|
|
2937
|
+
baseCost: import_v417.z.null(),
|
|
2938
|
+
premium: import_v417.z.null(),
|
|
2939
|
+
total: import_v417.z.null()
|
|
2897
2940
|
}).transform((v) => v)
|
|
2898
2941
|
]);
|
|
2899
2942
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2916,9 +2959,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2916
2959
|
});
|
|
2917
2960
|
}
|
|
2918
2961
|
}
|
|
2919
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
2962
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v417.z.union([
|
|
2920
2963
|
// referral available
|
|
2921
|
-
|
|
2964
|
+
import_v417.z.object({
|
|
2922
2965
|
encodedReferrer: makeHexStringSchema(
|
|
2923
2966
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2924
2967
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2926,9 +2969,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2926
2969
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2927
2970
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2928
2971
|
// referral not applicable
|
|
2929
|
-
|
|
2930
|
-
encodedReferrer:
|
|
2931
|
-
decodedReferrer:
|
|
2972
|
+
import_v417.z.object({
|
|
2973
|
+
encodedReferrer: import_v417.z.null(),
|
|
2974
|
+
decodedReferrer: import_v417.z.null()
|
|
2932
2975
|
})
|
|
2933
2976
|
]);
|
|
2934
2977
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2941,9 +2984,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2941
2984
|
});
|
|
2942
2985
|
}
|
|
2943
2986
|
}
|
|
2944
|
-
var EventIdSchema =
|
|
2945
|
-
var EventIdsSchema =
|
|
2946
|
-
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") =>
|
|
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({
|
|
2947
2990
|
id: EventIdSchema,
|
|
2948
2991
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
2949
2992
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -2957,38 +3000,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
|
|
|
2957
3000
|
eventIds: EventIdsSchema
|
|
2958
3001
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
2959
3002
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2960
|
-
type:
|
|
3003
|
+
type: import_v417.z.literal(RegistrarActionTypes.Registration)
|
|
2961
3004
|
});
|
|
2962
3005
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2963
|
-
type:
|
|
3006
|
+
type: import_v417.z.literal(RegistrarActionTypes.Renewal)
|
|
2964
3007
|
});
|
|
2965
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3008
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v417.z.discriminatedUnion("type", [
|
|
2966
3009
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
2967
3010
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
2968
3011
|
]);
|
|
2969
3012
|
|
|
2970
3013
|
// src/api/shared/pagination/zod-schemas.ts
|
|
2971
|
-
var
|
|
3014
|
+
var import_v418 = __toESM(require("zod/v4"), 1);
|
|
2972
3015
|
|
|
2973
3016
|
// src/api/shared/pagination/request.ts
|
|
2974
3017
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
2975
3018
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
2976
3019
|
|
|
2977
3020
|
// src/api/shared/pagination/zod-schemas.ts
|
|
2978
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3021
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v418.default.object({
|
|
2979
3022
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
2980
3023
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
2981
3024
|
RECORDS_PER_PAGE_MAX,
|
|
2982
3025
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
2983
3026
|
)
|
|
2984
3027
|
});
|
|
2985
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
2986
|
-
totalRecords:
|
|
2987
|
-
totalPages:
|
|
2988
|
-
hasNext:
|
|
2989
|
-
hasPrev:
|
|
2990
|
-
startIndex:
|
|
2991
|
-
endIndex:
|
|
3028
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v418.default.object({
|
|
3029
|
+
totalRecords: import_v418.default.literal(0),
|
|
3030
|
+
totalPages: import_v418.default.literal(1),
|
|
3031
|
+
hasNext: import_v418.default.literal(false),
|
|
3032
|
+
hasPrev: import_v418.default.literal(false),
|
|
3033
|
+
startIndex: import_v418.default.undefined(),
|
|
3034
|
+
endIndex: import_v418.default.undefined()
|
|
2992
3035
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
2993
3036
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
2994
3037
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3023,15 +3066,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3023
3066
|
});
|
|
3024
3067
|
}
|
|
3025
3068
|
}
|
|
3026
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3069
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v418.default.object({
|
|
3027
3070
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3028
3071
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3029
|
-
hasNext:
|
|
3030
|
-
hasPrev:
|
|
3072
|
+
hasNext: import_v418.default.boolean(),
|
|
3073
|
+
hasPrev: import_v418.default.boolean(),
|
|
3031
3074
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3032
3075
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3033
3076
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3034
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3077
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v418.default.union([
|
|
3035
3078
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3036
3079
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3037
3080
|
]);
|
|
@@ -3052,7 +3095,7 @@ var RegistrarActionsResponseCodes = {
|
|
|
3052
3095
|
function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
3053
3096
|
const { name, action } = ctx.value;
|
|
3054
3097
|
const expectedNode = action.registrationLifecycle.node;
|
|
3055
|
-
const actualNode = (0,
|
|
3098
|
+
const actualNode = (0, import_ens10.namehash)(name);
|
|
3056
3099
|
if (actualNode !== expectedNode) {
|
|
3057
3100
|
ctx.issues.push({
|
|
3058
3101
|
code: "custom",
|
|
@@ -3061,20 +3104,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3061
3104
|
});
|
|
3062
3105
|
}
|
|
3063
3106
|
}
|
|
3064
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3107
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v419.default.object({
|
|
3065
3108
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3066
3109
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3067
3110
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3068
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3069
|
-
responseCode:
|
|
3070
|
-
registrarActions:
|
|
3071
|
-
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`)
|
|
3111
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v419.default.object({
|
|
3112
|
+
responseCode: import_v419.default.literal(RegistrarActionsResponseCodes.Ok),
|
|
3113
|
+
registrarActions: import_v419.default.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
3114
|
+
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3115
|
+
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
3072
3116
|
});
|
|
3073
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3074
|
-
responseCode:
|
|
3117
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v419.default.strictObject({
|
|
3118
|
+
responseCode: import_v419.default.literal(RegistrarActionsResponseCodes.Error),
|
|
3075
3119
|
error: ErrorResponseSchema
|
|
3076
3120
|
});
|
|
3077
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3121
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v419.default.discriminatedUnion("responseCode", [
|
|
3078
3122
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3079
3123
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3080
3124
|
]);
|
|
@@ -3085,7 +3129,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3085
3129
|
if (parsed.error) {
|
|
3086
3130
|
throw new Error(
|
|
3087
3131
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3088
|
-
${(0,
|
|
3132
|
+
${(0, import_v420.prettifyError)(parsed.error)}
|
|
3089
3133
|
`
|
|
3090
3134
|
);
|
|
3091
3135
|
}
|
|
@@ -3096,7 +3140,9 @@ ${(0, import_v419.prettifyError)(parsed.error)}
|
|
|
3096
3140
|
var RegistrarActionsFilterTypes = {
|
|
3097
3141
|
BySubregistryNode: "bySubregistryNode",
|
|
3098
3142
|
WithEncodedReferral: "withEncodedReferral",
|
|
3099
|
-
ByDecodedReferrer: "byDecodedReferrer"
|
|
3143
|
+
ByDecodedReferrer: "byDecodedReferrer",
|
|
3144
|
+
BeginTimestamp: "beginTimestamp",
|
|
3145
|
+
EndTimestamp: "endTimestamp"
|
|
3100
3146
|
};
|
|
3101
3147
|
var RegistrarActionsOrders = {
|
|
3102
3148
|
LatestRegistrarActions: "orderBy[timestamp]=desc"
|
|
@@ -3129,10 +3175,30 @@ function byDecodedReferrer(decodedReferrer) {
|
|
|
3129
3175
|
value: decodedReferrer
|
|
3130
3176
|
};
|
|
3131
3177
|
}
|
|
3178
|
+
function beginTimestamp(timestamp) {
|
|
3179
|
+
if (typeof timestamp === "undefined") {
|
|
3180
|
+
return void 0;
|
|
3181
|
+
}
|
|
3182
|
+
return {
|
|
3183
|
+
filterType: RegistrarActionsFilterTypes.BeginTimestamp,
|
|
3184
|
+
value: timestamp
|
|
3185
|
+
};
|
|
3186
|
+
}
|
|
3187
|
+
function endTimestamp(timestamp) {
|
|
3188
|
+
if (typeof timestamp === "undefined") {
|
|
3189
|
+
return void 0;
|
|
3190
|
+
}
|
|
3191
|
+
return {
|
|
3192
|
+
filterType: RegistrarActionsFilterTypes.EndTimestamp,
|
|
3193
|
+
value: timestamp
|
|
3194
|
+
};
|
|
3195
|
+
}
|
|
3132
3196
|
var registrarActionsFilter = {
|
|
3133
3197
|
byParentNode,
|
|
3134
3198
|
withReferral,
|
|
3135
|
-
byDecodedReferrer
|
|
3199
|
+
byDecodedReferrer,
|
|
3200
|
+
beginTimestamp,
|
|
3201
|
+
endTimestamp
|
|
3136
3202
|
};
|
|
3137
3203
|
|
|
3138
3204
|
// src/api/registrar-actions/prerequisites.ts
|
|
@@ -3186,11 +3252,11 @@ var registrarActionsPrerequisites = Object.freeze({
|
|
|
3186
3252
|
});
|
|
3187
3253
|
|
|
3188
3254
|
// src/registrars/basenames-subregistry.ts
|
|
3189
|
-
var
|
|
3255
|
+
var import_datasources7 = require("@ensnode/datasources");
|
|
3190
3256
|
function getBasenamesSubregistryId(namespace) {
|
|
3191
|
-
const datasource = (0,
|
|
3257
|
+
const datasource = (0, import_datasources7.maybeGetDatasource)(namespace, import_datasources7.DatasourceNames.Basenames);
|
|
3192
3258
|
if (!datasource) {
|
|
3193
|
-
throw new Error(`Datasource not found for ${namespace} ${
|
|
3259
|
+
throw new Error(`Datasource not found for ${namespace} ${import_datasources7.DatasourceNames.Basenames}`);
|
|
3194
3260
|
}
|
|
3195
3261
|
const address = datasource.contracts.BaseRegistrar?.address;
|
|
3196
3262
|
if (address === void 0 || Array.isArray(address)) {
|
|
@@ -3203,12 +3269,11 @@ function getBasenamesSubregistryId(namespace) {
|
|
|
3203
3269
|
}
|
|
3204
3270
|
function getBasenamesSubregistryManagedName(namespaceId) {
|
|
3205
3271
|
switch (namespaceId) {
|
|
3206
|
-
case
|
|
3272
|
+
case import_datasources7.ENSNamespaceIds.Mainnet:
|
|
3207
3273
|
return "base.eth";
|
|
3208
|
-
case
|
|
3274
|
+
case import_datasources7.ENSNamespaceIds.Sepolia:
|
|
3209
3275
|
return "basetest.eth";
|
|
3210
|
-
case
|
|
3211
|
-
case import_datasources6.ENSNamespaceIds.EnsTestEnv:
|
|
3276
|
+
case import_datasources7.ENSNamespaceIds.EnsTestEnv:
|
|
3212
3277
|
throw new Error(
|
|
3213
3278
|
`No registrar managed name is known for the 'basenames' subregistry within the "${namespaceId}" namespace.`
|
|
3214
3279
|
);
|
|
@@ -3216,11 +3281,11 @@ function getBasenamesSubregistryManagedName(namespaceId) {
|
|
|
3216
3281
|
}
|
|
3217
3282
|
|
|
3218
3283
|
// src/registrars/ethnames-subregistry.ts
|
|
3219
|
-
var
|
|
3284
|
+
var import_datasources8 = require("@ensnode/datasources");
|
|
3220
3285
|
function getEthnamesSubregistryId(namespace) {
|
|
3221
|
-
const datasource = (0,
|
|
3286
|
+
const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, import_datasources8.DatasourceNames.ENSRoot);
|
|
3222
3287
|
if (!datasource) {
|
|
3223
|
-
throw new Error(`Datasource not found for ${namespace} ${
|
|
3288
|
+
throw new Error(`Datasource not found for ${namespace} ${import_datasources8.DatasourceNames.ENSRoot}`);
|
|
3224
3289
|
}
|
|
3225
3290
|
const address = datasource.contracts.BaseRegistrar?.address;
|
|
3226
3291
|
if (address === void 0 || Array.isArray(address)) {
|
|
@@ -3233,20 +3298,19 @@ function getEthnamesSubregistryId(namespace) {
|
|
|
3233
3298
|
}
|
|
3234
3299
|
function getEthnamesSubregistryManagedName(namespaceId) {
|
|
3235
3300
|
switch (namespaceId) {
|
|
3236
|
-
case
|
|
3237
|
-
case
|
|
3238
|
-
case
|
|
3239
|
-
case import_datasources7.ENSNamespaceIds.EnsTestEnv:
|
|
3301
|
+
case import_datasources8.ENSNamespaceIds.Mainnet:
|
|
3302
|
+
case import_datasources8.ENSNamespaceIds.Sepolia:
|
|
3303
|
+
case import_datasources8.ENSNamespaceIds.EnsTestEnv:
|
|
3240
3304
|
return "eth";
|
|
3241
3305
|
}
|
|
3242
3306
|
}
|
|
3243
3307
|
|
|
3244
3308
|
// src/registrars/lineanames-subregistry.ts
|
|
3245
|
-
var
|
|
3309
|
+
var import_datasources9 = require("@ensnode/datasources");
|
|
3246
3310
|
function getLineanamesSubregistryId(namespace) {
|
|
3247
|
-
const datasource = (0,
|
|
3311
|
+
const datasource = (0, import_datasources9.maybeGetDatasource)(namespace, import_datasources9.DatasourceNames.Lineanames);
|
|
3248
3312
|
if (!datasource) {
|
|
3249
|
-
throw new Error(`Datasource not found for ${namespace} ${
|
|
3313
|
+
throw new Error(`Datasource not found for ${namespace} ${import_datasources9.DatasourceNames.Lineanames}`);
|
|
3250
3314
|
}
|
|
3251
3315
|
const address = datasource.contracts.BaseRegistrar?.address;
|
|
3252
3316
|
if (address === void 0 || Array.isArray(address)) {
|
|
@@ -3259,18 +3323,32 @@ function getLineanamesSubregistryId(namespace) {
|
|
|
3259
3323
|
}
|
|
3260
3324
|
function getLineanamesSubregistryManagedName(namespaceId) {
|
|
3261
3325
|
switch (namespaceId) {
|
|
3262
|
-
case
|
|
3326
|
+
case import_datasources9.ENSNamespaceIds.Mainnet:
|
|
3263
3327
|
return "linea.eth";
|
|
3264
|
-
case
|
|
3328
|
+
case import_datasources9.ENSNamespaceIds.Sepolia:
|
|
3265
3329
|
return "linea-sepolia.eth";
|
|
3266
|
-
case
|
|
3267
|
-
case import_datasources8.ENSNamespaceIds.EnsTestEnv:
|
|
3330
|
+
case import_datasources9.ENSNamespaceIds.EnsTestEnv:
|
|
3268
3331
|
throw new Error(
|
|
3269
3332
|
`No registrar managed name is known for the 'Lineanames' subregistry within the "${namespaceId}" namespace.`
|
|
3270
3333
|
);
|
|
3271
3334
|
}
|
|
3272
3335
|
}
|
|
3273
3336
|
|
|
3337
|
+
// src/registrars/registration-expiration.ts
|
|
3338
|
+
function isRegistrationExpired(info, now) {
|
|
3339
|
+
if (info.expiry == null) return false;
|
|
3340
|
+
return info.expiry <= now;
|
|
3341
|
+
}
|
|
3342
|
+
function isRegistrationFullyExpired(info, now) {
|
|
3343
|
+
if (info.expiry == null) return false;
|
|
3344
|
+
return now >= info.expiry + (info.gracePeriod ?? 0n);
|
|
3345
|
+
}
|
|
3346
|
+
function isRegistrationInGracePeriod(info, now) {
|
|
3347
|
+
if (info.expiry == null) return false;
|
|
3348
|
+
if (info.gracePeriod == null) return false;
|
|
3349
|
+
return info.expiry <= now && info.expiry + info.gracePeriod > now;
|
|
3350
|
+
}
|
|
3351
|
+
|
|
3274
3352
|
// src/api/registrar-actions/serialize.ts
|
|
3275
3353
|
function serializeNamedRegistrarAction({
|
|
3276
3354
|
action,
|
|
@@ -3287,7 +3365,8 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3287
3365
|
return {
|
|
3288
3366
|
responseCode: response.responseCode,
|
|
3289
3367
|
registrarActions: response.registrarActions.map(serializeNamedRegistrarAction),
|
|
3290
|
-
pageContext: response.pageContext
|
|
3368
|
+
pageContext: response.pageContext,
|
|
3369
|
+
accurateAsOf: response.accurateAsOf
|
|
3291
3370
|
};
|
|
3292
3371
|
case RegistrarActionsResponseCodes.Error:
|
|
3293
3372
|
return response;
|
|
@@ -3295,12 +3374,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3295
3374
|
}
|
|
3296
3375
|
|
|
3297
3376
|
// src/api/shared/errors/deserialize.ts
|
|
3298
|
-
var
|
|
3377
|
+
var import_v421 = require("zod/v4");
|
|
3299
3378
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
3300
3379
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
3301
3380
|
if (parsed.error) {
|
|
3302
3381
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3303
|
-
${(0,
|
|
3382
|
+
${(0, import_v421.prettifyError)(parsed.error)}
|
|
3304
3383
|
`);
|
|
3305
3384
|
}
|
|
3306
3385
|
return parsed.data;
|
|
@@ -3355,10 +3434,10 @@ var ClientError = class _ClientError extends Error {
|
|
|
3355
3434
|
};
|
|
3356
3435
|
|
|
3357
3436
|
// src/ensanalytics/deserialize.ts
|
|
3358
|
-
var
|
|
3437
|
+
var import_v423 = require("zod/v4");
|
|
3359
3438
|
|
|
3360
3439
|
// src/ensanalytics/zod-schemas.ts
|
|
3361
|
-
var
|
|
3440
|
+
var import_v422 = __toESM(require("zod/v4"), 1);
|
|
3362
3441
|
|
|
3363
3442
|
// src/ensanalytics/types.ts
|
|
3364
3443
|
var ReferrerLeaderboardPageResponseCodes = {
|
|
@@ -3383,20 +3462,28 @@ var ReferrerDetailResponseCodes = {
|
|
|
3383
3462
|
};
|
|
3384
3463
|
|
|
3385
3464
|
// src/ensanalytics/zod-schemas.ts
|
|
3386
|
-
var
|
|
3465
|
+
var makeRevenueContributionSchema = (valueLabel = "RevenueContribution") => import_v422.default.coerce.bigint({
|
|
3466
|
+
error: `${valueLabel} must represent a bigint.`
|
|
3467
|
+
}).nonnegative({
|
|
3468
|
+
error: `${valueLabel} must not be negative.`
|
|
3469
|
+
});
|
|
3470
|
+
var makeReferralProgramRulesSchema = (valueLabel = "ReferralProgramRules") => import_v422.default.object({
|
|
3387
3471
|
totalAwardPoolValue: makeFiniteNonNegativeNumberSchema(`${valueLabel}.totalAwardPoolValue`),
|
|
3388
3472
|
maxQualifiedReferrers: makeNonNegativeIntegerSchema(`${valueLabel}.maxQualifiedReferrers`),
|
|
3389
3473
|
startTime: makeUnixTimestampSchema(`${valueLabel}.startTime`),
|
|
3390
3474
|
endTime: makeUnixTimestampSchema(`${valueLabel}.endTime`),
|
|
3391
3475
|
subregistryId: makeAccountIdSchema(`${valueLabel}.subregistryId`)
|
|
3392
3476
|
});
|
|
3393
|
-
var makeAwardedReferrerMetricsSchema = (valueLabel = "AwardedReferrerMetrics") =>
|
|
3477
|
+
var makeAwardedReferrerMetricsSchema = (valueLabel = "AwardedReferrerMetrics") => import_v422.default.object({
|
|
3394
3478
|
referrer: makeLowercaseAddressSchema(`${valueLabel}.referrer`),
|
|
3395
3479
|
totalReferrals: makeNonNegativeIntegerSchema(`${valueLabel}.totalReferrals`),
|
|
3396
3480
|
totalIncrementalDuration: makeDurationSchema(`${valueLabel}.totalIncrementalDuration`),
|
|
3481
|
+
totalRevenueContribution: makeRevenueContributionSchema(
|
|
3482
|
+
`${valueLabel}.totalRevenueContribution`
|
|
3483
|
+
),
|
|
3397
3484
|
score: makeFiniteNonNegativeNumberSchema(`${valueLabel}.score`),
|
|
3398
3485
|
rank: makePositiveIntegerSchema(`${valueLabel}.rank`),
|
|
3399
|
-
isQualified:
|
|
3486
|
+
isQualified: import_v422.default.boolean(),
|
|
3400
3487
|
finalScoreBoost: makeFiniteNonNegativeNumberSchema(`${valueLabel}.finalScoreBoost`).max(
|
|
3401
3488
|
1,
|
|
3402
3489
|
`${valueLabel}.finalScoreBoost must be <= 1`
|
|
@@ -3408,13 +3495,16 @@ var makeAwardedReferrerMetricsSchema = (valueLabel = "AwardedReferrerMetrics") =
|
|
|
3408
3495
|
),
|
|
3409
3496
|
awardPoolApproxValue: makeFiniteNonNegativeNumberSchema(`${valueLabel}.awardPoolApproxValue`)
|
|
3410
3497
|
});
|
|
3411
|
-
var makeUnrankedReferrerMetricsSchema = (valueLabel = "UnrankedReferrerMetrics") =>
|
|
3498
|
+
var makeUnrankedReferrerMetricsSchema = (valueLabel = "UnrankedReferrerMetrics") => import_v422.default.object({
|
|
3412
3499
|
referrer: makeLowercaseAddressSchema(`${valueLabel}.referrer`),
|
|
3413
3500
|
totalReferrals: makeNonNegativeIntegerSchema(`${valueLabel}.totalReferrals`),
|
|
3414
3501
|
totalIncrementalDuration: makeDurationSchema(`${valueLabel}.totalIncrementalDuration`),
|
|
3502
|
+
totalRevenueContribution: makeRevenueContributionSchema(
|
|
3503
|
+
`${valueLabel}.totalRevenueContribution`
|
|
3504
|
+
),
|
|
3415
3505
|
score: makeFiniteNonNegativeNumberSchema(`${valueLabel}.score`),
|
|
3416
|
-
rank:
|
|
3417
|
-
isQualified:
|
|
3506
|
+
rank: import_v422.default.null(),
|
|
3507
|
+
isQualified: import_v422.default.literal(false),
|
|
3418
3508
|
finalScoreBoost: makeFiniteNonNegativeNumberSchema(`${valueLabel}.finalScoreBoost`).max(
|
|
3419
3509
|
1,
|
|
3420
3510
|
`${valueLabel}.finalScoreBoost must be <= 1`
|
|
@@ -3426,11 +3516,14 @@ var makeUnrankedReferrerMetricsSchema = (valueLabel = "UnrankedReferrerMetrics")
|
|
|
3426
3516
|
),
|
|
3427
3517
|
awardPoolApproxValue: makeFiniteNonNegativeNumberSchema(`${valueLabel}.awardPoolApproxValue`)
|
|
3428
3518
|
});
|
|
3429
|
-
var makeAggregatedReferrerMetricsSchema = (valueLabel = "AggregatedReferrerMetrics") =>
|
|
3519
|
+
var makeAggregatedReferrerMetricsSchema = (valueLabel = "AggregatedReferrerMetrics") => import_v422.default.object({
|
|
3430
3520
|
grandTotalReferrals: makeNonNegativeIntegerSchema(`${valueLabel}.grandTotalReferrals`),
|
|
3431
3521
|
grandTotalIncrementalDuration: makeDurationSchema(
|
|
3432
3522
|
`${valueLabel}.grandTotalIncrementalDuration`
|
|
3433
3523
|
),
|
|
3524
|
+
grandTotalRevenueContribution: makeRevenueContributionSchema(
|
|
3525
|
+
`${valueLabel}.grandTotalRevenueContribution`
|
|
3526
|
+
),
|
|
3434
3527
|
grandTotalQualifiedReferrersFinalScore: makeFiniteNonNegativeNumberSchema(
|
|
3435
3528
|
`${valueLabel}.grandTotalQualifiedReferrersFinalScore`
|
|
3436
3529
|
),
|
|
@@ -3438,7 +3531,7 @@ var makeAggregatedReferrerMetricsSchema = (valueLabel = "AggregatedReferrerMetri
|
|
|
3438
3531
|
`${valueLabel}.minFinalScoreToQualify`
|
|
3439
3532
|
)
|
|
3440
3533
|
});
|
|
3441
|
-
var makeReferrerLeaderboardPageContextSchema = (valueLabel = "ReferrerLeaderboardPageContext") =>
|
|
3534
|
+
var makeReferrerLeaderboardPageContextSchema = (valueLabel = "ReferrerLeaderboardPageContext") => import_v422.default.object({
|
|
3442
3535
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3443
3536
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3444
3537
|
REFERRERS_PER_LEADERBOARD_PAGE_MAX,
|
|
@@ -3446,91 +3539,278 @@ var makeReferrerLeaderboardPageContextSchema = (valueLabel = "ReferrerLeaderboar
|
|
|
3446
3539
|
),
|
|
3447
3540
|
totalRecords: makeNonNegativeIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3448
3541
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3449
|
-
hasNext:
|
|
3450
|
-
hasPrev:
|
|
3451
|
-
startIndex:
|
|
3452
|
-
endIndex:
|
|
3542
|
+
hasNext: import_v422.default.boolean(),
|
|
3543
|
+
hasPrev: import_v422.default.boolean(),
|
|
3544
|
+
startIndex: import_v422.default.optional(makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`)),
|
|
3545
|
+
endIndex: import_v422.default.optional(makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`))
|
|
3453
3546
|
});
|
|
3454
|
-
var makeReferrerLeaderboardPageSchema = (valueLabel = "ReferrerLeaderboardPage") =>
|
|
3547
|
+
var makeReferrerLeaderboardPageSchema = (valueLabel = "ReferrerLeaderboardPage") => import_v422.default.object({
|
|
3455
3548
|
rules: makeReferralProgramRulesSchema(`${valueLabel}.rules`),
|
|
3456
|
-
referrers:
|
|
3549
|
+
referrers: import_v422.default.array(makeAwardedReferrerMetricsSchema(`${valueLabel}.referrers[record]`)),
|
|
3457
3550
|
aggregatedMetrics: makeAggregatedReferrerMetricsSchema(`${valueLabel}.aggregatedMetrics`),
|
|
3458
3551
|
pageContext: makeReferrerLeaderboardPageContextSchema(`${valueLabel}.pageContext`),
|
|
3459
3552
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3460
3553
|
});
|
|
3461
|
-
var makeReferrerLeaderboardPageResponseOkSchema = (valueLabel = "ReferrerLeaderboardPageResponseOk") =>
|
|
3462
|
-
responseCode:
|
|
3554
|
+
var makeReferrerLeaderboardPageResponseOkSchema = (valueLabel = "ReferrerLeaderboardPageResponseOk") => import_v422.default.object({
|
|
3555
|
+
responseCode: import_v422.default.literal(ReferrerLeaderboardPageResponseCodes.Ok),
|
|
3463
3556
|
data: makeReferrerLeaderboardPageSchema(`${valueLabel}.data`)
|
|
3464
3557
|
});
|
|
3465
|
-
var makeReferrerLeaderboardPageResponseErrorSchema = (_valueLabel = "ReferrerLeaderboardPageResponseError") =>
|
|
3466
|
-
responseCode:
|
|
3467
|
-
error:
|
|
3468
|
-
errorMessage:
|
|
3558
|
+
var makeReferrerLeaderboardPageResponseErrorSchema = (_valueLabel = "ReferrerLeaderboardPageResponseError") => import_v422.default.object({
|
|
3559
|
+
responseCode: import_v422.default.literal(ReferrerLeaderboardPageResponseCodes.Error),
|
|
3560
|
+
error: import_v422.default.string(),
|
|
3561
|
+
errorMessage: import_v422.default.string()
|
|
3469
3562
|
});
|
|
3470
|
-
var makeReferrerLeaderboardPageResponseSchema = (valueLabel = "ReferrerLeaderboardPageResponse") =>
|
|
3563
|
+
var makeReferrerLeaderboardPageResponseSchema = (valueLabel = "ReferrerLeaderboardPageResponse") => import_v422.default.union([
|
|
3471
3564
|
makeReferrerLeaderboardPageResponseOkSchema(valueLabel),
|
|
3472
3565
|
makeReferrerLeaderboardPageResponseErrorSchema(valueLabel)
|
|
3473
3566
|
]);
|
|
3474
|
-
var makeReferrerDetailRankedSchema = (valueLabel = "ReferrerDetailRanked") =>
|
|
3475
|
-
type:
|
|
3567
|
+
var makeReferrerDetailRankedSchema = (valueLabel = "ReferrerDetailRanked") => import_v422.default.object({
|
|
3568
|
+
type: import_v422.default.literal(ReferrerDetailTypeIds.Ranked),
|
|
3476
3569
|
rules: makeReferralProgramRulesSchema(`${valueLabel}.rules`),
|
|
3477
3570
|
referrer: makeAwardedReferrerMetricsSchema(`${valueLabel}.referrer`),
|
|
3478
3571
|
aggregatedMetrics: makeAggregatedReferrerMetricsSchema(`${valueLabel}.aggregatedMetrics`),
|
|
3479
3572
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3480
3573
|
});
|
|
3481
|
-
var makeReferrerDetailUnrankedSchema = (valueLabel = "ReferrerDetailUnranked") =>
|
|
3482
|
-
type:
|
|
3574
|
+
var makeReferrerDetailUnrankedSchema = (valueLabel = "ReferrerDetailUnranked") => import_v422.default.object({
|
|
3575
|
+
type: import_v422.default.literal(ReferrerDetailTypeIds.Unranked),
|
|
3483
3576
|
rules: makeReferralProgramRulesSchema(`${valueLabel}.rules`),
|
|
3484
3577
|
referrer: makeUnrankedReferrerMetricsSchema(`${valueLabel}.referrer`),
|
|
3485
3578
|
aggregatedMetrics: makeAggregatedReferrerMetricsSchema(`${valueLabel}.aggregatedMetrics`),
|
|
3486
3579
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3487
3580
|
});
|
|
3488
|
-
var makeReferrerDetailResponseOkSchema = (valueLabel = "ReferrerDetailResponse") =>
|
|
3489
|
-
responseCode:
|
|
3490
|
-
data:
|
|
3581
|
+
var makeReferrerDetailResponseOkSchema = (valueLabel = "ReferrerDetailResponse") => import_v422.default.object({
|
|
3582
|
+
responseCode: import_v422.default.literal(ReferrerDetailResponseCodes.Ok),
|
|
3583
|
+
data: import_v422.default.union([
|
|
3491
3584
|
makeReferrerDetailRankedSchema(`${valueLabel}.data`),
|
|
3492
3585
|
makeReferrerDetailUnrankedSchema(`${valueLabel}.data`)
|
|
3493
3586
|
])
|
|
3494
3587
|
});
|
|
3495
|
-
var makeReferrerDetailResponseErrorSchema = (_valueLabel = "ReferrerDetailResponse") =>
|
|
3496
|
-
responseCode:
|
|
3497
|
-
error:
|
|
3498
|
-
errorMessage:
|
|
3588
|
+
var makeReferrerDetailResponseErrorSchema = (_valueLabel = "ReferrerDetailResponse") => import_v422.default.object({
|
|
3589
|
+
responseCode: import_v422.default.literal(ReferrerDetailResponseCodes.Error),
|
|
3590
|
+
error: import_v422.default.string(),
|
|
3591
|
+
errorMessage: import_v422.default.string()
|
|
3499
3592
|
});
|
|
3500
|
-
var makeReferrerDetailResponseSchema = (valueLabel = "ReferrerDetailResponse") =>
|
|
3593
|
+
var makeReferrerDetailResponseSchema = (valueLabel = "ReferrerDetailResponse") => import_v422.default.union([
|
|
3501
3594
|
makeReferrerDetailResponseOkSchema(valueLabel),
|
|
3502
3595
|
makeReferrerDetailResponseErrorSchema(valueLabel)
|
|
3503
3596
|
]);
|
|
3504
3597
|
|
|
3505
3598
|
// src/ensanalytics/deserialize.ts
|
|
3599
|
+
function deserializeRevenueContribution(value) {
|
|
3600
|
+
return BigInt(value);
|
|
3601
|
+
}
|
|
3602
|
+
function deserializeReferralProgramRules(rules) {
|
|
3603
|
+
return rules;
|
|
3604
|
+
}
|
|
3605
|
+
function deserializeAwardedReferrerMetrics(metrics) {
|
|
3606
|
+
return {
|
|
3607
|
+
referrer: metrics.referrer,
|
|
3608
|
+
totalReferrals: metrics.totalReferrals,
|
|
3609
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3610
|
+
totalRevenueContribution: deserializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3611
|
+
score: metrics.score,
|
|
3612
|
+
rank: metrics.rank,
|
|
3613
|
+
isQualified: metrics.isQualified,
|
|
3614
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3615
|
+
finalScore: metrics.finalScore,
|
|
3616
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3617
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3618
|
+
};
|
|
3619
|
+
}
|
|
3620
|
+
function deserializeUnrankedReferrerMetrics(metrics) {
|
|
3621
|
+
return {
|
|
3622
|
+
referrer: metrics.referrer,
|
|
3623
|
+
totalReferrals: metrics.totalReferrals,
|
|
3624
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3625
|
+
totalRevenueContribution: deserializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3626
|
+
score: metrics.score,
|
|
3627
|
+
rank: metrics.rank,
|
|
3628
|
+
isQualified: metrics.isQualified,
|
|
3629
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3630
|
+
finalScore: metrics.finalScore,
|
|
3631
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3632
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3633
|
+
};
|
|
3634
|
+
}
|
|
3635
|
+
function deserializeAggregatedReferrerMetrics(metrics) {
|
|
3636
|
+
return {
|
|
3637
|
+
grandTotalReferrals: metrics.grandTotalReferrals,
|
|
3638
|
+
grandTotalIncrementalDuration: metrics.grandTotalIncrementalDuration,
|
|
3639
|
+
grandTotalRevenueContribution: deserializeRevenueContribution(
|
|
3640
|
+
metrics.grandTotalRevenueContribution
|
|
3641
|
+
),
|
|
3642
|
+
grandTotalQualifiedReferrersFinalScore: metrics.grandTotalQualifiedReferrersFinalScore,
|
|
3643
|
+
minFinalScoreToQualify: metrics.minFinalScoreToQualify
|
|
3644
|
+
};
|
|
3645
|
+
}
|
|
3646
|
+
function deserializeReferrerLeaderboardPage(page) {
|
|
3647
|
+
return {
|
|
3648
|
+
rules: deserializeReferralProgramRules(page.rules),
|
|
3649
|
+
referrers: page.referrers.map(deserializeAwardedReferrerMetrics),
|
|
3650
|
+
aggregatedMetrics: deserializeAggregatedReferrerMetrics(page.aggregatedMetrics),
|
|
3651
|
+
pageContext: page.pageContext,
|
|
3652
|
+
accurateAsOf: page.accurateAsOf
|
|
3653
|
+
};
|
|
3654
|
+
}
|
|
3655
|
+
function deserializeReferrerDetailRanked(detail) {
|
|
3656
|
+
return {
|
|
3657
|
+
type: detail.type,
|
|
3658
|
+
rules: deserializeReferralProgramRules(detail.rules),
|
|
3659
|
+
referrer: deserializeAwardedReferrerMetrics(detail.referrer),
|
|
3660
|
+
aggregatedMetrics: deserializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3661
|
+
accurateAsOf: detail.accurateAsOf
|
|
3662
|
+
};
|
|
3663
|
+
}
|
|
3664
|
+
function deserializeReferrerDetailUnranked(detail) {
|
|
3665
|
+
return {
|
|
3666
|
+
type: detail.type,
|
|
3667
|
+
rules: deserializeReferralProgramRules(detail.rules),
|
|
3668
|
+
referrer: deserializeUnrankedReferrerMetrics(detail.referrer),
|
|
3669
|
+
aggregatedMetrics: deserializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3670
|
+
accurateAsOf: detail.accurateAsOf
|
|
3671
|
+
};
|
|
3672
|
+
}
|
|
3506
3673
|
function deserializeReferrerLeaderboardPageResponse(maybeResponse, valueLabel) {
|
|
3674
|
+
let deserialized;
|
|
3675
|
+
switch (maybeResponse.responseCode) {
|
|
3676
|
+
case "ok": {
|
|
3677
|
+
deserialized = {
|
|
3678
|
+
responseCode: maybeResponse.responseCode,
|
|
3679
|
+
data: deserializeReferrerLeaderboardPage(maybeResponse.data)
|
|
3680
|
+
};
|
|
3681
|
+
break;
|
|
3682
|
+
}
|
|
3683
|
+
case "error":
|
|
3684
|
+
deserialized = maybeResponse;
|
|
3685
|
+
break;
|
|
3686
|
+
}
|
|
3507
3687
|
const schema = makeReferrerLeaderboardPageResponseSchema(valueLabel);
|
|
3508
|
-
const parsed = schema.safeParse(
|
|
3688
|
+
const parsed = schema.safeParse(deserialized);
|
|
3509
3689
|
if (parsed.error) {
|
|
3510
3690
|
throw new Error(
|
|
3511
3691
|
`Cannot deserialize SerializedReferrerLeaderboardPageResponse:
|
|
3512
|
-
${(0,
|
|
3692
|
+
${(0, import_v423.prettifyError)(parsed.error)}
|
|
3513
3693
|
`
|
|
3514
3694
|
);
|
|
3515
3695
|
}
|
|
3516
3696
|
return parsed.data;
|
|
3517
3697
|
}
|
|
3518
3698
|
function deserializeReferrerDetailResponse(maybeResponse, valueLabel) {
|
|
3699
|
+
let deserialized;
|
|
3700
|
+
switch (maybeResponse.responseCode) {
|
|
3701
|
+
case "ok": {
|
|
3702
|
+
switch (maybeResponse.data.type) {
|
|
3703
|
+
case "ranked":
|
|
3704
|
+
deserialized = {
|
|
3705
|
+
responseCode: maybeResponse.responseCode,
|
|
3706
|
+
data: deserializeReferrerDetailRanked(maybeResponse.data)
|
|
3707
|
+
};
|
|
3708
|
+
break;
|
|
3709
|
+
case "unranked":
|
|
3710
|
+
deserialized = {
|
|
3711
|
+
responseCode: maybeResponse.responseCode,
|
|
3712
|
+
data: deserializeReferrerDetailUnranked(maybeResponse.data)
|
|
3713
|
+
};
|
|
3714
|
+
break;
|
|
3715
|
+
}
|
|
3716
|
+
break;
|
|
3717
|
+
}
|
|
3718
|
+
case "error":
|
|
3719
|
+
deserialized = maybeResponse;
|
|
3720
|
+
break;
|
|
3721
|
+
}
|
|
3519
3722
|
const schema = makeReferrerDetailResponseSchema(valueLabel);
|
|
3520
|
-
const parsed = schema.safeParse(
|
|
3723
|
+
const parsed = schema.safeParse(deserialized);
|
|
3521
3724
|
if (parsed.error) {
|
|
3522
3725
|
throw new Error(`Cannot deserialize ReferrerDetailResponse:
|
|
3523
|
-
${(0,
|
|
3726
|
+
${(0, import_v423.prettifyError)(parsed.error)}
|
|
3524
3727
|
`);
|
|
3525
3728
|
}
|
|
3526
3729
|
return parsed.data;
|
|
3527
3730
|
}
|
|
3528
3731
|
|
|
3529
3732
|
// src/ensanalytics/serialize.ts
|
|
3733
|
+
function serializeRevenueContribution(revenueContribution) {
|
|
3734
|
+
return revenueContribution.toString();
|
|
3735
|
+
}
|
|
3736
|
+
function serializeReferralProgramRules(rules) {
|
|
3737
|
+
return rules;
|
|
3738
|
+
}
|
|
3739
|
+
function serializeAwardedReferrerMetrics(metrics) {
|
|
3740
|
+
return {
|
|
3741
|
+
referrer: metrics.referrer,
|
|
3742
|
+
totalReferrals: metrics.totalReferrals,
|
|
3743
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3744
|
+
totalRevenueContribution: serializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3745
|
+
score: metrics.score,
|
|
3746
|
+
rank: metrics.rank,
|
|
3747
|
+
isQualified: metrics.isQualified,
|
|
3748
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3749
|
+
finalScore: metrics.finalScore,
|
|
3750
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3751
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3752
|
+
};
|
|
3753
|
+
}
|
|
3754
|
+
function serializeUnrankedReferrerMetrics(metrics) {
|
|
3755
|
+
return {
|
|
3756
|
+
referrer: metrics.referrer,
|
|
3757
|
+
totalReferrals: metrics.totalReferrals,
|
|
3758
|
+
totalIncrementalDuration: metrics.totalIncrementalDuration,
|
|
3759
|
+
totalRevenueContribution: serializeRevenueContribution(metrics.totalRevenueContribution),
|
|
3760
|
+
score: metrics.score,
|
|
3761
|
+
rank: metrics.rank,
|
|
3762
|
+
isQualified: metrics.isQualified,
|
|
3763
|
+
finalScoreBoost: metrics.finalScoreBoost,
|
|
3764
|
+
finalScore: metrics.finalScore,
|
|
3765
|
+
awardPoolShare: metrics.awardPoolShare,
|
|
3766
|
+
awardPoolApproxValue: metrics.awardPoolApproxValue
|
|
3767
|
+
};
|
|
3768
|
+
}
|
|
3769
|
+
function serializeAggregatedReferrerMetrics(metrics) {
|
|
3770
|
+
return {
|
|
3771
|
+
grandTotalReferrals: metrics.grandTotalReferrals,
|
|
3772
|
+
grandTotalIncrementalDuration: metrics.grandTotalIncrementalDuration,
|
|
3773
|
+
grandTotalRevenueContribution: serializeRevenueContribution(
|
|
3774
|
+
metrics.grandTotalRevenueContribution
|
|
3775
|
+
),
|
|
3776
|
+
grandTotalQualifiedReferrersFinalScore: metrics.grandTotalQualifiedReferrersFinalScore,
|
|
3777
|
+
minFinalScoreToQualify: metrics.minFinalScoreToQualify
|
|
3778
|
+
};
|
|
3779
|
+
}
|
|
3780
|
+
function serializeReferrerLeaderboardPage(page) {
|
|
3781
|
+
return {
|
|
3782
|
+
rules: serializeReferralProgramRules(page.rules),
|
|
3783
|
+
referrers: page.referrers.map(serializeAwardedReferrerMetrics),
|
|
3784
|
+
aggregatedMetrics: serializeAggregatedReferrerMetrics(page.aggregatedMetrics),
|
|
3785
|
+
pageContext: page.pageContext,
|
|
3786
|
+
accurateAsOf: page.accurateAsOf
|
|
3787
|
+
};
|
|
3788
|
+
}
|
|
3789
|
+
function serializeReferrerDetailRanked(detail) {
|
|
3790
|
+
return {
|
|
3791
|
+
type: detail.type,
|
|
3792
|
+
rules: serializeReferralProgramRules(detail.rules),
|
|
3793
|
+
referrer: serializeAwardedReferrerMetrics(detail.referrer),
|
|
3794
|
+
aggregatedMetrics: serializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3795
|
+
accurateAsOf: detail.accurateAsOf
|
|
3796
|
+
};
|
|
3797
|
+
}
|
|
3798
|
+
function serializeReferrerDetailUnranked(detail) {
|
|
3799
|
+
return {
|
|
3800
|
+
type: detail.type,
|
|
3801
|
+
rules: serializeReferralProgramRules(detail.rules),
|
|
3802
|
+
referrer: serializeUnrankedReferrerMetrics(detail.referrer),
|
|
3803
|
+
aggregatedMetrics: serializeAggregatedReferrerMetrics(detail.aggregatedMetrics),
|
|
3804
|
+
accurateAsOf: detail.accurateAsOf
|
|
3805
|
+
};
|
|
3806
|
+
}
|
|
3530
3807
|
function serializeReferrerLeaderboardPageResponse(response) {
|
|
3531
3808
|
switch (response.responseCode) {
|
|
3532
3809
|
case ReferrerLeaderboardPageResponseCodes.Ok:
|
|
3533
|
-
return
|
|
3810
|
+
return {
|
|
3811
|
+
responseCode: response.responseCode,
|
|
3812
|
+
data: serializeReferrerLeaderboardPage(response.data)
|
|
3813
|
+
};
|
|
3534
3814
|
case ReferrerLeaderboardPageResponseCodes.Error:
|
|
3535
3815
|
return response;
|
|
3536
3816
|
}
|
|
@@ -3538,7 +3818,19 @@ function serializeReferrerLeaderboardPageResponse(response) {
|
|
|
3538
3818
|
function serializeReferrerDetailResponse(response) {
|
|
3539
3819
|
switch (response.responseCode) {
|
|
3540
3820
|
case ReferrerDetailResponseCodes.Ok:
|
|
3541
|
-
|
|
3821
|
+
switch (response.data.type) {
|
|
3822
|
+
case "ranked":
|
|
3823
|
+
return {
|
|
3824
|
+
responseCode: response.responseCode,
|
|
3825
|
+
data: serializeReferrerDetailRanked(response.data)
|
|
3826
|
+
};
|
|
3827
|
+
case "unranked":
|
|
3828
|
+
return {
|
|
3829
|
+
responseCode: response.responseCode,
|
|
3830
|
+
data: serializeReferrerDetailUnranked(response.data)
|
|
3831
|
+
};
|
|
3832
|
+
}
|
|
3833
|
+
break;
|
|
3542
3834
|
case ReferrerDetailResponseCodes.Error:
|
|
3543
3835
|
return response;
|
|
3544
3836
|
}
|
|
@@ -3970,6 +4262,7 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
3970
4262
|
* const { registrarActions, pageContext } = response;
|
|
3971
4263
|
* console.log(registrarActions);
|
|
3972
4264
|
* console.log(`Page ${pageContext.page} of ${pageContext.totalPages}`);
|
|
4265
|
+
* console.log(`Accurate as of: ${response.accurateAsOf}`);
|
|
3973
4266
|
* }
|
|
3974
4267
|
*
|
|
3975
4268
|
* // Get second page with 25 records per page
|
|
@@ -4000,6 +4293,26 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
4000
4293
|
* filters: [registrarActionsFilter.byParentNode(namehash('base.eth'))],
|
|
4001
4294
|
* recordsPerPage: 10
|
|
4002
4295
|
* });
|
|
4296
|
+
*
|
|
4297
|
+
* // get registrar actions within a specific time range
|
|
4298
|
+
* const beginTimestamp = 1764547200; // Dec 1, 2025, 00:00:00 UTC
|
|
4299
|
+
* const endTimestamp = 1767225600; // Jan 1, 2026, 00:00:00 UTC
|
|
4300
|
+
* await client.registrarActions({
|
|
4301
|
+
* filters: [
|
|
4302
|
+
* registrarActionsFilter.beginTimestamp(beginTimestamp),
|
|
4303
|
+
* registrarActionsFilter.endTimestamp(endTimestamp),
|
|
4304
|
+
* ],
|
|
4305
|
+
* });
|
|
4306
|
+
*
|
|
4307
|
+
* // get registrar actions from a specific timestamp onwards
|
|
4308
|
+
* await client.registrarActions({
|
|
4309
|
+
* filters: [registrarActionsFilter.beginTimestamp(1764547200)],
|
|
4310
|
+
* });
|
|
4311
|
+
*
|
|
4312
|
+
* // get registrar actions up to a specific timestamp
|
|
4313
|
+
* await client.registrarActions({
|
|
4314
|
+
* filters: [registrarActionsFilter.endTimestamp(1767225600)],
|
|
4315
|
+
* });
|
|
4003
4316
|
* ```
|
|
4004
4317
|
*/
|
|
4005
4318
|
async registrarActions(request = {}) {
|
|
@@ -4021,6 +4334,18 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
4021
4334
|
);
|
|
4022
4335
|
return decodedReferrerFilter ? { key: "decodedReferrer", value: decodedReferrerFilter.value } : null;
|
|
4023
4336
|
};
|
|
4337
|
+
const buildBeginTimestampArg = (filters) => {
|
|
4338
|
+
const beginTimestampFilter = filters?.find(
|
|
4339
|
+
(f) => f.filterType === RegistrarActionsFilterTypes.BeginTimestamp
|
|
4340
|
+
);
|
|
4341
|
+
return beginTimestampFilter ? { key: "beginTimestamp", value: beginTimestampFilter.value.toString() } : null;
|
|
4342
|
+
};
|
|
4343
|
+
const buildEndTimestampArg = (filters) => {
|
|
4344
|
+
const endTimestampFilter = filters?.find(
|
|
4345
|
+
(f) => f.filterType === RegistrarActionsFilterTypes.EndTimestamp
|
|
4346
|
+
);
|
|
4347
|
+
return endTimestampFilter ? { key: "endTimestamp", value: endTimestampFilter.value.toString() } : null;
|
|
4348
|
+
};
|
|
4024
4349
|
const buildOrderArg = (order) => {
|
|
4025
4350
|
switch (order) {
|
|
4026
4351
|
case RegistrarActionsOrders.LatestRegistrarActions: {
|
|
@@ -4051,6 +4376,14 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
4051
4376
|
if (decodedReferrerArg) {
|
|
4052
4377
|
url.searchParams.set(decodedReferrerArg.key, decodedReferrerArg.value);
|
|
4053
4378
|
}
|
|
4379
|
+
const beginTimestampArg = buildBeginTimestampArg(request.filters);
|
|
4380
|
+
if (beginTimestampArg) {
|
|
4381
|
+
url.searchParams.set(beginTimestampArg.key, beginTimestampArg.value);
|
|
4382
|
+
}
|
|
4383
|
+
const endTimestampArg = buildEndTimestampArg(request.filters);
|
|
4384
|
+
if (endTimestampArg) {
|
|
4385
|
+
url.searchParams.set(endTimestampArg.key, endTimestampArg.value);
|
|
4386
|
+
}
|
|
4054
4387
|
const response = await fetch(url);
|
|
4055
4388
|
let responseData;
|
|
4056
4389
|
try {
|
|
@@ -4104,7 +4437,7 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
4104
4437
|
const url = new URL(`/api/name-tokens`, this.options.url);
|
|
4105
4438
|
if (request.name !== void 0) {
|
|
4106
4439
|
url.searchParams.set("name", request.name);
|
|
4107
|
-
} else {
|
|
4440
|
+
} else if (request.domainId !== void 0) {
|
|
4108
4441
|
url.searchParams.set("domainId", request.domainId);
|
|
4109
4442
|
}
|
|
4110
4443
|
const response = await fetch(url);
|
|
@@ -4129,8 +4462,32 @@ var ENSNodeClient = class _ENSNodeClient {
|
|
|
4129
4462
|
}
|
|
4130
4463
|
};
|
|
4131
4464
|
|
|
4465
|
+
// src/ensv2/ids-lib.ts
|
|
4466
|
+
var import_viem21 = require("viem");
|
|
4467
|
+
var makeRegistryId = (accountId) => formatAccountId(accountId);
|
|
4468
|
+
var makeENSv1DomainId = (node) => node;
|
|
4469
|
+
var makeENSv2DomainId = (registry, canonicalId) => formatAssetId({
|
|
4470
|
+
assetNamespace: AssetNamespaces.ERC1155,
|
|
4471
|
+
contract: registry,
|
|
4472
|
+
tokenId: canonicalId
|
|
4473
|
+
});
|
|
4474
|
+
var maskLower32Bits = (num) => num ^ num & 0xffffffffn;
|
|
4475
|
+
var getCanonicalId = (input) => {
|
|
4476
|
+
if (typeof input === "bigint") return maskLower32Bits(input);
|
|
4477
|
+
return getCanonicalId((0, import_viem21.hexToBigInt)(input));
|
|
4478
|
+
};
|
|
4479
|
+
var makePermissionsId = (contract) => formatAccountId(contract);
|
|
4480
|
+
var makePermissionsResourceId = (contract, resource) => `${makePermissionsId(contract)}/${resource}`;
|
|
4481
|
+
var makePermissionsUserId = (contract, resource, user) => `${makePermissionsId(contract)}/${resource}/${user}`;
|
|
4482
|
+
var makeResolverId = (contract) => formatAccountId(contract);
|
|
4483
|
+
var makeResolverRecordsId = (resolver, node) => `${makeResolverId(resolver)}/${node}`;
|
|
4484
|
+
var makeLatestRegistrationId = (domainId) => `${domainId}/latest`;
|
|
4485
|
+
var makeRegistrationId = (domainId, index = 0) => `${domainId}/${index}`;
|
|
4486
|
+
var makeLatestRenewalId = (domainId, registrationIndex) => `${makeRegistrationId(domainId, registrationIndex)}/latest`;
|
|
4487
|
+
var makeRenewalId = (domainId, registrationIndex, index = 0) => `${makeRegistrationId(domainId, registrationIndex)}/${index}`;
|
|
4488
|
+
|
|
4132
4489
|
// src/identity/identity.ts
|
|
4133
|
-
var
|
|
4490
|
+
var import_datasources10 = require("@ensnode/datasources");
|
|
4134
4491
|
|
|
4135
4492
|
// src/identity/types.ts
|
|
4136
4493
|
var ResolutionStatusIds = {
|
|
@@ -4157,7 +4514,7 @@ var ResolutionStatusIds = {
|
|
|
4157
4514
|
function buildUnresolvedIdentity(address, namespaceId, chainId) {
|
|
4158
4515
|
return {
|
|
4159
4516
|
resolutionStatus: ResolutionStatusIds.Unresolved,
|
|
4160
|
-
chainId: chainId ?? (0,
|
|
4517
|
+
chainId: chainId ?? (0, import_datasources10.getENSRootChainId)(namespaceId),
|
|
4161
4518
|
address
|
|
4162
4519
|
};
|
|
4163
4520
|
}
|
|
@@ -4167,19 +4524,23 @@ function isResolvedIdentity(identity) {
|
|
|
4167
4524
|
|
|
4168
4525
|
// src/resolution/ensip19-chainid.ts
|
|
4169
4526
|
var import_chains = require("viem/chains");
|
|
4170
|
-
var
|
|
4527
|
+
var import_datasources11 = require("@ensnode/datasources");
|
|
4171
4528
|
var getResolvePrimaryNameChainIdParam = (chainId, namespaceId) => {
|
|
4172
|
-
const ensRootChainId = (0,
|
|
4529
|
+
const ensRootChainId = (0, import_datasources11.getENSRootChainId)(namespaceId);
|
|
4173
4530
|
return chainId === ensRootChainId ? import_chains.mainnet.id : chainId;
|
|
4174
4531
|
};
|
|
4175
4532
|
var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
|
|
4176
|
-
return chainId === DEFAULT_EVM_CHAIN_ID ? (0,
|
|
4533
|
+
return chainId === DEFAULT_EVM_CHAIN_ID ? (0, import_datasources11.getENSRootChainId)(namespaceId) : chainId;
|
|
4177
4534
|
};
|
|
4178
4535
|
|
|
4179
4536
|
// src/resolution/resolver-records-selection.ts
|
|
4180
4537
|
var isSelectionEmpty = (selection) => !selection.name && !selection.addresses?.length && !selection.texts?.length;
|
|
4181
4538
|
|
|
4182
|
-
// src/tracing/
|
|
4539
|
+
// src/tracing/ens-protocol-tracing.ts
|
|
4540
|
+
var PROTOCOL_ATTRIBUTE_PREFIX = "ens";
|
|
4541
|
+
var ATTR_PROTOCOL_NAME = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol`;
|
|
4542
|
+
var ATTR_PROTOCOL_STEP = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol.step`;
|
|
4543
|
+
var ATTR_PROTOCOL_STEP_RESULT = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol.step.result`;
|
|
4183
4544
|
var TraceableENSProtocol = /* @__PURE__ */ ((TraceableENSProtocol2) => {
|
|
4184
4545
|
TraceableENSProtocol2["ForwardResolution"] = "forward-resolution";
|
|
4185
4546
|
TraceableENSProtocol2["ReverseResolution"] = "reverse-resolution";
|
|
@@ -4204,8 +4565,4 @@ var ReverseResolutionProtocolStep = /* @__PURE__ */ ((ReverseResolutionProtocolS
|
|
|
4204
4565
|
ReverseResolutionProtocolStep2["VerifyResolvedAddressMatchesAddress"] = "verify-resolved-address-matches-address";
|
|
4205
4566
|
return ReverseResolutionProtocolStep2;
|
|
4206
4567
|
})(ReverseResolutionProtocolStep || {});
|
|
4207
|
-
var PROTOCOL_ATTRIBUTE_PREFIX = "ens";
|
|
4208
|
-
var ATTR_PROTOCOL_NAME = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol`;
|
|
4209
|
-
var ATTR_PROTOCOL_STEP = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol.step`;
|
|
4210
|
-
var ATTR_PROTOCOL_STEP_RESULT = `${PROTOCOL_ATTRIBUTE_PREFIX}.protocol.step.result`;
|
|
4211
4568
|
//# sourceMappingURL=index.cjs.map
|