@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.js
CHANGED
|
@@ -317,14 +317,15 @@ var makeLabelSetIdSchema = (valueLabel = "Label set ID") => {
|
|
|
317
317
|
var makeLabelSetVersionSchema = (valueLabel = "Label set version") => makeNonNegativeIntegerSchema(valueLabel);
|
|
318
318
|
var makeLabelSetVersionStringSchema = (valueLabel = "Label set version") => z2.coerce.number({ error: `${valueLabel} must be a non-negative integer` }).pipe(makeLabelSetVersionSchema(valueLabel));
|
|
319
319
|
var makeEnsRainbowPublicConfigSchema = (valueLabel = "EnsRainbowPublicConfig") => z2.object({
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
labelSetId: makeLabelSetIdSchema(`${valueLabel}.labelSet.labelSetId`),
|
|
320
|
+
serverLabelSet: z2.object({
|
|
321
|
+
labelSetId: makeLabelSetIdSchema(`${valueLabel}.serverLabelSet.labelSetId`),
|
|
323
322
|
highestLabelSetVersion: makeLabelSetVersionSchema(
|
|
324
|
-
`${valueLabel}.
|
|
323
|
+
`${valueLabel}.serverLabelSet.highestLabelSetVersion`
|
|
325
324
|
)
|
|
326
325
|
}),
|
|
327
|
-
|
|
326
|
+
versionInfo: z2.object({
|
|
327
|
+
ensRainbow: z2.string().nonempty({ error: `${valueLabel}.versionInfo.ensRainbow must be a non-empty string.` })
|
|
328
|
+
})
|
|
328
329
|
});
|
|
329
330
|
|
|
330
331
|
// src/shared/collections.ts
|
|
@@ -349,8 +350,8 @@ var PluginName = /* @__PURE__ */ ((PluginName2) => {
|
|
|
349
350
|
// src/ensindexer/config/is-subgraph-compatible.ts
|
|
350
351
|
function isSubgraphCompatible(config) {
|
|
351
352
|
const onlySubgraphPluginActivated = config.plugins.length === 1 && config.plugins[0] === "subgraph" /* Subgraph */;
|
|
352
|
-
const isSubgraphLabelSet = config.
|
|
353
|
-
const isEnsTestEnvLabelSet = config.
|
|
353
|
+
const isSubgraphLabelSet = config.clientLabelSet.labelSetId === "subgraph" && config.clientLabelSet.labelSetVersion === 0;
|
|
354
|
+
const isEnsTestEnvLabelSet = config.clientLabelSet.labelSetId === "ens-test-env" && config.clientLabelSet.labelSetVersion === 0;
|
|
354
355
|
const labelSetIsSubgraphCompatible = isSubgraphLabelSet || config.namespace === ENSNamespaceIds2.EnsTestEnv && isEnsTestEnvLabelSet;
|
|
355
356
|
return onlySubgraphPluginActivated && labelSetIsSubgraphCompatible;
|
|
356
357
|
}
|
|
@@ -448,13 +449,13 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
448
449
|
ctx.issues.push({
|
|
449
450
|
code: "custom",
|
|
450
451
|
input: config,
|
|
451
|
-
message: `'isSubgraphCompatible' requires only the '${"subgraph" /* Subgraph */}' plugin to be active and
|
|
452
|
+
message: `'isSubgraphCompatible' requires only the '${"subgraph" /* Subgraph */}' plugin to be active and 'clientLabelSet' must be {labelSetId: "subgraph", labelSetVersion: 0}`
|
|
452
453
|
});
|
|
453
454
|
}
|
|
454
455
|
}
|
|
455
456
|
function invariant_ensRainbowSupportedLabelSetAndVersion(ctx) {
|
|
456
|
-
const clientLabelSet = ctx.value
|
|
457
|
-
const serverLabelSet = ctx.value.ensRainbowPublicConfig
|
|
457
|
+
const { clientLabelSet } = ctx.value;
|
|
458
|
+
const { serverLabelSet } = ctx.value.ensRainbowPublicConfig;
|
|
458
459
|
try {
|
|
459
460
|
validateSupportedLabelSetAndVersion(serverLabelSet, clientLabelSet);
|
|
460
461
|
} catch (error) {
|
|
@@ -475,7 +476,7 @@ var makeEnsIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") =
|
|
|
475
476
|
isSubgraphCompatible: z3.boolean({
|
|
476
477
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
477
478
|
}),
|
|
478
|
-
|
|
479
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
479
480
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
480
481
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
481
482
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -489,7 +490,7 @@ var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIn
|
|
|
489
490
|
isSubgraphCompatible: z3.boolean({
|
|
490
491
|
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
491
492
|
}),
|
|
492
|
-
|
|
493
|
+
clientLabelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.clientLabelSet`),
|
|
493
494
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
494
495
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
495
496
|
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
@@ -589,7 +590,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
589
590
|
ensRainbowPublicConfig,
|
|
590
591
|
indexedChainIds,
|
|
591
592
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
592
|
-
|
|
593
|
+
clientLabelSet,
|
|
593
594
|
namespace,
|
|
594
595
|
plugins,
|
|
595
596
|
versionInfo
|
|
@@ -599,7 +600,7 @@ function serializeEnsIndexerPublicConfig(config) {
|
|
|
599
600
|
ensRainbowPublicConfig,
|
|
600
601
|
indexedChainIds: serializeIndexedChainIds(indexedChainIds),
|
|
601
602
|
isSubgraphCompatible: isSubgraphCompatible2,
|
|
602
|
-
|
|
603
|
+
clientLabelSet,
|
|
603
604
|
namespace,
|
|
604
605
|
plugins,
|
|
605
606
|
versionInfo
|
|
@@ -1844,21 +1845,21 @@ function validateEnsIndexerPublicConfigCompatibility(configA, configB) {
|
|
|
1844
1845
|
].join(" ")
|
|
1845
1846
|
);
|
|
1846
1847
|
}
|
|
1847
|
-
if (configA.
|
|
1848
|
+
if (configA.clientLabelSet.labelSetId !== configB.clientLabelSet.labelSetId) {
|
|
1848
1849
|
throw new Error(
|
|
1849
1850
|
[
|
|
1850
|
-
`'
|
|
1851
|
-
`Stored Config '
|
|
1852
|
-
`Current Config '
|
|
1851
|
+
`'clientLabelSet.labelSetId' must be compatible.`,
|
|
1852
|
+
`Stored Config 'clientLabelSet.labelSetId': '${configA.clientLabelSet.labelSetId}'.`,
|
|
1853
|
+
`Current Config 'clientLabelSet.labelSetId': '${configB.clientLabelSet.labelSetId}'.`
|
|
1853
1854
|
].join(" ")
|
|
1854
1855
|
);
|
|
1855
1856
|
}
|
|
1856
|
-
if (configA.
|
|
1857
|
+
if (configA.clientLabelSet.labelSetVersion !== configB.clientLabelSet.labelSetVersion) {
|
|
1857
1858
|
throw new Error(
|
|
1858
1859
|
[
|
|
1859
|
-
`'
|
|
1860
|
-
`Stored Config '
|
|
1861
|
-
`Current Config '
|
|
1860
|
+
`'clientLabelSet.labelSetVersion' must be compatible.`,
|
|
1861
|
+
`Stored Config 'clientLabelSet.labelSetVersion': '${configA.clientLabelSet.labelSetVersion}'.`,
|
|
1862
|
+
`Current Config 'clientLabelSet.labelSetVersion': '${configB.clientLabelSet.labelSetVersion}'.`
|
|
1862
1863
|
].join(" ")
|
|
1863
1864
|
);
|
|
1864
1865
|
}
|
|
@@ -1949,12 +1950,12 @@ function validateEnsIndexerVersionInfo(unvalidatedVersionInfo) {
|
|
|
1949
1950
|
}
|
|
1950
1951
|
|
|
1951
1952
|
// src/ensnode/api/indexing-status/deserialize.ts
|
|
1952
|
-
import { prettifyError as
|
|
1953
|
+
import { prettifyError as prettifyError14 } from "zod/v4";
|
|
1953
1954
|
|
|
1954
1955
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
1955
|
-
import { prettifyError as
|
|
1956
|
+
import { prettifyError as prettifyError13 } from "zod/v4";
|
|
1956
1957
|
|
|
1957
|
-
// src/stack-info/zod-schemas/
|
|
1958
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
1958
1959
|
import { z as z13 } from "zod/v4";
|
|
1959
1960
|
|
|
1960
1961
|
// src/ensdb/zod-schemas/config.ts
|
|
@@ -1963,49 +1964,134 @@ var makeEnsDbVersionInfoSchema = (valueLabel) => {
|
|
|
1963
1964
|
const label = valueLabel ?? "EnsDbVersionInfo";
|
|
1964
1965
|
return z12.object({
|
|
1965
1966
|
postgresql: z12.string().nonempty(`${label}.postgresql must be a non-empty string`).describe("Version of the PostgreSQL server hosting the ENSDb instance.")
|
|
1966
|
-
})
|
|
1967
|
+
});
|
|
1967
1968
|
};
|
|
1968
1969
|
var makeEnsDbPublicConfigSchema = (valueLabel) => {
|
|
1969
1970
|
const label = valueLabel ?? "EnsDbPublicConfig";
|
|
1970
1971
|
return z12.object({
|
|
1971
1972
|
versionInfo: makeEnsDbVersionInfoSchema(`${label}.versionInfo`)
|
|
1972
|
-
})
|
|
1973
|
+
});
|
|
1973
1974
|
};
|
|
1974
1975
|
|
|
1975
|
-
// src/stack-info/zod-schemas/
|
|
1976
|
-
function
|
|
1977
|
-
const label = valueLabel ?? "
|
|
1976
|
+
// src/stack-info/zod-schemas/ensindexer-stack-info.ts
|
|
1977
|
+
function makeSerializedEnsIndexerStackInfoSchema(valueLabel) {
|
|
1978
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
1978
1979
|
return z13.object({
|
|
1979
|
-
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
1980
1980
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
1981
1981
|
ensIndexer: makeSerializedEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
1982
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
1982
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
1983
1983
|
});
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1986
|
-
const
|
|
1985
|
+
function invariant_ensRainbowCompatibilityWithEnsIndexer(ctx) {
|
|
1986
|
+
const { ensIndexer, ensRainbow } = ctx.value;
|
|
1987
|
+
const { clientLabelSet } = ensIndexer;
|
|
1988
|
+
const { serverLabelSet } = ensRainbow;
|
|
1989
|
+
if (clientLabelSet.labelSetId !== serverLabelSet.labelSetId) {
|
|
1990
|
+
ctx.issues.push({
|
|
1991
|
+
code: "custom",
|
|
1992
|
+
input: ctx.value,
|
|
1993
|
+
message: `ENSRainbow's label set (id: ${serverLabelSet.labelSetId}) must be the same as ENSIndexer's label set (id: ${clientLabelSet.labelSetId}).`
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1996
|
+
if (clientLabelSet.labelSetVersion > serverLabelSet.highestLabelSetVersion) {
|
|
1997
|
+
ctx.issues.push({
|
|
1998
|
+
code: "custom",
|
|
1999
|
+
input: ctx.value,
|
|
2000
|
+
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}).`
|
|
2001
|
+
});
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
function makeEnsIndexerStackInfoSchema(valueLabel) {
|
|
2005
|
+
const label = valueLabel ?? "ENSIndexerStackInfo";
|
|
1987
2006
|
return z13.object({
|
|
1988
|
-
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`),
|
|
1989
2007
|
ensDb: makeEnsDbPublicConfigSchema(`${label}.ensDb`),
|
|
1990
2008
|
ensIndexer: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexer`),
|
|
1991
|
-
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2009
|
+
ensRainbow: makeEnsRainbowPublicConfigSchema(`${label}.ensRainbow`)
|
|
2010
|
+
}).check(invariant_ensRainbowCompatibilityWithEnsIndexer);
|
|
2011
|
+
}
|
|
2012
|
+
|
|
2013
|
+
// src/stack-info/zod-schemas/ensnode-stack-info.ts
|
|
2014
|
+
function invariant_ensApiCompatibilityWithEnsIndexerAndEnsRainbow(ctx) {
|
|
2015
|
+
const { ensApi, ensIndexer, ensRainbow } = ctx.value;
|
|
2016
|
+
if (ensIndexer.versionInfo.ensDb !== ensApi.versionInfo.ensApi) {
|
|
2017
|
+
ctx.issues.push({
|
|
2018
|
+
code: "custom",
|
|
2019
|
+
path: ["ensIndexer", "versionInfo", "ensDb"],
|
|
2020
|
+
input: ensIndexer.versionInfo.ensDb,
|
|
2021
|
+
message: `Version Mismatch: ENSDB@${ensIndexer.versionInfo.ensDb} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2022
|
+
});
|
|
2023
|
+
}
|
|
2024
|
+
if (ensIndexer.versionInfo.ensIndexer !== ensApi.versionInfo.ensApi) {
|
|
2025
|
+
ctx.issues.push({
|
|
2026
|
+
code: "custom",
|
|
2027
|
+
path: ["ensIndexer", "versionInfo", "ensIndexer"],
|
|
2028
|
+
input: ensIndexer.versionInfo.ensIndexer,
|
|
2029
|
+
message: `Version Mismatch: ENSIndexer@${ensIndexer.versionInfo.ensIndexer} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2030
|
+
});
|
|
2031
|
+
}
|
|
2032
|
+
if (ensRainbow.versionInfo.ensRainbow !== ensApi.versionInfo.ensApi) {
|
|
2033
|
+
ctx.issues.push({
|
|
2034
|
+
code: "custom",
|
|
2035
|
+
path: ["ensRainbow", "versionInfo", "ensRainbow"],
|
|
2036
|
+
input: ensRainbow.versionInfo.ensRainbow,
|
|
2037
|
+
message: `Version Mismatch: ENSRainbow@${ensRainbow.versionInfo.ensRainbow} !== ENSApi@${ensApi.versionInfo.ensApi}`
|
|
2038
|
+
});
|
|
2039
|
+
}
|
|
2040
|
+
if (ensIndexer.versionInfo.ensNormalize !== ensApi.versionInfo.ensNormalize) {
|
|
2041
|
+
ctx.issues.push({
|
|
2042
|
+
code: "custom",
|
|
2043
|
+
path: ["ensIndexer", "versionInfo", "ensNormalize"],
|
|
2044
|
+
input: ensIndexer.versionInfo.ensNormalize,
|
|
2045
|
+
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}`
|
|
2046
|
+
});
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
function makeSerializedEnsNodeStackInfoSchema(valueLabel) {
|
|
2050
|
+
const label = valueLabel ?? "ENSNodeStackInfo";
|
|
2051
|
+
return makeSerializedEnsIndexerStackInfoSchema(label).extend({
|
|
2052
|
+
ensApi: makeSerializedEnsApiPublicConfigSchema(`${label}.ensApi`)
|
|
1992
2053
|
});
|
|
1993
2054
|
}
|
|
2055
|
+
function makeEnsNodeStackInfoSchema(valueLabel) {
|
|
2056
|
+
const label = valueLabel ?? "ENSNodeStackInfo";
|
|
2057
|
+
return makeEnsIndexerStackInfoSchema(label).extend({
|
|
2058
|
+
ensApi: makeEnsApiPublicConfigSchema(`${label}.ensApi`)
|
|
2059
|
+
}).check(invariant_ensApiCompatibilityWithEnsIndexerAndEnsRainbow).check(invariant_ensRainbowCompatibilityWithEnsIndexer);
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
// src/stack-info/deserialize/ensindexer-stack-info.ts
|
|
2063
|
+
import { prettifyError as prettifyError12 } from "zod/v4";
|
|
2064
|
+
function buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo) {
|
|
2065
|
+
const { ensDb, ensRainbow } = serializedStackInfo;
|
|
2066
|
+
const ensIndexer = buildUnvalidatedEnsIndexerPublicConfig(serializedStackInfo.ensIndexer);
|
|
2067
|
+
return {
|
|
2068
|
+
ensDb,
|
|
2069
|
+
ensIndexer,
|
|
2070
|
+
ensRainbow
|
|
2071
|
+
};
|
|
2072
|
+
}
|
|
2073
|
+
function deserializeEnsIndexerStackInfo(maybeStackInfo, valueLabel) {
|
|
2074
|
+
const parsed = makeSerializedEnsIndexerStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsIndexerStackInfo).pipe(makeEnsIndexerStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2075
|
+
if (parsed.error) {
|
|
2076
|
+
throw new Error(`Cannot deserialize EnsIndexerStackInfo:
|
|
2077
|
+
${prettifyError12(parsed.error)}
|
|
2078
|
+
`);
|
|
2079
|
+
}
|
|
2080
|
+
return parsed.data;
|
|
2081
|
+
}
|
|
1994
2082
|
|
|
1995
2083
|
// src/stack-info/deserialize/ensnode-stack-info.ts
|
|
1996
2084
|
function buildUnvalidatedEnsNodeStackInfo(serializedStackInfo) {
|
|
1997
|
-
const { ensApi, ensIndexer, ...rest } = serializedStackInfo;
|
|
1998
2085
|
return {
|
|
1999
|
-
...
|
|
2000
|
-
ensApi: buildUnvalidatedEnsApiPublicConfig(ensApi)
|
|
2001
|
-
ensIndexer: buildUnvalidatedEnsIndexerPublicConfig(ensIndexer)
|
|
2086
|
+
...buildUnvalidatedEnsIndexerStackInfo(serializedStackInfo),
|
|
2087
|
+
ensApi: buildUnvalidatedEnsApiPublicConfig(serializedStackInfo.ensApi)
|
|
2002
2088
|
};
|
|
2003
2089
|
}
|
|
2004
2090
|
function deserializeEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
2005
2091
|
const parsed = makeSerializedEnsNodeStackInfoSchema(valueLabel).transform(buildUnvalidatedEnsNodeStackInfo).pipe(makeEnsNodeStackInfoSchema(valueLabel)).safeParse(maybeStackInfo);
|
|
2006
2092
|
if (parsed.error) {
|
|
2007
2093
|
throw new Error(`Cannot deserialize EnsNodeStackInfo:
|
|
2008
|
-
${
|
|
2094
|
+
${prettifyError13(parsed.error)}
|
|
2009
2095
|
`);
|
|
2010
2096
|
}
|
|
2011
2097
|
return parsed.data;
|
|
@@ -2065,7 +2151,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
2065
2151
|
if (parsed.error) {
|
|
2066
2152
|
throw new Error(
|
|
2067
2153
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
2068
|
-
${
|
|
2154
|
+
${prettifyError14(parsed.error)}
|
|
2069
2155
|
`
|
|
2070
2156
|
);
|
|
2071
2157
|
}
|
|
@@ -2073,13 +2159,26 @@ ${prettifyError13(parsed.error)}
|
|
|
2073
2159
|
}
|
|
2074
2160
|
var deserializeIndexingStatusResponse = deserializeEnsApiIndexingStatusResponse;
|
|
2075
2161
|
|
|
2162
|
+
// src/stack-info/serialize/ensindexer-stack-info.ts
|
|
2163
|
+
function serializeEnsIndexerStackInfo(stackInfo) {
|
|
2164
|
+
const {
|
|
2165
|
+
ensDb: serializedEnsDbPublicConfig,
|
|
2166
|
+
ensRainbow: serializedEnsRainbowPublicConfig,
|
|
2167
|
+
ensIndexer
|
|
2168
|
+
} = stackInfo;
|
|
2169
|
+
const serializedEnsIndexerPublicConfig = serializeEnsIndexerPublicConfig(ensIndexer);
|
|
2170
|
+
return {
|
|
2171
|
+
ensDb: serializedEnsDbPublicConfig,
|
|
2172
|
+
ensIndexer: serializedEnsIndexerPublicConfig,
|
|
2173
|
+
ensRainbow: serializedEnsRainbowPublicConfig
|
|
2174
|
+
};
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2076
2177
|
// src/stack-info/serialize/ensnode-stack-info.ts
|
|
2077
2178
|
function serializeEnsNodeStackInfo(stackInfo) {
|
|
2078
2179
|
return {
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
ensIndexer: serializeEnsIndexerPublicConfig(stackInfo.ensIndexer),
|
|
2082
|
-
ensRainbow: stackInfo.ensRainbow
|
|
2180
|
+
...serializeEnsIndexerStackInfo(stackInfo),
|
|
2181
|
+
ensApi: serializeEnsApiPublicConfig(stackInfo.ensApi)
|
|
2083
2182
|
};
|
|
2084
2183
|
}
|
|
2085
2184
|
|
|
@@ -2099,7 +2198,7 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2099
2198
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2100
2199
|
|
|
2101
2200
|
// src/ensnode/api/name-tokens/deserialize.ts
|
|
2102
|
-
import { prettifyError as
|
|
2201
|
+
import { prettifyError as prettifyError16 } from "zod/v4";
|
|
2103
2202
|
|
|
2104
2203
|
// src/ensnode/api/name-tokens/zod-schemas.ts
|
|
2105
2204
|
import { namehashInterpretedName } from "enssdk";
|
|
@@ -2149,7 +2248,7 @@ import {
|
|
|
2149
2248
|
stringifyAssetId
|
|
2150
2249
|
} from "enssdk";
|
|
2151
2250
|
import { isAddressEqual as isAddressEqual2, zeroAddress as zeroAddress2 } from "viem";
|
|
2152
|
-
import { prettifyError as
|
|
2251
|
+
import { prettifyError as prettifyError15 } from "zod/v4";
|
|
2153
2252
|
|
|
2154
2253
|
// src/tokenscope/zod-schemas.ts
|
|
2155
2254
|
import { AssetId as CaipAssetId } from "caip";
|
|
@@ -2250,7 +2349,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2250
2349
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2251
2350
|
if (parsed.error) {
|
|
2252
2351
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2253
|
-
${
|
|
2352
|
+
${prettifyError15(parsed.error)}
|
|
2254
2353
|
`);
|
|
2255
2354
|
}
|
|
2256
2355
|
return parsed.data;
|
|
@@ -2260,7 +2359,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2260
2359
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2261
2360
|
if (parsed.error) {
|
|
2262
2361
|
throw new RangeError(`Cannot parse AssetId:
|
|
2263
|
-
${
|
|
2362
|
+
${prettifyError15(parsed.error)}
|
|
2264
2363
|
`);
|
|
2265
2364
|
}
|
|
2266
2365
|
return parsed.data;
|
|
@@ -2686,7 +2785,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2686
2785
|
);
|
|
2687
2786
|
if (parsed.error) {
|
|
2688
2787
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2689
|
-
${
|
|
2788
|
+
${prettifyError16(parsed.error)}
|
|
2690
2789
|
`);
|
|
2691
2790
|
}
|
|
2692
2791
|
return parsed.data;
|
|
@@ -2760,7 +2859,7 @@ function serializeNameTokensResponse(response) {
|
|
|
2760
2859
|
}
|
|
2761
2860
|
|
|
2762
2861
|
// src/ensnode/api/registrar-actions/deserialize.ts
|
|
2763
|
-
import { prettifyError as
|
|
2862
|
+
import { prettifyError as prettifyError17 } from "zod/v4";
|
|
2764
2863
|
|
|
2765
2864
|
// src/ensnode/api/registrar-actions/zod-schemas.ts
|
|
2766
2865
|
import { namehashInterpretedName as namehashInterpretedName2 } from "enssdk";
|
|
@@ -3064,7 +3163,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3064
3163
|
if (parsed.error) {
|
|
3065
3164
|
throw new Error(
|
|
3066
3165
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3067
|
-
${
|
|
3166
|
+
${prettifyError17(parsed.error)}
|
|
3068
3167
|
`
|
|
3069
3168
|
);
|
|
3070
3169
|
}
|
|
@@ -3201,12 +3300,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3201
3300
|
}
|
|
3202
3301
|
|
|
3203
3302
|
// src/ensnode/api/shared/errors/deserialize.ts
|
|
3204
|
-
import { prettifyError as
|
|
3303
|
+
import { prettifyError as prettifyError18 } from "zod/v4";
|
|
3205
3304
|
function deserializeErrorResponse2(maybeErrorResponse) {
|
|
3206
3305
|
const parsed = makeErrorResponseSchema().safeParse(maybeErrorResponse);
|
|
3207
3306
|
if (parsed.error) {
|
|
3208
3307
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3209
|
-
${
|
|
3308
|
+
${prettifyError18(parsed.error)}
|
|
3210
3309
|
`);
|
|
3211
3310
|
}
|
|
3212
3311
|
return parsed.data;
|
|
@@ -3773,14 +3872,14 @@ function isResolvedIdentity(identity) {
|
|
|
3773
3872
|
}
|
|
3774
3873
|
|
|
3775
3874
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
3776
|
-
import { prettifyError as
|
|
3875
|
+
import { prettifyError as prettifyError19 } from "zod/v4";
|
|
3777
3876
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
3778
3877
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
3779
3878
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
3780
3879
|
if (parsed.error) {
|
|
3781
3880
|
throw new Error(
|
|
3782
3881
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
3783
|
-
${
|
|
3882
|
+
${prettifyError19(parsed.error)}
|
|
3784
3883
|
`
|
|
3785
3884
|
);
|
|
3786
3885
|
}
|
|
@@ -3798,26 +3897,26 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
3798
3897
|
}
|
|
3799
3898
|
|
|
3800
3899
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
3801
|
-
import { prettifyError as
|
|
3900
|
+
import { prettifyError as prettifyError20 } from "zod/v4";
|
|
3802
3901
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
3803
3902
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
3804
3903
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
3805
3904
|
if (parsed.error) {
|
|
3806
3905
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
3807
|
-
${
|
|
3906
|
+
${prettifyError20(parsed.error)}
|
|
3808
3907
|
`);
|
|
3809
3908
|
}
|
|
3810
3909
|
return parsed.data;
|
|
3811
3910
|
}
|
|
3812
3911
|
|
|
3813
3912
|
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
3814
|
-
import { prettifyError as
|
|
3913
|
+
import { prettifyError as prettifyError21 } from "zod/v4";
|
|
3815
3914
|
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
3816
3915
|
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
3817
3916
|
const parsed = schema.safeParse(unvalidatedProjection);
|
|
3818
3917
|
if (parsed.error) {
|
|
3819
3918
|
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
3820
|
-
${
|
|
3919
|
+
${prettifyError21(parsed.error)}
|
|
3821
3920
|
`);
|
|
3822
3921
|
}
|
|
3823
3922
|
return parsed.data;
|
|
@@ -4012,13 +4111,13 @@ import { getUnixTime as getUnixTime2 } from "date-fns/getUnixTime";
|
|
|
4012
4111
|
import { getUnixTime } from "date-fns/getUnixTime";
|
|
4013
4112
|
|
|
4014
4113
|
// src/shared/deserialize.ts
|
|
4015
|
-
import z21, { prettifyError as
|
|
4114
|
+
import z21, { prettifyError as prettifyError22 } from "zod/v4";
|
|
4016
4115
|
function deserializeChainId(maybeChainId, valueLabel) {
|
|
4017
4116
|
const schema = makeChainIdStringSchema(valueLabel);
|
|
4018
4117
|
const parsed = schema.safeParse(maybeChainId);
|
|
4019
4118
|
if (parsed.error) {
|
|
4020
4119
|
throw new Error(`Cannot deserialize ChainId:
|
|
4021
|
-
${
|
|
4120
|
+
${prettifyError22(parsed.error)}
|
|
4022
4121
|
`);
|
|
4023
4122
|
}
|
|
4024
4123
|
return parsed.data;
|
|
@@ -4028,7 +4127,7 @@ function deserializeDatetime(maybeDatetime, valueLabel) {
|
|
|
4028
4127
|
const parsed = schema.safeParse(maybeDatetime);
|
|
4029
4128
|
if (parsed.error) {
|
|
4030
4129
|
throw new Error(`Cannot deserialize Datetime:
|
|
4031
|
-
${
|
|
4130
|
+
${prettifyError22(parsed.error)}
|
|
4032
4131
|
`);
|
|
4033
4132
|
}
|
|
4034
4133
|
return parsed.data;
|
|
@@ -4038,7 +4137,7 @@ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
|
|
|
4038
4137
|
const parsed = schema.safeParse(maybeTimestamp);
|
|
4039
4138
|
if (parsed.error) {
|
|
4040
4139
|
throw new Error(`Cannot deserialize Unix Timestamp:
|
|
4041
|
-
${
|
|
4140
|
+
${prettifyError22(parsed.error)}
|
|
4042
4141
|
`);
|
|
4043
4142
|
}
|
|
4044
4143
|
return parsed.data;
|
|
@@ -4048,7 +4147,7 @@ function deserializeUrl(maybeUrl, valueLabel) {
|
|
|
4048
4147
|
const parsed = schema.safeParse(maybeUrl);
|
|
4049
4148
|
if (parsed.error) {
|
|
4050
4149
|
throw new Error(`Cannot deserialize URL:
|
|
4051
|
-
${
|
|
4150
|
+
${prettifyError22(parsed.error)}
|
|
4052
4151
|
`);
|
|
4053
4152
|
}
|
|
4054
4153
|
return parsed.data;
|
|
@@ -4058,7 +4157,7 @@ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
|
|
|
4058
4157
|
const parsed = schema.safeParse(maybeBlockNumber);
|
|
4059
4158
|
if (parsed.error) {
|
|
4060
4159
|
throw new Error(`Cannot deserialize BlockNumber:
|
|
4061
|
-
${
|
|
4160
|
+
${prettifyError22(parsed.error)}
|
|
4062
4161
|
`);
|
|
4063
4162
|
}
|
|
4064
4163
|
return parsed.data;
|
|
@@ -4068,7 +4167,7 @@ function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
|
4068
4167
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
4069
4168
|
if (parsed.error) {
|
|
4070
4169
|
throw new Error(`Cannot deserialize BlockRef:
|
|
4071
|
-
${
|
|
4170
|
+
${prettifyError22(parsed.error)}
|
|
4072
4171
|
`);
|
|
4073
4172
|
}
|
|
4074
4173
|
return parsed.data;
|
|
@@ -4078,7 +4177,7 @@ function deserializeDuration(maybeDuration, valueLabel) {
|
|
|
4078
4177
|
const parsed = schema.safeParse(maybeDuration);
|
|
4079
4178
|
if (parsed.error) {
|
|
4080
4179
|
throw new RangeError(`Cannot deserialize Duration:
|
|
4081
|
-
${
|
|
4180
|
+
${prettifyError22(parsed.error)}
|
|
4082
4181
|
`);
|
|
4083
4182
|
}
|
|
4084
4183
|
return parsed.data;
|
|
@@ -4088,7 +4187,7 @@ function parseAccountId(maybeAccountId, valueLabel) {
|
|
|
4088
4187
|
const parsed = schema.safeParse(maybeAccountId);
|
|
4089
4188
|
if (parsed.error) {
|
|
4090
4189
|
throw new RangeError(`Cannot deserialize AccountId:
|
|
4091
|
-
${
|
|
4190
|
+
${prettifyError22(parsed.error)}
|
|
4092
4191
|
`);
|
|
4093
4192
|
}
|
|
4094
4193
|
return parsed.data;
|
|
@@ -4098,7 +4197,7 @@ function deserializePriceEth(maybePrice, valueLabel) {
|
|
|
4098
4197
|
const parsed = schema.safeParse(maybePrice);
|
|
4099
4198
|
if (parsed.error) {
|
|
4100
4199
|
throw new Error(`Cannot deserialize PriceEth:
|
|
4101
|
-
${
|
|
4200
|
+
${prettifyError22(parsed.error)}
|
|
4102
4201
|
`);
|
|
4103
4202
|
}
|
|
4104
4203
|
return parsed.data;
|
|
@@ -4108,7 +4207,7 @@ function deserializePriceUsdc(maybePrice, valueLabel) {
|
|
|
4108
4207
|
const parsed = schema.safeParse(maybePrice);
|
|
4109
4208
|
if (parsed.error) {
|
|
4110
4209
|
throw new Error(`Cannot deserialize PriceUsdc:
|
|
4111
|
-
${
|
|
4210
|
+
${prettifyError22(parsed.error)}
|
|
4112
4211
|
`);
|
|
4113
4212
|
}
|
|
4114
4213
|
return parsed.data;
|
|
@@ -4118,7 +4217,7 @@ function deserializePriceDai(maybePrice, valueLabel) {
|
|
|
4118
4217
|
const parsed = schema.safeParse(maybePrice);
|
|
4119
4218
|
if (parsed.error) {
|
|
4120
4219
|
throw new Error(`Cannot deserialize PriceDai:
|
|
4121
|
-
${
|
|
4220
|
+
${prettifyError22(parsed.error)}
|
|
4122
4221
|
`);
|
|
4123
4222
|
}
|
|
4124
4223
|
return parsed.data;
|
|
@@ -4357,6 +4456,18 @@ function getNamespaceSpecificValue(namespace, value) {
|
|
|
4357
4456
|
return value[namespace] ?? value.default;
|
|
4358
4457
|
}
|
|
4359
4458
|
|
|
4459
|
+
// src/shared/replace-bigints.ts
|
|
4460
|
+
var replaceBigInts = (obj, replacer) => {
|
|
4461
|
+
if (typeof obj === "bigint") return replacer(obj);
|
|
4462
|
+
if (Array.isArray(obj))
|
|
4463
|
+
return obj.map((x) => replaceBigInts(x, replacer));
|
|
4464
|
+
if (obj && typeof obj === "object")
|
|
4465
|
+
return Object.fromEntries(
|
|
4466
|
+
Object.entries(obj).map(([k, v]) => [k, replaceBigInts(v, replacer)])
|
|
4467
|
+
);
|
|
4468
|
+
return obj;
|
|
4469
|
+
};
|
|
4470
|
+
|
|
4360
4471
|
// src/shared/root-registry.ts
|
|
4361
4472
|
import { makeRegistryId } from "enssdk";
|
|
4362
4473
|
import { DatasourceNames as DatasourceNames5 } from "@ensnode/datasources";
|
|
@@ -4372,6 +4483,13 @@ var maybeGetENSv2RootRegistryId = (namespace) => {
|
|
|
4372
4483
|
return makeRegistryId(root);
|
|
4373
4484
|
};
|
|
4374
4485
|
|
|
4486
|
+
// src/shared/to-json.ts
|
|
4487
|
+
var toJson = (value, options) => JSON.stringify(
|
|
4488
|
+
value,
|
|
4489
|
+
(_key, val) => typeof val === "bigint" ? String(val) : val,
|
|
4490
|
+
options?.pretty ? 2 : void 0
|
|
4491
|
+
);
|
|
4492
|
+
|
|
4375
4493
|
// src/shared/url.ts
|
|
4376
4494
|
function isHttpProtocol(url) {
|
|
4377
4495
|
return ["http:", "https:"].includes(url.protocol);
|
|
@@ -4380,14 +4498,45 @@ function isWebSocketProtocol(url) {
|
|
|
4380
4498
|
return ["ws:", "wss:"].includes(url.protocol);
|
|
4381
4499
|
}
|
|
4382
4500
|
|
|
4383
|
-
// src/stack-info/
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
|
|
4501
|
+
// src/stack-info/validate/ensindexer-stack-info.ts
|
|
4502
|
+
import { prettifyError as prettifyError23 } from "zod/v4";
|
|
4503
|
+
function validateEnsIndexerStackInfo(maybeStackInfo, valueLabel) {
|
|
4504
|
+
const parsed = makeEnsIndexerStackInfoSchema(valueLabel).safeParse(maybeStackInfo);
|
|
4505
|
+
if (parsed.error) {
|
|
4506
|
+
throw new Error(`Cannot validate EnsIndexerStackInfo:
|
|
4507
|
+
${prettifyError23(parsed.error)}
|
|
4508
|
+
`);
|
|
4509
|
+
}
|
|
4510
|
+
return parsed.data;
|
|
4511
|
+
}
|
|
4512
|
+
|
|
4513
|
+
// src/stack-info/ensindexer-stack-info.ts
|
|
4514
|
+
function buildEnsIndexerStackInfo(ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig) {
|
|
4515
|
+
return validateEnsIndexerStackInfo({
|
|
4387
4516
|
ensDb: ensDbPublicConfig,
|
|
4388
|
-
ensIndexer:
|
|
4389
|
-
ensRainbow:
|
|
4390
|
-
};
|
|
4517
|
+
ensIndexer: ensIndexerPublicConfig,
|
|
4518
|
+
ensRainbow: ensRainbowPublicConfig
|
|
4519
|
+
});
|
|
4520
|
+
}
|
|
4521
|
+
|
|
4522
|
+
// src/stack-info/validate/ensnode-stack-info.ts
|
|
4523
|
+
import { prettifyError as prettifyError24 } from "zod/v4";
|
|
4524
|
+
function validateEnsNodeStackInfo(maybeStackInfo, valueLabel) {
|
|
4525
|
+
const parsed = makeEnsNodeStackInfoSchema(valueLabel).safeParse(maybeStackInfo);
|
|
4526
|
+
if (parsed.error) {
|
|
4527
|
+
throw new Error(`Cannot validate EnsNodeStackInfo:
|
|
4528
|
+
${prettifyError24(parsed.error)}
|
|
4529
|
+
`);
|
|
4530
|
+
}
|
|
4531
|
+
return parsed.data;
|
|
4532
|
+
}
|
|
4533
|
+
|
|
4534
|
+
// src/stack-info/ensnode-stack-info.ts
|
|
4535
|
+
function buildEnsNodeStackInfo(ensApiPublicConfig, ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig) {
|
|
4536
|
+
return validateEnsNodeStackInfo({
|
|
4537
|
+
...buildEnsIndexerStackInfo(ensDbPublicConfig, ensIndexerPublicConfig, ensRainbowPublicConfig),
|
|
4538
|
+
ensApi: ensApiPublicConfig
|
|
4539
|
+
});
|
|
4391
4540
|
}
|
|
4392
4541
|
|
|
4393
4542
|
// src/subgraph-api/prerequisites.ts
|
|
@@ -4482,6 +4631,7 @@ export {
|
|
|
4482
4631
|
buildBlockRefRange,
|
|
4483
4632
|
buildCrossChainIndexingStatusSnapshotOmnichain,
|
|
4484
4633
|
buildEncodedReferrer,
|
|
4634
|
+
buildEnsIndexerStackInfo,
|
|
4485
4635
|
buildEnsNodeStackInfo,
|
|
4486
4636
|
buildEnsRainbowClientLabelSet,
|
|
4487
4637
|
buildIndexedBlockranges,
|
|
@@ -4493,6 +4643,7 @@ export {
|
|
|
4493
4643
|
buildUnvalidatedCrossChainIndexingStatusSnapshot,
|
|
4494
4644
|
buildUnvalidatedEnsApiPublicConfig,
|
|
4495
4645
|
buildUnvalidatedEnsIndexerPublicConfig,
|
|
4646
|
+
buildUnvalidatedEnsIndexerStackInfo,
|
|
4496
4647
|
buildUnvalidatedEnsNodeStackInfo,
|
|
4497
4648
|
buildUnvalidatedOmnichainIndexingStatusSnapshot,
|
|
4498
4649
|
buildUnvalidatedRealtimeIndexingStatusProjection,
|
|
@@ -4517,6 +4668,7 @@ export {
|
|
|
4517
4668
|
deserializeEnsIndexerConfigResponse,
|
|
4518
4669
|
deserializeEnsIndexerIndexingStatusResponse,
|
|
4519
4670
|
deserializeEnsIndexerPublicConfig,
|
|
4671
|
+
deserializeEnsIndexerStackInfo,
|
|
4520
4672
|
deserializeEnsNodeStackInfo,
|
|
4521
4673
|
deserializeErrorResponse2 as deserializeErrorResponse,
|
|
4522
4674
|
deserializeIndexingStatusResponse,
|
|
@@ -4606,6 +4758,7 @@ export {
|
|
|
4606
4758
|
priceEth,
|
|
4607
4759
|
priceUsdc,
|
|
4608
4760
|
registrarActionsFilter,
|
|
4761
|
+
replaceBigInts,
|
|
4609
4762
|
scaleBigintByNumber,
|
|
4610
4763
|
scalePrice,
|
|
4611
4764
|
serializeAssetId,
|
|
@@ -4622,6 +4775,7 @@ export {
|
|
|
4622
4775
|
serializeEnsIndexerConfigResponse,
|
|
4623
4776
|
serializeEnsIndexerIndexingStatusResponse,
|
|
4624
4777
|
serializeEnsIndexerPublicConfig,
|
|
4778
|
+
serializeEnsIndexerStackInfo,
|
|
4625
4779
|
serializeEnsNodeStackInfo,
|
|
4626
4780
|
serializeIndexedChainIds,
|
|
4627
4781
|
serializeIndexingStatusResponse,
|
|
@@ -4642,13 +4796,16 @@ export {
|
|
|
4642
4796
|
sortChainStatusesByStartBlockAsc,
|
|
4643
4797
|
stripNullBytes,
|
|
4644
4798
|
subtractPrice,
|
|
4799
|
+
toJson,
|
|
4645
4800
|
translateDefaultableChainIdToChainId,
|
|
4646
4801
|
uniq,
|
|
4647
4802
|
validateChainIndexingStatusSnapshot,
|
|
4648
4803
|
validateCrossChainIndexingStatusSnapshot,
|
|
4649
4804
|
validateEnsIndexerPublicConfig,
|
|
4650
4805
|
validateEnsIndexerPublicConfigCompatibility,
|
|
4806
|
+
validateEnsIndexerStackInfo,
|
|
4651
4807
|
validateEnsIndexerVersionInfo,
|
|
4808
|
+
validateEnsNodeStackInfo,
|
|
4652
4809
|
validateOmnichainIndexingStatusSnapshot,
|
|
4653
4810
|
validateRealtimeIndexingStatusProjection,
|
|
4654
4811
|
validateSupportedLabelSetAndVersion
|