@ensnode/ensnode-sdk 1.10.0 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +768 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +317 -93
- package/dist/index.d.ts +317 -93
- package/dist/index.js +684 -225
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -41,13 +41,14 @@ __export(index_exports, {
|
|
|
41
41
|
DEFAULT_ENSNODE_URL_SEPOLIA: () => DEFAULT_ENSNODE_URL_SEPOLIA,
|
|
42
42
|
ENCODED_REFERRER_BYTE_LENGTH: () => ENCODED_REFERRER_BYTE_LENGTH,
|
|
43
43
|
ENCODED_REFERRER_BYTE_OFFSET: () => ENCODED_REFERRER_BYTE_OFFSET,
|
|
44
|
-
ENSNamespaceIds: () =>
|
|
44
|
+
ENSNamespaceIds: () => import_datasources11.ENSNamespaceIds,
|
|
45
45
|
EXPECTED_ENCODED_REFERRER_PADDING: () => EXPECTED_ENCODED_REFERRER_PADDING,
|
|
46
46
|
EnsApiIndexingStatusResponseCodes: () => EnsApiIndexingStatusResponseCodes,
|
|
47
47
|
EnsIndexerClient: () => EnsIndexerClient,
|
|
48
48
|
EnsIndexerIndexingStatusResponseCodes: () => EnsIndexerIndexingStatusResponseCodes,
|
|
49
49
|
EnsNodeClient: () => EnsNodeClient,
|
|
50
50
|
ForwardResolutionProtocolStep: () => ForwardResolutionProtocolStep,
|
|
51
|
+
IndexingMetadataContextStatusCodes: () => IndexingMetadataContextStatusCodes,
|
|
51
52
|
IndexingStatusResponseCodes: () => IndexingStatusResponseCodes,
|
|
52
53
|
LruCache: () => LruCache,
|
|
53
54
|
NFTMintStatuses: () => NFTMintStatuses,
|
|
@@ -82,9 +83,12 @@ __export(index_exports, {
|
|
|
82
83
|
buildBlockRefRange: () => buildBlockRefRange,
|
|
83
84
|
buildCrossChainIndexingStatusSnapshotOmnichain: () => buildCrossChainIndexingStatusSnapshotOmnichain,
|
|
84
85
|
buildEncodedReferrer: () => buildEncodedReferrer,
|
|
86
|
+
buildEnsIndexerStackInfo: () => buildEnsIndexerStackInfo,
|
|
85
87
|
buildEnsNodeStackInfo: () => buildEnsNodeStackInfo,
|
|
86
88
|
buildEnsRainbowClientLabelSet: () => buildEnsRainbowClientLabelSet,
|
|
87
89
|
buildIndexedBlockranges: () => buildIndexedBlockranges,
|
|
90
|
+
buildIndexingMetadataContextInitialized: () => buildIndexingMetadataContextInitialized,
|
|
91
|
+
buildIndexingMetadataContextUninitialized: () => buildIndexingMetadataContextUninitialized,
|
|
88
92
|
buildLabelSetId: () => buildLabelSetId,
|
|
89
93
|
buildLabelSetVersion: () => buildLabelSetVersion,
|
|
90
94
|
buildOmnichainIndexingStatusSnapshot: () => buildOmnichainIndexingStatusSnapshot,
|
|
@@ -93,6 +97,7 @@ __export(index_exports, {
|
|
|
93
97
|
buildUnvalidatedCrossChainIndexingStatusSnapshot: () => buildUnvalidatedCrossChainIndexingStatusSnapshot,
|
|
94
98
|
buildUnvalidatedEnsApiPublicConfig: () => buildUnvalidatedEnsApiPublicConfig,
|
|
95
99
|
buildUnvalidatedEnsIndexerPublicConfig: () => buildUnvalidatedEnsIndexerPublicConfig,
|
|
100
|
+
buildUnvalidatedEnsIndexerStackInfo: () => buildUnvalidatedEnsIndexerStackInfo,
|
|
96
101
|
buildUnvalidatedEnsNodeStackInfo: () => buildUnvalidatedEnsNodeStackInfo,
|
|
97
102
|
buildUnvalidatedOmnichainIndexingStatusSnapshot: () => buildUnvalidatedOmnichainIndexingStatusSnapshot,
|
|
98
103
|
buildUnvalidatedRealtimeIndexingStatusProjection: () => buildUnvalidatedRealtimeIndexingStatusProjection,
|
|
@@ -117,11 +122,14 @@ __export(index_exports, {
|
|
|
117
122
|
deserializeEnsIndexerConfigResponse: () => deserializeEnsIndexerConfigResponse,
|
|
118
123
|
deserializeEnsIndexerIndexingStatusResponse: () => deserializeEnsIndexerIndexingStatusResponse,
|
|
119
124
|
deserializeEnsIndexerPublicConfig: () => deserializeEnsIndexerPublicConfig,
|
|
125
|
+
deserializeEnsIndexerStackInfo: () => deserializeEnsIndexerStackInfo,
|
|
120
126
|
deserializeEnsNodeStackInfo: () => deserializeEnsNodeStackInfo,
|
|
121
127
|
deserializeErrorResponse: () => deserializeErrorResponse2,
|
|
128
|
+
deserializeIndexingMetadataContext: () => deserializeIndexingMetadataContext,
|
|
122
129
|
deserializeIndexingStatusResponse: () => deserializeIndexingStatusResponse,
|
|
123
130
|
deserializeOmnichainIndexingStatusSnapshot: () => deserializeOmnichainIndexingStatusSnapshot,
|
|
124
131
|
deserializePriceDai: () => deserializePriceDai,
|
|
132
|
+
deserializePriceEnsTokens: () => deserializePriceEnsTokens,
|
|
125
133
|
deserializePriceEth: () => deserializePriceEth,
|
|
126
134
|
deserializePriceUsdc: () => deserializePriceUsdc,
|
|
127
135
|
deserializeRealtimeIndexingStatusProjection: () => deserializeRealtimeIndexingStatusProjection,
|
|
@@ -131,21 +139,17 @@ __export(index_exports, {
|
|
|
131
139
|
deserializedNameTokensResponse: () => deserializedNameTokensResponse,
|
|
132
140
|
durationBetween: () => durationBetween,
|
|
133
141
|
formatNFTTransferEventMetadata: () => formatNFTTransferEventMetadata,
|
|
134
|
-
getBasenamesSubregistryId: () => getBasenamesSubregistryId,
|
|
135
|
-
getBasenamesSubregistryManagedName: () => getBasenamesSubregistryManagedName,
|
|
136
142
|
getCurrencyInfo: () => getCurrencyInfo,
|
|
137
143
|
getDatasourceContract: () => getDatasourceContract,
|
|
138
144
|
getDefaultEnsNodeUrl: () => getDefaultEnsNodeUrl,
|
|
139
145
|
getENSRootChainId: () => import_datasources.getENSRootChainId,
|
|
140
146
|
getENSv1Registry: () => getENSv1Registry,
|
|
147
|
+
getENSv1RootRegistryId: () => getENSv1RootRegistryId,
|
|
141
148
|
getENSv2RootRegistry: () => getENSv2RootRegistry,
|
|
142
149
|
getENSv2RootRegistryId: () => getENSv2RootRegistryId,
|
|
143
|
-
getEthnamesSubregistryId: () => getEthnamesSubregistryId,
|
|
144
|
-
getEthnamesSubregistryManagedName: () => getEthnamesSubregistryManagedName,
|
|
145
150
|
getHighestKnownBlockTimestamp: () => getHighestKnownBlockTimestamp,
|
|
146
151
|
getLatestIndexedBlockRef: () => getLatestIndexedBlockRef,
|
|
147
|
-
|
|
148
|
-
getLineanamesSubregistryManagedName: () => getLineanamesSubregistryManagedName,
|
|
152
|
+
getManagedName: () => getManagedName,
|
|
149
153
|
getNFTTransferType: () => getNFTTransferType,
|
|
150
154
|
getNameTokenOwnership: () => getNameTokenOwnership,
|
|
151
155
|
getNameWrapperAccounts: () => getNameWrapperAccounts,
|
|
@@ -153,6 +157,8 @@ __export(index_exports, {
|
|
|
153
157
|
getOmnichainIndexingCursor: () => getOmnichainIndexingCursor,
|
|
154
158
|
getOmnichainIndexingStatus: () => getOmnichainIndexingStatus,
|
|
155
159
|
getResolvePrimaryNameChainIdParam: () => getResolvePrimaryNameChainIdParam,
|
|
160
|
+
getRootRegistryId: () => getRootRegistryId,
|
|
161
|
+
getRootRegistryIds: () => getRootRegistryIds,
|
|
156
162
|
getTimestampForHighestOmnichainKnownBlock: () => getTimestampForHighestOmnichainKnownBlock,
|
|
157
163
|
getTimestampForLowestOmnichainStartBlock: () => getTimestampForLowestOmnichainStartBlock,
|
|
158
164
|
hasNullByte: () => hasNullByte,
|
|
@@ -171,6 +177,7 @@ __export(index_exports, {
|
|
|
171
177
|
isENSv1Registry: () => isENSv1Registry,
|
|
172
178
|
isENSv2RootRegistry: () => isENSv2RootRegistry,
|
|
173
179
|
isHttpProtocol: () => isHttpProtocol,
|
|
180
|
+
isNameWrapper: () => isNameWrapper,
|
|
174
181
|
isPccFuseSet: () => isPccFuseSet,
|
|
175
182
|
isPriceCurrencyEqual: () => isPriceCurrencyEqual,
|
|
176
183
|
isPriceEqual: () => isPriceEqual,
|
|
@@ -188,22 +195,27 @@ __export(index_exports, {
|
|
|
188
195
|
makeENSApiPublicConfigSchema: () => makeENSApiPublicConfigSchema,
|
|
189
196
|
makeEnsApiPublicConfigSchema: () => makeEnsApiPublicConfigSchema,
|
|
190
197
|
makeSerializedEnsApiPublicConfigSchema: () => makeSerializedEnsApiPublicConfigSchema,
|
|
198
|
+
maxPrice: () => maxPrice,
|
|
191
199
|
maybeGetDatasourceContract: () => maybeGetDatasourceContract,
|
|
192
200
|
maybeGetENSv2RootRegistry: () => maybeGetENSv2RootRegistry,
|
|
193
201
|
maybeGetENSv2RootRegistryId: () => maybeGetENSv2RootRegistryId,
|
|
194
202
|
mergeBlockNumberRanges: () => mergeBlockNumberRanges,
|
|
203
|
+
minPrice: () => minPrice,
|
|
195
204
|
nameTokensPrerequisites: () => nameTokensPrerequisites,
|
|
196
205
|
parseAccountId: () => parseAccountId,
|
|
197
206
|
parseAssetId: () => parseAssetId,
|
|
198
207
|
parseDai: () => parseDai,
|
|
208
|
+
parseEnsTokens: () => parseEnsTokens,
|
|
199
209
|
parseEth: () => parseEth,
|
|
200
210
|
parseNonNegativeInteger: () => parseNonNegativeInteger,
|
|
201
211
|
parseTimestamp: () => parseTimestamp,
|
|
202
212
|
parseUsdc: () => parseUsdc,
|
|
203
213
|
priceDai: () => priceDai,
|
|
214
|
+
priceEnsTokens: () => priceEnsTokens,
|
|
204
215
|
priceEth: () => priceEth,
|
|
205
216
|
priceUsdc: () => priceUsdc,
|
|
206
217
|
registrarActionsFilter: () => registrarActionsFilter,
|
|
218
|
+
replaceBigInts: () => replaceBigInts,
|
|
207
219
|
scaleBigintByNumber: () => scaleBigintByNumber,
|
|
208
220
|
scalePrice: () => scalePrice,
|
|
209
221
|
serializeAssetId: () => serializeAssetId,
|
|
@@ -220,8 +232,11 @@ __export(index_exports, {
|
|
|
220
232
|
serializeEnsIndexerConfigResponse: () => serializeEnsIndexerConfigResponse,
|
|
221
233
|
serializeEnsIndexerIndexingStatusResponse: () => serializeEnsIndexerIndexingStatusResponse,
|
|
222
234
|
serializeEnsIndexerPublicConfig: () => serializeEnsIndexerPublicConfig,
|
|
235
|
+
serializeEnsIndexerStackInfo: () => serializeEnsIndexerStackInfo,
|
|
223
236
|
serializeEnsNodeStackInfo: () => serializeEnsNodeStackInfo,
|
|
224
237
|
serializeIndexedChainIds: () => serializeIndexedChainIds,
|
|
238
|
+
serializeIndexingMetadataContext: () => serializeIndexingMetadataContext,
|
|
239
|
+
serializeIndexingMetadataContextInitialized: () => serializeIndexingMetadataContextInitialized,
|
|
225
240
|
serializeIndexingStatusResponse: () => serializeIndexingStatusResponse,
|
|
226
241
|
serializeNameToken: () => serializeNameToken,
|
|
227
242
|
serializeNameTokensResponse: () => serializeNameTokensResponse,
|
|
@@ -229,6 +244,7 @@ __export(index_exports, {
|
|
|
229
244
|
serializeOmnichainIndexingStatusSnapshot: () => serializeOmnichainIndexingStatusSnapshot,
|
|
230
245
|
serializePrice: () => serializePrice,
|
|
231
246
|
serializePriceDai: () => serializePriceDai,
|
|
247
|
+
serializePriceEnsTokens: () => serializePriceEnsTokens,
|
|
232
248
|
serializePriceEth: () => serializePriceEth,
|
|
233
249
|
serializePriceUsdc: () => serializePriceUsdc,
|
|
234
250
|
serializeRealtimeIndexingStatusProjection: () => serializeRealtimeIndexingStatusProjection,
|
|
@@ -239,19 +255,24 @@ __export(index_exports, {
|
|
|
239
255
|
serializeUrl: () => serializeUrl,
|
|
240
256
|
sortChainStatusesByStartBlockAsc: () => sortChainStatusesByStartBlockAsc,
|
|
241
257
|
stripNullBytes: () => stripNullBytes,
|
|
258
|
+
subtractPrice: () => subtractPrice,
|
|
259
|
+
toJson: () => toJson,
|
|
242
260
|
translateDefaultableChainIdToChainId: () => translateDefaultableChainIdToChainId,
|
|
243
261
|
uniq: () => uniq,
|
|
244
262
|
validateChainIndexingStatusSnapshot: () => validateChainIndexingStatusSnapshot,
|
|
245
263
|
validateCrossChainIndexingStatusSnapshot: () => validateCrossChainIndexingStatusSnapshot,
|
|
246
264
|
validateEnsIndexerPublicConfig: () => validateEnsIndexerPublicConfig,
|
|
247
265
|
validateEnsIndexerPublicConfigCompatibility: () => validateEnsIndexerPublicConfigCompatibility,
|
|
266
|
+
validateEnsIndexerStackInfo: () => validateEnsIndexerStackInfo,
|
|
248
267
|
validateEnsIndexerVersionInfo: () => validateEnsIndexerVersionInfo,
|
|
268
|
+
validateEnsNodeStackInfo: () => validateEnsNodeStackInfo,
|
|
269
|
+
validateIndexingMetadataContextInitialized: () => validateIndexingMetadataContextInitialized,
|
|
249
270
|
validateOmnichainIndexingStatusSnapshot: () => validateOmnichainIndexingStatusSnapshot,
|
|
250
271
|
validateRealtimeIndexingStatusProjection: () => validateRealtimeIndexingStatusProjection,
|
|
251
272
|
validateSupportedLabelSetAndVersion: () => validateSupportedLabelSetAndVersion
|
|
252
273
|
});
|
|
253
274
|
module.exports = __toCommonJS(index_exports);
|
|
254
|
-
var
|
|
275
|
+
var import_datasources11 = require("@ensnode/datasources");
|
|
255
276
|
|
|
256
277
|
// src/ens/index.ts
|
|
257
278
|
var import_datasources = require("@ensnode/datasources");
|
|
@@ -328,7 +349,8 @@ function scaleBigintByNumber(value, scaleFactor) {
|
|
|
328
349
|
var CurrencyIds = {
|
|
329
350
|
ETH: "ETH",
|
|
330
351
|
USDC: "USDC",
|
|
331
|
-
DAI: "DAI"
|
|
352
|
+
DAI: "DAI",
|
|
353
|
+
ENSTokens: "ENSTokens"
|
|
332
354
|
};
|
|
333
355
|
var currencyInfo = {
|
|
334
356
|
[CurrencyIds.ETH]: {
|
|
@@ -345,6 +367,11 @@ var currencyInfo = {
|
|
|
345
367
|
id: CurrencyIds.DAI,
|
|
346
368
|
name: "Dai Stablecoin",
|
|
347
369
|
decimals: 18
|
|
370
|
+
},
|
|
371
|
+
[CurrencyIds.ENSTokens]: {
|
|
372
|
+
id: CurrencyIds.ENSTokens,
|
|
373
|
+
name: "$ENS Tokens",
|
|
374
|
+
decimals: 18
|
|
348
375
|
}
|
|
349
376
|
};
|
|
350
377
|
function getCurrencyInfo(currencyId) {
|
|
@@ -368,6 +395,12 @@ function priceDai(amount) {
|
|
|
368
395
|
currency: CurrencyIds.DAI
|
|
369
396
|
};
|
|
370
397
|
}
|
|
398
|
+
function priceEnsTokens(amount) {
|
|
399
|
+
return {
|
|
400
|
+
amount,
|
|
401
|
+
currency: CurrencyIds.ENSTokens
|
|
402
|
+
};
|
|
403
|
+
}
|
|
371
404
|
function isPriceCurrencyEqual(priceA, priceB) {
|
|
372
405
|
return priceA.currency === priceB.currency;
|
|
373
406
|
}
|
|
@@ -392,6 +425,32 @@ function addPrices(...prices) {
|
|
|
392
425
|
}
|
|
393
426
|
);
|
|
394
427
|
}
|
|
428
|
+
function subtractPrice(a, b) {
|
|
429
|
+
if (!isPriceCurrencyEqual(a, b)) {
|
|
430
|
+
throw new Error("All prices must have the same currency to be subtracted.");
|
|
431
|
+
}
|
|
432
|
+
const resultAmount = a.amount - b.amount;
|
|
433
|
+
if (resultAmount < 0n) {
|
|
434
|
+
throw new Error("subtractPrice result must be non-negative.");
|
|
435
|
+
}
|
|
436
|
+
return { amount: resultAmount, currency: a.currency };
|
|
437
|
+
}
|
|
438
|
+
function minPrice(...prices) {
|
|
439
|
+
const firstPrice = prices[0];
|
|
440
|
+
const allPricesInSameCurrency = prices.every((price) => isPriceCurrencyEqual(firstPrice, price));
|
|
441
|
+
if (allPricesInSameCurrency === false) {
|
|
442
|
+
throw new Error("All prices must have the same currency to be compared.");
|
|
443
|
+
}
|
|
444
|
+
return prices.reduce((acc, price) => price.amount < acc.amount ? price : acc);
|
|
445
|
+
}
|
|
446
|
+
function maxPrice(...prices) {
|
|
447
|
+
const firstPrice = prices[0];
|
|
448
|
+
const allPricesInSameCurrency = prices.every((price) => isPriceCurrencyEqual(firstPrice, price));
|
|
449
|
+
if (allPricesInSameCurrency === false) {
|
|
450
|
+
throw new Error("All prices must have the same currency to be compared.");
|
|
451
|
+
}
|
|
452
|
+
return prices.reduce((acc, price) => price.amount > acc.amount ? price : acc);
|
|
453
|
+
}
|
|
395
454
|
function scalePrice(price, scaleFactor) {
|
|
396
455
|
const scaledAmount = scaleBigintByNumber(price.amount, scaleFactor);
|
|
397
456
|
return {
|
|
@@ -429,6 +488,12 @@ function parseDai(value) {
|
|
|
429
488
|
const amount = (0, import_viem.parseUnits)(value, currencyInfo2.decimals);
|
|
430
489
|
return priceDai(amount);
|
|
431
490
|
}
|
|
491
|
+
function parseEnsTokens(value) {
|
|
492
|
+
validateAmountToParse(value);
|
|
493
|
+
const currencyInfo2 = getCurrencyInfo(CurrencyIds.ENSTokens);
|
|
494
|
+
const amount = (0, import_viem.parseUnits)(value, currencyInfo2.decimals);
|
|
495
|
+
return priceEnsTokens(amount);
|
|
496
|
+
}
|
|
432
497
|
|
|
433
498
|
// src/shared/zod-schemas.ts
|
|
434
499
|
var makeIntegerSchema = (valueLabel = "Value") => import_v4.z.int({
|
|
@@ -489,6 +554,7 @@ var makePriceCurrencySchema = (currency, valueLabel = "Price Currency") => impor
|
|
|
489
554
|
var makePriceEthSchema = (valueLabel = "Price ETH") => makePriceCurrencySchema(CurrencyIds.ETH, valueLabel).transform((v) => v);
|
|
490
555
|
var makePriceUsdcSchema = (valueLabel = "Price USDC") => makePriceCurrencySchema(CurrencyIds.USDC, valueLabel).transform((v) => v);
|
|
491
556
|
var makePriceDaiSchema = (valueLabel = "Price DAI") => makePriceCurrencySchema(CurrencyIds.DAI, valueLabel).transform((v) => v);
|
|
557
|
+
var makePriceEnsTokensSchema = (valueLabel = "Price ENSTokens") => makePriceCurrencySchema(CurrencyIds.ENSTokens, valueLabel).transform((v) => v);
|
|
492
558
|
var makeAccountIdSchema = (valueLabel = "AccountId") => import_v4.z.strictObject({
|
|
493
559
|
chainId: makeChainIdSchema(`${valueLabel} chain ID`),
|
|
494
560
|
address: makeNormalizedAddressSchema(`${valueLabel} address`)
|
|
@@ -543,14 +609,15 @@ var makeLabelSetIdSchema = (valueLabel = "Label set ID") => {
|
|
|
543
609
|
var makeLabelSetVersionSchema = (valueLabel = "Label set version") => makeNonNegativeIntegerSchema(valueLabel);
|
|
544
610
|
var makeLabelSetVersionStringSchema = (valueLabel = "Label set version") => import_v42.z.coerce.number({ error: `${valueLabel} must be a non-negative integer` }).pipe(makeLabelSetVersionSchema(valueLabel));
|
|
545
611
|
var makeEnsRainbowPublicConfigSchema = (valueLabel = "EnsRainbowPublicConfig") => import_v42.z.object({
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
labelSetId: makeLabelSetIdSchema(`${valueLabel}.labelSet.labelSetId`),
|
|
612
|
+
serverLabelSet: import_v42.z.object({
|
|
613
|
+
labelSetId: makeLabelSetIdSchema(`${valueLabel}.serverLabelSet.labelSetId`),
|
|
549
614
|
highestLabelSetVersion: makeLabelSetVersionSchema(
|
|
550
|
-
`${valueLabel}.
|
|
615
|
+
`${valueLabel}.serverLabelSet.highestLabelSetVersion`
|
|
551
616
|
)
|
|
552
617
|
}),
|
|
553
|
-
|
|
618
|
+
versionInfo: import_v42.z.object({
|
|
619
|
+
ensRainbow: import_v42.z.string().nonempty({ error: `${valueLabel}.versionInfo.ensRainbow must be a non-empty string.` })
|
|
620
|
+
})
|
|
554
621
|
});
|
|
555
622
|
|
|
556
623
|
// src/shared/collections.ts
|
|
@@ -575,8 +642,8 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
575
642
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
576
643
|
function isSubgraphCompatible(config) {
|
|
577
644
|
const onlySubgraphPluginActivated = config.plugins.length === 1 && config.plugins[0] === "subgraph" /* Subgraph */;
|
|
578
|
-
const isSubgraphLabelSet = config.
|
|
579
|
-
const isEnsTestEnvLabelSet = config.
|
|
645
|
+
const isSubgraphLabelSet = config.clientLabelSet.labelSetId === "subgraph" && config.clientLabelSet.labelSetVersion === 0;
|
|
646
|
+
const isEnsTestEnvLabelSet = config.clientLabelSet.labelSetId === "ens-test-env" && config.clientLabelSet.labelSetVersion === 0;
|
|
580
647
|
const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === import_datasources2.ENSNamespaceIds.EnsTestEnv && isEnsTestEnvLabelSet;
|
|
581
648
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
582
649
|
}
|
|
@@ -674,13 +741,13 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
674
741
|
ctx.issues.push({
|
|
675
742
|
code: "custom",
|
|
676
743
|
input: config,
|
|
677
|
-
message: `'isSubgraphCompatible' requires only the '${"subgraph" /* Subgraph */}' plugin to be active and
|
|
744
|
+
message: `'isSubgraphCompatible' requires only the '${"subgraph" /* Subgraph */}' plugin to be active and 'clientLabelSet' must be {labelSetId: "subgraph", labelSetVersion: 0}`
|
|
678
745
|
});
|
|
679
746
|
}
|
|
680
747
|
}
|
|
681
748
|
function invariant_ensRainbowSupportedLabelSetAndVersion(ctx) {
|
|
682
|
-
const clientLabelSet = ctx.value
|
|
683
|
-
const serverLabelSet = ctx.value.ensRainbowPublicConfig
|
|
749
|
+
const { clientLabelSet } = ctx.value;
|
|
750
|
+
const { serverLabelSet } = ctx.value.ensRainbowPublicConfig;
|
|
684
751
|
try {
|
|
685
752
|
validateSupportedLabelSetAndVersion(serverLabelSet, clientLabelSet);
|
|
686
753
|
} catch (error) {
|
|
@@ -701,7 +768,7 @@ var makeEnsIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") =
|
|
|
701
768
|
isSubgraphCompatible: import_v43.z.boolean({
|
|
702
769
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
703
770
|
}),
|
|
704
|
-
|
|
771
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
705
772
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
706
773
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
707
774
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -715,7 +782,7 @@ var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIn
|
|
|
715
782
|
isSubgraphCompatible: import_v43.z.boolean({
|
|
716
783
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
717
784
|
}),
|
|
718
|
-
|
|
785
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
719
786
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
720
787
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
721
788
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -815,7 +882,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
815
882
|
ensRainbowPublicConfig,
|
|
816
883
|
indexedChainIds,
|
|
817
884
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
818
|
-
|
|
885
|
+
clientLabelSet,
|
|
819
886
|
namespace,
|
|
820
887
|
plugins,
|
|
821
888
|
versionInfo
|
|
@@ -825,7 +892,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
825
892
|
ensRainbowPublicConfig,
|
|
826
893
|
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
827
894
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
828
|
-
|
|
895
|
+
clientLabelSet,
|
|
829
896
|
namespace,
|
|
830
897
|
plugins,
|
|
831
898
|
versionInfo
|
|
@@ -1864,6 +1931,9 @@ function serializePriceUsdc(price) {
|
|
|
1864
1931
|
function serializePriceDai(price) {
|
|
1865
1932
|
return serializePrice(price);
|
|
1866
1933
|
}
|
|
1934
|
+
function serializePriceEnsTokens(price) {
|
|
1935
|
+
return serializePrice(price);
|
|
1936
|
+
}
|
|
1867
1937
|
|
|
1868
1938
|
// src/indexing-status/serialize/chain-indexing-status-snapshot.ts
|
|
1869
1939
|
function serializeChainIndexingSnapshots(chains) {
|
|
@@ -2070,21 +2140,21 @@ function validateEnsIndexerPublicConfigCompatibility(configA, configB) {
|
|
|
2070
2140
|
].join(" ")
|
|
2071
2141
|
);
|
|
2072
2142
|
}
|
|
2073
|
-
if (configA.
|
|
2143
|
+
if (configA.clientLabelSet.labelSetId !== configB.clientLabelSet.labelSetId) {
|
|
2074
2144
|
throw new Error(
|
|
2075
2145
|
[
|
|
2076
|
-
`'
|
|
2077
|
-
`Stored Config '
|
|
2078
|
-
`Current Config '
|
|
2146
|
+
`'clientLabelSet.labelSetId' must be compatible.`,
|
|
2147
|
+
`Stored Config 'clientLabelSet.labelSetId': '${configA.clientLabelSet.labelSetId}'.`,
|
|
2148
|
+
`Current Config 'clientLabelSet.labelSetId': '${configB.clientLabelSet.labelSetId}'.`
|
|
2079
2149
|
].join(" ")
|
|
2080
2150
|
);
|
|
2081
2151
|
}
|
|
2082
|
-
if (configA.
|
|
2152
|
+
if (configA.clientLabelSet.labelSetVersion !== configB.clientLabelSet.labelSetVersion) {
|
|
2083
2153
|
throw new Error(
|
|
2084
2154
|
[
|
|
2085
|
-
`'
|
|
2086
|
-
`Stored Config '
|
|
2087
|
-
`Current Config '
|
|
2155
|
+
`'clientLabelSet.labelSetVersion' must be compatible.`,
|
|
2156
|
+
`Stored Config 'clientLabelSet.labelSetVersion': '${configA.clientLabelSet.labelSetVersion}'.`,
|
|
2157
|
+
`Current Config 'clientLabelSet.labelSetVersion': '${configB.clientLabelSet.labelSetVersion}'.`
|
|
2088
2158
|
].join(" ")
|
|
2089
2159
|
);
|
|
2090
2160
|
}
|
|
@@ -2175,12 +2245,12 @@ function validateEnsIndexerVersionInfo(unvalidatedVersionInfo) {
|
|
|
2175
2245
|
}
|
|
2176
2246
|
|
|
2177
2247
|
// src/ensnode/api/indexing-status/deserialize.ts
|
|
2178
|
-
var
|
|
2248
|
+
var import_v428 = require("zod/v4");
|
|
2179
2249
|
|
|
2180
2250
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
2181
|
-
var
|
|
2251
|
+
var import_v426 = require("zod/v4");
|
|
2182
2252
|
|
|
2183
|
-
// src/stack-info/zod-schemas/
|
|
2253
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
2184
2254
|
var import_v424 = require("zod/v4");
|
|
2185
2255
|
|
|
2186
2256
|
// src/ensdb/zod-schemas/config.ts
|
|
@@ -2189,49 +2259,134 @@ var makeEnsDbVersionInfoSchema = (valueLabel) => {
|
|
|
2189
2259
|
const label = valueLabel ?? "EnsDbVersionInfo";
|
|
2190
2260
|
return import_v423.z.object({
|
|
2191
2261
|
postgresql: import_v423.z.string().nonempty(`${label}.postgresql must be a non-empty string`).describe("Version of the PostgreSQL server hosting the ENSDb instance.")
|
|
2192
|
-
})
|
|
2262
|
+
});
|
|
2193
2263
|
};
|
|
2194
2264
|
var makeEnsDbPublicConfigSchema = (valueLabel) => {
|
|
2195
2265
|
const label = valueLabel ?? "EnsDbPublicConfig";
|
|
2196
2266
|
return import_v423.z.object({
|
|
2197
2267
|
versionInfo: makeEnsDbVersionInfoSchema(`${label}.versionInfo`)
|
|
2198
|
-
})
|
|
2268
|
+
});
|
|
2199
2269
|
};
|
|
2200
2270
|
|
|
2201
|
-
// src/stack-info/zod-schemas/
|
|
2202
|
-
function
|
|
2203
|
-
const label = valueLabel ?? "
|
|
2271
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
2272
|
+
function makeSerializedEnsIndexerStackInfoSchema(valueLabel) {
|
|
2273
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
2204
2274
|
return import_v424.z.object({
|
|
2205
|
-
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
2206
2275
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
2207
2276
|
ensIndexer: makeSerializedEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
2208
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2277
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2209
2278
|
});
|
|
2210
2279
|
}
|
|
2211
|
-
function
|
|
2212
|
-
const
|
|
2280
|
+
function invariant_ensRainbowCompatibilityWithEnsIndexer(ctx) {
|
|
2281
|
+
const { ensIndexer, ensRainbow } = ctx.value;
|
|
2282
|
+
const { clientLabelSet } = ensIndexer;
|
|
2283
|
+
const { serverLabelSet } = ensRainbow;
|
|
2284
|
+
if (clientLabelSet.labelSetId !== serverLabelSet.labelSetId) {
|
|
2285
|
+
ctx.issues.push({
|
|
2286
|
+
code: "custom",
|
|
2287
|
+
input: ctx.value,
|
|
2288
|
+
message: `ENSRainbow's label set (id: ${serverLabelSet.labelSetId}) must be the same as ENSIndexer's label set (id: ${clientLabelSet.labelSetId}).`
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
if (clientLabelSet.labelSetVersion > serverLabelSet.highestLabelSetVersion) {
|
|
2292
|
+
ctx.issues.push({
|
|
2293
|
+
code: "custom",
|
|
2294
|
+
input: ctx.value,
|
|
2295
|
+
message: `ENSRainbow's server label set version (highest: ${serverLabelSet.highestLabelSetVersion}) must be greater than or equal to ENSIndexer's client label set version (current: ${clientLabelSet.labelSetVersion}).`
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
function makeEnsIndexerStackInfoSchema(valueLabel) {
|
|
2300
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
2213
2301
|
return import_v424.z.object({
|
|
2214
|
-
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
2215
2302
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
2216
2303
|
ensIndexer: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
2217
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2304
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2305
|
+
}).check(invariant_ensRainbowCompatibilityWithEnsIndexer);
|
|
2306
|
+
}
|
|
2307
|
+
|
|
2308
|
+
// src/stack-info/zod-schemas/ensnode-stack-info.ts
|
|
2309
|
+
function invariant_ensApiCompatibilityWithEnsIndexerAndEnsRainbow(ctx) {
|
|
2310
|
+
const { ensApi, ensIndexer, ensRainbow } = ctx.value;
|
|
2311
|
+
if (ensIndexer.versionInfo.ensDb !== ensApi.versionInfo.ensApi) {
|
|
2312
|
+
ctx.issues.push({
|
|
2313
|
+
code: "custom",
|
|
2314
|
+
path: ["ensIndexer", "versionInfo", "ensDb"],
|
|
2315
|
+
input: ensIndexer.versionInfo.ensDb,
|
|
2316
|
+
message: `Version Mismatch: ENSDB@${ensIndexer.versionInfo.ensDb} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2317
|
+
});
|
|
2318
|
+
}
|
|
2319
|
+
if (ensIndexer.versionInfo.ensIndexer !== ensApi.versionInfo.ensApi) {
|
|
2320
|
+
ctx.issues.push({
|
|
2321
|
+
code: "custom",
|
|
2322
|
+
path: ["ensIndexer", "versionInfo", "ensIndexer"],
|
|
2323
|
+
input: ensIndexer.versionInfo.ensIndexer,
|
|
2324
|
+
message: `Version Mismatch: ENSIndexer@${ensIndexer.versionInfo.ensIndexer} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2325
|
+
});
|
|
2326
|
+
}
|
|
2327
|
+
if (ensRainbow.versionInfo.ensRainbow !== ensApi.versionInfo.ensApi) {
|
|
2328
|
+
ctx.issues.push({
|
|
2329
|
+
code: "custom",
|
|
2330
|
+
path: ["ensRainbow", "versionInfo", "ensRainbow"],
|
|
2331
|
+
input: ensRainbow.versionInfo.ensRainbow,
|
|
2332
|
+
message: `Version Mismatch: ENSRainbow@${ensRainbow.versionInfo.ensRainbow} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
if (ensIndexer.versionInfo.ensNormalize !== ensApi.versionInfo.ensNormalize) {
|
|
2336
|
+
ctx.issues.push({
|
|
2337
|
+
code: "custom",
|
|
2338
|
+
path: ["ensIndexer", "versionInfo", "ensNormalize"],
|
|
2339
|
+
input: ensIndexer.versionInfo.ensNormalize,
|
|
2340
|
+
message: `Dependency Version Mismatch: '@adraffy/ens-normalize' version must be the same between ENSIndexer and ENSApi. Found ENSApi@${ensApi.versionInfo.ensNormalize} and ENSIndexer@${ensIndexer.versionInfo.ensNormalize}`
|
|
2341
|
+
});
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
function makeSerializedEnsNodeStackInfoSchema(valueLabel) {
|
|
2345
|
+
const label = valueLabel ?? "ENSNodeStackInfo";
|
|
2346
|
+
return makeSerializedEnsIndexerStackInfoSchema(label).extend({
|
|
2347
|
+
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`)
|
|
2218
2348
|
});
|
|
2219
2349
|
}
|
|
2350
|
+
function makeEnsNodeStackInfoSchema(valueLabel) {
|
|
2351
|
+
const label = valueLabel ?? "ENSNodeStackInfo";
|
|
2352
|
+
return makeEnsIndexerStackInfoSchema(label).extend({
|
|
2353
|
+
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`)
|
|
2354
|
+
}).check(invariant_ensApiCompatibilityWithEnsIndexerAndEnsRainbow).check(invariant_ensRainbowCompatibilityWithEnsIndexer);
|
|
2355
|
+
}
|
|
2356
|
+
|
|
2357
|
+
// src/stack-info/deserialize/ensindexer-stack-info.ts
|
|
2358
|
+
var import_v425 = require("zod/v4");
|
|
2359
|
+
function buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo) {
|
|
2360
|
+
const { ensDb, ensRainbow } = serializedStackInfo;
|
|
2361
|
+
const ensIndexer = buildUnvalidatedEnsIndexerPublicConfig(serializedStackInfo.ensIndexer);
|
|
2362
|
+
return {
|
|
2363
|
+
ensDb,
|
|
2364
|
+
ensIndexer,
|
|
2365
|
+
ensRainbow
|
|
2366
|
+
};
|
|
2367
|
+
}
|
|
2368
|
+
function deserializeEnsIndexerStackInfo(maybeStackInfo, valueLabel) {
|
|
2369
|
+
const parsed = makeSerializedEnsIndexerStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsIndexerStackInfo).pipe(makeEnsIndexerStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2370
|
+
if (parsed.error) {
|
|
2371
|
+
throw new Error(`Cannot deserialize EnsIndexerStackInfo:
|
|
2372
|
+
${(0, import_v425.prettifyError)(parsed.error)}
|
|
2373
|
+
`);
|
|
2374
|
+
}
|
|
2375
|
+
return parsed.data;
|
|
2376
|
+
}
|
|
2220
2377
|
|
|
2221
2378
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
2222
2379
|
function buildUnvalidatedEnsNodeStackInfo(serializedStackInfo) {
|
|
2223
|
-
const { ensApi, ensIndexer, ...rest } = serializedStackInfo;
|
|
2224
2380
|
return {
|
|
2225
|
-
...
|
|
2226
|
-
ensApi: buildUnvalidatedEnsApiPublicConfig(ensApi)
|
|
2227
|
-
ensIndexer: buildUnvalidatedEnsIndexerPublicConfig(ensIndexer)
|
|
2381
|
+
...buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo),
|
|
2382
|
+
ensApi: buildUnvalidatedEnsApiPublicConfig(serializedStackInfo.ensApi)
|
|
2228
2383
|
};
|
|
2229
2384
|
}
|
|
2230
2385
|
function deserializeEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
2231
2386
|
const parsed = makeSerializedEnsNodeStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsNodeStackInfo).pipe(makeEnsNodeStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2232
2387
|
if (parsed.error) {
|
|
2233
2388
|
throw new Error(`Cannot deserialize EnsNodeStackInfo:
|
|
2234
|
-
${(0,
|
|
2389
|
+
${(0, import_v426.prettifyError)(parsed.error)}
|
|
2235
2390
|
`);
|
|
2236
2391
|
}
|
|
2237
2392
|
return parsed.data;
|
|
@@ -2251,25 +2406,25 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
2251
2406
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
2252
2407
|
|
|
2253
2408
|
// src/ensnode/api/indexing-status/zod-schemas.ts
|
|
2254
|
-
var
|
|
2255
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
2256
|
-
responseCode:
|
|
2409
|
+
var import_v427 = require("zod/v4");
|
|
2410
|
+
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v427.z.strictObject({
|
|
2411
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2257
2412
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel),
|
|
2258
2413
|
stackInfo: makeEnsNodeStackInfoSchema(valueLabel)
|
|
2259
2414
|
});
|
|
2260
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
2261
|
-
responseCode:
|
|
2415
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v427.z.strictObject({
|
|
2416
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
2262
2417
|
});
|
|
2263
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2418
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
2264
2419
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2265
2420
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2266
2421
|
]);
|
|
2267
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
2268
|
-
responseCode:
|
|
2422
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v427.z.object({
|
|
2423
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2269
2424
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel),
|
|
2270
2425
|
stackInfo: makeSerializedEnsNodeStackInfoSchema(valueLabel)
|
|
2271
2426
|
});
|
|
2272
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
2427
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
2273
2428
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2274
2429
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2275
2430
|
]);
|
|
@@ -2291,7 +2446,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
2291
2446
|
if (parsed.error) {
|
|
2292
2447
|
throw new Error(
|
|
2293
2448
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
2294
|
-
${(0,
|
|
2449
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
2295
2450
|
`
|
|
2296
2451
|
);
|
|
2297
2452
|
}
|
|
@@ -2299,13 +2454,26 @@ ${(0, import_v427.prettifyError)(parsed.error)}
|
|
|
2299
2454
|
}
|
|
2300
2455
|
var deserializeIndexingStatusResponse = deserializeEnsApiIndexingStatusResponse;
|
|
2301
2456
|
|
|
2457
|
+
// src/stack-info/serialize/ensindexer-stack-info.ts
|
|
2458
|
+
function serializeEnsIndexerStackInfo(stackInfo) {
|
|
2459
|
+
const {
|
|
2460
|
+
ensDb: serializedEnsDbPublicConfig,
|
|
2461
|
+
ensRainbow: serializedEnsRainbowPublicConfig,
|
|
2462
|
+
ensIndexer
|
|
2463
|
+
} = stackInfo;
|
|
2464
|
+
const serializedEnsIndexerPublicConfig = serializeEnsIndexerPublicConfig(ensIndexer);
|
|
2465
|
+
return {
|
|
2466
|
+
ensDb: serializedEnsDbPublicConfig,
|
|
2467
|
+
ensIndexer: serializedEnsIndexerPublicConfig,
|
|
2468
|
+
ensRainbow: serializedEnsRainbowPublicConfig
|
|
2469
|
+
};
|
|
2470
|
+
}
|
|
2471
|
+
|
|
2302
2472
|
// src/stack-info/serialize/ensnode-stack-info.ts
|
|
2303
2473
|
function serializeEnsNodeStackInfo(stackInfo) {
|
|
2304
2474
|
return {
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
ensIndexer: serializeEnsIndexerPublicConfig(stackInfo.ensIndexer),
|
|
2308
|
-
ensRainbow: stackInfo.ensRainbow
|
|
2475
|
+
...serializeEnsIndexerStackInfo(stackInfo),
|
|
2476
|
+
ensApi: serializeEnsApiPublicConfig(stackInfo.ensApi)
|
|
2309
2477
|
};
|
|
2310
2478
|
}
|
|
2311
2479
|
|
|
@@ -2325,11 +2493,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2325
2493
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2326
2494
|
|
|
2327
2495
|
// src/ensnode/api/name-tokens/deserialize.ts
|
|
2328
|
-
var
|
|
2496
|
+
var import_v433 = require("zod/v4");
|
|
2329
2497
|
|
|
2330
2498
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2331
2499
|
var import_enssdk5 = require("enssdk");
|
|
2332
|
-
var
|
|
2500
|
+
var import_v432 = require("zod/v4");
|
|
2333
2501
|
|
|
2334
2502
|
// src/tokenscope/name-token.ts
|
|
2335
2503
|
var import_enssdk4 = require("enssdk");
|
|
@@ -2371,17 +2539,17 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2371
2539
|
// src/tokenscope/assets.ts
|
|
2372
2540
|
var import_enssdk3 = require("enssdk");
|
|
2373
2541
|
var import_viem6 = require("viem");
|
|
2374
|
-
var
|
|
2542
|
+
var import_v430 = require("zod/v4");
|
|
2375
2543
|
|
|
2376
2544
|
// src/tokenscope/zod-schemas.ts
|
|
2377
2545
|
var import_caip2 = require("caip");
|
|
2378
2546
|
var import_enssdk2 = require("enssdk");
|
|
2379
2547
|
var import_viem5 = require("viem");
|
|
2380
|
-
var
|
|
2381
|
-
var tokenIdSchemaSerializable =
|
|
2382
|
-
var tokenIdSchemaNative =
|
|
2548
|
+
var import_v429 = require("zod/v4");
|
|
2549
|
+
var tokenIdSchemaSerializable = import_v429.z.string();
|
|
2550
|
+
var tokenIdSchemaNative = import_v429.z.preprocess(
|
|
2383
2551
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2384
|
-
|
|
2552
|
+
import_v429.z.bigint().positive()
|
|
2385
2553
|
);
|
|
2386
2554
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2387
2555
|
if (serializable) {
|
|
@@ -2391,13 +2559,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2391
2559
|
}
|
|
2392
2560
|
}
|
|
2393
2561
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2394
|
-
return
|
|
2395
|
-
assetNamespace:
|
|
2562
|
+
return import_v429.z.object({
|
|
2563
|
+
assetNamespace: import_v429.z.enum(import_enssdk2.AssetNamespaces),
|
|
2396
2564
|
contract: makeAccountIdSchema(valueLabel),
|
|
2397
2565
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2398
2566
|
});
|
|
2399
2567
|
};
|
|
2400
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2568
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v429.z.preprocess((v) => {
|
|
2401
2569
|
if (typeof v === "string") {
|
|
2402
2570
|
const result = new import_caip2.AssetId(v);
|
|
2403
2571
|
return {
|
|
@@ -2421,20 +2589,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2421
2589
|
});
|
|
2422
2590
|
}
|
|
2423
2591
|
}
|
|
2424
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2425
|
-
ownershipType:
|
|
2592
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v429.z.object({
|
|
2593
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2426
2594
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2427
2595
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2428
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2429
|
-
ownershipType:
|
|
2596
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v429.z.object({
|
|
2597
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2430
2598
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2431
2599
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2432
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2433
|
-
ownershipType:
|
|
2600
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v429.z.object({
|
|
2601
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2434
2602
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2435
2603
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2436
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2437
|
-
ownershipType:
|
|
2604
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v429.z.object({
|
|
2605
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2438
2606
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2439
2607
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2440
2608
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2447,16 +2615,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2447
2615
|
});
|
|
2448
2616
|
}
|
|
2449
2617
|
}
|
|
2450
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2618
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v429.z.discriminatedUnion("ownershipType", [
|
|
2451
2619
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2452
2620
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2453
2621
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2454
2622
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2455
2623
|
]);
|
|
2456
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2624
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v429.z.object({
|
|
2457
2625
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2458
2626
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2459
|
-
mintStatus:
|
|
2627
|
+
mintStatus: import_v429.z.enum(NFTMintStatuses)
|
|
2460
2628
|
});
|
|
2461
2629
|
|
|
2462
2630
|
// src/tokenscope/assets.ts
|
|
@@ -2472,7 +2640,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2472
2640
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2473
2641
|
if (parsed.error) {
|
|
2474
2642
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2475
|
-
${(0,
|
|
2643
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
2476
2644
|
`);
|
|
2477
2645
|
}
|
|
2478
2646
|
return parsed.data;
|
|
@@ -2482,7 +2650,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2482
2650
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2483
2651
|
if (parsed.error) {
|
|
2484
2652
|
throw new RangeError(`Cannot parse AssetId:
|
|
2485
|
-
${(0,
|
|
2653
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
2486
2654
|
`);
|
|
2487
2655
|
}
|
|
2488
2656
|
return parsed.data;
|
|
@@ -2783,10 +2951,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2783
2951
|
}
|
|
2784
2952
|
|
|
2785
2953
|
// src/ensnode/api/shared/errors/zod-schemas.ts
|
|
2786
|
-
var
|
|
2787
|
-
var makeErrorResponseSchema = () =>
|
|
2788
|
-
message:
|
|
2789
|
-
details:
|
|
2954
|
+
var import_v431 = require("zod/v4");
|
|
2955
|
+
var makeErrorResponseSchema = () => import_v431.z.object({
|
|
2956
|
+
message: import_v431.z.string(),
|
|
2957
|
+
details: import_v431.z.optional(import_v431.z.unknown())
|
|
2790
2958
|
});
|
|
2791
2959
|
|
|
2792
2960
|
// src/ensnode/api/name-tokens/response.ts
|
|
@@ -2825,10 +2993,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2825
2993
|
};
|
|
2826
2994
|
|
|
2827
2995
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2828
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2996
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v432.z.object({
|
|
2829
2997
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2830
2998
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2831
|
-
tokens:
|
|
2999
|
+
tokens: import_v432.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2832
3000
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2833
3001
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2834
3002
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2870,32 +3038,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2870
3038
|
});
|
|
2871
3039
|
}
|
|
2872
3040
|
});
|
|
2873
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2874
|
-
responseCode:
|
|
3041
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v432.z.strictObject({
|
|
3042
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Ok),
|
|
2875
3043
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2876
3044
|
});
|
|
2877
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2878
|
-
responseCode:
|
|
2879
|
-
errorCode:
|
|
3045
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v432.z.strictObject({
|
|
3046
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Error),
|
|
3047
|
+
errorCode: import_v432.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2880
3048
|
error: makeErrorResponseSchema()
|
|
2881
3049
|
});
|
|
2882
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2883
|
-
responseCode:
|
|
2884
|
-
errorCode:
|
|
3050
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v432.z.strictObject({
|
|
3051
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Error),
|
|
3052
|
+
errorCode: import_v432.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2885
3053
|
error: makeErrorResponseSchema()
|
|
2886
3054
|
});
|
|
2887
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2888
|
-
responseCode:
|
|
2889
|
-
errorCode:
|
|
3055
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v432.z.strictObject({
|
|
3056
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Error),
|
|
3057
|
+
errorCode: import_v432.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2890
3058
|
error: makeErrorResponseSchema()
|
|
2891
3059
|
});
|
|
2892
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
3060
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v432.z.discriminatedUnion("errorCode", [
|
|
2893
3061
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2894
3062
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2895
3063
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2896
3064
|
]);
|
|
2897
3065
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2898
|
-
return
|
|
3066
|
+
return import_v432.z.discriminatedUnion("responseCode", [
|
|
2899
3067
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2900
3068
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2901
3069
|
]);
|
|
@@ -2908,7 +3076,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2908
3076
|
);
|
|
2909
3077
|
if (parsed.error) {
|
|
2910
3078
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2911
|
-
${(0,
|
|
3079
|
+
${(0, import_v433.prettifyError)(parsed.error)}
|
|
2912
3080
|
`);
|
|
2913
3081
|
}
|
|
2914
3082
|
return parsed.data;
|
|
@@ -2982,14 +3150,14 @@ function serializeNameTokensResponse(response) {
|
|
|
2982
3150
|
}
|
|
2983
3151
|
|
|
2984
3152
|
// src/ensnode/api/registrar-actions/deserialize.ts
|
|
2985
|
-
var
|
|
3153
|
+
var import_v437 = require("zod/v4");
|
|
2986
3154
|
|
|
2987
3155
|
// src/ensnode/api/registrar-actions/zod-schemas.ts
|
|
2988
3156
|
var import_enssdk7 = require("enssdk");
|
|
2989
|
-
var
|
|
3157
|
+
var import_v436 = require("zod/v4");
|
|
2990
3158
|
|
|
2991
3159
|
// src/registrars/zod-schemas.ts
|
|
2992
|
-
var
|
|
3160
|
+
var import_v434 = require("zod/v4");
|
|
2993
3161
|
|
|
2994
3162
|
// src/registrars/encoded-referrer.ts
|
|
2995
3163
|
var import_enssdk6 = require("enssdk");
|
|
@@ -3063,11 +3231,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
3063
3231
|
}
|
|
3064
3232
|
|
|
3065
3233
|
// src/registrars/zod-schemas.ts
|
|
3066
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
3234
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v434.z.object({
|
|
3067
3235
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
3068
3236
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
3069
3237
|
});
|
|
3070
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
3238
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v434.z.object({
|
|
3071
3239
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
3072
3240
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
3073
3241
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -3083,18 +3251,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
3083
3251
|
});
|
|
3084
3252
|
}
|
|
3085
3253
|
}
|
|
3086
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
3254
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v434.z.union([
|
|
3087
3255
|
// pricing available
|
|
3088
|
-
|
|
3256
|
+
import_v434.z.object({
|
|
3089
3257
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
3090
3258
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
3091
3259
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
3092
3260
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
3093
3261
|
// pricing unknown
|
|
3094
|
-
|
|
3095
|
-
baseCost:
|
|
3096
|
-
premium:
|
|
3097
|
-
total:
|
|
3262
|
+
import_v434.z.object({
|
|
3263
|
+
baseCost: import_v434.z.null(),
|
|
3264
|
+
premium: import_v434.z.null(),
|
|
3265
|
+
total: import_v434.z.null()
|
|
3098
3266
|
}).transform((v) => v)
|
|
3099
3267
|
]);
|
|
3100
3268
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -3117,9 +3285,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
3117
3285
|
});
|
|
3118
3286
|
}
|
|
3119
3287
|
}
|
|
3120
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
3288
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v434.z.union([
|
|
3121
3289
|
// referral available
|
|
3122
|
-
|
|
3290
|
+
import_v434.z.object({
|
|
3123
3291
|
encodedReferrer: makeHexStringSchema(
|
|
3124
3292
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
3125
3293
|
`${valueLabel} Encoded Referrer`
|
|
@@ -3127,9 +3295,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
3127
3295
|
decodedReferrer: makeNormalizedAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
3128
3296
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
3129
3297
|
// referral not applicable
|
|
3130
|
-
|
|
3131
|
-
encodedReferrer:
|
|
3132
|
-
decodedReferrer:
|
|
3298
|
+
import_v434.z.object({
|
|
3299
|
+
encodedReferrer: import_v434.z.null(),
|
|
3300
|
+
decodedReferrer: import_v434.z.null()
|
|
3133
3301
|
})
|
|
3134
3302
|
]);
|
|
3135
3303
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -3142,9 +3310,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
3142
3310
|
});
|
|
3143
3311
|
}
|
|
3144
3312
|
}
|
|
3145
|
-
var EventIdSchema =
|
|
3146
|
-
var EventIdsSchema =
|
|
3147
|
-
var makeBaseRegistrarActionSchemaWithoutCheck = (valueLabel = "Base Registrar Action") =>
|
|
3313
|
+
var EventIdSchema = import_v434.z.string().nonempty();
|
|
3314
|
+
var EventIdsSchema = import_v434.z.array(EventIdSchema).min(1).transform((v) => v);
|
|
3315
|
+
var makeBaseRegistrarActionSchemaWithoutCheck = (valueLabel = "Base Registrar Action") => import_v434.z.object({
|
|
3148
3316
|
id: EventIdSchema,
|
|
3149
3317
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
3150
3318
|
registrant: makeNormalizedAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -3159,36 +3327,36 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => ma
|
|
|
3159
3327
|
invariant_eventIdsInitialElementIsTheActionId
|
|
3160
3328
|
);
|
|
3161
3329
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3162
|
-
type:
|
|
3330
|
+
type: import_v434.z.literal(RegistrarActionTypes.Registration)
|
|
3163
3331
|
});
|
|
3164
3332
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3165
|
-
type:
|
|
3333
|
+
type: import_v434.z.literal(RegistrarActionTypes.Renewal)
|
|
3166
3334
|
});
|
|
3167
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3335
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v434.z.discriminatedUnion("type", [
|
|
3168
3336
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
3169
3337
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
3170
3338
|
]);
|
|
3171
3339
|
|
|
3172
3340
|
// src/ensnode/api/shared/pagination/zod-schemas.ts
|
|
3173
|
-
var
|
|
3341
|
+
var import_v435 = require("zod/v4");
|
|
3174
3342
|
|
|
3175
3343
|
// src/ensnode/api/shared/pagination/request.ts
|
|
3176
3344
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
3177
3345
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
3178
3346
|
|
|
3179
3347
|
// src/ensnode/api/shared/pagination/zod-schemas.ts
|
|
3180
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3348
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v435.z.object({
|
|
3181
3349
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3182
3350
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3183
3351
|
RECORDS_PER_PAGE_MAX,
|
|
3184
3352
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
3185
3353
|
)
|
|
3186
3354
|
});
|
|
3187
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
3188
|
-
totalRecords:
|
|
3189
|
-
totalPages:
|
|
3190
|
-
hasNext:
|
|
3191
|
-
hasPrev:
|
|
3355
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v435.z.object({
|
|
3356
|
+
totalRecords: import_v435.z.literal(0),
|
|
3357
|
+
totalPages: import_v435.z.literal(1),
|
|
3358
|
+
hasNext: import_v435.z.literal(false),
|
|
3359
|
+
hasPrev: import_v435.z.literal(false)
|
|
3192
3360
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
3193
3361
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
3194
3362
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3223,15 +3391,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3223
3391
|
});
|
|
3224
3392
|
}
|
|
3225
3393
|
}
|
|
3226
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3394
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v435.z.object({
|
|
3227
3395
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3228
3396
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3229
|
-
hasNext:
|
|
3230
|
-
hasPrev:
|
|
3397
|
+
hasNext: import_v435.z.boolean(),
|
|
3398
|
+
hasPrev: import_v435.z.boolean(),
|
|
3231
3399
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3232
3400
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3233
3401
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3234
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3402
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v435.z.union([
|
|
3235
3403
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3236
3404
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3237
3405
|
]);
|
|
@@ -3261,21 +3429,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3261
3429
|
});
|
|
3262
3430
|
}
|
|
3263
3431
|
}
|
|
3264
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3432
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v436.z.object({
|
|
3265
3433
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3266
3434
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3267
3435
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3268
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3269
|
-
responseCode:
|
|
3270
|
-
registrarActions:
|
|
3436
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v436.z.object({
|
|
3437
|
+
responseCode: import_v436.z.literal(RegistrarActionsResponseCodes.Ok),
|
|
3438
|
+
registrarActions: import_v436.z.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
3271
3439
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3272
3440
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3273
3441
|
});
|
|
3274
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3275
|
-
responseCode:
|
|
3442
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v436.z.strictObject({
|
|
3443
|
+
responseCode: import_v436.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3276
3444
|
error: makeErrorResponseSchema()
|
|
3277
3445
|
});
|
|
3278
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3446
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v436.z.discriminatedUnion("responseCode", [
|
|
3279
3447
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3280
3448
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3281
3449
|
]);
|
|
@@ -3286,7 +3454,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3286
3454
|
if (parsed.error) {
|
|
3287
3455
|
throw new Error(
|
|
3288
3456
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3289
|
-
${(0,
|
|
3457
|
+
${(0, import_v437.prettifyError)(parsed.error)}
|
|
3290
3458
|
`
|
|
3291
3459
|
);
|
|
3292
3460
|
}
|
|
@@ -3423,12 +3591,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3423
3591
|
}
|
|
3424
3592
|
|
|
3425
3593
|
// src/ensnode/api/shared/errors/deserialize.ts
|
|
3426
|
-
var
|
|
3594
|
+
var import_v438 = require("zod/v4");
|
|
3427
3595
|
function deserializeErrorResponse2(maybeErrorResponse) {
|
|
3428
3596
|
const parsed = makeErrorResponseSchema().safeParse(maybeErrorResponse);
|
|
3429
3597
|
if (parsed.error) {
|
|
3430
3598
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3431
|
-
${(0,
|
|
3599
|
+
${(0, import_v438.prettifyError)(parsed.error)}
|
|
3432
3600
|
`);
|
|
3433
3601
|
}
|
|
3434
3602
|
return parsed.data;
|
|
@@ -3958,51 +4126,18 @@ var EnsNodeClient = class _EnsNodeClient {
|
|
|
3958
4126
|
}
|
|
3959
4127
|
};
|
|
3960
4128
|
|
|
3961
|
-
// src/
|
|
3962
|
-
var
|
|
3963
|
-
|
|
3964
|
-
// src/identity/types.ts
|
|
3965
|
-
var ResolutionStatusIds = {
|
|
3966
|
-
/**
|
|
3967
|
-
* Represents that the `Identity` is not resolved yet.
|
|
3968
|
-
*/
|
|
3969
|
-
Unresolved: "unresolved",
|
|
3970
|
-
/**
|
|
3971
|
-
* Represents that resolution of the `Identity` resulted in a named identity.
|
|
3972
|
-
*/
|
|
3973
|
-
Named: "named",
|
|
3974
|
-
/**
|
|
3975
|
-
* Represents that resolution of the `Identity` resulted in an unnamed identity.
|
|
3976
|
-
*/
|
|
3977
|
-
Unnamed: "unnamed",
|
|
3978
|
-
/**
|
|
3979
|
-
* Represents that attempted resolution of the `Identity` resulted in an error
|
|
3980
|
-
* and therefore it is unknown if the `Identity` resolves to a named or unnamed identity.
|
|
3981
|
-
*/
|
|
3982
|
-
Unknown: "unknown"
|
|
3983
|
-
};
|
|
3984
|
-
|
|
3985
|
-
// src/identity/identity.ts
|
|
3986
|
-
function buildUnresolvedIdentity(address, namespaceId, chainId) {
|
|
3987
|
-
return {
|
|
3988
|
-
resolutionStatus: ResolutionStatusIds.Unresolved,
|
|
3989
|
-
chainId: chainId ?? (0, import_datasources6.getENSRootChainId)(namespaceId),
|
|
3990
|
-
address
|
|
3991
|
-
};
|
|
3992
|
-
}
|
|
3993
|
-
function isResolvedIdentity(identity) {
|
|
3994
|
-
return identity.resolutionStatus !== ResolutionStatusIds.Unresolved;
|
|
3995
|
-
}
|
|
4129
|
+
// src/ensnode/metadata/deserialize/indexing-metadata-context.ts
|
|
4130
|
+
var import_v446 = require("zod/v4");
|
|
3996
4131
|
|
|
3997
4132
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
3998
|
-
var
|
|
4133
|
+
var import_v439 = require("zod/v4");
|
|
3999
4134
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4000
4135
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4001
4136
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4002
4137
|
if (parsed.error) {
|
|
4003
4138
|
throw new Error(
|
|
4004
4139
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4005
|
-
${(0,
|
|
4140
|
+
${(0, import_v439.prettifyError)(parsed.error)}
|
|
4006
4141
|
`
|
|
4007
4142
|
);
|
|
4008
4143
|
}
|
|
@@ -4020,121 +4155,256 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4020
4155
|
}
|
|
4021
4156
|
|
|
4022
4157
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4023
|
-
var
|
|
4158
|
+
var import_v440 = require("zod/v4");
|
|
4024
4159
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4025
4160
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4026
4161
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4027
4162
|
if (parsed.error) {
|
|
4028
4163
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4029
|
-
${(0,
|
|
4164
|
+
${(0, import_v440.prettifyError)(parsed.error)}
|
|
4030
4165
|
`);
|
|
4031
4166
|
}
|
|
4032
4167
|
return parsed.data;
|
|
4033
4168
|
}
|
|
4034
4169
|
|
|
4035
4170
|
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
4036
|
-
var
|
|
4171
|
+
var import_v441 = require("zod/v4");
|
|
4037
4172
|
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
4038
4173
|
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
4039
4174
|
const parsed = schema.safeParse(unvalidatedProjection);
|
|
4040
4175
|
if (parsed.error) {
|
|
4041
4176
|
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
4042
|
-
${(0,
|
|
4177
|
+
${(0, import_v441.prettifyError)(parsed.error)}
|
|
4043
4178
|
`);
|
|
4044
4179
|
}
|
|
4045
4180
|
return parsed.data;
|
|
4046
4181
|
}
|
|
4047
4182
|
|
|
4048
|
-
// src/
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4183
|
+
// src/stack-info/validate/ensindexer-stack-info.ts
|
|
4184
|
+
var import_v442 = require("zod/v4");
|
|
4185
|
+
function validateEnsIndexerStackInfo(maybeStackInfo, valueLabel) {
|
|
4186
|
+
const parsed = makeEnsIndexerStackInfoSchema(valueLabel).safeParse(maybeStackInfo);
|
|
4187
|
+
if (parsed.error) {
|
|
4188
|
+
throw new Error(`Cannot validate EnsIndexerStackInfo:
|
|
4189
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4190
|
+
`);
|
|
4191
|
+
}
|
|
4192
|
+
return parsed.data;
|
|
4056
4193
|
}
|
|
4057
4194
|
|
|
4058
|
-
// src/
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
return (0, import_enssdk8.asInterpretedName)("base.eth");
|
|
4076
|
-
case import_datasources7.ENSNamespaceIds.Sepolia:
|
|
4077
|
-
case import_datasources7.ENSNamespaceIds.SepoliaV2:
|
|
4078
|
-
return (0, import_enssdk8.asInterpretedName)("basetest.eth");
|
|
4079
|
-
case import_datasources7.ENSNamespaceIds.EnsTestEnv:
|
|
4080
|
-
throw new Error(
|
|
4081
|
-
`No registrar managed name is known for the 'basenames' subregistry within the "${namespaceId}" namespace.`
|
|
4082
|
-
);
|
|
4195
|
+
// src/stack-info/ensindexer-stack-info.ts
|
|
4196
|
+
function buildEnsIndexerStackInfo(ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig) {
|
|
4197
|
+
return validateEnsIndexerStackInfo({
|
|
4198
|
+
ensDb: ensDbPublicConfig,
|
|
4199
|
+
ensIndexer: ensIndexerPublicConfig,
|
|
4200
|
+
ensRainbow: ensRainbowPublicConfig
|
|
4201
|
+
});
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
// src/stack-info/validate/ensnode-stack-info.ts
|
|
4205
|
+
var import_v443 = require("zod/v4");
|
|
4206
|
+
function validateEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
4207
|
+
const parsed = makeEnsNodeStackInfoSchema(valueLabel).safeParse(maybeStackInfo);
|
|
4208
|
+
if (parsed.error) {
|
|
4209
|
+
throw new Error(`Cannot validate EnsNodeStackInfo:
|
|
4210
|
+
${(0, import_v443.prettifyError)(parsed.error)}
|
|
4211
|
+
`);
|
|
4083
4212
|
}
|
|
4213
|
+
return parsed.data;
|
|
4084
4214
|
}
|
|
4085
4215
|
|
|
4086
|
-
// src/
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4216
|
+
// src/stack-info/ensnode-stack-info.ts
|
|
4217
|
+
function buildEnsNodeStackInfo(ensApiPublicConfig, ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig) {
|
|
4218
|
+
return validateEnsNodeStackInfo({
|
|
4219
|
+
...buildEnsIndexerStackInfo(ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig),
|
|
4220
|
+
ensApi: ensApiPublicConfig
|
|
4221
|
+
});
|
|
4222
|
+
}
|
|
4223
|
+
|
|
4224
|
+
// src/ensnode/metadata/validate/indexing-metadata-context.ts
|
|
4225
|
+
var import_v445 = require("zod/v4");
|
|
4226
|
+
|
|
4227
|
+
// src/ensnode/metadata/zod-schemas/indexing-metadata-context.ts
|
|
4228
|
+
var import_v444 = require("zod/v4");
|
|
4229
|
+
var makeSerializedIndexingMetadataContextUninitializedSchema = (valueLabel) => {
|
|
4230
|
+
const label = valueLabel ?? "SerializedIndexingMetadataContextUninitialized";
|
|
4231
|
+
return import_v444.z.object({
|
|
4232
|
+
statusCode: import_v444.z.literal(IndexingMetadataContextStatusCodes.Uninitialized, {
|
|
4233
|
+
error: `${label} must have status code ${IndexingMetadataContextStatusCodes.Uninitialized}`
|
|
4234
|
+
})
|
|
4235
|
+
});
|
|
4236
|
+
};
|
|
4237
|
+
var makeSerializedIndexingMetadataContextInitializedSchema = (valueLabel) => {
|
|
4238
|
+
const label = valueLabel ?? "SerializedIndexingMetadataContextInitialized";
|
|
4239
|
+
return import_v444.z.object({
|
|
4240
|
+
statusCode: import_v444.z.literal(IndexingMetadataContextStatusCodes.Initialized, {
|
|
4241
|
+
error: `${label} must have status code ${IndexingMetadataContextStatusCodes.Initialized}`
|
|
4242
|
+
}),
|
|
4243
|
+
indexingStatus: makeSerializedCrossChainIndexingStatusSnapshotSchema(`${label}.indexingStatus`),
|
|
4244
|
+
stackInfo: makeSerializedEnsIndexerStackInfoSchema(`${label}.stackInfo`)
|
|
4245
|
+
});
|
|
4246
|
+
};
|
|
4247
|
+
var makeSerializedIndexingMetadataContextSchema = (valueLabel) => {
|
|
4248
|
+
const label = valueLabel ?? "SerializedIndexingMetadataContext";
|
|
4249
|
+
return import_v444.z.discriminatedUnion("statusCode", [
|
|
4250
|
+
makeSerializedIndexingMetadataContextUninitializedSchema(label),
|
|
4251
|
+
makeSerializedIndexingMetadataContextInitializedSchema(label)
|
|
4252
|
+
]);
|
|
4253
|
+
};
|
|
4254
|
+
var makeIndexingMetadataContextUninitializedSchema = makeSerializedIndexingMetadataContextUninitializedSchema;
|
|
4255
|
+
var makeIndexingMetadataContextInitializedSchema = (valueLabel) => {
|
|
4256
|
+
const label = valueLabel ?? "IndexingMetadataContextInitialized";
|
|
4257
|
+
return import_v444.z.object({
|
|
4258
|
+
statusCode: import_v444.z.literal(IndexingMetadataContextStatusCodes.Initialized, {
|
|
4259
|
+
error: `${label} must have status code ${IndexingMetadataContextStatusCodes.Initialized}`
|
|
4260
|
+
}),
|
|
4261
|
+
indexingStatus: makeCrossChainIndexingStatusSnapshotSchema(`${label}.indexingStatus`),
|
|
4262
|
+
stackInfo: makeEnsIndexerStackInfoSchema(`${label}.stackInfo`)
|
|
4263
|
+
});
|
|
4264
|
+
};
|
|
4265
|
+
var makeIndexingMetadataContextSchema = (valueLabel) => {
|
|
4266
|
+
const label = valueLabel ?? "IndexingMetadataContext";
|
|
4267
|
+
return import_v444.z.discriminatedUnion("statusCode", [
|
|
4268
|
+
makeIndexingMetadataContextUninitializedSchema(label),
|
|
4269
|
+
makeIndexingMetadataContextInitializedSchema(label)
|
|
4270
|
+
]);
|
|
4271
|
+
};
|
|
4272
|
+
|
|
4273
|
+
// src/ensnode/metadata/validate/indexing-metadata-context.ts
|
|
4274
|
+
function validateIndexingMetadataContextInitialized(maybeIndexingMetadataContext, valueLabel) {
|
|
4275
|
+
const label = valueLabel ?? "IndexingMetadataContextInitialized";
|
|
4276
|
+
const result = makeIndexingMetadataContextInitializedSchema(label).safeParse(
|
|
4277
|
+
maybeIndexingMetadataContext
|
|
4278
|
+
);
|
|
4279
|
+
if (result.error) {
|
|
4280
|
+
throw new Error(`Cannot validate ${label}:
|
|
4281
|
+
${(0, import_v445.prettifyError)(result.error)}
|
|
4282
|
+
`);
|
|
4093
4283
|
}
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4284
|
+
return result.data;
|
|
4285
|
+
}
|
|
4286
|
+
|
|
4287
|
+
// src/ensnode/metadata/indexing-metadata-context.ts
|
|
4288
|
+
var IndexingMetadataContextStatusCodes = {
|
|
4289
|
+
/**
|
|
4290
|
+
* Represents that no indexing metadata context has been initialized
|
|
4291
|
+
* for the ENSIndexer Schema Name in the ENSNode Metadata table in ENSDb.
|
|
4292
|
+
*/
|
|
4293
|
+
Uninitialized: "uninitialized",
|
|
4294
|
+
/**
|
|
4295
|
+
* Represents that the indexing metadata context has been initialized
|
|
4296
|
+
* for the ENSIndexer Schema Name in the ENSNode Metadata table in ENSDb.
|
|
4297
|
+
*/
|
|
4298
|
+
Initialized: "initialized"
|
|
4299
|
+
};
|
|
4300
|
+
function buildIndexingMetadataContextUninitialized() {
|
|
4301
|
+
return {
|
|
4302
|
+
statusCode: IndexingMetadataContextStatusCodes.Uninitialized
|
|
4303
|
+
};
|
|
4304
|
+
}
|
|
4305
|
+
function buildIndexingMetadataContextInitialized(indexingStatus, stackInfo) {
|
|
4306
|
+
return validateIndexingMetadataContextInitialized({
|
|
4307
|
+
statusCode: IndexingMetadataContextStatusCodes.Initialized,
|
|
4308
|
+
indexingStatus,
|
|
4309
|
+
stackInfo
|
|
4310
|
+
});
|
|
4311
|
+
}
|
|
4312
|
+
|
|
4313
|
+
// src/ensnode/metadata/deserialize/indexing-metadata-context.ts
|
|
4314
|
+
function buildUnvalidatedIndexingMetadataContextInitialized(serializedIndexingMetadataContext) {
|
|
4315
|
+
return {
|
|
4316
|
+
statusCode: serializedIndexingMetadataContext.statusCode,
|
|
4317
|
+
indexingStatus: buildUnvalidatedCrossChainIndexingStatusSnapshot(
|
|
4318
|
+
serializedIndexingMetadataContext.indexingStatus
|
|
4319
|
+
),
|
|
4320
|
+
stackInfo: buildUnvalidatedEnsIndexerStackInfo(serializedIndexingMetadataContext.stackInfo)
|
|
4321
|
+
};
|
|
4322
|
+
}
|
|
4323
|
+
function buildUnvalidatedIndexingMetadataContext(serializedIndexingMetadataContext) {
|
|
4324
|
+
switch (serializedIndexingMetadataContext.statusCode) {
|
|
4325
|
+
case IndexingMetadataContextStatusCodes.Uninitialized:
|
|
4326
|
+
return serializedIndexingMetadataContext;
|
|
4327
|
+
case IndexingMetadataContextStatusCodes.Initialized:
|
|
4328
|
+
return buildUnvalidatedIndexingMetadataContextInitialized(serializedIndexingMetadataContext);
|
|
4097
4329
|
}
|
|
4098
|
-
return { chainId: datasource.chain.id, address };
|
|
4099
4330
|
}
|
|
4100
|
-
function
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4331
|
+
function deserializeIndexingMetadataContext(serializedIndexingMetadataContext, valueLabel) {
|
|
4332
|
+
const label = valueLabel ?? "IndexingMetadataContext";
|
|
4333
|
+
const parsed = makeSerializedIndexingMetadataContextSchema(label).transform(buildUnvalidatedIndexingMetadataContext).pipe(makeIndexingMetadataContextSchema(label)).safeParse(serializedIndexingMetadataContext);
|
|
4334
|
+
if (parsed.error) {
|
|
4335
|
+
throw new Error(
|
|
4336
|
+
`Cannot deserialize IndexingMetadataContext:
|
|
4337
|
+
${(0, import_v446.prettifyError)(parsed.error)}
|
|
4338
|
+
`
|
|
4339
|
+
);
|
|
4107
4340
|
}
|
|
4341
|
+
return parsed.data;
|
|
4108
4342
|
}
|
|
4109
4343
|
|
|
4110
|
-
// src/
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
}
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
switch (namespaceId) {
|
|
4126
|
-
case import_datasources9.ENSNamespaceIds.Mainnet:
|
|
4127
|
-
return (0, import_enssdk10.asInterpretedName)("linea.eth");
|
|
4128
|
-
case import_datasources9.ENSNamespaceIds.Sepolia:
|
|
4129
|
-
case import_datasources9.ENSNamespaceIds.SepoliaV2:
|
|
4130
|
-
return (0, import_enssdk10.asInterpretedName)("linea-sepolia.eth");
|
|
4131
|
-
case import_datasources9.ENSNamespaceIds.EnsTestEnv:
|
|
4132
|
-
throw new Error(
|
|
4133
|
-
`No registrar managed name is known for the 'Lineanames' subregistry within the "${namespaceId}" namespace.`
|
|
4134
|
-
);
|
|
4344
|
+
// src/ensnode/metadata/serialize/indexing-metadata-context.ts
|
|
4345
|
+
function serializeIndexingMetadataContextInitialized(context) {
|
|
4346
|
+
const { statusCode, indexingStatus, stackInfo } = context;
|
|
4347
|
+
return {
|
|
4348
|
+
statusCode,
|
|
4349
|
+
indexingStatus: serializeCrossChainIndexingStatusSnapshot(indexingStatus),
|
|
4350
|
+
stackInfo: serializeEnsIndexerStackInfo(stackInfo)
|
|
4351
|
+
};
|
|
4352
|
+
}
|
|
4353
|
+
function serializeIndexingMetadataContext(context) {
|
|
4354
|
+
switch (context.statusCode) {
|
|
4355
|
+
case IndexingMetadataContextStatusCodes.Uninitialized:
|
|
4356
|
+
return context;
|
|
4357
|
+
case IndexingMetadataContextStatusCodes.Initialized:
|
|
4358
|
+
return serializeIndexingMetadataContextInitialized(context);
|
|
4135
4359
|
}
|
|
4136
4360
|
}
|
|
4137
4361
|
|
|
4362
|
+
// src/identity/identity.ts
|
|
4363
|
+
var import_datasources6 = require("@ensnode/datasources");
|
|
4364
|
+
|
|
4365
|
+
// src/identity/types.ts
|
|
4366
|
+
var ResolutionStatusIds = {
|
|
4367
|
+
/**
|
|
4368
|
+
* Represents that the `Identity` is not resolved yet.
|
|
4369
|
+
*/
|
|
4370
|
+
Unresolved: "unresolved",
|
|
4371
|
+
/**
|
|
4372
|
+
* Represents that resolution of the `Identity` resulted in a named identity.
|
|
4373
|
+
*/
|
|
4374
|
+
Named: "named",
|
|
4375
|
+
/**
|
|
4376
|
+
* Represents that resolution of the `Identity` resulted in an unnamed identity.
|
|
4377
|
+
*/
|
|
4378
|
+
Unnamed: "unnamed",
|
|
4379
|
+
/**
|
|
4380
|
+
* Represents that attempted resolution of the `Identity` resulted in an error
|
|
4381
|
+
* and therefore it is unknown if the `Identity` resolves to a named or unnamed identity.
|
|
4382
|
+
*/
|
|
4383
|
+
Unknown: "unknown"
|
|
4384
|
+
};
|
|
4385
|
+
|
|
4386
|
+
// src/identity/identity.ts
|
|
4387
|
+
function buildUnresolvedIdentity(address, namespaceId, chainId) {
|
|
4388
|
+
return {
|
|
4389
|
+
resolutionStatus: ResolutionStatusIds.Unresolved,
|
|
4390
|
+
chainId: chainId ?? (0, import_datasources6.getENSRootChainId)(namespaceId),
|
|
4391
|
+
address
|
|
4392
|
+
};
|
|
4393
|
+
}
|
|
4394
|
+
function isResolvedIdentity(identity) {
|
|
4395
|
+
return identity.resolutionStatus !== ResolutionStatusIds.Unresolved;
|
|
4396
|
+
}
|
|
4397
|
+
|
|
4398
|
+
// src/omnigraph-api/prerequisites.ts
|
|
4399
|
+
function hasOmnigraphApiConfigSupport(config) {
|
|
4400
|
+
const supported = config.plugins.includes("ensv2" /* ENSv2 */);
|
|
4401
|
+
if (supported) return { supported };
|
|
4402
|
+
return {
|
|
4403
|
+
supported: false,
|
|
4404
|
+
reason: `The connected ENSNode's Config must have the '${"ensv2" /* ENSv2 */}' plugin enabled.`
|
|
4405
|
+
};
|
|
4406
|
+
}
|
|
4407
|
+
|
|
4138
4408
|
// src/registrars/registration-expiration.ts
|
|
4139
4409
|
function isRegistrationExpired(info, now) {
|
|
4140
4410
|
if (info.expiry == null) return false;
|
|
@@ -4151,15 +4421,15 @@ function isRegistrationInGracePeriod(info, now) {
|
|
|
4151
4421
|
}
|
|
4152
4422
|
|
|
4153
4423
|
// src/resolution/ensip19-chainid.ts
|
|
4154
|
-
var
|
|
4424
|
+
var import_enssdk8 = require("enssdk");
|
|
4155
4425
|
var import_chains = require("viem/chains");
|
|
4156
|
-
var
|
|
4426
|
+
var import_datasources7 = require("@ensnode/datasources");
|
|
4157
4427
|
var getResolvePrimaryNameChainIdParam = (chainId, namespaceId) => {
|
|
4158
|
-
const ensRootChainId = (0,
|
|
4428
|
+
const ensRootChainId = (0, import_datasources7.getENSRootChainId)(namespaceId);
|
|
4159
4429
|
return chainId === ensRootChainId ? import_chains.mainnet.id : chainId;
|
|
4160
4430
|
};
|
|
4161
4431
|
var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
|
|
4162
|
-
return chainId ===
|
|
4432
|
+
return chainId === import_enssdk8.DEFAULT_EVM_CHAIN_ID ? (0, import_datasources7.getENSRootChainId)(namespaceId) : chainId;
|
|
4163
4433
|
};
|
|
4164
4434
|
|
|
4165
4435
|
// src/resolution/resolver-records-selection.ts
|
|
@@ -4222,13 +4492,13 @@ var import_getUnixTime2 = require("date-fns/getUnixTime");
|
|
|
4222
4492
|
var import_getUnixTime = require("date-fns/getUnixTime");
|
|
4223
4493
|
|
|
4224
4494
|
// src/shared/deserialize.ts
|
|
4225
|
-
var
|
|
4495
|
+
var import_v447 = __toESM(require("zod/v4"), 1);
|
|
4226
4496
|
function deserializeChainId(maybeChainId, valueLabel) {
|
|
4227
4497
|
const schema = makeChainIdStringSchema(valueLabel);
|
|
4228
4498
|
const parsed = schema.safeParse(maybeChainId);
|
|
4229
4499
|
if (parsed.error) {
|
|
4230
4500
|
throw new Error(`Cannot deserialize ChainId:
|
|
4231
|
-
${(0,
|
|
4501
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4232
4502
|
`);
|
|
4233
4503
|
}
|
|
4234
4504
|
return parsed.data;
|
|
@@ -4238,7 +4508,7 @@ function deserializeDatetime(maybeDatetime, valueLabel) {
|
|
|
4238
4508
|
const parsed = schema.safeParse(maybeDatetime);
|
|
4239
4509
|
if (parsed.error) {
|
|
4240
4510
|
throw new Error(`Cannot deserialize Datetime:
|
|
4241
|
-
${(0,
|
|
4511
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4242
4512
|
`);
|
|
4243
4513
|
}
|
|
4244
4514
|
return parsed.data;
|
|
@@ -4248,7 +4518,7 @@ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
|
|
|
4248
4518
|
const parsed = schema.safeParse(maybeTimestamp);
|
|
4249
4519
|
if (parsed.error) {
|
|
4250
4520
|
throw new Error(`Cannot deserialize Unix Timestamp:
|
|
4251
|
-
${(0,
|
|
4521
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4252
4522
|
`);
|
|
4253
4523
|
}
|
|
4254
4524
|
return parsed.data;
|
|
@@ -4258,7 +4528,7 @@ function deserializeUrl(maybeUrl, valueLabel) {
|
|
|
4258
4528
|
const parsed = schema.safeParse(maybeUrl);
|
|
4259
4529
|
if (parsed.error) {
|
|
4260
4530
|
throw new Error(`Cannot deserialize URL:
|
|
4261
|
-
${(0,
|
|
4531
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4262
4532
|
`);
|
|
4263
4533
|
}
|
|
4264
4534
|
return parsed.data;
|
|
@@ -4268,7 +4538,7 @@ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
|
|
|
4268
4538
|
const parsed = schema.safeParse(maybeBlockNumber);
|
|
4269
4539
|
if (parsed.error) {
|
|
4270
4540
|
throw new Error(`Cannot deserialize BlockNumber:
|
|
4271
|
-
${(0,
|
|
4541
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4272
4542
|
`);
|
|
4273
4543
|
}
|
|
4274
4544
|
return parsed.data;
|
|
@@ -4278,17 +4548,17 @@ function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
|
4278
4548
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
4279
4549
|
if (parsed.error) {
|
|
4280
4550
|
throw new Error(`Cannot deserialize BlockRef:
|
|
4281
|
-
${(0,
|
|
4551
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4282
4552
|
`);
|
|
4283
4553
|
}
|
|
4284
4554
|
return parsed.data;
|
|
4285
4555
|
}
|
|
4286
4556
|
function deserializeDuration(maybeDuration, valueLabel) {
|
|
4287
|
-
const schema =
|
|
4557
|
+
const schema = import_v447.default.coerce.number().pipe(makeDurationSchema(valueLabel));
|
|
4288
4558
|
const parsed = schema.safeParse(maybeDuration);
|
|
4289
4559
|
if (parsed.error) {
|
|
4290
4560
|
throw new RangeError(`Cannot deserialize Duration:
|
|
4291
|
-
${(0,
|
|
4561
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4292
4562
|
`);
|
|
4293
4563
|
}
|
|
4294
4564
|
return parsed.data;
|
|
@@ -4298,7 +4568,7 @@ function parseAccountId(maybeAccountId, valueLabel) {
|
|
|
4298
4568
|
const parsed = schema.safeParse(maybeAccountId);
|
|
4299
4569
|
if (parsed.error) {
|
|
4300
4570
|
throw new RangeError(`Cannot deserialize AccountId:
|
|
4301
|
-
${(0,
|
|
4571
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4302
4572
|
`);
|
|
4303
4573
|
}
|
|
4304
4574
|
return parsed.data;
|
|
@@ -4308,7 +4578,7 @@ function deserializePriceEth(maybePrice, valueLabel) {
|
|
|
4308
4578
|
const parsed = schema.safeParse(maybePrice);
|
|
4309
4579
|
if (parsed.error) {
|
|
4310
4580
|
throw new Error(`Cannot deserialize PriceEth:
|
|
4311
|
-
${(0,
|
|
4581
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4312
4582
|
`);
|
|
4313
4583
|
}
|
|
4314
4584
|
return parsed.data;
|
|
@@ -4318,7 +4588,7 @@ function deserializePriceUsdc(maybePrice, valueLabel) {
|
|
|
4318
4588
|
const parsed = schema.safeParse(maybePrice);
|
|
4319
4589
|
if (parsed.error) {
|
|
4320
4590
|
throw new Error(`Cannot deserialize PriceUsdc:
|
|
4321
|
-
${(0,
|
|
4591
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4322
4592
|
`);
|
|
4323
4593
|
}
|
|
4324
4594
|
return parsed.data;
|
|
@@ -4328,7 +4598,17 @@ function deserializePriceDai(maybePrice, valueLabel) {
|
|
|
4328
4598
|
const parsed = schema.safeParse(maybePrice);
|
|
4329
4599
|
if (parsed.error) {
|
|
4330
4600
|
throw new Error(`Cannot deserialize PriceDai:
|
|
4331
|
-
${(0,
|
|
4601
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4602
|
+
`);
|
|
4603
|
+
}
|
|
4604
|
+
return parsed.data;
|
|
4605
|
+
}
|
|
4606
|
+
function deserializePriceEnsTokens(maybePrice, valueLabel) {
|
|
4607
|
+
const schema = makePriceEnsTokensSchema(valueLabel);
|
|
4608
|
+
const parsed = schema.safeParse(maybePrice);
|
|
4609
|
+
if (parsed.error) {
|
|
4610
|
+
throw new Error(`Cannot deserialize PriceEnsTokens:
|
|
4611
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4332
4612
|
`);
|
|
4333
4613
|
}
|
|
4334
4614
|
return parsed.data;
|
|
@@ -4480,12 +4760,12 @@ var TtlCache = class {
|
|
|
4480
4760
|
};
|
|
4481
4761
|
|
|
4482
4762
|
// src/shared/config/indexed-blockranges.ts
|
|
4483
|
-
var
|
|
4763
|
+
var import_datasources8 = require("@ensnode/datasources");
|
|
4484
4764
|
function buildIndexedBlockranges(namespace, pluginsDatasourceNames) {
|
|
4485
4765
|
const indexedBlockranges = /* @__PURE__ */ new Map();
|
|
4486
4766
|
for (const [, datasourceNames] of pluginsDatasourceNames) {
|
|
4487
4767
|
for (const datasourceName of datasourceNames) {
|
|
4488
|
-
const datasource = (0,
|
|
4768
|
+
const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, datasourceName);
|
|
4489
4769
|
if (!datasource) continue;
|
|
4490
4770
|
const datasourceChainId = datasource.chain.id;
|
|
4491
4771
|
const datasourceContracts = Object.values(datasource.contracts);
|
|
@@ -4513,7 +4793,7 @@ var import_viem9 = require("viem");
|
|
|
4513
4793
|
var interpretAddress = (owner) => (0, import_viem9.isAddressEqual)(import_viem9.zeroAddress, owner) ? null : owner;
|
|
4514
4794
|
|
|
4515
4795
|
// src/shared/interpretation/interpret-record-values.ts
|
|
4516
|
-
var
|
|
4796
|
+
var import_enssdk9 = require("enssdk");
|
|
4517
4797
|
var import_viem10 = require("viem");
|
|
4518
4798
|
|
|
4519
4799
|
// src/shared/null-bytes.ts
|
|
@@ -4523,7 +4803,7 @@ var stripNullBytes = (value) => value.replaceAll("\0", "");
|
|
|
4523
4803
|
// src/shared/interpretation/interpret-record-values.ts
|
|
4524
4804
|
function interpretNameRecordValue(value) {
|
|
4525
4805
|
if (value === "") return null;
|
|
4526
|
-
if (!(0,
|
|
4806
|
+
if (!(0, import_enssdk9.isInterpretedName)(value)) return null;
|
|
4527
4807
|
return value;
|
|
4528
4808
|
}
|
|
4529
4809
|
function interpretAddressRecordValue(value) {
|
|
@@ -4532,7 +4812,7 @@ function interpretAddressRecordValue(value) {
|
|
|
4532
4812
|
if (value === "0x") return null;
|
|
4533
4813
|
if (!(0, import_viem10.isAddress)(value, { strict: false })) return value;
|
|
4534
4814
|
if ((0, import_viem10.isAddressEqual)(value, import_viem10.zeroAddress)) return null;
|
|
4535
|
-
return (0,
|
|
4815
|
+
return (0, import_enssdk9.toNormalizedAddress)(value);
|
|
4536
4816
|
}
|
|
4537
4817
|
function interpretTextRecordKey(key) {
|
|
4538
4818
|
if (hasNullByte(key)) return null;
|
|
@@ -4560,24 +4840,216 @@ function interpretDnszonehashValue(value) {
|
|
|
4560
4840
|
return value;
|
|
4561
4841
|
}
|
|
4562
4842
|
|
|
4843
|
+
// src/shared/managed-names.ts
|
|
4844
|
+
var import_enssdk10 = require("enssdk");
|
|
4845
|
+
var import_datasources9 = require("@ensnode/datasources");
|
|
4846
|
+
|
|
4847
|
+
// src/shared/to-json.ts
|
|
4848
|
+
var toJson = (value, options) => JSON.stringify(
|
|
4849
|
+
value,
|
|
4850
|
+
(_key, val) => typeof val === "bigint" ? String(val) : val,
|
|
4851
|
+
options?.pretty ? 2 : void 0
|
|
4852
|
+
);
|
|
4853
|
+
|
|
4854
|
+
// src/shared/managed-names.ts
|
|
4855
|
+
var MANAGED_NAME_BY_NAMESPACE = {
|
|
4856
|
+
sepolia: {
|
|
4857
|
+
"base.eth": "basetest.eth",
|
|
4858
|
+
"linea.eth": "linea-sepolia.eth"
|
|
4859
|
+
}
|
|
4860
|
+
};
|
|
4861
|
+
var getContractsByManagedName = (namespace) => {
|
|
4862
|
+
const ensRootRegistry = getDatasourceContract(
|
|
4863
|
+
namespace,
|
|
4864
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4865
|
+
"ENSv1Registry"
|
|
4866
|
+
);
|
|
4867
|
+
const ensRootRegistryOld = getDatasourceContract(
|
|
4868
|
+
namespace,
|
|
4869
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4870
|
+
"ENSv1RegistryOld"
|
|
4871
|
+
);
|
|
4872
|
+
const ethnamesNameWrapper = getDatasourceContract(
|
|
4873
|
+
namespace,
|
|
4874
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4875
|
+
"NameWrapper"
|
|
4876
|
+
);
|
|
4877
|
+
const basenamesRegistry = maybeGetDatasourceContract(
|
|
4878
|
+
namespace,
|
|
4879
|
+
import_datasources9.DatasourceNames.Basenames,
|
|
4880
|
+
"Registry"
|
|
4881
|
+
);
|
|
4882
|
+
const lineanamesRegistry = maybeGetDatasourceContract(
|
|
4883
|
+
namespace,
|
|
4884
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4885
|
+
"Registry"
|
|
4886
|
+
);
|
|
4887
|
+
const lineanamesNameWrapper = maybeGetDatasourceContract(
|
|
4888
|
+
namespace,
|
|
4889
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4890
|
+
"NameWrapper"
|
|
4891
|
+
);
|
|
4892
|
+
return {
|
|
4893
|
+
[import_enssdk10.ENS_ROOT_NAME]: {
|
|
4894
|
+
registry: ensRootRegistry,
|
|
4895
|
+
contracts: [ensRootRegistry, ensRootRegistryOld]
|
|
4896
|
+
},
|
|
4897
|
+
eth: {
|
|
4898
|
+
registry: ensRootRegistry,
|
|
4899
|
+
contracts: [
|
|
4900
|
+
getDatasourceContract(namespace, import_datasources9.DatasourceNames.ENSRoot, "BaseRegistrar"),
|
|
4901
|
+
getDatasourceContract(
|
|
4902
|
+
namespace,
|
|
4903
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4904
|
+
"UnwrappedEthRegistrarController"
|
|
4905
|
+
),
|
|
4906
|
+
maybeGetDatasourceContract(
|
|
4907
|
+
namespace,
|
|
4908
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4909
|
+
"LegacyEthRegistrarController"
|
|
4910
|
+
),
|
|
4911
|
+
maybeGetDatasourceContract(
|
|
4912
|
+
namespace,
|
|
4913
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4914
|
+
"WrappedEthRegistrarController"
|
|
4915
|
+
),
|
|
4916
|
+
maybeGetDatasourceContract(
|
|
4917
|
+
namespace,
|
|
4918
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4919
|
+
"UniversalRegistrarRenewalWithReferrer"
|
|
4920
|
+
),
|
|
4921
|
+
ethnamesNameWrapper
|
|
4922
|
+
].filter((c) => !!c)
|
|
4923
|
+
},
|
|
4924
|
+
...basenamesRegistry && {
|
|
4925
|
+
"base.eth": {
|
|
4926
|
+
registry: basenamesRegistry,
|
|
4927
|
+
contracts: [
|
|
4928
|
+
basenamesRegistry,
|
|
4929
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Basenames, "BaseRegistrar"),
|
|
4930
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Basenames, "EARegistrarController"),
|
|
4931
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Basenames, "RegistrarController"),
|
|
4932
|
+
maybeGetDatasourceContract(
|
|
4933
|
+
namespace,
|
|
4934
|
+
import_datasources9.DatasourceNames.Basenames,
|
|
4935
|
+
"UpgradeableRegistrarController"
|
|
4936
|
+
)
|
|
4937
|
+
].filter((c) => !!c)
|
|
4938
|
+
}
|
|
4939
|
+
},
|
|
4940
|
+
...lineanamesRegistry && {
|
|
4941
|
+
"linea.eth": {
|
|
4942
|
+
registry: lineanamesRegistry,
|
|
4943
|
+
contracts: [
|
|
4944
|
+
lineanamesRegistry,
|
|
4945
|
+
maybeGetDatasourceContract(namespace, import_datasources9.DatasourceNames.Lineanames, "BaseRegistrar"),
|
|
4946
|
+
maybeGetDatasourceContract(
|
|
4947
|
+
namespace,
|
|
4948
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4949
|
+
"EthRegistrarController"
|
|
4950
|
+
),
|
|
4951
|
+
lineanamesNameWrapper
|
|
4952
|
+
].filter((c) => !!c)
|
|
4953
|
+
}
|
|
4954
|
+
}
|
|
4955
|
+
};
|
|
4956
|
+
};
|
|
4957
|
+
var cache = /* @__PURE__ */ new Map();
|
|
4958
|
+
var getManagedName = (namespace, contract) => {
|
|
4959
|
+
const cacheKey = `${namespace}:${(0, import_enssdk10.stringifyAccountId)(contract)}`;
|
|
4960
|
+
const cached = cache.get(cacheKey);
|
|
4961
|
+
if (cached !== void 0) return cached;
|
|
4962
|
+
for (const [managedName, group] of Object.entries(getContractsByManagedName(namespace))) {
|
|
4963
|
+
const isAnyOfTheContracts = group.contracts.some(
|
|
4964
|
+
(_contract) => accountIdEqual(_contract, contract)
|
|
4965
|
+
);
|
|
4966
|
+
if (isAnyOfTheContracts) {
|
|
4967
|
+
const namespaceSpecific = MANAGED_NAME_BY_NAMESPACE[namespace]?.[managedName];
|
|
4968
|
+
const name = (0, import_enssdk10.asInterpretedName)(namespaceSpecific ?? managedName);
|
|
4969
|
+
const node = (0, import_enssdk10.namehashInterpretedName)(name);
|
|
4970
|
+
const result = { name, node, registry: group.registry };
|
|
4971
|
+
cache.set(cacheKey, result);
|
|
4972
|
+
return result;
|
|
4973
|
+
}
|
|
4974
|
+
}
|
|
4975
|
+
throw new Error(
|
|
4976
|
+
`The following contract ${toJson(contract, { pretty: true })} does not have a configured Managed Name in namespace '${namespace}'.`
|
|
4977
|
+
);
|
|
4978
|
+
};
|
|
4979
|
+
var isNameWrapper = (namespace, contract) => {
|
|
4980
|
+
const ethnamesNameWrapper = getDatasourceContract(
|
|
4981
|
+
namespace,
|
|
4982
|
+
import_datasources9.DatasourceNames.ENSRoot,
|
|
4983
|
+
"NameWrapper"
|
|
4984
|
+
);
|
|
4985
|
+
if (accountIdEqual(ethnamesNameWrapper, contract)) return true;
|
|
4986
|
+
const lineanamesNameWrapper = maybeGetDatasourceContract(
|
|
4987
|
+
namespace,
|
|
4988
|
+
import_datasources9.DatasourceNames.Lineanames,
|
|
4989
|
+
"NameWrapper"
|
|
4990
|
+
);
|
|
4991
|
+
if (lineanamesNameWrapper && accountIdEqual(lineanamesNameWrapper, contract)) return true;
|
|
4992
|
+
return false;
|
|
4993
|
+
};
|
|
4994
|
+
|
|
4563
4995
|
// src/shared/namespace-specific-value.ts
|
|
4564
4996
|
function getNamespaceSpecificValue(namespace, value) {
|
|
4565
4997
|
return value[namespace] ?? value.default;
|
|
4566
4998
|
}
|
|
4567
4999
|
|
|
5000
|
+
// src/shared/replace-bigints.ts
|
|
5001
|
+
var replaceBigInts = (obj, replacer) => {
|
|
5002
|
+
if (typeof obj === "bigint") return replacer(obj);
|
|
5003
|
+
if (Array.isArray(obj))
|
|
5004
|
+
return obj.map((x) => replaceBigInts(x, replacer));
|
|
5005
|
+
if (obj && typeof obj === "object")
|
|
5006
|
+
return Object.fromEntries(
|
|
5007
|
+
Object.entries(obj).map(([k, v]) => [k, replaceBigInts(v, replacer)])
|
|
5008
|
+
);
|
|
5009
|
+
return obj;
|
|
5010
|
+
};
|
|
5011
|
+
|
|
4568
5012
|
// src/shared/root-registry.ts
|
|
4569
|
-
var
|
|
4570
|
-
var
|
|
4571
|
-
var getENSv1Registry = (namespace) => getDatasourceContract(namespace,
|
|
5013
|
+
var import_enssdk11 = require("enssdk");
|
|
5014
|
+
var import_datasources10 = require("@ensnode/datasources");
|
|
5015
|
+
var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
5016
|
+
var getENSv1RootRegistryId = (namespace) => (0, import_enssdk11.makeENSv1RegistryId)(getENSv1Registry(namespace));
|
|
4572
5017
|
var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
|
|
4573
|
-
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace,
|
|
4574
|
-
var getENSv2RootRegistryId = (namespace) => (0,
|
|
5018
|
+
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
5019
|
+
var getENSv2RootRegistryId = (namespace) => (0, import_enssdk11.makeENSv2RegistryId)(getENSv2RootRegistry(namespace));
|
|
4575
5020
|
var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
|
|
4576
|
-
var maybeGetENSv2RootRegistry = (namespace) => maybeGetDatasourceContract(namespace,
|
|
5021
|
+
var maybeGetENSv2RootRegistry = (namespace) => maybeGetDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
4577
5022
|
var maybeGetENSv2RootRegistryId = (namespace) => {
|
|
4578
5023
|
const root = maybeGetENSv2RootRegistry(namespace);
|
|
4579
5024
|
if (!root) return void 0;
|
|
4580
|
-
return (0,
|
|
5025
|
+
return (0, import_enssdk11.makeENSv2RegistryId)(root);
|
|
5026
|
+
};
|
|
5027
|
+
var getRootRegistryId = (namespace) => maybeGetENSv2RootRegistryId(namespace) ?? getENSv1RootRegistryId(namespace);
|
|
5028
|
+
var getRootRegistryIds = (namespace) => {
|
|
5029
|
+
const v1RootRegistryId = getENSv1RootRegistryId(namespace);
|
|
5030
|
+
const v2RootRegistryId = maybeGetENSv2RootRegistryId(namespace);
|
|
5031
|
+
const basenamesRegistry = maybeGetDatasourceContract(
|
|
5032
|
+
namespace,
|
|
5033
|
+
import_datasources10.DatasourceNames.Basenames,
|
|
5034
|
+
"Registry"
|
|
5035
|
+
);
|
|
5036
|
+
const lineanamesRegistry = maybeGetDatasourceContract(
|
|
5037
|
+
namespace,
|
|
5038
|
+
import_datasources10.DatasourceNames.Lineanames,
|
|
5039
|
+
"Registry"
|
|
5040
|
+
);
|
|
5041
|
+
return [
|
|
5042
|
+
v1RootRegistryId,
|
|
5043
|
+
basenamesRegistry && (0, import_enssdk11.makeENSv1VirtualRegistryId)(
|
|
5044
|
+
basenamesRegistry,
|
|
5045
|
+
getManagedName(namespace, basenamesRegistry).node
|
|
5046
|
+
),
|
|
5047
|
+
lineanamesRegistry && (0, import_enssdk11.makeENSv1VirtualRegistryId)(
|
|
5048
|
+
lineanamesRegistry,
|
|
5049
|
+
getManagedName(namespace, lineanamesRegistry).node
|
|
5050
|
+
),
|
|
5051
|
+
v2RootRegistryId
|
|
5052
|
+
].filter((id) => !!id);
|
|
4581
5053
|
};
|
|
4582
5054
|
|
|
4583
5055
|
// src/shared/url.ts
|
|
@@ -4588,16 +5060,6 @@ function isWebSocketProtocol(url) {
|
|
|
4588
5060
|
return ["ws:", "wss:"].includes(url.protocol);
|
|
4589
5061
|
}
|
|
4590
5062
|
|
|
4591
|
-
// src/stack-info/ensnode-stack-info.ts
|
|
4592
|
-
function buildEnsNodeStackInfo(ensApiPublicConfig, ensDbPublicConfig) {
|
|
4593
|
-
return {
|
|
4594
|
-
ensApi: ensApiPublicConfig,
|
|
4595
|
-
ensDb: ensDbPublicConfig,
|
|
4596
|
-
ensIndexer: ensApiPublicConfig.ensIndexerPublicConfig,
|
|
4597
|
-
ensRainbow: ensApiPublicConfig.ensIndexerPublicConfig.ensRainbowPublicConfig
|
|
4598
|
-
};
|
|
4599
|
-
}
|
|
4600
|
-
|
|
4601
5063
|
// src/subgraph-api/prerequisites.ts
|
|
4602
5064
|
function hasSubgraphApiConfigSupport(config) {
|
|
4603
5065
|
const supported = config.plugins.includes("subgraph" /* Subgraph */);
|