@ensnode/ensnode-sdk 1.10.1 → 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 +739 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +289 -93
- package/dist/index.d.ts +289 -93
- package/dist/index.js +655 -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,
|
|
@@ -198,14 +205,17 @@ __export(index_exports, {
|
|
|
198
205
|
parseAccountId: () => parseAccountId,
|
|
199
206
|
parseAssetId: () => parseAssetId,
|
|
200
207
|
parseDai: () => parseDai,
|
|
208
|
+
parseEnsTokens: () => parseEnsTokens,
|
|
201
209
|
parseEth: () => parseEth,
|
|
202
210
|
parseNonNegativeInteger: () => parseNonNegativeInteger,
|
|
203
211
|
parseTimestamp: () => parseTimestamp,
|
|
204
212
|
parseUsdc: () => parseUsdc,
|
|
205
213
|
priceDai: () => priceDai,
|
|
214
|
+
priceEnsTokens: () => priceEnsTokens,
|
|
206
215
|
priceEth: () => priceEth,
|
|
207
216
|
priceUsdc: () => priceUsdc,
|
|
208
217
|
registrarActionsFilter: () => registrarActionsFilter,
|
|
218
|
+
replaceBigInts: () => replaceBigInts,
|
|
209
219
|
scaleBigintByNumber: () => scaleBigintByNumber,
|
|
210
220
|
scalePrice: () => scalePrice,
|
|
211
221
|
serializeAssetId: () => serializeAssetId,
|
|
@@ -222,8 +232,11 @@ __export(index_exports, {
|
|
|
222
232
|
serializeEnsIndexerConfigResponse: () => serializeEnsIndexerConfigResponse,
|
|
223
233
|
serializeEnsIndexerIndexingStatusResponse: () => serializeEnsIndexerIndexingStatusResponse,
|
|
224
234
|
serializeEnsIndexerPublicConfig: () => serializeEnsIndexerPublicConfig,
|
|
235
|
+
serializeEnsIndexerStackInfo: () => serializeEnsIndexerStackInfo,
|
|
225
236
|
serializeEnsNodeStackInfo: () => serializeEnsNodeStackInfo,
|
|
226
237
|
serializeIndexedChainIds: () => serializeIndexedChainIds,
|
|
238
|
+
serializeIndexingMetadataContext: () => serializeIndexingMetadataContext,
|
|
239
|
+
serializeIndexingMetadataContextInitialized: () => serializeIndexingMetadataContextInitialized,
|
|
227
240
|
serializeIndexingStatusResponse: () => serializeIndexingStatusResponse,
|
|
228
241
|
serializeNameToken: () => serializeNameToken,
|
|
229
242
|
serializeNameTokensResponse: () => serializeNameTokensResponse,
|
|
@@ -231,6 +244,7 @@ __export(index_exports, {
|
|
|
231
244
|
serializeOmnichainIndexingStatusSnapshot: () => serializeOmnichainIndexingStatusSnapshot,
|
|
232
245
|
serializePrice: () => serializePrice,
|
|
233
246
|
serializePriceDai: () => serializePriceDai,
|
|
247
|
+
serializePriceEnsTokens: () => serializePriceEnsTokens,
|
|
234
248
|
serializePriceEth: () => serializePriceEth,
|
|
235
249
|
serializePriceUsdc: () => serializePriceUsdc,
|
|
236
250
|
serializeRealtimeIndexingStatusProjection: () => serializeRealtimeIndexingStatusProjection,
|
|
@@ -242,19 +256,23 @@ __export(index_exports, {
|
|
|
242
256
|
sortChainStatusesByStartBlockAsc: () => sortChainStatusesByStartBlockAsc,
|
|
243
257
|
stripNullBytes: () => stripNullBytes,
|
|
244
258
|
subtractPrice: () => subtractPrice,
|
|
259
|
+
toJson: () => toJson,
|
|
245
260
|
translateDefaultableChainIdToChainId: () => translateDefaultableChainIdToChainId,
|
|
246
261
|
uniq: () => uniq,
|
|
247
262
|
validateChainIndexingStatusSnapshot: () => validateChainIndexingStatusSnapshot,
|
|
248
263
|
validateCrossChainIndexingStatusSnapshot: () => validateCrossChainIndexingStatusSnapshot,
|
|
249
264
|
validateEnsIndexerPublicConfig: () => validateEnsIndexerPublicConfig,
|
|
250
265
|
validateEnsIndexerPublicConfigCompatibility: () => validateEnsIndexerPublicConfigCompatibility,
|
|
266
|
+
validateEnsIndexerStackInfo: () => validateEnsIndexerStackInfo,
|
|
251
267
|
validateEnsIndexerVersionInfo: () => validateEnsIndexerVersionInfo,
|
|
268
|
+
validateEnsNodeStackInfo: () => validateEnsNodeStackInfo,
|
|
269
|
+
validateIndexingMetadataContextInitialized: () => validateIndexingMetadataContextInitialized,
|
|
252
270
|
validateOmnichainIndexingStatusSnapshot: () => validateOmnichainIndexingStatusSnapshot,
|
|
253
271
|
validateRealtimeIndexingStatusProjection: () => validateRealtimeIndexingStatusProjection,
|
|
254
272
|
validateSupportedLabelSetAndVersion: () => validateSupportedLabelSetAndVersion
|
|
255
273
|
});
|
|
256
274
|
module.exports = __toCommonJS(index_exports);
|
|
257
|
-
var
|
|
275
|
+
var import_datasources11 = require("@ensnode/datasources");
|
|
258
276
|
|
|
259
277
|
// src/ens/index.ts
|
|
260
278
|
var import_datasources = require("@ensnode/datasources");
|
|
@@ -331,7 +349,8 @@ function scaleBigintByNumber(value, scaleFactor) {
|
|
|
331
349
|
var CurrencyIds = {
|
|
332
350
|
ETH: "ETH",
|
|
333
351
|
USDC: "USDC",
|
|
334
|
-
DAI: "DAI"
|
|
352
|
+
DAI: "DAI",
|
|
353
|
+
ENSTokens: "ENSTokens"
|
|
335
354
|
};
|
|
336
355
|
var currencyInfo = {
|
|
337
356
|
[CurrencyIds.ETH]: {
|
|
@@ -348,6 +367,11 @@ var currencyInfo = {
|
|
|
348
367
|
id: CurrencyIds.DAI,
|
|
349
368
|
name: "Dai Stablecoin",
|
|
350
369
|
decimals: 18
|
|
370
|
+
},
|
|
371
|
+
[CurrencyIds.ENSTokens]: {
|
|
372
|
+
id: CurrencyIds.ENSTokens,
|
|
373
|
+
name: "$ENS Tokens",
|
|
374
|
+
decimals: 18
|
|
351
375
|
}
|
|
352
376
|
};
|
|
353
377
|
function getCurrencyInfo(currencyId) {
|
|
@@ -371,6 +395,12 @@ function priceDai(amount) {
|
|
|
371
395
|
currency: CurrencyIds.DAI
|
|
372
396
|
};
|
|
373
397
|
}
|
|
398
|
+
function priceEnsTokens(amount) {
|
|
399
|
+
return {
|
|
400
|
+
amount,
|
|
401
|
+
currency: CurrencyIds.ENSTokens
|
|
402
|
+
};
|
|
403
|
+
}
|
|
374
404
|
function isPriceCurrencyEqual(priceA, priceB) {
|
|
375
405
|
return priceA.currency === priceB.currency;
|
|
376
406
|
}
|
|
@@ -458,6 +488,12 @@ function parseDai(value) {
|
|
|
458
488
|
const amount = (0, import_viem.parseUnits)(value, currencyInfo2.decimals);
|
|
459
489
|
return priceDai(amount);
|
|
460
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
|
+
}
|
|
461
497
|
|
|
462
498
|
// src/shared/zod-schemas.ts
|
|
463
499
|
var makeIntegerSchema = (valueLabel = "Value") => import_v4.z.int({
|
|
@@ -518,6 +554,7 @@ var makePriceCurrencySchema = (currency, valueLabel = "Price Currency") => impor
|
|
|
518
554
|
var makePriceEthSchema = (valueLabel = "Price ETH") => makePriceCurrencySchema(CurrencyIds.ETH, valueLabel).transform((v) => v);
|
|
519
555
|
var makePriceUsdcSchema = (valueLabel = "Price USDC") => makePriceCurrencySchema(CurrencyIds.USDC, valueLabel).transform((v) => v);
|
|
520
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);
|
|
521
558
|
var makeAccountIdSchema = (valueLabel = "AccountId") => import_v4.z.strictObject({
|
|
522
559
|
chainId: makeChainIdSchema(`${valueLabel} chain ID`),
|
|
523
560
|
address: makeNormalizedAddressSchema(`${valueLabel} address`)
|
|
@@ -572,14 +609,15 @@ var makeLabelSetIdSchema = (valueLabel = "Label set ID") => {
|
|
|
572
609
|
var makeLabelSetVersionSchema = (valueLabel = "Label set version") => makeNonNegativeIntegerSchema(valueLabel);
|
|
573
610
|
var makeLabelSetVersionStringSchema = (valueLabel = "Label set version") => import_v42.z.coerce.number({ error: `${valueLabel} must be a non-negative integer` }).pipe(makeLabelSetVersionSchema(valueLabel));
|
|
574
611
|
var makeEnsRainbowPublicConfigSchema = (valueLabel = "EnsRainbowPublicConfig") => import_v42.z.object({
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
labelSetId: makeLabelSetIdSchema(`${valueLabel}.labelSet.labelSetId`),
|
|
612
|
+
serverLabelSet: import_v42.z.object({
|
|
613
|
+
labelSetId: makeLabelSetIdSchema(`${valueLabel}.serverLabelSet.labelSetId`),
|
|
578
614
|
highestLabelSetVersion: makeLabelSetVersionSchema(
|
|
579
|
-
`${valueLabel}.
|
|
615
|
+
`${valueLabel}.serverLabelSet.highestLabelSetVersion`
|
|
580
616
|
)
|
|
581
617
|
}),
|
|
582
|
-
|
|
618
|
+
versionInfo: import_v42.z.object({
|
|
619
|
+
ensRainbow: import_v42.z.string().nonempty({ error: `${valueLabel}.versionInfo.ensRainbow must be a non-empty string.` })
|
|
620
|
+
})
|
|
583
621
|
});
|
|
584
622
|
|
|
585
623
|
// src/shared/collections.ts
|
|
@@ -604,8 +642,8 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
604
642
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
605
643
|
function isSubgraphCompatible(config) {
|
|
606
644
|
const onlySubgraphPluginActivated = config.plugins.length === 1 && config.plugins[0] === "subgraph" /* Subgraph */;
|
|
607
|
-
const isSubgraphLabelSet = config.
|
|
608
|
-
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;
|
|
609
647
|
const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === import_datasources2.ENSNamespaceIds.EnsTestEnv && isEnsTestEnvLabelSet;
|
|
610
648
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
611
649
|
}
|
|
@@ -703,13 +741,13 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
703
741
|
ctx.issues.push({
|
|
704
742
|
code: "custom",
|
|
705
743
|
input: config,
|
|
706
|
-
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}`
|
|
707
745
|
});
|
|
708
746
|
}
|
|
709
747
|
}
|
|
710
748
|
function invariant_ensRainbowSupportedLabelSetAndVersion(ctx) {
|
|
711
|
-
const clientLabelSet = ctx.value
|
|
712
|
-
const serverLabelSet = ctx.value.ensRainbowPublicConfig
|
|
749
|
+
const { clientLabelSet } = ctx.value;
|
|
750
|
+
const { serverLabelSet } = ctx.value.ensRainbowPublicConfig;
|
|
713
751
|
try {
|
|
714
752
|
validateSupportedLabelSetAndVersion(serverLabelSet, clientLabelSet);
|
|
715
753
|
} catch (error) {
|
|
@@ -730,7 +768,7 @@ var makeEnsIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") =
|
|
|
730
768
|
isSubgraphCompatible: import_v43.z.boolean({
|
|
731
769
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
732
770
|
}),
|
|
733
|
-
|
|
771
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
734
772
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
735
773
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
736
774
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -744,7 +782,7 @@ var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIn
|
|
|
744
782
|
isSubgraphCompatible: import_v43.z.boolean({
|
|
745
783
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
746
784
|
}),
|
|
747
|
-
|
|
785
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
748
786
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
749
787
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
750
788
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -844,7 +882,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
844
882
|
ensRainbowPublicConfig,
|
|
845
883
|
indexedChainIds,
|
|
846
884
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
847
|
-
|
|
885
|
+
clientLabelSet,
|
|
848
886
|
namespace,
|
|
849
887
|
plugins,
|
|
850
888
|
versionInfo
|
|
@@ -854,7 +892,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
854
892
|
ensRainbowPublicConfig,
|
|
855
893
|
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
856
894
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
857
|
-
|
|
895
|
+
clientLabelSet,
|
|
858
896
|
namespace,
|
|
859
897
|
plugins,
|
|
860
898
|
versionInfo
|
|
@@ -1893,6 +1931,9 @@ function serializePriceUsdc(price) {
|
|
|
1893
1931
|
function serializePriceDai(price) {
|
|
1894
1932
|
return serializePrice(price);
|
|
1895
1933
|
}
|
|
1934
|
+
function serializePriceEnsTokens(price) {
|
|
1935
|
+
return serializePrice(price);
|
|
1936
|
+
}
|
|
1896
1937
|
|
|
1897
1938
|
// src/indexing-status/serialize/chain-indexing-status-snapshot.ts
|
|
1898
1939
|
function serializeChainIndexingSnapshots(chains) {
|
|
@@ -2099,21 +2140,21 @@ function validateEnsIndexerPublicConfigCompatibility(configA, configB) {
|
|
|
2099
2140
|
].join(" ")
|
|
2100
2141
|
);
|
|
2101
2142
|
}
|
|
2102
|
-
if (configA.
|
|
2143
|
+
if (configA.clientLabelSet.labelSetId !== configB.clientLabelSet.labelSetId) {
|
|
2103
2144
|
throw new Error(
|
|
2104
2145
|
[
|
|
2105
|
-
`'
|
|
2106
|
-
`Stored Config '
|
|
2107
|
-
`Current Config '
|
|
2146
|
+
`'clientLabelSet.labelSetId' must be compatible.`,
|
|
2147
|
+
`Stored Config 'clientLabelSet.labelSetId': '${configA.clientLabelSet.labelSetId}'.`,
|
|
2148
|
+
`Current Config 'clientLabelSet.labelSetId': '${configB.clientLabelSet.labelSetId}'.`
|
|
2108
2149
|
].join(" ")
|
|
2109
2150
|
);
|
|
2110
2151
|
}
|
|
2111
|
-
if (configA.
|
|
2152
|
+
if (configA.clientLabelSet.labelSetVersion !== configB.clientLabelSet.labelSetVersion) {
|
|
2112
2153
|
throw new Error(
|
|
2113
2154
|
[
|
|
2114
|
-
`'
|
|
2115
|
-
`Stored Config '
|
|
2116
|
-
`Current Config '
|
|
2155
|
+
`'clientLabelSet.labelSetVersion' must be compatible.`,
|
|
2156
|
+
`Stored Config 'clientLabelSet.labelSetVersion': '${configA.clientLabelSet.labelSetVersion}'.`,
|
|
2157
|
+
`Current Config 'clientLabelSet.labelSetVersion': '${configB.clientLabelSet.labelSetVersion}'.`
|
|
2117
2158
|
].join(" ")
|
|
2118
2159
|
);
|
|
2119
2160
|
}
|
|
@@ -2204,12 +2245,12 @@ function validateEnsIndexerVersionInfo(unvalidatedVersionInfo) {
|
|
|
2204
2245
|
}
|
|
2205
2246
|
|
|
2206
2247
|
// src/ensnode/api/indexing-status/deserialize.ts
|
|
2207
|
-
var
|
|
2248
|
+
var import_v428 = require("zod/v4");
|
|
2208
2249
|
|
|
2209
2250
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
2210
|
-
var
|
|
2251
|
+
var import_v426 = require("zod/v4");
|
|
2211
2252
|
|
|
2212
|
-
// src/stack-info/zod-schemas/
|
|
2253
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
2213
2254
|
var import_v424 = require("zod/v4");
|
|
2214
2255
|
|
|
2215
2256
|
// src/ensdb/zod-schemas/config.ts
|
|
@@ -2218,49 +2259,134 @@ var makeEnsDbVersionInfoSchema = (valueLabel) => {
|
|
|
2218
2259
|
const label = valueLabel ?? "EnsDbVersionInfo";
|
|
2219
2260
|
return import_v423.z.object({
|
|
2220
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.")
|
|
2221
|
-
})
|
|
2262
|
+
});
|
|
2222
2263
|
};
|
|
2223
2264
|
var makeEnsDbPublicConfigSchema = (valueLabel) => {
|
|
2224
2265
|
const label = valueLabel ?? "EnsDbPublicConfig";
|
|
2225
2266
|
return import_v423.z.object({
|
|
2226
2267
|
versionInfo: makeEnsDbVersionInfoSchema(`${label}.versionInfo`)
|
|
2227
|
-
})
|
|
2268
|
+
});
|
|
2228
2269
|
};
|
|
2229
2270
|
|
|
2230
|
-
// src/stack-info/zod-schemas/
|
|
2231
|
-
function
|
|
2232
|
-
const label = valueLabel ?? "
|
|
2271
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
2272
|
+
function makeSerializedEnsIndexerStackInfoSchema(valueLabel) {
|
|
2273
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
2233
2274
|
return import_v424.z.object({
|
|
2234
|
-
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
2235
2275
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
2236
2276
|
ensIndexer: makeSerializedEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
2237
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2277
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2238
2278
|
});
|
|
2239
2279
|
}
|
|
2240
|
-
function
|
|
2241
|
-
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";
|
|
2242
2301
|
return import_v424.z.object({
|
|
2243
|
-
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
2244
2302
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
2245
2303
|
ensIndexer: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
2246
|
-
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`)
|
|
2247
2348
|
});
|
|
2248
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
|
+
}
|
|
2249
2377
|
|
|
2250
2378
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
2251
2379
|
function buildUnvalidatedEnsNodeStackInfo(serializedStackInfo) {
|
|
2252
|
-
const { ensApi, ensIndexer, ...rest } = serializedStackInfo;
|
|
2253
2380
|
return {
|
|
2254
|
-
...
|
|
2255
|
-
ensApi: buildUnvalidatedEnsApiPublicConfig(ensApi)
|
|
2256
|
-
ensIndexer: buildUnvalidatedEnsIndexerPublicConfig(ensIndexer)
|
|
2381
|
+
...buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo),
|
|
2382
|
+
ensApi: buildUnvalidatedEnsApiPublicConfig(serializedStackInfo.ensApi)
|
|
2257
2383
|
};
|
|
2258
2384
|
}
|
|
2259
2385
|
function deserializeEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
2260
2386
|
const parsed = makeSerializedEnsNodeStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsNodeStackInfo).pipe(makeEnsNodeStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2261
2387
|
if (parsed.error) {
|
|
2262
2388
|
throw new Error(`Cannot deserialize EnsNodeStackInfo:
|
|
2263
|
-
${(0,
|
|
2389
|
+
${(0, import_v426.prettifyError)(parsed.error)}
|
|
2264
2390
|
`);
|
|
2265
2391
|
}
|
|
2266
2392
|
return parsed.data;
|
|
@@ -2280,25 +2406,25 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
2280
2406
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
2281
2407
|
|
|
2282
2408
|
// src/ensnode/api/indexing-status/zod-schemas.ts
|
|
2283
|
-
var
|
|
2284
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
2285
|
-
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),
|
|
2286
2412
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel),
|
|
2287
2413
|
stackInfo: makeEnsNodeStackInfoSchema(valueLabel)
|
|
2288
2414
|
});
|
|
2289
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
2290
|
-
responseCode:
|
|
2415
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v427.z.strictObject({
|
|
2416
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
2291
2417
|
});
|
|
2292
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2418
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
2293
2419
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2294
2420
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2295
2421
|
]);
|
|
2296
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
2297
|
-
responseCode:
|
|
2422
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v427.z.object({
|
|
2423
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2298
2424
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel),
|
|
2299
2425
|
stackInfo: makeSerializedEnsNodeStackInfoSchema(valueLabel)
|
|
2300
2426
|
});
|
|
2301
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
2427
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
2302
2428
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2303
2429
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2304
2430
|
]);
|
|
@@ -2320,7 +2446,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
2320
2446
|
if (parsed.error) {
|
|
2321
2447
|
throw new Error(
|
|
2322
2448
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
2323
|
-
${(0,
|
|
2449
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
2324
2450
|
`
|
|
2325
2451
|
);
|
|
2326
2452
|
}
|
|
@@ -2328,13 +2454,26 @@ ${(0, import_v427.prettifyError)(parsed.error)}
|
|
|
2328
2454
|
}
|
|
2329
2455
|
var deserializeIndexingStatusResponse = deserializeEnsApiIndexingStatusResponse;
|
|
2330
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
|
+
|
|
2331
2472
|
// src/stack-info/serialize/ensnode-stack-info.ts
|
|
2332
2473
|
function serializeEnsNodeStackInfo(stackInfo) {
|
|
2333
2474
|
return {
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
ensIndexer: serializeEnsIndexerPublicConfig(stackInfo.ensIndexer),
|
|
2337
|
-
ensRainbow: stackInfo.ensRainbow
|
|
2475
|
+
...serializeEnsIndexerStackInfo(stackInfo),
|
|
2476
|
+
ensApi: serializeEnsApiPublicConfig(stackInfo.ensApi)
|
|
2338
2477
|
};
|
|
2339
2478
|
}
|
|
2340
2479
|
|
|
@@ -2354,11 +2493,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2354
2493
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2355
2494
|
|
|
2356
2495
|
// src/ensnode/api/name-tokens/deserialize.ts
|
|
2357
|
-
var
|
|
2496
|
+
var import_v433 = require("zod/v4");
|
|
2358
2497
|
|
|
2359
2498
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2360
2499
|
var import_enssdk5 = require("enssdk");
|
|
2361
|
-
var
|
|
2500
|
+
var import_v432 = require("zod/v4");
|
|
2362
2501
|
|
|
2363
2502
|
// src/tokenscope/name-token.ts
|
|
2364
2503
|
var import_enssdk4 = require("enssdk");
|
|
@@ -2400,17 +2539,17 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2400
2539
|
// src/tokenscope/assets.ts
|
|
2401
2540
|
var import_enssdk3 = require("enssdk");
|
|
2402
2541
|
var import_viem6 = require("viem");
|
|
2403
|
-
var
|
|
2542
|
+
var import_v430 = require("zod/v4");
|
|
2404
2543
|
|
|
2405
2544
|
// src/tokenscope/zod-schemas.ts
|
|
2406
2545
|
var import_caip2 = require("caip");
|
|
2407
2546
|
var import_enssdk2 = require("enssdk");
|
|
2408
2547
|
var import_viem5 = require("viem");
|
|
2409
|
-
var
|
|
2410
|
-
var tokenIdSchemaSerializable =
|
|
2411
|
-
var tokenIdSchemaNative =
|
|
2548
|
+
var import_v429 = require("zod/v4");
|
|
2549
|
+
var tokenIdSchemaSerializable = import_v429.z.string();
|
|
2550
|
+
var tokenIdSchemaNative = import_v429.z.preprocess(
|
|
2412
2551
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2413
|
-
|
|
2552
|
+
import_v429.z.bigint().positive()
|
|
2414
2553
|
);
|
|
2415
2554
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2416
2555
|
if (serializable) {
|
|
@@ -2420,13 +2559,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2420
2559
|
}
|
|
2421
2560
|
}
|
|
2422
2561
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2423
|
-
return
|
|
2424
|
-
assetNamespace:
|
|
2562
|
+
return import_v429.z.object({
|
|
2563
|
+
assetNamespace: import_v429.z.enum(import_enssdk2.AssetNamespaces),
|
|
2425
2564
|
contract: makeAccountIdSchema(valueLabel),
|
|
2426
2565
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2427
2566
|
});
|
|
2428
2567
|
};
|
|
2429
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2568
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v429.z.preprocess((v) => {
|
|
2430
2569
|
if (typeof v === "string") {
|
|
2431
2570
|
const result = new import_caip2.AssetId(v);
|
|
2432
2571
|
return {
|
|
@@ -2450,20 +2589,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2450
2589
|
});
|
|
2451
2590
|
}
|
|
2452
2591
|
}
|
|
2453
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2454
|
-
ownershipType:
|
|
2592
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v429.z.object({
|
|
2593
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2455
2594
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2456
2595
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2457
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2458
|
-
ownershipType:
|
|
2596
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v429.z.object({
|
|
2597
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2459
2598
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2460
2599
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2461
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2462
|
-
ownershipType:
|
|
2600
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v429.z.object({
|
|
2601
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2463
2602
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2464
2603
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2465
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2466
|
-
ownershipType:
|
|
2604
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v429.z.object({
|
|
2605
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2467
2606
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2468
2607
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2469
2608
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2476,16 +2615,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2476
2615
|
});
|
|
2477
2616
|
}
|
|
2478
2617
|
}
|
|
2479
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2618
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v429.z.discriminatedUnion("ownershipType", [
|
|
2480
2619
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2481
2620
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2482
2621
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2483
2622
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2484
2623
|
]);
|
|
2485
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2624
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v429.z.object({
|
|
2486
2625
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2487
2626
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2488
|
-
mintStatus:
|
|
2627
|
+
mintStatus: import_v429.z.enum(NFTMintStatuses)
|
|
2489
2628
|
});
|
|
2490
2629
|
|
|
2491
2630
|
// src/tokenscope/assets.ts
|
|
@@ -2501,7 +2640,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2501
2640
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2502
2641
|
if (parsed.error) {
|
|
2503
2642
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2504
|
-
${(0,
|
|
2643
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
2505
2644
|
`);
|
|
2506
2645
|
}
|
|
2507
2646
|
return parsed.data;
|
|
@@ -2511,7 +2650,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2511
2650
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2512
2651
|
if (parsed.error) {
|
|
2513
2652
|
throw new RangeError(`Cannot parse AssetId:
|
|
2514
|
-
${(0,
|
|
2653
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
2515
2654
|
`);
|
|
2516
2655
|
}
|
|
2517
2656
|
return parsed.data;
|
|
@@ -2812,10 +2951,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2812
2951
|
}
|
|
2813
2952
|
|
|
2814
2953
|
// src/ensnode/api/shared/errors/zod-schemas.ts
|
|
2815
|
-
var
|
|
2816
|
-
var makeErrorResponseSchema = () =>
|
|
2817
|
-
message:
|
|
2818
|
-
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())
|
|
2819
2958
|
});
|
|
2820
2959
|
|
|
2821
2960
|
// src/ensnode/api/name-tokens/response.ts
|
|
@@ -2854,10 +2993,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2854
2993
|
};
|
|
2855
2994
|
|
|
2856
2995
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2857
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2996
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v432.z.object({
|
|
2858
2997
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2859
2998
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2860
|
-
tokens:
|
|
2999
|
+
tokens: import_v432.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2861
3000
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2862
3001
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2863
3002
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2899,32 +3038,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2899
3038
|
});
|
|
2900
3039
|
}
|
|
2901
3040
|
});
|
|
2902
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2903
|
-
responseCode:
|
|
3041
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v432.z.strictObject({
|
|
3042
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Ok),
|
|
2904
3043
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2905
3044
|
});
|
|
2906
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2907
|
-
responseCode:
|
|
2908
|
-
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),
|
|
2909
3048
|
error: makeErrorResponseSchema()
|
|
2910
3049
|
});
|
|
2911
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2912
|
-
responseCode:
|
|
2913
|
-
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),
|
|
2914
3053
|
error: makeErrorResponseSchema()
|
|
2915
3054
|
});
|
|
2916
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2917
|
-
responseCode:
|
|
2918
|
-
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),
|
|
2919
3058
|
error: makeErrorResponseSchema()
|
|
2920
3059
|
});
|
|
2921
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
3060
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v432.z.discriminatedUnion("errorCode", [
|
|
2922
3061
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2923
3062
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2924
3063
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2925
3064
|
]);
|
|
2926
3065
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2927
|
-
return
|
|
3066
|
+
return import_v432.z.discriminatedUnion("responseCode", [
|
|
2928
3067
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2929
3068
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2930
3069
|
]);
|
|
@@ -2937,7 +3076,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2937
3076
|
);
|
|
2938
3077
|
if (parsed.error) {
|
|
2939
3078
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2940
|
-
${(0,
|
|
3079
|
+
${(0, import_v433.prettifyError)(parsed.error)}
|
|
2941
3080
|
`);
|
|
2942
3081
|
}
|
|
2943
3082
|
return parsed.data;
|
|
@@ -3011,14 +3150,14 @@ function serializeNameTokensResponse(response) {
|
|
|
3011
3150
|
}
|
|
3012
3151
|
|
|
3013
3152
|
// src/ensnode/api/registrar-actions/deserialize.ts
|
|
3014
|
-
var
|
|
3153
|
+
var import_v437 = require("zod/v4");
|
|
3015
3154
|
|
|
3016
3155
|
// src/ensnode/api/registrar-actions/zod-schemas.ts
|
|
3017
3156
|
var import_enssdk7 = require("enssdk");
|
|
3018
|
-
var
|
|
3157
|
+
var import_v436 = require("zod/v4");
|
|
3019
3158
|
|
|
3020
3159
|
// src/registrars/zod-schemas.ts
|
|
3021
|
-
var
|
|
3160
|
+
var import_v434 = require("zod/v4");
|
|
3022
3161
|
|
|
3023
3162
|
// src/registrars/encoded-referrer.ts
|
|
3024
3163
|
var import_enssdk6 = require("enssdk");
|
|
@@ -3092,11 +3231,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
3092
3231
|
}
|
|
3093
3232
|
|
|
3094
3233
|
// src/registrars/zod-schemas.ts
|
|
3095
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
3234
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v434.z.object({
|
|
3096
3235
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
3097
3236
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
3098
3237
|
});
|
|
3099
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
3238
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v434.z.object({
|
|
3100
3239
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
3101
3240
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
3102
3241
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -3112,18 +3251,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
3112
3251
|
});
|
|
3113
3252
|
}
|
|
3114
3253
|
}
|
|
3115
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
3254
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v434.z.union([
|
|
3116
3255
|
// pricing available
|
|
3117
|
-
|
|
3256
|
+
import_v434.z.object({
|
|
3118
3257
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
3119
3258
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
3120
3259
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
3121
3260
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
3122
3261
|
// pricing unknown
|
|
3123
|
-
|
|
3124
|
-
baseCost:
|
|
3125
|
-
premium:
|
|
3126
|
-
total:
|
|
3262
|
+
import_v434.z.object({
|
|
3263
|
+
baseCost: import_v434.z.null(),
|
|
3264
|
+
premium: import_v434.z.null(),
|
|
3265
|
+
total: import_v434.z.null()
|
|
3127
3266
|
}).transform((v) => v)
|
|
3128
3267
|
]);
|
|
3129
3268
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -3146,9 +3285,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
3146
3285
|
});
|
|
3147
3286
|
}
|
|
3148
3287
|
}
|
|
3149
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
3288
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v434.z.union([
|
|
3150
3289
|
// referral available
|
|
3151
|
-
|
|
3290
|
+
import_v434.z.object({
|
|
3152
3291
|
encodedReferrer: makeHexStringSchema(
|
|
3153
3292
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
3154
3293
|
`${valueLabel} Encoded Referrer`
|
|
@@ -3156,9 +3295,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
3156
3295
|
decodedReferrer: makeNormalizedAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
3157
3296
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
3158
3297
|
// referral not applicable
|
|
3159
|
-
|
|
3160
|
-
encodedReferrer:
|
|
3161
|
-
decodedReferrer:
|
|
3298
|
+
import_v434.z.object({
|
|
3299
|
+
encodedReferrer: import_v434.z.null(),
|
|
3300
|
+
decodedReferrer: import_v434.z.null()
|
|
3162
3301
|
})
|
|
3163
3302
|
]);
|
|
3164
3303
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -3171,9 +3310,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
3171
3310
|
});
|
|
3172
3311
|
}
|
|
3173
3312
|
}
|
|
3174
|
-
var EventIdSchema =
|
|
3175
|
-
var EventIdsSchema =
|
|
3176
|
-
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({
|
|
3177
3316
|
id: EventIdSchema,
|
|
3178
3317
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
3179
3318
|
registrant: makeNormalizedAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -3188,36 +3327,36 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => ma
|
|
|
3188
3327
|
invariant_eventIdsInitialElementIsTheActionId
|
|
3189
3328
|
);
|
|
3190
3329
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3191
|
-
type:
|
|
3330
|
+
type: import_v434.z.literal(RegistrarActionTypes.Registration)
|
|
3192
3331
|
});
|
|
3193
3332
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3194
|
-
type:
|
|
3333
|
+
type: import_v434.z.literal(RegistrarActionTypes.Renewal)
|
|
3195
3334
|
});
|
|
3196
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3335
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v434.z.discriminatedUnion("type", [
|
|
3197
3336
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
3198
3337
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
3199
3338
|
]);
|
|
3200
3339
|
|
|
3201
3340
|
// src/ensnode/api/shared/pagination/zod-schemas.ts
|
|
3202
|
-
var
|
|
3341
|
+
var import_v435 = require("zod/v4");
|
|
3203
3342
|
|
|
3204
3343
|
// src/ensnode/api/shared/pagination/request.ts
|
|
3205
3344
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
3206
3345
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
3207
3346
|
|
|
3208
3347
|
// src/ensnode/api/shared/pagination/zod-schemas.ts
|
|
3209
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3348
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v435.z.object({
|
|
3210
3349
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3211
3350
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3212
3351
|
RECORDS_PER_PAGE_MAX,
|
|
3213
3352
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
3214
3353
|
)
|
|
3215
3354
|
});
|
|
3216
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
3217
|
-
totalRecords:
|
|
3218
|
-
totalPages:
|
|
3219
|
-
hasNext:
|
|
3220
|
-
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)
|
|
3221
3360
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
3222
3361
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
3223
3362
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3252,15 +3391,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3252
3391
|
});
|
|
3253
3392
|
}
|
|
3254
3393
|
}
|
|
3255
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3394
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v435.z.object({
|
|
3256
3395
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3257
3396
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3258
|
-
hasNext:
|
|
3259
|
-
hasPrev:
|
|
3397
|
+
hasNext: import_v435.z.boolean(),
|
|
3398
|
+
hasPrev: import_v435.z.boolean(),
|
|
3260
3399
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3261
3400
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3262
3401
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3263
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3402
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v435.z.union([
|
|
3264
3403
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3265
3404
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3266
3405
|
]);
|
|
@@ -3290,21 +3429,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3290
3429
|
});
|
|
3291
3430
|
}
|
|
3292
3431
|
}
|
|
3293
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3432
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v436.z.object({
|
|
3294
3433
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3295
3434
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3296
3435
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3297
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3298
|
-
responseCode:
|
|
3299
|
-
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)),
|
|
3300
3439
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3301
3440
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3302
3441
|
});
|
|
3303
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3304
|
-
responseCode:
|
|
3442
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v436.z.strictObject({
|
|
3443
|
+
responseCode: import_v436.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3305
3444
|
error: makeErrorResponseSchema()
|
|
3306
3445
|
});
|
|
3307
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3446
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v436.z.discriminatedUnion("responseCode", [
|
|
3308
3447
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3309
3448
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3310
3449
|
]);
|
|
@@ -3315,7 +3454,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3315
3454
|
if (parsed.error) {
|
|
3316
3455
|
throw new Error(
|
|
3317
3456
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3318
|
-
${(0,
|
|
3457
|
+
${(0, import_v437.prettifyError)(parsed.error)}
|
|
3319
3458
|
`
|
|
3320
3459
|
);
|
|
3321
3460
|
}
|
|
@@ -3452,12 +3591,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3452
3591
|
}
|
|
3453
3592
|
|
|
3454
3593
|
// src/ensnode/api/shared/errors/deserialize.ts
|
|
3455
|
-
var
|
|
3594
|
+
var import_v438 = require("zod/v4");
|
|
3456
3595
|
function deserializeErrorResponse2(maybeErrorResponse) {
|
|
3457
3596
|
const parsed = makeErrorResponseSchema().safeParse(maybeErrorResponse);
|
|
3458
3597
|
if (parsed.error) {
|
|
3459
3598
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3460
|
-
${(0,
|
|
3599
|
+
${(0, import_v438.prettifyError)(parsed.error)}
|
|
3461
3600
|
`);
|
|
3462
3601
|
}
|
|
3463
3602
|
return parsed.data;
|
|
@@ -3987,51 +4126,18 @@ var EnsNodeClient = class _EnsNodeClient {
|
|
|
3987
4126
|
}
|
|
3988
4127
|
};
|
|
3989
4128
|
|
|
3990
|
-
// src/
|
|
3991
|
-
var
|
|
3992
|
-
|
|
3993
|
-
// src/identity/types.ts
|
|
3994
|
-
var ResolutionStatusIds = {
|
|
3995
|
-
/**
|
|
3996
|
-
* Represents that the `Identity` is not resolved yet.
|
|
3997
|
-
*/
|
|
3998
|
-
Unresolved: "unresolved",
|
|
3999
|
-
/**
|
|
4000
|
-
* Represents that resolution of the `Identity` resulted in a named identity.
|
|
4001
|
-
*/
|
|
4002
|
-
Named: "named",
|
|
4003
|
-
/**
|
|
4004
|
-
* Represents that resolution of the `Identity` resulted in an unnamed identity.
|
|
4005
|
-
*/
|
|
4006
|
-
Unnamed: "unnamed",
|
|
4007
|
-
/**
|
|
4008
|
-
* Represents that attempted resolution of the `Identity` resulted in an error
|
|
4009
|
-
* and therefore it is unknown if the `Identity` resolves to a named or unnamed identity.
|
|
4010
|
-
*/
|
|
4011
|
-
Unknown: "unknown"
|
|
4012
|
-
};
|
|
4013
|
-
|
|
4014
|
-
// src/identity/identity.ts
|
|
4015
|
-
function buildUnresolvedIdentity(address, namespaceId, chainId) {
|
|
4016
|
-
return {
|
|
4017
|
-
resolutionStatus: ResolutionStatusIds.Unresolved,
|
|
4018
|
-
chainId: chainId ?? (0, import_datasources6.getENSRootChainId)(namespaceId),
|
|
4019
|
-
address
|
|
4020
|
-
};
|
|
4021
|
-
}
|
|
4022
|
-
function isResolvedIdentity(identity) {
|
|
4023
|
-
return identity.resolutionStatus !== ResolutionStatusIds.Unresolved;
|
|
4024
|
-
}
|
|
4129
|
+
// src/ensnode/metadata/deserialize/indexing-metadata-context.ts
|
|
4130
|
+
var import_v446 = require("zod/v4");
|
|
4025
4131
|
|
|
4026
4132
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
4027
|
-
var
|
|
4133
|
+
var import_v439 = require("zod/v4");
|
|
4028
4134
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4029
4135
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4030
4136
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4031
4137
|
if (parsed.error) {
|
|
4032
4138
|
throw new Error(
|
|
4033
4139
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4034
|
-
${(0,
|
|
4140
|
+
${(0, import_v439.prettifyError)(parsed.error)}
|
|
4035
4141
|
`
|
|
4036
4142
|
);
|
|
4037
4143
|
}
|
|
@@ -4049,121 +4155,256 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4049
4155
|
}
|
|
4050
4156
|
|
|
4051
4157
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4052
|
-
var
|
|
4158
|
+
var import_v440 = require("zod/v4");
|
|
4053
4159
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4054
4160
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4055
4161
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4056
4162
|
if (parsed.error) {
|
|
4057
4163
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4058
|
-
${(0,
|
|
4164
|
+
${(0, import_v440.prettifyError)(parsed.error)}
|
|
4059
4165
|
`);
|
|
4060
4166
|
}
|
|
4061
4167
|
return parsed.data;
|
|
4062
4168
|
}
|
|
4063
4169
|
|
|
4064
4170
|
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
4065
|
-
var
|
|
4171
|
+
var import_v441 = require("zod/v4");
|
|
4066
4172
|
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
4067
4173
|
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
4068
4174
|
const parsed = schema.safeParse(unvalidatedProjection);
|
|
4069
4175
|
if (parsed.error) {
|
|
4070
4176
|
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
4071
|
-
${(0,
|
|
4177
|
+
${(0, import_v441.prettifyError)(parsed.error)}
|
|
4072
4178
|
`);
|
|
4073
4179
|
}
|
|
4074
4180
|
return parsed.data;
|
|
4075
4181
|
}
|
|
4076
4182
|
|
|
4077
|
-
// src/
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
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;
|
|
4085
4193
|
}
|
|
4086
4194
|
|
|
4087
|
-
// src/
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
return (0, import_enssdk8.asInterpretedName)("base.eth");
|
|
4105
|
-
case import_datasources7.ENSNamespaceIds.Sepolia:
|
|
4106
|
-
case import_datasources7.ENSNamespaceIds.SepoliaV2:
|
|
4107
|
-
return (0, import_enssdk8.asInterpretedName)("basetest.eth");
|
|
4108
|
-
case import_datasources7.ENSNamespaceIds.EnsTestEnv:
|
|
4109
|
-
throw new Error(
|
|
4110
|
-
`No registrar managed name is known for the 'basenames' subregistry within the "${namespaceId}" namespace.`
|
|
4111
|
-
);
|
|
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
|
+
`);
|
|
4112
4212
|
}
|
|
4213
|
+
return parsed.data;
|
|
4113
4214
|
}
|
|
4114
4215
|
|
|
4115
|
-
// src/
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
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
|
+
`);
|
|
4122
4283
|
}
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
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);
|
|
4126
4329
|
}
|
|
4127
|
-
return { chainId: datasource.chain.id, address };
|
|
4128
4330
|
}
|
|
4129
|
-
function
|
|
4130
|
-
|
|
4131
|
-
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
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
|
+
);
|
|
4136
4340
|
}
|
|
4341
|
+
return parsed.data;
|
|
4137
4342
|
}
|
|
4138
4343
|
|
|
4139
|
-
// src/
|
|
4140
|
-
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
}
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
switch (namespaceId) {
|
|
4155
|
-
case import_datasources9.ENSNamespaceIds.Mainnet:
|
|
4156
|
-
return (0, import_enssdk10.asInterpretedName)("linea.eth");
|
|
4157
|
-
case import_datasources9.ENSNamespaceIds.Sepolia:
|
|
4158
|
-
case import_datasources9.ENSNamespaceIds.SepoliaV2:
|
|
4159
|
-
return (0, import_enssdk10.asInterpretedName)("linea-sepolia.eth");
|
|
4160
|
-
case import_datasources9.ENSNamespaceIds.EnsTestEnv:
|
|
4161
|
-
throw new Error(
|
|
4162
|
-
`No registrar managed name is known for the 'Lineanames' subregistry within the "${namespaceId}" namespace.`
|
|
4163
|
-
);
|
|
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);
|
|
4164
4359
|
}
|
|
4165
4360
|
}
|
|
4166
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
|
+
|
|
4167
4408
|
// src/registrars/registration-expiration.ts
|
|
4168
4409
|
function isRegistrationExpired(info, now) {
|
|
4169
4410
|
if (info.expiry == null) return false;
|
|
@@ -4180,15 +4421,15 @@ function isRegistrationInGracePeriod(info, now) {
|
|
|
4180
4421
|
}
|
|
4181
4422
|
|
|
4182
4423
|
// src/resolution/ensip19-chainid.ts
|
|
4183
|
-
var
|
|
4424
|
+
var import_enssdk8 = require("enssdk");
|
|
4184
4425
|
var import_chains = require("viem/chains");
|
|
4185
|
-
var
|
|
4426
|
+
var import_datasources7 = require("@ensnode/datasources");
|
|
4186
4427
|
var getResolvePrimaryNameChainIdParam = (chainId, namespaceId) => {
|
|
4187
|
-
const ensRootChainId = (0,
|
|
4428
|
+
const ensRootChainId = (0, import_datasources7.getENSRootChainId)(namespaceId);
|
|
4188
4429
|
return chainId === ensRootChainId ? import_chains.mainnet.id : chainId;
|
|
4189
4430
|
};
|
|
4190
4431
|
var translateDefaultableChainIdToChainId = (chainId, namespaceId) => {
|
|
4191
|
-
return chainId ===
|
|
4432
|
+
return chainId === import_enssdk8.DEFAULT_EVM_CHAIN_ID ? (0, import_datasources7.getENSRootChainId)(namespaceId) : chainId;
|
|
4192
4433
|
};
|
|
4193
4434
|
|
|
4194
4435
|
// src/resolution/resolver-records-selection.ts
|
|
@@ -4251,13 +4492,13 @@ var import_getUnixTime2 = require("date-fns/getUnixTime");
|
|
|
4251
4492
|
var import_getUnixTime = require("date-fns/getUnixTime");
|
|
4252
4493
|
|
|
4253
4494
|
// src/shared/deserialize.ts
|
|
4254
|
-
var
|
|
4495
|
+
var import_v447 = __toESM(require("zod/v4"), 1);
|
|
4255
4496
|
function deserializeChainId(maybeChainId, valueLabel) {
|
|
4256
4497
|
const schema = makeChainIdStringSchema(valueLabel);
|
|
4257
4498
|
const parsed = schema.safeParse(maybeChainId);
|
|
4258
4499
|
if (parsed.error) {
|
|
4259
4500
|
throw new Error(`Cannot deserialize ChainId:
|
|
4260
|
-
${(0,
|
|
4501
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4261
4502
|
`);
|
|
4262
4503
|
}
|
|
4263
4504
|
return parsed.data;
|
|
@@ -4267,7 +4508,7 @@ function deserializeDatetime(maybeDatetime, valueLabel) {
|
|
|
4267
4508
|
const parsed = schema.safeParse(maybeDatetime);
|
|
4268
4509
|
if (parsed.error) {
|
|
4269
4510
|
throw new Error(`Cannot deserialize Datetime:
|
|
4270
|
-
${(0,
|
|
4511
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4271
4512
|
`);
|
|
4272
4513
|
}
|
|
4273
4514
|
return parsed.data;
|
|
@@ -4277,7 +4518,7 @@ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
|
|
|
4277
4518
|
const parsed = schema.safeParse(maybeTimestamp);
|
|
4278
4519
|
if (parsed.error) {
|
|
4279
4520
|
throw new Error(`Cannot deserialize Unix Timestamp:
|
|
4280
|
-
${(0,
|
|
4521
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4281
4522
|
`);
|
|
4282
4523
|
}
|
|
4283
4524
|
return parsed.data;
|
|
@@ -4287,7 +4528,7 @@ function deserializeUrl(maybeUrl, valueLabel) {
|
|
|
4287
4528
|
const parsed = schema.safeParse(maybeUrl);
|
|
4288
4529
|
if (parsed.error) {
|
|
4289
4530
|
throw new Error(`Cannot deserialize URL:
|
|
4290
|
-
${(0,
|
|
4531
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4291
4532
|
`);
|
|
4292
4533
|
}
|
|
4293
4534
|
return parsed.data;
|
|
@@ -4297,7 +4538,7 @@ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
|
|
|
4297
4538
|
const parsed = schema.safeParse(maybeBlockNumber);
|
|
4298
4539
|
if (parsed.error) {
|
|
4299
4540
|
throw new Error(`Cannot deserialize BlockNumber:
|
|
4300
|
-
${(0,
|
|
4541
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4301
4542
|
`);
|
|
4302
4543
|
}
|
|
4303
4544
|
return parsed.data;
|
|
@@ -4307,17 +4548,17 @@ function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
|
4307
4548
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
4308
4549
|
if (parsed.error) {
|
|
4309
4550
|
throw new Error(`Cannot deserialize BlockRef:
|
|
4310
|
-
${(0,
|
|
4551
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4311
4552
|
`);
|
|
4312
4553
|
}
|
|
4313
4554
|
return parsed.data;
|
|
4314
4555
|
}
|
|
4315
4556
|
function deserializeDuration(maybeDuration, valueLabel) {
|
|
4316
|
-
const schema =
|
|
4557
|
+
const schema = import_v447.default.coerce.number().pipe(makeDurationSchema(valueLabel));
|
|
4317
4558
|
const parsed = schema.safeParse(maybeDuration);
|
|
4318
4559
|
if (parsed.error) {
|
|
4319
4560
|
throw new RangeError(`Cannot deserialize Duration:
|
|
4320
|
-
${(0,
|
|
4561
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4321
4562
|
`);
|
|
4322
4563
|
}
|
|
4323
4564
|
return parsed.data;
|
|
@@ -4327,7 +4568,7 @@ function parseAccountId(maybeAccountId, valueLabel) {
|
|
|
4327
4568
|
const parsed = schema.safeParse(maybeAccountId);
|
|
4328
4569
|
if (parsed.error) {
|
|
4329
4570
|
throw new RangeError(`Cannot deserialize AccountId:
|
|
4330
|
-
${(0,
|
|
4571
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4331
4572
|
`);
|
|
4332
4573
|
}
|
|
4333
4574
|
return parsed.data;
|
|
@@ -4337,7 +4578,7 @@ function deserializePriceEth(maybePrice, valueLabel) {
|
|
|
4337
4578
|
const parsed = schema.safeParse(maybePrice);
|
|
4338
4579
|
if (parsed.error) {
|
|
4339
4580
|
throw new Error(`Cannot deserialize PriceEth:
|
|
4340
|
-
${(0,
|
|
4581
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4341
4582
|
`);
|
|
4342
4583
|
}
|
|
4343
4584
|
return parsed.data;
|
|
@@ -4347,7 +4588,7 @@ function deserializePriceUsdc(maybePrice, valueLabel) {
|
|
|
4347
4588
|
const parsed = schema.safeParse(maybePrice);
|
|
4348
4589
|
if (parsed.error) {
|
|
4349
4590
|
throw new Error(`Cannot deserialize PriceUsdc:
|
|
4350
|
-
${(0,
|
|
4591
|
+
${(0, import_v447.prettifyError)(parsed.error)}
|
|
4351
4592
|
`);
|
|
4352
4593
|
}
|
|
4353
4594
|
return parsed.data;
|
|
@@ -4357,7 +4598,17 @@ function deserializePriceDai(maybePrice, valueLabel) {
|
|
|
4357
4598
|
const parsed = schema.safeParse(maybePrice);
|
|
4358
4599
|
if (parsed.error) {
|
|
4359
4600
|
throw new Error(`Cannot deserialize PriceDai:
|
|
4360
|
-
${(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)}
|
|
4361
4612
|
`);
|
|
4362
4613
|
}
|
|
4363
4614
|
return parsed.data;
|
|
@@ -4509,12 +4760,12 @@ var TtlCache = class {
|
|
|
4509
4760
|
};
|
|
4510
4761
|
|
|
4511
4762
|
// src/shared/config/indexed-blockranges.ts
|
|
4512
|
-
var
|
|
4763
|
+
var import_datasources8 = require("@ensnode/datasources");
|
|
4513
4764
|
function buildIndexedBlockranges(namespace, pluginsDatasourceNames) {
|
|
4514
4765
|
const indexedBlockranges = /* @__PURE__ */ new Map();
|
|
4515
4766
|
for (const [, datasourceNames] of pluginsDatasourceNames) {
|
|
4516
4767
|
for (const datasourceName of datasourceNames) {
|
|
4517
|
-
const datasource = (0,
|
|
4768
|
+
const datasource = (0, import_datasources8.maybeGetDatasource)(namespace, datasourceName);
|
|
4518
4769
|
if (!datasource) continue;
|
|
4519
4770
|
const datasourceChainId = datasource.chain.id;
|
|
4520
4771
|
const datasourceContracts = Object.values(datasource.contracts);
|
|
@@ -4542,7 +4793,7 @@ var import_viem9 = require("viem");
|
|
|
4542
4793
|
var interpretAddress = (owner) => (0, import_viem9.isAddressEqual)(import_viem9.zeroAddress, owner) ? null : owner;
|
|
4543
4794
|
|
|
4544
4795
|
// src/shared/interpretation/interpret-record-values.ts
|
|
4545
|
-
var
|
|
4796
|
+
var import_enssdk9 = require("enssdk");
|
|
4546
4797
|
var import_viem10 = require("viem");
|
|
4547
4798
|
|
|
4548
4799
|
// src/shared/null-bytes.ts
|
|
@@ -4552,7 +4803,7 @@ var stripNullBytes = (value) => value.replaceAll("\0", "");
|
|
|
4552
4803
|
// src/shared/interpretation/interpret-record-values.ts
|
|
4553
4804
|
function interpretNameRecordValue(value) {
|
|
4554
4805
|
if (value === "") return null;
|
|
4555
|
-
if (!(0,
|
|
4806
|
+
if (!(0, import_enssdk9.isInterpretedName)(value)) return null;
|
|
4556
4807
|
return value;
|
|
4557
4808
|
}
|
|
4558
4809
|
function interpretAddressRecordValue(value) {
|
|
@@ -4561,7 +4812,7 @@ function interpretAddressRecordValue(value) {
|
|
|
4561
4812
|
if (value === "0x") return null;
|
|
4562
4813
|
if (!(0, import_viem10.isAddress)(value, { strict: false })) return value;
|
|
4563
4814
|
if ((0, import_viem10.isAddressEqual)(value, import_viem10.zeroAddress)) return null;
|
|
4564
|
-
return (0,
|
|
4815
|
+
return (0, import_enssdk9.toNormalizedAddress)(value);
|
|
4565
4816
|
}
|
|
4566
4817
|
function interpretTextRecordKey(key) {
|
|
4567
4818
|
if (hasNullByte(key)) return null;
|
|
@@ -4589,24 +4840,216 @@ function interpretDnszonehashValue(value) {
|
|
|
4589
4840
|
return value;
|
|
4590
4841
|
}
|
|
4591
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
|
+
|
|
4592
4995
|
// src/shared/namespace-specific-value.ts
|
|
4593
4996
|
function getNamespaceSpecificValue(namespace, value) {
|
|
4594
4997
|
return value[namespace] ?? value.default;
|
|
4595
4998
|
}
|
|
4596
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
|
+
|
|
4597
5012
|
// src/shared/root-registry.ts
|
|
4598
|
-
var
|
|
4599
|
-
var
|
|
4600
|
-
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));
|
|
4601
5017
|
var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
|
|
4602
|
-
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace,
|
|
4603
|
-
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));
|
|
4604
5020
|
var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
|
|
4605
|
-
var maybeGetENSv2RootRegistry = (namespace) => maybeGetDatasourceContract(namespace,
|
|
5021
|
+
var maybeGetENSv2RootRegistry = (namespace) => maybeGetDatasourceContract(namespace, import_datasources10.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
4606
5022
|
var maybeGetENSv2RootRegistryId = (namespace) => {
|
|
4607
5023
|
const root = maybeGetENSv2RootRegistry(namespace);
|
|
4608
5024
|
if (!root) return void 0;
|
|
4609
|
-
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);
|
|
4610
5053
|
};
|
|
4611
5054
|
|
|
4612
5055
|
// src/shared/url.ts
|
|
@@ -4617,16 +5060,6 @@ function isWebSocketProtocol(url) {
|
|
|
4617
5060
|
return ["ws:", "wss:"].includes(url.protocol);
|
|
4618
5061
|
}
|
|
4619
5062
|
|
|
4620
|
-
// src/stack-info/ensnode-stack-info.ts
|
|
4621
|
-
function buildEnsNodeStackInfo(ensApiPublicConfig, ensDbPublicConfig) {
|
|
4622
|
-
return {
|
|
4623
|
-
ensApi: ensApiPublicConfig,
|
|
4624
|
-
ensDb: ensDbPublicConfig,
|
|
4625
|
-
ensIndexer: ensApiPublicConfig.ensIndexerPublicConfig,
|
|
4626
|
-
ensRainbow: ensApiPublicConfig.ensIndexerPublicConfig.ensRainbowPublicConfig
|
|
4627
|
-
};
|
|
4628
|
-
}
|
|
4629
|
-
|
|
4630
5063
|
// src/subgraph-api/prerequisites.ts
|
|
4631
5064
|
function hasSubgraphApiConfigSupport(config) {
|
|
4632
5065
|
const supported = config.plugins.includes("subgraph" /* Subgraph */);
|