@ensnode/ensnode-sdk 0.0.0-next-20260217124010 → 0.0.0-next-20260217194807
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 +252 -212
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +57 -10
- package/dist/index.d.ts +57 -10
- package/dist/index.js +92 -52
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -194,10 +194,10 @@ var uint256ToHex32 = (num) => toHex(num, { size: 32 });
|
|
|
194
194
|
import { ENSNamespaceIds } from "@ensnode/datasources";
|
|
195
195
|
|
|
196
196
|
// src/ensapi/config/deserialize.ts
|
|
197
|
-
import { prettifyError
|
|
197
|
+
import { prettifyError as prettifyError2 } from "zod/v4";
|
|
198
198
|
|
|
199
|
-
// src/
|
|
200
|
-
import {
|
|
199
|
+
// src/ensindexer/config/deserialize.ts
|
|
200
|
+
import { prettifyError } from "zod/v4";
|
|
201
201
|
|
|
202
202
|
// src/ensindexer/config/zod-schemas.ts
|
|
203
203
|
import { z as z2 } from "zod/v4";
|
|
@@ -541,9 +541,14 @@ function invariant_ensDbVersionIsSameAsEnsIndexerVersion(ctx) {
|
|
|
541
541
|
}
|
|
542
542
|
|
|
543
543
|
// src/ensindexer/config/zod-schemas.ts
|
|
544
|
-
var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => z2.
|
|
544
|
+
var makeIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => z2.set(makeChainIdSchema(valueLabel), { error: `${valueLabel} must be a set` }).min(1, {
|
|
545
|
+
error: `${valueLabel} must be a set with at least one chain ID.`
|
|
546
|
+
});
|
|
547
|
+
var makeSerializedIndexedChainIdsSchema = (valueLabel = "Indexed Chain IDs") => z2.array(makeChainIdSchema(valueLabel), {
|
|
545
548
|
error: `${valueLabel} must be an array.`
|
|
546
|
-
}).min(1, {
|
|
549
|
+
}).min(1, {
|
|
550
|
+
error: `${valueLabel} must be an array with at least one chain ID.`
|
|
551
|
+
});
|
|
547
552
|
var makePluginsListSchema = (valueLabel = "Plugins") => z2.array(z2.string(), {
|
|
548
553
|
error: `${valueLabel} must be a list of strings.`
|
|
549
554
|
}).min(1, {
|
|
@@ -592,7 +597,6 @@ var makeEnsIndexerVersionInfoSchema = (valueLabel = "Value") => z2.strictObject(
|
|
|
592
597
|
error: `${valueLabel} must be a valid ENSIndexerVersionInfo object.`
|
|
593
598
|
}
|
|
594
599
|
).check(invariant_ensDbVersionIsSameAsEnsIndexerVersion);
|
|
595
|
-
var makeENSIndexerVersionInfoSchema = makeEnsIndexerVersionInfoSchema;
|
|
596
600
|
function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
597
601
|
const { value: config } = ctx;
|
|
598
602
|
if (config.isSubgraphCompatible && !isSubgraphCompatible(config)) {
|
|
@@ -606,12 +610,46 @@ function invariant_isSubgraphCompatibleRequirements(ctx) {
|
|
|
606
610
|
var makeEnsIndexerPublicConfigSchema = (valueLabel = "ENSIndexerPublicConfig") => z2.object({
|
|
607
611
|
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
608
612
|
indexedChainIds: makeIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
609
|
-
isSubgraphCompatible: z2.boolean({
|
|
613
|
+
isSubgraphCompatible: z2.boolean({
|
|
614
|
+
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
615
|
+
}),
|
|
610
616
|
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
611
617
|
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
612
618
|
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
613
|
-
versionInfo:
|
|
619
|
+
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
614
620
|
}).check(invariant_isSubgraphCompatibleRequirements);
|
|
621
|
+
var makeSerializedEnsIndexerPublicConfigSchema = (valueLabel = "Serialized ENSIndexerPublicConfig") => z2.object({
|
|
622
|
+
labelSet: makeFullyPinnedLabelSetSchema(`${valueLabel}.labelSet`),
|
|
623
|
+
indexedChainIds: makeSerializedIndexedChainIdsSchema(`${valueLabel}.indexedChainIds`),
|
|
624
|
+
isSubgraphCompatible: z2.boolean({
|
|
625
|
+
error: `${valueLabel}.isSubgraphCompatible must be a boolean value.`
|
|
626
|
+
}),
|
|
627
|
+
namespace: makeENSNamespaceIdSchema(`${valueLabel}.namespace`),
|
|
628
|
+
plugins: makePluginsListSchema(`${valueLabel}.plugins`),
|
|
629
|
+
databaseSchemaName: makeDatabaseSchemaNameSchema(`${valueLabel}.databaseSchemaName`),
|
|
630
|
+
versionInfo: makeEnsIndexerVersionInfoSchema(`${valueLabel}.versionInfo`)
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
// src/ensindexer/config/deserialize.ts
|
|
634
|
+
function buildUnvalidatedEnsIndexerPublicConfig(serializedPublicConfig) {
|
|
635
|
+
return {
|
|
636
|
+
...serializedPublicConfig,
|
|
637
|
+
indexedChainIds: new Set(serializedPublicConfig.indexedChainIds)
|
|
638
|
+
};
|
|
639
|
+
}
|
|
640
|
+
function deserializeEnsIndexerPublicConfig(maybePublicConfig, valueLabel) {
|
|
641
|
+
const parsed = makeSerializedEnsIndexerPublicConfigSchema(valueLabel).transform(buildUnvalidatedEnsIndexerPublicConfig).pipe(makeEnsIndexerPublicConfigSchema(valueLabel)).safeParse(maybePublicConfig);
|
|
642
|
+
if (parsed.error) {
|
|
643
|
+
throw new Error(`Cannot deserialize EnsIndexerPublicConfig:
|
|
644
|
+
${prettifyError(parsed.error)}
|
|
645
|
+
`);
|
|
646
|
+
}
|
|
647
|
+
return parsed.data;
|
|
648
|
+
}
|
|
649
|
+
var deserializeENSIndexerPublicConfig = deserializeEnsIndexerPublicConfig;
|
|
650
|
+
|
|
651
|
+
// src/ensapi/config/zod-schemas.ts
|
|
652
|
+
import { z as z4 } from "zod/v4";
|
|
615
653
|
|
|
616
654
|
// src/shared/config/thegraph.ts
|
|
617
655
|
import { z as z3 } from "zod/v4";
|
|
@@ -634,33 +672,47 @@ var TheGraphFallbackSchema = z3.discriminatedUnion("canFallback", [
|
|
|
634
672
|
// src/ensapi/config/zod-schemas.ts
|
|
635
673
|
function makeEnsApiPublicConfigSchema(valueLabel) {
|
|
636
674
|
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
637
|
-
return z4.
|
|
675
|
+
return z4.object({
|
|
638
676
|
version: z4.string().min(1, `${label}.version must be a non-empty string`),
|
|
639
677
|
theGraphFallback: TheGraphFallbackSchema,
|
|
640
678
|
ensIndexerPublicConfig: makeEnsIndexerPublicConfigSchema(`${label}.ensIndexerPublicConfig`)
|
|
641
679
|
});
|
|
642
680
|
}
|
|
643
681
|
var makeENSApiPublicConfigSchema = makeEnsApiPublicConfigSchema;
|
|
682
|
+
function makeSerializedEnsApiPublicConfigSchema(valueLabel) {
|
|
683
|
+
const label = valueLabel ?? "ENSApiPublicConfig";
|
|
684
|
+
return z4.object({
|
|
685
|
+
version: z4.string().min(1, `${label}.version must be a non-empty string`),
|
|
686
|
+
theGraphFallback: TheGraphFallbackSchema,
|
|
687
|
+
ensIndexerPublicConfig: makeSerializedEnsIndexerPublicConfigSchema(
|
|
688
|
+
`${label}.ensIndexerPublicConfig`
|
|
689
|
+
)
|
|
690
|
+
});
|
|
691
|
+
}
|
|
644
692
|
|
|
645
693
|
// src/ensapi/config/deserialize.ts
|
|
646
|
-
function
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
694
|
+
function buildUnvalidatedEnsApiPublicConfig(serializedPublicConfig) {
|
|
695
|
+
return {
|
|
696
|
+
...serializedPublicConfig,
|
|
697
|
+
ensIndexerPublicConfig: buildUnvalidatedEnsIndexerPublicConfig(
|
|
698
|
+
serializedPublicConfig.ensIndexerPublicConfig
|
|
699
|
+
)
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
function deserializeEnsApiPublicConfig(maybePublicConfig, valueLabel) {
|
|
703
|
+
const parsed = makeSerializedEnsApiPublicConfigSchema(valueLabel).transform(buildUnvalidatedEnsApiPublicConfig).pipe(makeEnsApiPublicConfigSchema(valueLabel)).safeParse(maybePublicConfig);
|
|
704
|
+
if (parsed.error) {
|
|
705
|
+
throw new Error(`Cannot deserialize EnsApiPublicConfig:
|
|
706
|
+
${prettifyError2(parsed.error)}
|
|
654
707
|
`);
|
|
655
|
-
}
|
|
656
|
-
throw error;
|
|
657
708
|
}
|
|
709
|
+
return parsed.data;
|
|
658
710
|
}
|
|
659
711
|
var deserializeENSApiPublicConfig = deserializeEnsApiPublicConfig;
|
|
660
712
|
|
|
661
713
|
// src/ensapi/api/config/deserialize.ts
|
|
662
|
-
function deserializeEnsApiConfigResponse(
|
|
663
|
-
return deserializeEnsApiPublicConfig(
|
|
714
|
+
function deserializeEnsApiConfigResponse(maybeResponse) {
|
|
715
|
+
return deserializeEnsApiPublicConfig(maybeResponse);
|
|
664
716
|
}
|
|
665
717
|
var deserializeConfigResponse = deserializeEnsApiConfigResponse;
|
|
666
718
|
|
|
@@ -708,10 +760,10 @@ function serializeEnsApiConfigResponse(response) {
|
|
|
708
760
|
var serializeConfigResponse = serializeEnsApiConfigResponse;
|
|
709
761
|
|
|
710
762
|
// src/ensapi/api/indexing-status/deserialize.ts
|
|
711
|
-
import { prettifyError as
|
|
763
|
+
import { prettifyError as prettifyError6 } from "zod/v4";
|
|
712
764
|
|
|
713
765
|
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
714
|
-
import { prettifyError as
|
|
766
|
+
import { prettifyError as prettifyError5 } from "zod/v4";
|
|
715
767
|
|
|
716
768
|
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
717
769
|
import { z as z8 } from "zod/v4";
|
|
@@ -1390,10 +1442,10 @@ var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value"
|
|
|
1390
1442
|
});
|
|
1391
1443
|
|
|
1392
1444
|
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1393
|
-
import { prettifyError as
|
|
1445
|
+
import { prettifyError as prettifyError4 } from "zod/v4";
|
|
1394
1446
|
|
|
1395
1447
|
// src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
|
|
1396
|
-
import { prettifyError as
|
|
1448
|
+
import { prettifyError as prettifyError3 } from "zod/v4";
|
|
1397
1449
|
function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1398
1450
|
const chains = /* @__PURE__ */ new Map();
|
|
1399
1451
|
for (const [chainIdString, chainIndexingStatusSnapshot] of Object.entries(
|
|
@@ -1414,7 +1466,7 @@ function deserializeOmnichainIndexingStatusSnapshot(data, valueLabel) {
|
|
|
1414
1466
|
if (parsed.error) {
|
|
1415
1467
|
throw new Error(
|
|
1416
1468
|
`Cannot deserialize into OmnichainIndexingStatusSnapshot:
|
|
1417
|
-
${
|
|
1469
|
+
${prettifyError3(parsed.error)}
|
|
1418
1470
|
`
|
|
1419
1471
|
);
|
|
1420
1472
|
}
|
|
@@ -1436,7 +1488,7 @@ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel)
|
|
|
1436
1488
|
if (parsed.error) {
|
|
1437
1489
|
throw new Error(
|
|
1438
1490
|
`Cannot deserialize into CrossChainIndexingStatusSnapshot:
|
|
1439
|
-
${
|
|
1491
|
+
${prettifyError4(parsed.error)}
|
|
1440
1492
|
`
|
|
1441
1493
|
);
|
|
1442
1494
|
}
|
|
@@ -1456,7 +1508,7 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1456
1508
|
if (parsed.error) {
|
|
1457
1509
|
throw new Error(
|
|
1458
1510
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1459
|
-
${
|
|
1511
|
+
${prettifyError5(parsed.error)}
|
|
1460
1512
|
`
|
|
1461
1513
|
);
|
|
1462
1514
|
}
|
|
@@ -1515,7 +1567,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
1515
1567
|
if (parsed.error) {
|
|
1516
1568
|
throw new Error(
|
|
1517
1569
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
1518
|
-
${
|
|
1570
|
+
${prettifyError6(parsed.error)}
|
|
1519
1571
|
`
|
|
1520
1572
|
);
|
|
1521
1573
|
}
|
|
@@ -1646,7 +1698,7 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
1646
1698
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
1647
1699
|
|
|
1648
1700
|
// src/ensapi/api/name-tokens/deserialize.ts
|
|
1649
|
-
import { prettifyError as
|
|
1701
|
+
import { prettifyError as prettifyError8 } from "zod/v4";
|
|
1650
1702
|
|
|
1651
1703
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
1652
1704
|
import { namehash as namehash2 } from "viem";
|
|
@@ -1692,7 +1744,7 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
1692
1744
|
|
|
1693
1745
|
// src/tokenscope/assets.ts
|
|
1694
1746
|
import { isAddressEqual as isAddressEqual2, zeroAddress as zeroAddress2 } from "viem";
|
|
1695
|
-
import { prettifyError as
|
|
1747
|
+
import { prettifyError as prettifyError7 } from "zod/v4";
|
|
1696
1748
|
|
|
1697
1749
|
// src/tokenscope/zod-schemas.ts
|
|
1698
1750
|
import { AssetId as CaipAssetId2 } from "caip";
|
|
@@ -1800,7 +1852,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
1800
1852
|
const parsed = schema.safeParse(maybeAssetId);
|
|
1801
1853
|
if (parsed.error) {
|
|
1802
1854
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
1803
|
-
${
|
|
1855
|
+
${prettifyError7(parsed.error)}
|
|
1804
1856
|
`);
|
|
1805
1857
|
}
|
|
1806
1858
|
return parsed.data;
|
|
@@ -1810,7 +1862,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
1810
1862
|
const parsed = schema.safeParse(maybeAssetId);
|
|
1811
1863
|
if (parsed.error) {
|
|
1812
1864
|
throw new RangeError(`Cannot parse AssetId:
|
|
1813
|
-
${
|
|
1865
|
+
${prettifyError7(parsed.error)}
|
|
1814
1866
|
`);
|
|
1815
1867
|
}
|
|
1816
1868
|
return parsed.data;
|
|
@@ -2235,7 +2287,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2235
2287
|
);
|
|
2236
2288
|
if (parsed.error) {
|
|
2237
2289
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2238
|
-
${
|
|
2290
|
+
${prettifyError8(parsed.error)}
|
|
2239
2291
|
`);
|
|
2240
2292
|
}
|
|
2241
2293
|
return parsed.data;
|
|
@@ -2309,7 +2361,7 @@ function serializeNameTokensResponse(response) {
|
|
|
2309
2361
|
}
|
|
2310
2362
|
|
|
2311
2363
|
// src/ensapi/api/registrar-actions/deserialize.ts
|
|
2312
|
-
import { prettifyError as
|
|
2364
|
+
import { prettifyError as prettifyError9 } from "zod/v4";
|
|
2313
2365
|
|
|
2314
2366
|
// src/ensapi/api/registrar-actions/zod-schemas.ts
|
|
2315
2367
|
import { namehash as namehash3 } from "viem/ens";
|
|
@@ -2615,7 +2667,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
2615
2667
|
if (parsed.error) {
|
|
2616
2668
|
throw new Error(
|
|
2617
2669
|
`Cannot deserialize RegistrarActionsResponse:
|
|
2618
|
-
${
|
|
2670
|
+
${prettifyError9(parsed.error)}
|
|
2619
2671
|
`
|
|
2620
2672
|
);
|
|
2621
2673
|
}
|
|
@@ -2762,12 +2814,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
2762
2814
|
}
|
|
2763
2815
|
|
|
2764
2816
|
// src/ensapi/api/shared/errors/deserialize.ts
|
|
2765
|
-
import { prettifyError as
|
|
2817
|
+
import { prettifyError as prettifyError10 } from "zod/v4";
|
|
2766
2818
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
2767
2819
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
2768
2820
|
if (parsed.error) {
|
|
2769
2821
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
2770
|
-
${
|
|
2822
|
+
${prettifyError10(parsed.error)}
|
|
2771
2823
|
`);
|
|
2772
2824
|
}
|
|
2773
2825
|
return parsed.data;
|
|
@@ -3310,20 +3362,6 @@ var EnsApiClient = class _EnsApiClient {
|
|
|
3310
3362
|
var ENSNodeClient = class extends EnsApiClient {
|
|
3311
3363
|
};
|
|
3312
3364
|
|
|
3313
|
-
// src/ensindexer/config/deserialize.ts
|
|
3314
|
-
import { prettifyError as prettifyError10 } from "zod/v4";
|
|
3315
|
-
function deserializeEnsIndexerPublicConfig(maybeConfig, valueLabel) {
|
|
3316
|
-
const schema = makeEnsIndexerPublicConfigSchema(valueLabel);
|
|
3317
|
-
const parsed = schema.safeParse(maybeConfig);
|
|
3318
|
-
if (parsed.error) {
|
|
3319
|
-
throw new Error(`Cannot deserialize EnsIndexerPublicConfig:
|
|
3320
|
-
${prettifyError10(parsed.error)}
|
|
3321
|
-
`);
|
|
3322
|
-
}
|
|
3323
|
-
return parsed.data;
|
|
3324
|
-
}
|
|
3325
|
-
var deserializeENSIndexerPublicConfig = deserializeEnsIndexerPublicConfig;
|
|
3326
|
-
|
|
3327
3365
|
// src/ensindexer/config/label-utils.ts
|
|
3328
3366
|
import { hexToBytes as hexToBytes2 } from "viem";
|
|
3329
3367
|
function labelHashToBytes(labelHash) {
|
|
@@ -4223,6 +4261,7 @@ export {
|
|
|
4223
4261
|
buildPageContext,
|
|
4224
4262
|
buildUnresolvedIdentity,
|
|
4225
4263
|
buildUnvalidatedCrossChainIndexingStatusSnapshot,
|
|
4264
|
+
buildUnvalidatedEnsIndexerPublicConfig,
|
|
4226
4265
|
buildUnvalidatedOmnichainIndexingStatusSnapshot,
|
|
4227
4266
|
buildUnvalidatedRealtimeIndexingStatusProjection,
|
|
4228
4267
|
checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill,
|
|
@@ -4349,6 +4388,7 @@ export {
|
|
|
4349
4388
|
makeRenewalId,
|
|
4350
4389
|
makeResolverId,
|
|
4351
4390
|
makeResolverRecordsId,
|
|
4391
|
+
makeSerializedEnsApiPublicConfigSchema,
|
|
4352
4392
|
makeSubdomainNode,
|
|
4353
4393
|
maybeGetDatasourceContract,
|
|
4354
4394
|
nameTokensPrerequisites,
|