@ensnode/ensnode-sdk 0.0.0-next-20260422175343 → 0.0.0-next-20260424124838
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 +324 -167
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +113 -38
- package/dist/index.d.ts +113 -38
- package/dist/index.js +237 -80
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -82,6 +82,7 @@ __export(index_exports, {
|
|
|
82
82
|
buildBlockRefRange: () => buildBlockRefRange,
|
|
83
83
|
buildCrossChainIndexingStatusSnapshotOmnichain: () => buildCrossChainIndexingStatusSnapshotOmnichain,
|
|
84
84
|
buildEncodedReferrer: () => buildEncodedReferrer,
|
|
85
|
+
buildEnsIndexerStackInfo: () => buildEnsIndexerStackInfo,
|
|
85
86
|
buildEnsNodeStackInfo: () => buildEnsNodeStackInfo,
|
|
86
87
|
buildEnsRainbowClientLabelSet: () => buildEnsRainbowClientLabelSet,
|
|
87
88
|
buildIndexedBlockranges: () => buildIndexedBlockranges,
|
|
@@ -93,6 +94,7 @@ __export(index_exports, {
|
|
|
93
94
|
buildUnvalidatedCrossChainIndexingStatusSnapshot: () => buildUnvalidatedCrossChainIndexingStatusSnapshot,
|
|
94
95
|
buildUnvalidatedEnsApiPublicConfig: () => buildUnvalidatedEnsApiPublicConfig,
|
|
95
96
|
buildUnvalidatedEnsIndexerPublicConfig: () => buildUnvalidatedEnsIndexerPublicConfig,
|
|
97
|
+
buildUnvalidatedEnsIndexerStackInfo: () => buildUnvalidatedEnsIndexerStackInfo,
|
|
96
98
|
buildUnvalidatedEnsNodeStackInfo: () => buildUnvalidatedEnsNodeStackInfo,
|
|
97
99
|
buildUnvalidatedOmnichainIndexingStatusSnapshot: () => buildUnvalidatedOmnichainIndexingStatusSnapshot,
|
|
98
100
|
buildUnvalidatedRealtimeIndexingStatusProjection: () => buildUnvalidatedRealtimeIndexingStatusProjection,
|
|
@@ -117,6 +119,7 @@ __export(index_exports, {
|
|
|
117
119
|
deserializeEnsIndexerConfigResponse: () => deserializeEnsIndexerConfigResponse,
|
|
118
120
|
deserializeEnsIndexerIndexingStatusResponse: () => deserializeEnsIndexerIndexingStatusResponse,
|
|
119
121
|
deserializeEnsIndexerPublicConfig: () => deserializeEnsIndexerPublicConfig,
|
|
122
|
+
deserializeEnsIndexerStackInfo: () => deserializeEnsIndexerStackInfo,
|
|
120
123
|
deserializeEnsNodeStackInfo: () => deserializeEnsNodeStackInfo,
|
|
121
124
|
deserializeErrorResponse: () => deserializeErrorResponse2,
|
|
122
125
|
deserializeIndexingStatusResponse: () => deserializeIndexingStatusResponse,
|
|
@@ -206,6 +209,7 @@ __export(index_exports, {
|
|
|
206
209
|
priceEth: () => priceEth,
|
|
207
210
|
priceUsdc: () => priceUsdc,
|
|
208
211
|
registrarActionsFilter: () => registrarActionsFilter,
|
|
212
|
+
replaceBigInts: () => replaceBigInts,
|
|
209
213
|
scaleBigintByNumber: () => scaleBigintByNumber,
|
|
210
214
|
scalePrice: () => scalePrice,
|
|
211
215
|
serializeAssetId: () => serializeAssetId,
|
|
@@ -222,6 +226,7 @@ __export(index_exports, {
|
|
|
222
226
|
serializeEnsIndexerConfigResponse: () => serializeEnsIndexerConfigResponse,
|
|
223
227
|
serializeEnsIndexerIndexingStatusResponse: () => serializeEnsIndexerIndexingStatusResponse,
|
|
224
228
|
serializeEnsIndexerPublicConfig: () => serializeEnsIndexerPublicConfig,
|
|
229
|
+
serializeEnsIndexerStackInfo: () => serializeEnsIndexerStackInfo,
|
|
225
230
|
serializeEnsNodeStackInfo: () => serializeEnsNodeStackInfo,
|
|
226
231
|
serializeIndexedChainIds: () => serializeIndexedChainIds,
|
|
227
232
|
serializeIndexingStatusResponse: () => serializeIndexingStatusResponse,
|
|
@@ -242,13 +247,16 @@ __export(index_exports, {
|
|
|
242
247
|
sortChainStatusesByStartBlockAsc: () => sortChainStatusesByStartBlockAsc,
|
|
243
248
|
stripNullBytes: () => stripNullBytes,
|
|
244
249
|
subtractPrice: () => subtractPrice,
|
|
250
|
+
toJson: () => toJson,
|
|
245
251
|
translateDefaultableChainIdToChainId: () => translateDefaultableChainIdToChainId,
|
|
246
252
|
uniq: () => uniq,
|
|
247
253
|
validateChainIndexingStatusSnapshot: () => validateChainIndexingStatusSnapshot,
|
|
248
254
|
validateCrossChainIndexingStatusSnapshot: () => validateCrossChainIndexingStatusSnapshot,
|
|
249
255
|
validateEnsIndexerPublicConfig: () => validateEnsIndexerPublicConfig,
|
|
250
256
|
validateEnsIndexerPublicConfigCompatibility: () => validateEnsIndexerPublicConfigCompatibility,
|
|
257
|
+
validateEnsIndexerStackInfo: () => validateEnsIndexerStackInfo,
|
|
251
258
|
validateEnsIndexerVersionInfo: () => validateEnsIndexerVersionInfo,
|
|
259
|
+
validateEnsNodeStackInfo: () => validateEnsNodeStackInfo,
|
|
252
260
|
validateOmnichainIndexingStatusSnapshot: () => validateOmnichainIndexingStatusSnapshot,
|
|
253
261
|
validateRealtimeIndexingStatusProjection: () => validateRealtimeIndexingStatusProjection,
|
|
254
262
|
validateSupportedLabelSetAndVersion: () => validateSupportedLabelSetAndVersion
|
|
@@ -572,14 +580,15 @@ var makeLabelSetIdSchema = (valueLabel = "Label set ID") => {
|
|
|
572
580
|
var makeLabelSetVersionSchema = (valueLabel = "Label set version") => makeNonNegativeIntegerSchema(valueLabel);
|
|
573
581
|
var makeLabelSetVersionStringSchema = (valueLabel = "Label set version") => import_v42.z.coerce.number({ error: `${valueLabel} must be a non-negative integer` }).pipe(makeLabelSetVersionSchema(valueLabel));
|
|
574
582
|
var makeEnsRainbowPublicConfigSchema = (valueLabel = "EnsRainbowPublicConfig") => import_v42.z.object({
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
labelSetId: makeLabelSetIdSchema(`${valueLabel}.labelSet.labelSetId`),
|
|
583
|
+
serverLabelSet: import_v42.z.object({
|
|
584
|
+
labelSetId: makeLabelSetIdSchema(`${valueLabel}.serverLabelSet.labelSetId`),
|
|
578
585
|
highestLabelSetVersion: makeLabelSetVersionSchema(
|
|
579
|
-
`${valueLabel}.
|
|
586
|
+
`${valueLabel}.serverLabelSet.highestLabelSetVersion`
|
|
580
587
|
)
|
|
581
588
|
}),
|
|
582
|
-
|
|
589
|
+
versionInfo: import_v42.z.object({
|
|
590
|
+
ensRainbow: import_v42.z.string().nonempty({ error: `${valueLabel}.versionInfo.ensRainbow must be a non-empty string.` })
|
|
591
|
+
})
|
|
583
592
|
});
|
|
584
593
|
|
|
585
594
|
// src/shared/collections.ts
|
|
@@ -604,8 +613,8 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
604
613
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
605
614
|
function isSubgraphCompatible(config) {
|
|
606
615
|
const onlySubgraphPluginActivated = config.plugins.length === 1 && config.plugins[0] === "subgraph" /* Subgraph */;
|
|
607
|
-
const isSubgraphLabelSet = config.
|
|
608
|
-
const isEnsTestEnvLabelSet = config.
|
|
616
|
+
const isSubgraphLabelSet = config.clientLabelSet.labelSetId === "subgraph" && config.clientLabelSet.labelSetVersion === 0;
|
|
617
|
+
const isEnsTestEnvLabelSet = config.clientLabelSet.labelSetId === "ens-test-env" && config.clientLabelSet.labelSetVersion === 0;
|
|
609
618
|
const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === import_datasources2.ENSNamespaceIds.EnsTestEnv && isEnsTestEnvLabelSet;
|
|
610
619
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
611
620
|
}
|
|
@@ -703,13 +712,13 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
703
712
|
ctx.issues.push({
|
|
704
713
|
code: "custom",
|
|
705
714
|
input: config,
|
|
706
|
-
message: `'isSubgraphCompatible' requires only the '${"subgraph" /* Subgraph */}' plugin to be active and
|
|
715
|
+
message: `'isSubgraphCompatible' requires only the '${"subgraph" /* Subgraph */}' plugin to be active and 'clientLabelSet' must be {labelSetId: "subgraph", labelSetVersion: 0}`
|
|
707
716
|
});
|
|
708
717
|
}
|
|
709
718
|
}
|
|
710
719
|
function invariant_ensRainbowSupportedLabelSetAndVersion(ctx) {
|
|
711
|
-
const clientLabelSet = ctx.value
|
|
712
|
-
const serverLabelSet = ctx.value.ensRainbowPublicConfig
|
|
720
|
+
const { clientLabelSet } = ctx.value;
|
|
721
|
+
const { serverLabelSet } = ctx.value.ensRainbowPublicConfig;
|
|
713
722
|
try {
|
|
714
723
|
validateSupportedLabelSetAndVersion(serverLabelSet, clientLabelSet);
|
|
715
724
|
} catch (error) {
|
|
@@ -730,7 +739,7 @@ var makeEnsIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") =
|
|
|
730
739
|
isSubgraphCompatible: import_v43.z.boolean({
|
|
731
740
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
732
741
|
}),
|
|
733
|
-
|
|
742
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
734
743
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
735
744
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
736
745
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -744,7 +753,7 @@ var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIn
|
|
|
744
753
|
isSubgraphCompatible: import_v43.z.boolean({
|
|
745
754
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
746
755
|
}),
|
|
747
|
-
|
|
756
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
748
757
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
749
758
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
750
759
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -844,7 +853,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
844
853
|
ensRainbowPublicConfig,
|
|
845
854
|
indexedChainIds,
|
|
846
855
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
847
|
-
|
|
856
|
+
clientLabelSet,
|
|
848
857
|
namespace,
|
|
849
858
|
plugins,
|
|
850
859
|
versionInfo
|
|
@@ -854,7 +863,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
854
863
|
ensRainbowPublicConfig,
|
|
855
864
|
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
856
865
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
857
|
-
|
|
866
|
+
clientLabelSet,
|
|
858
867
|
namespace,
|
|
859
868
|
plugins,
|
|
860
869
|
versionInfo
|
|
@@ -2099,21 +2108,21 @@ function validateEnsIndexerPublicConfigCompatibility(configA, configB) {
|
|
|
2099
2108
|
].join(" ")
|
|
2100
2109
|
);
|
|
2101
2110
|
}
|
|
2102
|
-
if (configA.
|
|
2111
|
+
if (configA.clientLabelSet.labelSetId !== configB.clientLabelSet.labelSetId) {
|
|
2103
2112
|
throw new Error(
|
|
2104
2113
|
[
|
|
2105
|
-
`'
|
|
2106
|
-
`Stored Config '
|
|
2107
|
-
`Current Config '
|
|
2114
|
+
`'clientLabelSet.labelSetId' must be compatible.`,
|
|
2115
|
+
`Stored Config 'clientLabelSet.labelSetId': '${configA.clientLabelSet.labelSetId}'.`,
|
|
2116
|
+
`Current Config 'clientLabelSet.labelSetId': '${configB.clientLabelSet.labelSetId}'.`
|
|
2108
2117
|
].join(" ")
|
|
2109
2118
|
);
|
|
2110
2119
|
}
|
|
2111
|
-
if (configA.
|
|
2120
|
+
if (configA.clientLabelSet.labelSetVersion !== configB.clientLabelSet.labelSetVersion) {
|
|
2112
2121
|
throw new Error(
|
|
2113
2122
|
[
|
|
2114
|
-
`'
|
|
2115
|
-
`Stored Config '
|
|
2116
|
-
`Current Config '
|
|
2123
|
+
`'clientLabelSet.labelSetVersion' must be compatible.`,
|
|
2124
|
+
`Stored Config 'clientLabelSet.labelSetVersion': '${configA.clientLabelSet.labelSetVersion}'.`,
|
|
2125
|
+
`Current Config 'clientLabelSet.labelSetVersion': '${configB.clientLabelSet.labelSetVersion}'.`
|
|
2117
2126
|
].join(" ")
|
|
2118
2127
|
);
|
|
2119
2128
|
}
|
|
@@ -2204,12 +2213,12 @@ function validateEnsIndexerVersionInfo(unvalidatedVersionInfo) {
|
|
|
2204
2213
|
}
|
|
2205
2214
|
|
|
2206
2215
|
// src/ensnode/api/indexing-status/deserialize.ts
|
|
2207
|
-
var
|
|
2216
|
+
var import_v428 = require("zod/v4");
|
|
2208
2217
|
|
|
2209
2218
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
2210
|
-
var
|
|
2219
|
+
var import_v426 = require("zod/v4");
|
|
2211
2220
|
|
|
2212
|
-
// src/stack-info/zod-schemas/
|
|
2221
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
2213
2222
|
var import_v424 = require("zod/v4");
|
|
2214
2223
|
|
|
2215
2224
|
// src/ensdb/zod-schemas/config.ts
|
|
@@ -2218,49 +2227,134 @@ var makeEnsDbVersionInfoSchema = (valueLabel) => {
|
|
|
2218
2227
|
const label = valueLabel ?? "EnsDbVersionInfo";
|
|
2219
2228
|
return import_v423.z.object({
|
|
2220
2229
|
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
|
-
})
|
|
2230
|
+
});
|
|
2222
2231
|
};
|
|
2223
2232
|
var makeEnsDbPublicConfigSchema = (valueLabel) => {
|
|
2224
2233
|
const label = valueLabel ?? "EnsDbPublicConfig";
|
|
2225
2234
|
return import_v423.z.object({
|
|
2226
2235
|
versionInfo: makeEnsDbVersionInfoSchema(`${label}.versionInfo`)
|
|
2227
|
-
})
|
|
2236
|
+
});
|
|
2228
2237
|
};
|
|
2229
2238
|
|
|
2230
|
-
// src/stack-info/zod-schemas/
|
|
2231
|
-
function
|
|
2232
|
-
const label = valueLabel ?? "
|
|
2239
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
2240
|
+
function makeSerializedEnsIndexerStackInfoSchema(valueLabel) {
|
|
2241
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
2233
2242
|
return import_v424.z.object({
|
|
2234
|
-
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
2235
2243
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
2236
2244
|
ensIndexer: makeSerializedEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
2237
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2245
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2238
2246
|
});
|
|
2239
2247
|
}
|
|
2240
|
-
function
|
|
2241
|
-
const
|
|
2248
|
+
function invariant_ensRainbowCompatibilityWithEnsIndexer(ctx) {
|
|
2249
|
+
const { ensIndexer, ensRainbow } = ctx.value;
|
|
2250
|
+
const { clientLabelSet } = ensIndexer;
|
|
2251
|
+
const { serverLabelSet } = ensRainbow;
|
|
2252
|
+
if (clientLabelSet.labelSetId !== serverLabelSet.labelSetId) {
|
|
2253
|
+
ctx.issues.push({
|
|
2254
|
+
code: "custom",
|
|
2255
|
+
input: ctx.value,
|
|
2256
|
+
message: `ENSRainbow's label set (id: ${serverLabelSet.labelSetId}) must be the same as ENSIndexer's label set (id: ${clientLabelSet.labelSetId}).`
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
if (clientLabelSet.labelSetVersion > serverLabelSet.highestLabelSetVersion) {
|
|
2260
|
+
ctx.issues.push({
|
|
2261
|
+
code: "custom",
|
|
2262
|
+
input: ctx.value,
|
|
2263
|
+
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}).`
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
function makeEnsIndexerStackInfoSchema(valueLabel) {
|
|
2268
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
2242
2269
|
return import_v424.z.object({
|
|
2243
|
-
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
2244
2270
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
2245
2271
|
ensIndexer: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
2246
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2272
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2273
|
+
}).check(invariant_ensRainbowCompatibilityWithEnsIndexer);
|
|
2274
|
+
}
|
|
2275
|
+
|
|
2276
|
+
// src/stack-info/zod-schemas/ensnode-stack-info.ts
|
|
2277
|
+
function invariant_ensApiCompatibilityWithEnsIndexerAndEnsRainbow(ctx) {
|
|
2278
|
+
const { ensApi, ensIndexer, ensRainbow } = ctx.value;
|
|
2279
|
+
if (ensIndexer.versionInfo.ensDb !== ensApi.versionInfo.ensApi) {
|
|
2280
|
+
ctx.issues.push({
|
|
2281
|
+
code: "custom",
|
|
2282
|
+
path: ["ensIndexer", "versionInfo", "ensDb"],
|
|
2283
|
+
input: ensIndexer.versionInfo.ensDb,
|
|
2284
|
+
message: `Version Mismatch: ENSDB@${ensIndexer.versionInfo.ensDb} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2285
|
+
});
|
|
2286
|
+
}
|
|
2287
|
+
if (ensIndexer.versionInfo.ensIndexer !== ensApi.versionInfo.ensApi) {
|
|
2288
|
+
ctx.issues.push({
|
|
2289
|
+
code: "custom",
|
|
2290
|
+
path: ["ensIndexer", "versionInfo", "ensIndexer"],
|
|
2291
|
+
input: ensIndexer.versionInfo.ensIndexer,
|
|
2292
|
+
message: `Version Mismatch: ENSIndexer@${ensIndexer.versionInfo.ensIndexer} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2293
|
+
});
|
|
2294
|
+
}
|
|
2295
|
+
if (ensRainbow.versionInfo.ensRainbow !== ensApi.versionInfo.ensApi) {
|
|
2296
|
+
ctx.issues.push({
|
|
2297
|
+
code: "custom",
|
|
2298
|
+
path: ["ensRainbow", "versionInfo", "ensRainbow"],
|
|
2299
|
+
input: ensRainbow.versionInfo.ensRainbow,
|
|
2300
|
+
message: `Version Mismatch: ENSRainbow@${ensRainbow.versionInfo.ensRainbow} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2303
|
+
if (ensIndexer.versionInfo.ensNormalize !== ensApi.versionInfo.ensNormalize) {
|
|
2304
|
+
ctx.issues.push({
|
|
2305
|
+
code: "custom",
|
|
2306
|
+
path: ["ensIndexer", "versionInfo", "ensNormalize"],
|
|
2307
|
+
input: ensIndexer.versionInfo.ensNormalize,
|
|
2308
|
+
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}`
|
|
2309
|
+
});
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
function makeSerializedEnsNodeStackInfoSchema(valueLabel) {
|
|
2313
|
+
const label = valueLabel ?? "ENSNodeStackInfo";
|
|
2314
|
+
return makeSerializedEnsIndexerStackInfoSchema(label).extend({
|
|
2315
|
+
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`)
|
|
2247
2316
|
});
|
|
2248
2317
|
}
|
|
2318
|
+
function makeEnsNodeStackInfoSchema(valueLabel) {
|
|
2319
|
+
const label = valueLabel ?? "ENSNodeStackInfo";
|
|
2320
|
+
return makeEnsIndexerStackInfoSchema(label).extend({
|
|
2321
|
+
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`)
|
|
2322
|
+
}).check(invariant_ensApiCompatibilityWithEnsIndexerAndEnsRainbow).check(invariant_ensRainbowCompatibilityWithEnsIndexer);
|
|
2323
|
+
}
|
|
2324
|
+
|
|
2325
|
+
// src/stack-info/deserialize/ensindexer-stack-info.ts
|
|
2326
|
+
var import_v425 = require("zod/v4");
|
|
2327
|
+
function buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo) {
|
|
2328
|
+
const { ensDb, ensRainbow } = serializedStackInfo;
|
|
2329
|
+
const ensIndexer = buildUnvalidatedEnsIndexerPublicConfig(serializedStackInfo.ensIndexer);
|
|
2330
|
+
return {
|
|
2331
|
+
ensDb,
|
|
2332
|
+
ensIndexer,
|
|
2333
|
+
ensRainbow
|
|
2334
|
+
};
|
|
2335
|
+
}
|
|
2336
|
+
function deserializeEnsIndexerStackInfo(maybeStackInfo, valueLabel) {
|
|
2337
|
+
const parsed = makeSerializedEnsIndexerStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsIndexerStackInfo).pipe(makeEnsIndexerStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2338
|
+
if (parsed.error) {
|
|
2339
|
+
throw new Error(`Cannot deserialize EnsIndexerStackInfo:
|
|
2340
|
+
${(0, import_v425.prettifyError)(parsed.error)}
|
|
2341
|
+
`);
|
|
2342
|
+
}
|
|
2343
|
+
return parsed.data;
|
|
2344
|
+
}
|
|
2249
2345
|
|
|
2250
2346
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
2251
2347
|
function buildUnvalidatedEnsNodeStackInfo(serializedStackInfo) {
|
|
2252
|
-
const { ensApi, ensIndexer, ...rest } = serializedStackInfo;
|
|
2253
2348
|
return {
|
|
2254
|
-
...
|
|
2255
|
-
ensApi: buildUnvalidatedEnsApiPublicConfig(ensApi)
|
|
2256
|
-
ensIndexer: buildUnvalidatedEnsIndexerPublicConfig(ensIndexer)
|
|
2349
|
+
...buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo),
|
|
2350
|
+
ensApi: buildUnvalidatedEnsApiPublicConfig(serializedStackInfo.ensApi)
|
|
2257
2351
|
};
|
|
2258
2352
|
}
|
|
2259
2353
|
function deserializeEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
2260
2354
|
const parsed = makeSerializedEnsNodeStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsNodeStackInfo).pipe(makeEnsNodeStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2261
2355
|
if (parsed.error) {
|
|
2262
2356
|
throw new Error(`Cannot deserialize EnsNodeStackInfo:
|
|
2263
|
-
${(0,
|
|
2357
|
+
${(0, import_v426.prettifyError)(parsed.error)}
|
|
2264
2358
|
`);
|
|
2265
2359
|
}
|
|
2266
2360
|
return parsed.data;
|
|
@@ -2280,25 +2374,25 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
2280
2374
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
2281
2375
|
|
|
2282
2376
|
// src/ensnode/api/indexing-status/zod-schemas.ts
|
|
2283
|
-
var
|
|
2284
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
2285
|
-
responseCode:
|
|
2377
|
+
var import_v427 = require("zod/v4");
|
|
2378
|
+
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v427.z.strictObject({
|
|
2379
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2286
2380
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel),
|
|
2287
2381
|
stackInfo: makeEnsNodeStackInfoSchema(valueLabel)
|
|
2288
2382
|
});
|
|
2289
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
2290
|
-
responseCode:
|
|
2383
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v427.z.strictObject({
|
|
2384
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
2291
2385
|
});
|
|
2292
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2386
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
2293
2387
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2294
2388
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2295
2389
|
]);
|
|
2296
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
2297
|
-
responseCode:
|
|
2390
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v427.z.object({
|
|
2391
|
+
responseCode: import_v427.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
2298
2392
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel),
|
|
2299
2393
|
stackInfo: makeSerializedEnsNodeStackInfoSchema(valueLabel)
|
|
2300
2394
|
});
|
|
2301
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
2395
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
2302
2396
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
2303
2397
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
2304
2398
|
]);
|
|
@@ -2320,7 +2414,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
2320
2414
|
if (parsed.error) {
|
|
2321
2415
|
throw new Error(
|
|
2322
2416
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
2323
|
-
${(0,
|
|
2417
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
2324
2418
|
`
|
|
2325
2419
|
);
|
|
2326
2420
|
}
|
|
@@ -2328,13 +2422,26 @@ ${(0, import_v427.prettifyError)(parsed.error)}
|
|
|
2328
2422
|
}
|
|
2329
2423
|
var deserializeIndexingStatusResponse = deserializeEnsApiIndexingStatusResponse;
|
|
2330
2424
|
|
|
2425
|
+
// src/stack-info/serialize/ensindexer-stack-info.ts
|
|
2426
|
+
function serializeEnsIndexerStackInfo(stackInfo) {
|
|
2427
|
+
const {
|
|
2428
|
+
ensDb: serializedEnsDbPublicConfig,
|
|
2429
|
+
ensRainbow: serializedEnsRainbowPublicConfig,
|
|
2430
|
+
ensIndexer
|
|
2431
|
+
} = stackInfo;
|
|
2432
|
+
const serializedEnsIndexerPublicConfig = serializeEnsIndexerPublicConfig(ensIndexer);
|
|
2433
|
+
return {
|
|
2434
|
+
ensDb: serializedEnsDbPublicConfig,
|
|
2435
|
+
ensIndexer: serializedEnsIndexerPublicConfig,
|
|
2436
|
+
ensRainbow: serializedEnsRainbowPublicConfig
|
|
2437
|
+
};
|
|
2438
|
+
}
|
|
2439
|
+
|
|
2331
2440
|
// src/stack-info/serialize/ensnode-stack-info.ts
|
|
2332
2441
|
function serializeEnsNodeStackInfo(stackInfo) {
|
|
2333
2442
|
return {
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
ensIndexer: serializeEnsIndexerPublicConfig(stackInfo.ensIndexer),
|
|
2337
|
-
ensRainbow: stackInfo.ensRainbow
|
|
2443
|
+
...serializeEnsIndexerStackInfo(stackInfo),
|
|
2444
|
+
ensApi: serializeEnsApiPublicConfig(stackInfo.ensApi)
|
|
2338
2445
|
};
|
|
2339
2446
|
}
|
|
2340
2447
|
|
|
@@ -2354,11 +2461,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2354
2461
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2355
2462
|
|
|
2356
2463
|
// src/ensnode/api/name-tokens/deserialize.ts
|
|
2357
|
-
var
|
|
2464
|
+
var import_v433 = require("zod/v4");
|
|
2358
2465
|
|
|
2359
2466
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2360
2467
|
var import_enssdk5 = require("enssdk");
|
|
2361
|
-
var
|
|
2468
|
+
var import_v432 = require("zod/v4");
|
|
2362
2469
|
|
|
2363
2470
|
// src/tokenscope/name-token.ts
|
|
2364
2471
|
var import_enssdk4 = require("enssdk");
|
|
@@ -2400,17 +2507,17 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2400
2507
|
// src/tokenscope/assets.ts
|
|
2401
2508
|
var import_enssdk3 = require("enssdk");
|
|
2402
2509
|
var import_viem6 = require("viem");
|
|
2403
|
-
var
|
|
2510
|
+
var import_v430 = require("zod/v4");
|
|
2404
2511
|
|
|
2405
2512
|
// src/tokenscope/zod-schemas.ts
|
|
2406
2513
|
var import_caip2 = require("caip");
|
|
2407
2514
|
var import_enssdk2 = require("enssdk");
|
|
2408
2515
|
var import_viem5 = require("viem");
|
|
2409
|
-
var
|
|
2410
|
-
var tokenIdSchemaSerializable =
|
|
2411
|
-
var tokenIdSchemaNative =
|
|
2516
|
+
var import_v429 = require("zod/v4");
|
|
2517
|
+
var tokenIdSchemaSerializable = import_v429.z.string();
|
|
2518
|
+
var tokenIdSchemaNative = import_v429.z.preprocess(
|
|
2412
2519
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2413
|
-
|
|
2520
|
+
import_v429.z.bigint().positive()
|
|
2414
2521
|
);
|
|
2415
2522
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2416
2523
|
if (serializable) {
|
|
@@ -2420,13 +2527,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2420
2527
|
}
|
|
2421
2528
|
}
|
|
2422
2529
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2423
|
-
return
|
|
2424
|
-
assetNamespace:
|
|
2530
|
+
return import_v429.z.object({
|
|
2531
|
+
assetNamespace: import_v429.z.enum(import_enssdk2.AssetNamespaces),
|
|
2425
2532
|
contract: makeAccountIdSchema(valueLabel),
|
|
2426
2533
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2427
2534
|
});
|
|
2428
2535
|
};
|
|
2429
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2536
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v429.z.preprocess((v) => {
|
|
2430
2537
|
if (typeof v === "string") {
|
|
2431
2538
|
const result = new import_caip2.AssetId(v);
|
|
2432
2539
|
return {
|
|
@@ -2450,20 +2557,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2450
2557
|
});
|
|
2451
2558
|
}
|
|
2452
2559
|
}
|
|
2453
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2454
|
-
ownershipType:
|
|
2560
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v429.z.object({
|
|
2561
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2455
2562
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2456
2563
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2457
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2458
|
-
ownershipType:
|
|
2564
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v429.z.object({
|
|
2565
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2459
2566
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2460
2567
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2461
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2462
|
-
ownershipType:
|
|
2568
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v429.z.object({
|
|
2569
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2463
2570
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2464
2571
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2465
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2466
|
-
ownershipType:
|
|
2572
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v429.z.object({
|
|
2573
|
+
ownershipType: import_v429.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2467
2574
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2468
2575
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2469
2576
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2476,16 +2583,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2476
2583
|
});
|
|
2477
2584
|
}
|
|
2478
2585
|
}
|
|
2479
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2586
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v429.z.discriminatedUnion("ownershipType", [
|
|
2480
2587
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2481
2588
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2482
2589
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2483
2590
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2484
2591
|
]);
|
|
2485
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2592
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v429.z.object({
|
|
2486
2593
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2487
2594
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2488
|
-
mintStatus:
|
|
2595
|
+
mintStatus: import_v429.z.enum(NFTMintStatuses)
|
|
2489
2596
|
});
|
|
2490
2597
|
|
|
2491
2598
|
// src/tokenscope/assets.ts
|
|
@@ -2501,7 +2608,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2501
2608
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2502
2609
|
if (parsed.error) {
|
|
2503
2610
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2504
|
-
${(0,
|
|
2611
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
2505
2612
|
`);
|
|
2506
2613
|
}
|
|
2507
2614
|
return parsed.data;
|
|
@@ -2511,7 +2618,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2511
2618
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2512
2619
|
if (parsed.error) {
|
|
2513
2620
|
throw new RangeError(`Cannot parse AssetId:
|
|
2514
|
-
${(0,
|
|
2621
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
2515
2622
|
`);
|
|
2516
2623
|
}
|
|
2517
2624
|
return parsed.data;
|
|
@@ -2812,10 +2919,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2812
2919
|
}
|
|
2813
2920
|
|
|
2814
2921
|
// src/ensnode/api/shared/errors/zod-schemas.ts
|
|
2815
|
-
var
|
|
2816
|
-
var makeErrorResponseSchema = () =>
|
|
2817
|
-
message:
|
|
2818
|
-
details:
|
|
2922
|
+
var import_v431 = require("zod/v4");
|
|
2923
|
+
var makeErrorResponseSchema = () => import_v431.z.object({
|
|
2924
|
+
message: import_v431.z.string(),
|
|
2925
|
+
details: import_v431.z.optional(import_v431.z.unknown())
|
|
2819
2926
|
});
|
|
2820
2927
|
|
|
2821
2928
|
// src/ensnode/api/name-tokens/response.ts
|
|
@@ -2854,10 +2961,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2854
2961
|
};
|
|
2855
2962
|
|
|
2856
2963
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2857
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2964
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v432.z.object({
|
|
2858
2965
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2859
2966
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2860
|
-
tokens:
|
|
2967
|
+
tokens: import_v432.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2861
2968
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2862
2969
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2863
2970
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2899,32 +3006,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2899
3006
|
});
|
|
2900
3007
|
}
|
|
2901
3008
|
});
|
|
2902
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2903
|
-
responseCode:
|
|
3009
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v432.z.strictObject({
|
|
3010
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Ok),
|
|
2904
3011
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2905
3012
|
});
|
|
2906
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2907
|
-
responseCode:
|
|
2908
|
-
errorCode:
|
|
3013
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v432.z.strictObject({
|
|
3014
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Error),
|
|
3015
|
+
errorCode: import_v432.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2909
3016
|
error: makeErrorResponseSchema()
|
|
2910
3017
|
});
|
|
2911
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2912
|
-
responseCode:
|
|
2913
|
-
errorCode:
|
|
3018
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v432.z.strictObject({
|
|
3019
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Error),
|
|
3020
|
+
errorCode: import_v432.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2914
3021
|
error: makeErrorResponseSchema()
|
|
2915
3022
|
});
|
|
2916
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2917
|
-
responseCode:
|
|
2918
|
-
errorCode:
|
|
3023
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v432.z.strictObject({
|
|
3024
|
+
responseCode: import_v432.z.literal(NameTokensResponseCodes.Error),
|
|
3025
|
+
errorCode: import_v432.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2919
3026
|
error: makeErrorResponseSchema()
|
|
2920
3027
|
});
|
|
2921
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
3028
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v432.z.discriminatedUnion("errorCode", [
|
|
2922
3029
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2923
3030
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2924
3031
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2925
3032
|
]);
|
|
2926
3033
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2927
|
-
return
|
|
3034
|
+
return import_v432.z.discriminatedUnion("responseCode", [
|
|
2928
3035
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2929
3036
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2930
3037
|
]);
|
|
@@ -2937,7 +3044,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2937
3044
|
);
|
|
2938
3045
|
if (parsed.error) {
|
|
2939
3046
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2940
|
-
${(0,
|
|
3047
|
+
${(0, import_v433.prettifyError)(parsed.error)}
|
|
2941
3048
|
`);
|
|
2942
3049
|
}
|
|
2943
3050
|
return parsed.data;
|
|
@@ -3011,14 +3118,14 @@ function serializeNameTokensResponse(response) {
|
|
|
3011
3118
|
}
|
|
3012
3119
|
|
|
3013
3120
|
// src/ensnode/api/registrar-actions/deserialize.ts
|
|
3014
|
-
var
|
|
3121
|
+
var import_v437 = require("zod/v4");
|
|
3015
3122
|
|
|
3016
3123
|
// src/ensnode/api/registrar-actions/zod-schemas.ts
|
|
3017
3124
|
var import_enssdk7 = require("enssdk");
|
|
3018
|
-
var
|
|
3125
|
+
var import_v436 = require("zod/v4");
|
|
3019
3126
|
|
|
3020
3127
|
// src/registrars/zod-schemas.ts
|
|
3021
|
-
var
|
|
3128
|
+
var import_v434 = require("zod/v4");
|
|
3022
3129
|
|
|
3023
3130
|
// src/registrars/encoded-referrer.ts
|
|
3024
3131
|
var import_enssdk6 = require("enssdk");
|
|
@@ -3092,11 +3199,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
3092
3199
|
}
|
|
3093
3200
|
|
|
3094
3201
|
// src/registrars/zod-schemas.ts
|
|
3095
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
3202
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v434.z.object({
|
|
3096
3203
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
3097
3204
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
3098
3205
|
});
|
|
3099
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
3206
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v434.z.object({
|
|
3100
3207
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
3101
3208
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
3102
3209
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -3112,18 +3219,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
3112
3219
|
});
|
|
3113
3220
|
}
|
|
3114
3221
|
}
|
|
3115
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
3222
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v434.z.union([
|
|
3116
3223
|
// pricing available
|
|
3117
|
-
|
|
3224
|
+
import_v434.z.object({
|
|
3118
3225
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
3119
3226
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
3120
3227
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
3121
3228
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
3122
3229
|
// pricing unknown
|
|
3123
|
-
|
|
3124
|
-
baseCost:
|
|
3125
|
-
premium:
|
|
3126
|
-
total:
|
|
3230
|
+
import_v434.z.object({
|
|
3231
|
+
baseCost: import_v434.z.null(),
|
|
3232
|
+
premium: import_v434.z.null(),
|
|
3233
|
+
total: import_v434.z.null()
|
|
3127
3234
|
}).transform((v) => v)
|
|
3128
3235
|
]);
|
|
3129
3236
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -3146,9 +3253,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
3146
3253
|
});
|
|
3147
3254
|
}
|
|
3148
3255
|
}
|
|
3149
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
3256
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v434.z.union([
|
|
3150
3257
|
// referral available
|
|
3151
|
-
|
|
3258
|
+
import_v434.z.object({
|
|
3152
3259
|
encodedReferrer: makeHexStringSchema(
|
|
3153
3260
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
3154
3261
|
`${valueLabel} Encoded Referrer`
|
|
@@ -3156,9 +3263,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
3156
3263
|
decodedReferrer: makeNormalizedAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
3157
3264
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
3158
3265
|
// referral not applicable
|
|
3159
|
-
|
|
3160
|
-
encodedReferrer:
|
|
3161
|
-
decodedReferrer:
|
|
3266
|
+
import_v434.z.object({
|
|
3267
|
+
encodedReferrer: import_v434.z.null(),
|
|
3268
|
+
decodedReferrer: import_v434.z.null()
|
|
3162
3269
|
})
|
|
3163
3270
|
]);
|
|
3164
3271
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -3171,9 +3278,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
3171
3278
|
});
|
|
3172
3279
|
}
|
|
3173
3280
|
}
|
|
3174
|
-
var EventIdSchema =
|
|
3175
|
-
var EventIdsSchema =
|
|
3176
|
-
var makeBaseRegistrarActionSchemaWithoutCheck = (valueLabel = "Base Registrar Action") =>
|
|
3281
|
+
var EventIdSchema = import_v434.z.string().nonempty();
|
|
3282
|
+
var EventIdsSchema = import_v434.z.array(EventIdSchema).min(1).transform((v) => v);
|
|
3283
|
+
var makeBaseRegistrarActionSchemaWithoutCheck = (valueLabel = "Base Registrar Action") => import_v434.z.object({
|
|
3177
3284
|
id: EventIdSchema,
|
|
3178
3285
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
3179
3286
|
registrant: makeNormalizedAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -3188,36 +3295,36 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => ma
|
|
|
3188
3295
|
invariant_eventIdsInitialElementIsTheActionId
|
|
3189
3296
|
);
|
|
3190
3297
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3191
|
-
type:
|
|
3298
|
+
type: import_v434.z.literal(RegistrarActionTypes.Registration)
|
|
3192
3299
|
});
|
|
3193
3300
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
3194
|
-
type:
|
|
3301
|
+
type: import_v434.z.literal(RegistrarActionTypes.Renewal)
|
|
3195
3302
|
});
|
|
3196
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3303
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v434.z.discriminatedUnion("type", [
|
|
3197
3304
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
3198
3305
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
3199
3306
|
]);
|
|
3200
3307
|
|
|
3201
3308
|
// src/ensnode/api/shared/pagination/zod-schemas.ts
|
|
3202
|
-
var
|
|
3309
|
+
var import_v435 = require("zod/v4");
|
|
3203
3310
|
|
|
3204
3311
|
// src/ensnode/api/shared/pagination/request.ts
|
|
3205
3312
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
3206
3313
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
3207
3314
|
|
|
3208
3315
|
// src/ensnode/api/shared/pagination/zod-schemas.ts
|
|
3209
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3316
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v435.z.object({
|
|
3210
3317
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
3211
3318
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
3212
3319
|
RECORDS_PER_PAGE_MAX,
|
|
3213
3320
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
3214
3321
|
)
|
|
3215
3322
|
});
|
|
3216
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
3217
|
-
totalRecords:
|
|
3218
|
-
totalPages:
|
|
3219
|
-
hasNext:
|
|
3220
|
-
hasPrev:
|
|
3323
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v435.z.object({
|
|
3324
|
+
totalRecords: import_v435.z.literal(0),
|
|
3325
|
+
totalPages: import_v435.z.literal(1),
|
|
3326
|
+
hasNext: import_v435.z.literal(false),
|
|
3327
|
+
hasPrev: import_v435.z.literal(false)
|
|
3221
3328
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
3222
3329
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
3223
3330
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3252,15 +3359,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3252
3359
|
});
|
|
3253
3360
|
}
|
|
3254
3361
|
}
|
|
3255
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3362
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v435.z.object({
|
|
3256
3363
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3257
3364
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3258
|
-
hasNext:
|
|
3259
|
-
hasPrev:
|
|
3365
|
+
hasNext: import_v435.z.boolean(),
|
|
3366
|
+
hasPrev: import_v435.z.boolean(),
|
|
3260
3367
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3261
3368
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3262
3369
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3263
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3370
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v435.z.union([
|
|
3264
3371
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3265
3372
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3266
3373
|
]);
|
|
@@ -3290,21 +3397,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3290
3397
|
});
|
|
3291
3398
|
}
|
|
3292
3399
|
}
|
|
3293
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3400
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v436.z.object({
|
|
3294
3401
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3295
3402
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3296
3403
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3297
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3298
|
-
responseCode:
|
|
3299
|
-
registrarActions:
|
|
3404
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v436.z.object({
|
|
3405
|
+
responseCode: import_v436.z.literal(RegistrarActionsResponseCodes.Ok),
|
|
3406
|
+
registrarActions: import_v436.z.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
3300
3407
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3301
3408
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
3302
3409
|
});
|
|
3303
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3304
|
-
responseCode:
|
|
3410
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v436.z.strictObject({
|
|
3411
|
+
responseCode: import_v436.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3305
3412
|
error: makeErrorResponseSchema()
|
|
3306
3413
|
});
|
|
3307
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3414
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v436.z.discriminatedUnion("responseCode", [
|
|
3308
3415
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3309
3416
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3310
3417
|
]);
|
|
@@ -3315,7 +3422,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3315
3422
|
if (parsed.error) {
|
|
3316
3423
|
throw new Error(
|
|
3317
3424
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3318
|
-
${(0,
|
|
3425
|
+
${(0, import_v437.prettifyError)(parsed.error)}
|
|
3319
3426
|
`
|
|
3320
3427
|
);
|
|
3321
3428
|
}
|
|
@@ -3452,12 +3559,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3452
3559
|
}
|
|
3453
3560
|
|
|
3454
3561
|
// src/ensnode/api/shared/errors/deserialize.ts
|
|
3455
|
-
var
|
|
3562
|
+
var import_v438 = require("zod/v4");
|
|
3456
3563
|
function deserializeErrorResponse2(maybeErrorResponse) {
|
|
3457
3564
|
const parsed = makeErrorResponseSchema().safeParse(maybeErrorResponse);
|
|
3458
3565
|
if (parsed.error) {
|
|
3459
3566
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3460
|
-
${(0,
|
|
3567
|
+
${(0, import_v438.prettifyError)(parsed.error)}
|
|
3461
3568
|
`);
|
|
3462
3569
|
}
|
|
3463
3570
|
return parsed.data;
|
|
@@ -4024,14 +4131,14 @@ function isResolvedIdentity(identity) {
|
|
|
4024
4131
|
}
|
|
4025
4132
|
|
|
4026
4133
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
4027
|
-
var
|
|
4134
|
+
var import_v439 = require("zod/v4");
|
|
4028
4135
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4029
4136
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4030
4137
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4031
4138
|
if (parsed.error) {
|
|
4032
4139
|
throw new Error(
|
|
4033
4140
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4034
|
-
${(0,
|
|
4141
|
+
${(0, import_v439.prettifyError)(parsed.error)}
|
|
4035
4142
|
`
|
|
4036
4143
|
);
|
|
4037
4144
|
}
|
|
@@ -4049,26 +4156,26 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4049
4156
|
}
|
|
4050
4157
|
|
|
4051
4158
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4052
|
-
var
|
|
4159
|
+
var import_v440 = require("zod/v4");
|
|
4053
4160
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4054
4161
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4055
4162
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4056
4163
|
if (parsed.error) {
|
|
4057
4164
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4058
|
-
${(0,
|
|
4165
|
+
${(0, import_v440.prettifyError)(parsed.error)}
|
|
4059
4166
|
`);
|
|
4060
4167
|
}
|
|
4061
4168
|
return parsed.data;
|
|
4062
4169
|
}
|
|
4063
4170
|
|
|
4064
4171
|
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
4065
|
-
var
|
|
4172
|
+
var import_v441 = require("zod/v4");
|
|
4066
4173
|
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
4067
4174
|
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
4068
4175
|
const parsed = schema.safeParse(unvalidatedProjection);
|
|
4069
4176
|
if (parsed.error) {
|
|
4070
4177
|
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
4071
|
-
${(0,
|
|
4178
|
+
${(0, import_v441.prettifyError)(parsed.error)}
|
|
4072
4179
|
`);
|
|
4073
4180
|
}
|
|
4074
4181
|
return parsed.data;
|
|
@@ -4251,13 +4358,13 @@ var import_getUnixTime2 = require("date-fns/getUnixTime");
|
|
|
4251
4358
|
var import_getUnixTime = require("date-fns/getUnixTime");
|
|
4252
4359
|
|
|
4253
4360
|
// src/shared/deserialize.ts
|
|
4254
|
-
var
|
|
4361
|
+
var import_v442 = __toESM(require("zod/v4"), 1);
|
|
4255
4362
|
function deserializeChainId(maybeChainId, valueLabel) {
|
|
4256
4363
|
const schema = makeChainIdStringSchema(valueLabel);
|
|
4257
4364
|
const parsed = schema.safeParse(maybeChainId);
|
|
4258
4365
|
if (parsed.error) {
|
|
4259
4366
|
throw new Error(`Cannot deserialize ChainId:
|
|
4260
|
-
${(0,
|
|
4367
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4261
4368
|
`);
|
|
4262
4369
|
}
|
|
4263
4370
|
return parsed.data;
|
|
@@ -4267,7 +4374,7 @@ function deserializeDatetime(maybeDatetime, valueLabel) {
|
|
|
4267
4374
|
const parsed = schema.safeParse(maybeDatetime);
|
|
4268
4375
|
if (parsed.error) {
|
|
4269
4376
|
throw new Error(`Cannot deserialize Datetime:
|
|
4270
|
-
${(0,
|
|
4377
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4271
4378
|
`);
|
|
4272
4379
|
}
|
|
4273
4380
|
return parsed.data;
|
|
@@ -4277,7 +4384,7 @@ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
|
|
|
4277
4384
|
const parsed = schema.safeParse(maybeTimestamp);
|
|
4278
4385
|
if (parsed.error) {
|
|
4279
4386
|
throw new Error(`Cannot deserialize Unix Timestamp:
|
|
4280
|
-
${(0,
|
|
4387
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4281
4388
|
`);
|
|
4282
4389
|
}
|
|
4283
4390
|
return parsed.data;
|
|
@@ -4287,7 +4394,7 @@ function deserializeUrl(maybeUrl, valueLabel) {
|
|
|
4287
4394
|
const parsed = schema.safeParse(maybeUrl);
|
|
4288
4395
|
if (parsed.error) {
|
|
4289
4396
|
throw new Error(`Cannot deserialize URL:
|
|
4290
|
-
${(0,
|
|
4397
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4291
4398
|
`);
|
|
4292
4399
|
}
|
|
4293
4400
|
return parsed.data;
|
|
@@ -4297,7 +4404,7 @@ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
|
|
|
4297
4404
|
const parsed = schema.safeParse(maybeBlockNumber);
|
|
4298
4405
|
if (parsed.error) {
|
|
4299
4406
|
throw new Error(`Cannot deserialize BlockNumber:
|
|
4300
|
-
${(0,
|
|
4407
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4301
4408
|
`);
|
|
4302
4409
|
}
|
|
4303
4410
|
return parsed.data;
|
|
@@ -4307,17 +4414,17 @@ function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
|
4307
4414
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
4308
4415
|
if (parsed.error) {
|
|
4309
4416
|
throw new Error(`Cannot deserialize BlockRef:
|
|
4310
|
-
${(0,
|
|
4417
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4311
4418
|
`);
|
|
4312
4419
|
}
|
|
4313
4420
|
return parsed.data;
|
|
4314
4421
|
}
|
|
4315
4422
|
function deserializeDuration(maybeDuration, valueLabel) {
|
|
4316
|
-
const schema =
|
|
4423
|
+
const schema = import_v442.default.coerce.number().pipe(makeDurationSchema(valueLabel));
|
|
4317
4424
|
const parsed = schema.safeParse(maybeDuration);
|
|
4318
4425
|
if (parsed.error) {
|
|
4319
4426
|
throw new RangeError(`Cannot deserialize Duration:
|
|
4320
|
-
${(0,
|
|
4427
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4321
4428
|
`);
|
|
4322
4429
|
}
|
|
4323
4430
|
return parsed.data;
|
|
@@ -4327,7 +4434,7 @@ function parseAccountId(maybeAccountId, valueLabel) {
|
|
|
4327
4434
|
const parsed = schema.safeParse(maybeAccountId);
|
|
4328
4435
|
if (parsed.error) {
|
|
4329
4436
|
throw new RangeError(`Cannot deserialize AccountId:
|
|
4330
|
-
${(0,
|
|
4437
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4331
4438
|
`);
|
|
4332
4439
|
}
|
|
4333
4440
|
return parsed.data;
|
|
@@ -4337,7 +4444,7 @@ function deserializePriceEth(maybePrice, valueLabel) {
|
|
|
4337
4444
|
const parsed = schema.safeParse(maybePrice);
|
|
4338
4445
|
if (parsed.error) {
|
|
4339
4446
|
throw new Error(`Cannot deserialize PriceEth:
|
|
4340
|
-
${(0,
|
|
4447
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4341
4448
|
`);
|
|
4342
4449
|
}
|
|
4343
4450
|
return parsed.data;
|
|
@@ -4347,7 +4454,7 @@ function deserializePriceUsdc(maybePrice, valueLabel) {
|
|
|
4347
4454
|
const parsed = schema.safeParse(maybePrice);
|
|
4348
4455
|
if (parsed.error) {
|
|
4349
4456
|
throw new Error(`Cannot deserialize PriceUsdc:
|
|
4350
|
-
${(0,
|
|
4457
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4351
4458
|
`);
|
|
4352
4459
|
}
|
|
4353
4460
|
return parsed.data;
|
|
@@ -4357,7 +4464,7 @@ function deserializePriceDai(maybePrice, valueLabel) {
|
|
|
4357
4464
|
const parsed = schema.safeParse(maybePrice);
|
|
4358
4465
|
if (parsed.error) {
|
|
4359
4466
|
throw new Error(`Cannot deserialize PriceDai:
|
|
4360
|
-
${(0,
|
|
4467
|
+
${(0, import_v442.prettifyError)(parsed.error)}
|
|
4361
4468
|
`);
|
|
4362
4469
|
}
|
|
4363
4470
|
return parsed.data;
|
|
@@ -4594,6 +4701,18 @@ function getNamespaceSpecificValue(namespace, value) {
|
|
|
4594
4701
|
return value[namespace] ?? value.default;
|
|
4595
4702
|
}
|
|
4596
4703
|
|
|
4704
|
+
// src/shared/replace-bigints.ts
|
|
4705
|
+
var replaceBigInts = (obj, replacer) => {
|
|
4706
|
+
if (typeof obj === "bigint") return replacer(obj);
|
|
4707
|
+
if (Array.isArray(obj))
|
|
4708
|
+
return obj.map((x) => replaceBigInts(x, replacer));
|
|
4709
|
+
if (obj && typeof obj === "object")
|
|
4710
|
+
return Object.fromEntries(
|
|
4711
|
+
Object.entries(obj).map(([k, v]) => [k, replaceBigInts(v, replacer)])
|
|
4712
|
+
);
|
|
4713
|
+
return obj;
|
|
4714
|
+
};
|
|
4715
|
+
|
|
4597
4716
|
// src/shared/root-registry.ts
|
|
4598
4717
|
var import_enssdk13 = require("enssdk");
|
|
4599
4718
|
var import_datasources12 = require("@ensnode/datasources");
|
|
@@ -4609,6 +4728,13 @@ var maybeGetENSv2RootRegistryId = (namespace) => {
|
|
|
4609
4728
|
return (0, import_enssdk13.makeRegistryId)(root);
|
|
4610
4729
|
};
|
|
4611
4730
|
|
|
4731
|
+
// src/shared/to-json.ts
|
|
4732
|
+
var toJson = (value, options) => JSON.stringify(
|
|
4733
|
+
value,
|
|
4734
|
+
(_key, val) => typeof val === "bigint" ? String(val) : val,
|
|
4735
|
+
options?.pretty ? 2 : void 0
|
|
4736
|
+
);
|
|
4737
|
+
|
|
4612
4738
|
// src/shared/url.ts
|
|
4613
4739
|
function isHttpProtocol(url) {
|
|
4614
4740
|
return ["http:", "https:"].includes(url.protocol);
|
|
@@ -4617,14 +4743,45 @@ function isWebSocketProtocol(url) {
|
|
|
4617
4743
|
return ["ws:", "wss:"].includes(url.protocol);
|
|
4618
4744
|
}
|
|
4619
4745
|
|
|
4620
|
-
// src/stack-info/
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4746
|
+
// src/stack-info/validate/ensindexer-stack-info.ts
|
|
4747
|
+
var import_v443 = require("zod/v4");
|
|
4748
|
+
function validateEnsIndexerStackInfo(maybeStackInfo, valueLabel) {
|
|
4749
|
+
const parsed = makeEnsIndexerStackInfoSchema(valueLabel).safeParse(maybeStackInfo);
|
|
4750
|
+
if (parsed.error) {
|
|
4751
|
+
throw new Error(`Cannot validate EnsIndexerStackInfo:
|
|
4752
|
+
${(0, import_v443.prettifyError)(parsed.error)}
|
|
4753
|
+
`);
|
|
4754
|
+
}
|
|
4755
|
+
return parsed.data;
|
|
4756
|
+
}
|
|
4757
|
+
|
|
4758
|
+
// src/stack-info/ensindexer-stack-info.ts
|
|
4759
|
+
function buildEnsIndexerStackInfo(ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig) {
|
|
4760
|
+
return validateEnsIndexerStackInfo({
|
|
4624
4761
|
ensDb: ensDbPublicConfig,
|
|
4625
|
-
ensIndexer:
|
|
4626
|
-
ensRainbow:
|
|
4627
|
-
};
|
|
4762
|
+
ensIndexer: ensIndexerPublicConfig,
|
|
4763
|
+
ensRainbow: ensRainbowPublicConfig
|
|
4764
|
+
});
|
|
4765
|
+
}
|
|
4766
|
+
|
|
4767
|
+
// src/stack-info/validate/ensnode-stack-info.ts
|
|
4768
|
+
var import_v444 = require("zod/v4");
|
|
4769
|
+
function validateEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
4770
|
+
const parsed = makeEnsNodeStackInfoSchema(valueLabel).safeParse(maybeStackInfo);
|
|
4771
|
+
if (parsed.error) {
|
|
4772
|
+
throw new Error(`Cannot validate EnsNodeStackInfo:
|
|
4773
|
+
${(0, import_v444.prettifyError)(parsed.error)}
|
|
4774
|
+
`);
|
|
4775
|
+
}
|
|
4776
|
+
return parsed.data;
|
|
4777
|
+
}
|
|
4778
|
+
|
|
4779
|
+
// src/stack-info/ensnode-stack-info.ts
|
|
4780
|
+
function buildEnsNodeStackInfo(ensApiPublicConfig, ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig) {
|
|
4781
|
+
return validateEnsNodeStackInfo({
|
|
4782
|
+
...buildEnsIndexerStackInfo(ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig),
|
|
4783
|
+
ensApi: ensApiPublicConfig
|
|
4784
|
+
});
|
|
4628
4785
|
}
|
|
4629
4786
|
|
|
4630
4787
|
// src/subgraph-api/prerequisites.ts
|