@ensnode/ensnode-sdk 0.0.0-next-20260228175526 → 0.0.0-next-20260302052919
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 +328 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -1
- package/dist/index.d.ts +40 -1
- package/dist/index.js +159 -50
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -98,10 +98,13 @@ __export(index_exports, {
|
|
|
98
98
|
buildAssetId: () => buildAssetId,
|
|
99
99
|
buildBlockNumberRange: () => buildBlockNumberRange,
|
|
100
100
|
buildBlockRefRange: () => buildBlockRefRange,
|
|
101
|
+
buildCrossChainIndexingStatusSnapshotOmnichain: () => buildCrossChainIndexingStatusSnapshotOmnichain,
|
|
101
102
|
buildEncodedReferrer: () => buildEncodedReferrer,
|
|
102
103
|
buildEnsRainbowClientLabelSet: () => buildEnsRainbowClientLabelSet,
|
|
104
|
+
buildIndexedBlockranges: () => buildIndexedBlockranges,
|
|
103
105
|
buildLabelSetId: () => buildLabelSetId,
|
|
104
106
|
buildLabelSetVersion: () => buildLabelSetVersion,
|
|
107
|
+
buildOmnichainIndexingStatusSnapshot: () => buildOmnichainIndexingStatusSnapshot,
|
|
105
108
|
buildPageContext: () => buildPageContext,
|
|
106
109
|
buildUnresolvedIdentity: () => buildUnresolvedIdentity,
|
|
107
110
|
buildUnvalidatedCrossChainIndexingStatusSnapshot: () => buildUnvalidatedCrossChainIndexingStatusSnapshot,
|
|
@@ -233,6 +236,7 @@ __export(index_exports, {
|
|
|
233
236
|
makeSerializedEnsApiPublicConfigSchema: () => makeSerializedEnsApiPublicConfigSchema,
|
|
234
237
|
makeSubdomainNode: () => makeSubdomainNode,
|
|
235
238
|
maybeGetDatasourceContract: () => maybeGetDatasourceContract,
|
|
239
|
+
mergeBlockNumberRanges: () => mergeBlockNumberRanges,
|
|
236
240
|
nameTokensPrerequisites: () => nameTokensPrerequisites,
|
|
237
241
|
parseAccountId: () => parseAccountId,
|
|
238
242
|
parseAssetId: () => parseAssetId,
|
|
@@ -1072,16 +1076,16 @@ function serializeEnsApiConfigResponse(response) {
|
|
|
1072
1076
|
var serializeConfigResponse = serializeEnsApiConfigResponse;
|
|
1073
1077
|
|
|
1074
1078
|
// src/ensapi/api/indexing-status/deserialize.ts
|
|
1075
|
-
var
|
|
1079
|
+
var import_v417 = require("zod/v4");
|
|
1076
1080
|
|
|
1077
1081
|
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1078
|
-
var
|
|
1082
|
+
var import_v415 = require("zod/v4");
|
|
1079
1083
|
|
|
1080
1084
|
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1081
|
-
var
|
|
1085
|
+
var import_v412 = require("zod/v4");
|
|
1082
1086
|
|
|
1083
1087
|
// src/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1084
|
-
var
|
|
1088
|
+
var import_v411 = require("zod/v4");
|
|
1085
1089
|
|
|
1086
1090
|
// src/shared/block-ref.ts
|
|
1087
1091
|
function isBefore(blockA, blockB) {
|
|
@@ -1133,6 +1137,26 @@ function buildBlockNumberRange(startBlock, endBlock) {
|
|
|
1133
1137
|
}
|
|
1134
1138
|
throw new Error("Invalid block number range. This should be unreachable.");
|
|
1135
1139
|
}
|
|
1140
|
+
function mergeBlockNumberRanges(...ranges) {
|
|
1141
|
+
if (ranges.length === 0) {
|
|
1142
|
+
return buildBlockNumberRange(void 0, void 0);
|
|
1143
|
+
}
|
|
1144
|
+
let minStartBlock;
|
|
1145
|
+
let maxEndBlock;
|
|
1146
|
+
for (const range of ranges) {
|
|
1147
|
+
if (range.startBlock !== void 0) {
|
|
1148
|
+
if (minStartBlock === void 0 || range.startBlock < minStartBlock) {
|
|
1149
|
+
minStartBlock = range.startBlock;
|
|
1150
|
+
}
|
|
1151
|
+
}
|
|
1152
|
+
if (range.endBlock !== void 0) {
|
|
1153
|
+
if (maxEndBlock === void 0 || range.endBlock > maxEndBlock) {
|
|
1154
|
+
maxEndBlock = range.endBlock;
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
return buildBlockNumberRange(minStartBlock, maxEndBlock);
|
|
1159
|
+
}
|
|
1136
1160
|
function buildBlockRefRange(startBlock, endBlock) {
|
|
1137
1161
|
if (startBlock === void 0 && endBlock === void 0) {
|
|
1138
1162
|
return {
|
|
@@ -1240,6 +1264,19 @@ function sortChainStatusesByStartBlockAsc(chains) {
|
|
|
1240
1264
|
);
|
|
1241
1265
|
}
|
|
1242
1266
|
|
|
1267
|
+
// src/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
1268
|
+
var import_v47 = require("zod/v4");
|
|
1269
|
+
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1270
|
+
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
1271
|
+
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1272
|
+
if (parsed.error) {
|
|
1273
|
+
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
1274
|
+
${(0, import_v47.prettifyError)(parsed.error)}
|
|
1275
|
+
`);
|
|
1276
|
+
}
|
|
1277
|
+
return parsed.data;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1243
1280
|
// src/indexing-status/cross-chain-indexing-status-snapshot.ts
|
|
1244
1281
|
var CrossChainIndexingStrategyIds = {
|
|
1245
1282
|
/**
|
|
@@ -1268,9 +1305,30 @@ function getLatestIndexedBlockRef(indexingStatus, chainId) {
|
|
|
1268
1305
|
}
|
|
1269
1306
|
return chainIndexingStatus.latestIndexedBlock;
|
|
1270
1307
|
}
|
|
1308
|
+
function buildCrossChainIndexingStatusSnapshotOmnichain(omnichainSnapshot, snapshotTime) {
|
|
1309
|
+
return validateCrossChainIndexingStatusSnapshot({
|
|
1310
|
+
strategy: CrossChainIndexingStrategyIds.Omnichain,
|
|
1311
|
+
slowestChainIndexingCursor: omnichainSnapshot.omnichainIndexingCursor,
|
|
1312
|
+
omnichainSnapshot,
|
|
1313
|
+
snapshotTime
|
|
1314
|
+
});
|
|
1315
|
+
}
|
|
1271
1316
|
|
|
1272
1317
|
// src/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1318
|
+
var import_v410 = require("zod/v4");
|
|
1319
|
+
|
|
1320
|
+
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
1273
1321
|
var import_v48 = require("zod/v4");
|
|
1322
|
+
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1323
|
+
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
1324
|
+
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1325
|
+
if (parsed.error) {
|
|
1326
|
+
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
1327
|
+
${(0, import_v48.prettifyError)(parsed.error)}
|
|
1328
|
+
`);
|
|
1329
|
+
}
|
|
1330
|
+
return parsed.data;
|
|
1331
|
+
}
|
|
1274
1332
|
|
|
1275
1333
|
// src/indexing-status/omnichain-indexing-status-snapshot.ts
|
|
1276
1334
|
var OmnichainIndexingStatusIds = {
|
|
@@ -1352,9 +1410,51 @@ function getOmnichainIndexingCursor(chains) {
|
|
|
1352
1410
|
}
|
|
1353
1411
|
return Math.max(...latestIndexedBlockTimestamps);
|
|
1354
1412
|
}
|
|
1413
|
+
function buildOmnichainIndexingStatusSnapshot(chainStatusSnapshots) {
|
|
1414
|
+
if (chainStatusSnapshots.size === 0) {
|
|
1415
|
+
throw new Error(
|
|
1416
|
+
"At least one chain indexing status snapshot is required to build an OmnichainIndexingStatusSnapshot"
|
|
1417
|
+
);
|
|
1418
|
+
}
|
|
1419
|
+
const chains = Array.from(chainStatusSnapshots.values());
|
|
1420
|
+
const omnichainStatus = getOmnichainIndexingStatus(chains);
|
|
1421
|
+
const omnichainIndexingCursor = getOmnichainIndexingCursor(chains);
|
|
1422
|
+
switch (omnichainStatus) {
|
|
1423
|
+
case OmnichainIndexingStatusIds.Unstarted: {
|
|
1424
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1425
|
+
omnichainStatus: OmnichainIndexingStatusIds.Unstarted,
|
|
1426
|
+
chains: chainStatusSnapshots,
|
|
1427
|
+
// narrowing the type here, will be validated in the following 'check' step
|
|
1428
|
+
omnichainIndexingCursor
|
|
1429
|
+
});
|
|
1430
|
+
}
|
|
1431
|
+
case OmnichainIndexingStatusIds.Backfill: {
|
|
1432
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1433
|
+
omnichainStatus: OmnichainIndexingStatusIds.Backfill,
|
|
1434
|
+
chains: chainStatusSnapshots,
|
|
1435
|
+
// narrowing the type here, will be validated in the following 'check' step
|
|
1436
|
+
omnichainIndexingCursor
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
case OmnichainIndexingStatusIds.Completed: {
|
|
1440
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1441
|
+
omnichainStatus: OmnichainIndexingStatusIds.Completed,
|
|
1442
|
+
chains: chainStatusSnapshots,
|
|
1443
|
+
// narrowing the type here, will be validated in the following 'check' step
|
|
1444
|
+
omnichainIndexingCursor
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1447
|
+
case OmnichainIndexingStatusIds.Following:
|
|
1448
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1449
|
+
omnichainStatus: OmnichainIndexingStatusIds.Following,
|
|
1450
|
+
chains: chainStatusSnapshots,
|
|
1451
|
+
omnichainIndexingCursor
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1355
1455
|
|
|
1356
1456
|
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1357
|
-
var
|
|
1457
|
+
var import_v49 = require("zod/v4");
|
|
1358
1458
|
function invariant_chainSnapshotQueuedBlocks(ctx) {
|
|
1359
1459
|
const { config } = ctx.value;
|
|
1360
1460
|
if (config.rangeType === RangeTypeIds.LeftBounded) {
|
|
@@ -1429,29 +1529,29 @@ function invariant_chainSnapshotFollowingBlocks(ctx) {
|
|
|
1429
1529
|
});
|
|
1430
1530
|
}
|
|
1431
1531
|
}
|
|
1432
|
-
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") =>
|
|
1433
|
-
chainStatus:
|
|
1434
|
-
config:
|
|
1435
|
-
|
|
1436
|
-
rangeType:
|
|
1532
|
+
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v49.z.object({
|
|
1533
|
+
chainStatus: import_v49.z.literal(ChainIndexingStatusIds.Queued),
|
|
1534
|
+
config: import_v49.z.discriminatedUnion("rangeType", [
|
|
1535
|
+
import_v49.z.object({
|
|
1536
|
+
rangeType: import_v49.z.literal(RangeTypeIds.LeftBounded),
|
|
1437
1537
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1438
1538
|
}),
|
|
1439
|
-
|
|
1440
|
-
rangeType:
|
|
1539
|
+
import_v49.z.object({
|
|
1540
|
+
rangeType: import_v49.z.literal(RangeTypeIds.Bounded),
|
|
1441
1541
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1442
1542
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1443
1543
|
})
|
|
1444
1544
|
])
|
|
1445
1545
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1446
|
-
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") =>
|
|
1447
|
-
chainStatus:
|
|
1448
|
-
config:
|
|
1449
|
-
|
|
1450
|
-
rangeType:
|
|
1546
|
+
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v49.z.object({
|
|
1547
|
+
chainStatus: import_v49.z.literal(ChainIndexingStatusIds.Backfill),
|
|
1548
|
+
config: import_v49.z.discriminatedUnion("rangeType", [
|
|
1549
|
+
import_v49.z.object({
|
|
1550
|
+
rangeType: import_v49.z.literal(RangeTypeIds.LeftBounded),
|
|
1451
1551
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1452
1552
|
}),
|
|
1453
|
-
|
|
1454
|
-
rangeType:
|
|
1553
|
+
import_v49.z.object({
|
|
1554
|
+
rangeType: import_v49.z.literal(RangeTypeIds.Bounded),
|
|
1455
1555
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1456
1556
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1457
1557
|
})
|
|
@@ -1459,25 +1559,25 @@ var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => im
|
|
|
1459
1559
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1460
1560
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1461
1561
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1462
|
-
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") =>
|
|
1463
|
-
chainStatus:
|
|
1464
|
-
config:
|
|
1465
|
-
rangeType:
|
|
1562
|
+
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => import_v49.z.object({
|
|
1563
|
+
chainStatus: import_v49.z.literal(ChainIndexingStatusIds.Completed),
|
|
1564
|
+
config: import_v49.z.object({
|
|
1565
|
+
rangeType: import_v49.z.literal(RangeTypeIds.Bounded),
|
|
1466
1566
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1467
1567
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1468
1568
|
}),
|
|
1469
1569
|
latestIndexedBlock: makeBlockRefSchema(valueLabel)
|
|
1470
1570
|
}).check(invariant_chainSnapshotCompletedBlocks);
|
|
1471
|
-
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") =>
|
|
1472
|
-
chainStatus:
|
|
1473
|
-
config:
|
|
1474
|
-
rangeType:
|
|
1571
|
+
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => import_v49.z.object({
|
|
1572
|
+
chainStatus: import_v49.z.literal(ChainIndexingStatusIds.Following),
|
|
1573
|
+
config: import_v49.z.object({
|
|
1574
|
+
rangeType: import_v49.z.literal(RangeTypeIds.LeftBounded),
|
|
1475
1575
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1476
1576
|
}),
|
|
1477
1577
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1478
1578
|
latestKnownBlock: makeBlockRefSchema(valueLabel)
|
|
1479
1579
|
}).check(invariant_chainSnapshotFollowingBlocks);
|
|
1480
|
-
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1580
|
+
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v49.z.discriminatedUnion("chainStatus", [
|
|
1481
1581
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1482
1582
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1483
1583
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1606,11 +1706,11 @@ function invariant_omnichainStatusSnapshotFollowingHasValidChains(ctx) {
|
|
|
1606
1706
|
});
|
|
1607
1707
|
}
|
|
1608
1708
|
}
|
|
1609
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1610
|
-
omnichainStatus:
|
|
1611
|
-
chains:
|
|
1709
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v410.z.object({
|
|
1710
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1711
|
+
chains: import_v410.z.map(
|
|
1612
1712
|
makeChainIdSchema(),
|
|
1613
|
-
|
|
1713
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1614
1714
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1615
1715
|
]),
|
|
1616
1716
|
{
|
|
@@ -1619,11 +1719,11 @@ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_
|
|
|
1619
1719
|
),
|
|
1620
1720
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1621
1721
|
}).check(invariant_omnichainSnapshotUnstartedHasValidChains);
|
|
1622
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1623
|
-
omnichainStatus:
|
|
1624
|
-
chains:
|
|
1722
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v410.z.object({
|
|
1723
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1724
|
+
chains: import_v410.z.map(
|
|
1625
1725
|
makeChainIdSchema(),
|
|
1626
|
-
|
|
1726
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1627
1727
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1628
1728
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1629
1729
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1634,11 +1734,11 @@ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v
|
|
|
1634
1734
|
),
|
|
1635
1735
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1636
1736
|
}).check(invariant_omnichainStatusSnapshotBackfillHasValidChains);
|
|
1637
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1638
|
-
omnichainStatus:
|
|
1639
|
-
chains:
|
|
1737
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v410.z.object({
|
|
1738
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1739
|
+
chains: import_v410.z.map(
|
|
1640
1740
|
makeChainIdSchema(),
|
|
1641
|
-
|
|
1741
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1642
1742
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1643
1743
|
]),
|
|
1644
1744
|
{
|
|
@@ -1647,11 +1747,11 @@ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_
|
|
|
1647
1747
|
),
|
|
1648
1748
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1649
1749
|
}).check(invariant_omnichainStatusSnapshotCompletedHasValidChains);
|
|
1650
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1651
|
-
omnichainStatus:
|
|
1652
|
-
chains:
|
|
1750
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v410.z.object({
|
|
1751
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1752
|
+
chains: import_v410.z.map(
|
|
1653
1753
|
makeChainIdSchema(),
|
|
1654
|
-
|
|
1754
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1655
1755
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1656
1756
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1657
1757
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1663,7 +1763,7 @@ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_
|
|
|
1663
1763
|
),
|
|
1664
1764
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1665
1765
|
}).check(invariant_omnichainStatusSnapshotFollowingHasValidChains);
|
|
1666
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1766
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v410.z.discriminatedUnion("omnichainStatus", [
|
|
1667
1767
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1668
1768
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1669
1769
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1671,21 +1771,21 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1671
1771
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1672
1772
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1673
1773
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1674
|
-
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1675
|
-
omnichainStatus:
|
|
1676
|
-
chains:
|
|
1774
|
+
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v410.z.object({
|
|
1775
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1776
|
+
chains: import_v410.z.record(
|
|
1677
1777
|
makeChainIdStringSchema(),
|
|
1678
|
-
|
|
1778
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1679
1779
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1680
1780
|
])
|
|
1681
1781
|
),
|
|
1682
1782
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1683
1783
|
});
|
|
1684
|
-
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1685
|
-
omnichainStatus:
|
|
1686
|
-
chains:
|
|
1784
|
+
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v410.z.object({
|
|
1785
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1786
|
+
chains: import_v410.z.record(
|
|
1687
1787
|
makeChainIdStringSchema(),
|
|
1688
|
-
|
|
1788
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1689
1789
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1690
1790
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1691
1791
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1693,21 +1793,21 @@ var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =
|
|
|
1693
1793
|
),
|
|
1694
1794
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1695
1795
|
});
|
|
1696
|
-
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1697
|
-
omnichainStatus:
|
|
1698
|
-
chains:
|
|
1796
|
+
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v410.z.object({
|
|
1797
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1798
|
+
chains: import_v410.z.record(
|
|
1699
1799
|
makeChainIdStringSchema(),
|
|
1700
|
-
|
|
1800
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1701
1801
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1702
1802
|
])
|
|
1703
1803
|
),
|
|
1704
1804
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1705
1805
|
});
|
|
1706
|
-
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1707
|
-
omnichainStatus:
|
|
1708
|
-
chains:
|
|
1806
|
+
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v410.z.object({
|
|
1807
|
+
omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1808
|
+
chains: import_v410.z.record(
|
|
1709
1809
|
makeChainIdStringSchema(),
|
|
1710
|
-
|
|
1810
|
+
import_v410.z.discriminatedUnion("chainStatus", [
|
|
1711
1811
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1712
1812
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1713
1813
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1716,7 +1816,7 @@ var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel)
|
|
|
1716
1816
|
),
|
|
1717
1817
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1718
1818
|
});
|
|
1719
|
-
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1819
|
+
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v410.z.discriminatedUnion("omnichainStatus", [
|
|
1720
1820
|
makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1721
1821
|
makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1722
1822
|
makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1756,17 +1856,17 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1756
1856
|
});
|
|
1757
1857
|
}
|
|
1758
1858
|
}
|
|
1759
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1760
|
-
strategy:
|
|
1859
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v411.z.object({
|
|
1860
|
+
strategy: import_v411.z.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1761
1861
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1762
1862
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1763
1863
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1764
1864
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1765
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1865
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v411.z.discriminatedUnion("strategy", [
|
|
1766
1866
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1767
1867
|
]);
|
|
1768
|
-
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") =>
|
|
1769
|
-
strategy:
|
|
1868
|
+
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") => import_v411.z.object({
|
|
1869
|
+
strategy: import_v411.z.enum(CrossChainIndexingStrategyIds),
|
|
1770
1870
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1771
1871
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1772
1872
|
omnichainSnapshot: makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
@@ -1796,22 +1896,22 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
|
|
|
1796
1896
|
});
|
|
1797
1897
|
}
|
|
1798
1898
|
}
|
|
1799
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") =>
|
|
1899
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v412.z.object({
|
|
1800
1900
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1801
1901
|
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1802
1902
|
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
1803
1903
|
}).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
|
|
1804
|
-
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") =>
|
|
1904
|
+
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v412.z.object({
|
|
1805
1905
|
snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
|
|
1806
1906
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1807
1907
|
worstCaseDistance: makeDurationSchema(valueLabel)
|
|
1808
1908
|
});
|
|
1809
1909
|
|
|
1810
1910
|
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1811
|
-
var
|
|
1911
|
+
var import_v414 = require("zod/v4");
|
|
1812
1912
|
|
|
1813
1913
|
// src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
|
|
1814
|
-
var
|
|
1914
|
+
var import_v413 = require("zod/v4");
|
|
1815
1915
|
function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1816
1916
|
const chains = /* @__PURE__ */ new Map();
|
|
1817
1917
|
for (const [chainIdString, chainIndexingStatusSnapshot] of Object.entries(
|
|
@@ -1832,7 +1932,7 @@ function deserializeOmnichainIndexingStatusSnapshot(data, valueLabel) {
|
|
|
1832
1932
|
if (parsed.error) {
|
|
1833
1933
|
throw new Error(
|
|
1834
1934
|
`Cannot deserialize into OmnichainIndexingStatusSnapshot:
|
|
1835
|
-
${(0,
|
|
1935
|
+
${(0, import_v413.prettifyError)(parsed.error)}
|
|
1836
1936
|
`
|
|
1837
1937
|
);
|
|
1838
1938
|
}
|
|
@@ -1854,7 +1954,7 @@ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel)
|
|
|
1854
1954
|
if (parsed.error) {
|
|
1855
1955
|
throw new Error(
|
|
1856
1956
|
`Cannot deserialize into CrossChainIndexingStatusSnapshot:
|
|
1857
|
-
${(0,
|
|
1957
|
+
${(0, import_v414.prettifyError)(parsed.error)}
|
|
1858
1958
|
`
|
|
1859
1959
|
);
|
|
1860
1960
|
}
|
|
@@ -1874,7 +1974,7 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1874
1974
|
if (parsed.error) {
|
|
1875
1975
|
throw new Error(
|
|
1876
1976
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1877
|
-
${(0,
|
|
1977
|
+
${(0, import_v415.prettifyError)(parsed.error)}
|
|
1878
1978
|
`
|
|
1879
1979
|
);
|
|
1880
1980
|
}
|
|
@@ -1895,23 +1995,23 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
1895
1995
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
1896
1996
|
|
|
1897
1997
|
// src/ensapi/api/indexing-status/zod-schemas.ts
|
|
1898
|
-
var
|
|
1899
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
1900
|
-
responseCode:
|
|
1998
|
+
var import_v416 = require("zod/v4");
|
|
1999
|
+
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v416.z.strictObject({
|
|
2000
|
+
responseCode: import_v416.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
1901
2001
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1902
2002
|
});
|
|
1903
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
1904
|
-
responseCode:
|
|
2003
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v416.z.strictObject({
|
|
2004
|
+
responseCode: import_v416.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
1905
2005
|
});
|
|
1906
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
2006
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v416.z.discriminatedUnion("responseCode", [
|
|
1907
2007
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
1908
2008
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
1909
2009
|
]);
|
|
1910
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
1911
|
-
responseCode:
|
|
2010
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v416.z.strictObject({
|
|
2011
|
+
responseCode: import_v416.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
1912
2012
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1913
2013
|
});
|
|
1914
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
2014
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v416.z.discriminatedUnion("responseCode", [
|
|
1915
2015
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
1916
2016
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
1917
2017
|
]);
|
|
@@ -1933,7 +2033,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
1933
2033
|
if (parsed.error) {
|
|
1934
2034
|
throw new Error(
|
|
1935
2035
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
1936
|
-
${(0,
|
|
2036
|
+
${(0, import_v417.prettifyError)(parsed.error)}
|
|
1937
2037
|
`
|
|
1938
2038
|
);
|
|
1939
2039
|
}
|
|
@@ -2070,11 +2170,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2070
2170
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2071
2171
|
|
|
2072
2172
|
// src/ensapi/api/name-tokens/deserialize.ts
|
|
2073
|
-
var
|
|
2173
|
+
var import_v422 = require("zod/v4");
|
|
2074
2174
|
|
|
2075
2175
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2076
2176
|
var import_viem14 = require("viem");
|
|
2077
|
-
var
|
|
2177
|
+
var import_v421 = require("zod/v4");
|
|
2078
2178
|
|
|
2079
2179
|
// src/tokenscope/name-token.ts
|
|
2080
2180
|
var import_viem13 = require("viem");
|
|
@@ -2114,12 +2214,12 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2114
2214
|
|
|
2115
2215
|
// src/tokenscope/assets.ts
|
|
2116
2216
|
var import_viem12 = require("viem");
|
|
2117
|
-
var
|
|
2217
|
+
var import_v419 = require("zod/v4");
|
|
2118
2218
|
|
|
2119
2219
|
// src/tokenscope/zod-schemas.ts
|
|
2120
2220
|
var import_caip3 = require("caip");
|
|
2121
2221
|
var import_viem11 = require("viem");
|
|
2122
|
-
var
|
|
2222
|
+
var import_v418 = require("zod/v4");
|
|
2123
2223
|
|
|
2124
2224
|
// src/shared/types.ts
|
|
2125
2225
|
var AssetNamespaces = {
|
|
@@ -2128,10 +2228,10 @@ var AssetNamespaces = {
|
|
|
2128
2228
|
};
|
|
2129
2229
|
|
|
2130
2230
|
// src/tokenscope/zod-schemas.ts
|
|
2131
|
-
var tokenIdSchemaSerializable =
|
|
2132
|
-
var tokenIdSchemaNative =
|
|
2231
|
+
var tokenIdSchemaSerializable = import_v418.z.string();
|
|
2232
|
+
var tokenIdSchemaNative = import_v418.z.preprocess(
|
|
2133
2233
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2134
|
-
|
|
2234
|
+
import_v418.z.bigint().positive()
|
|
2135
2235
|
);
|
|
2136
2236
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2137
2237
|
if (serializable) {
|
|
@@ -2141,13 +2241,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2141
2241
|
}
|
|
2142
2242
|
}
|
|
2143
2243
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2144
|
-
return
|
|
2145
|
-
assetNamespace:
|
|
2244
|
+
return import_v418.z.object({
|
|
2245
|
+
assetNamespace: import_v418.z.enum(AssetNamespaces),
|
|
2146
2246
|
contract: makeAccountIdSchema(valueLabel),
|
|
2147
2247
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2148
2248
|
});
|
|
2149
2249
|
};
|
|
2150
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2250
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v418.z.preprocess((v) => {
|
|
2151
2251
|
if (typeof v === "string") {
|
|
2152
2252
|
const result = new import_caip3.AssetId(v);
|
|
2153
2253
|
return {
|
|
@@ -2171,20 +2271,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2171
2271
|
});
|
|
2172
2272
|
}
|
|
2173
2273
|
}
|
|
2174
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2175
|
-
ownershipType:
|
|
2274
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v418.z.object({
|
|
2275
|
+
ownershipType: import_v418.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2176
2276
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2177
2277
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2178
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2179
|
-
ownershipType:
|
|
2278
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v418.z.object({
|
|
2279
|
+
ownershipType: import_v418.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2180
2280
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2181
2281
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2182
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2183
|
-
ownershipType:
|
|
2282
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v418.z.object({
|
|
2283
|
+
ownershipType: import_v418.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2184
2284
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2185
2285
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2186
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2187
|
-
ownershipType:
|
|
2286
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v418.z.object({
|
|
2287
|
+
ownershipType: import_v418.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2188
2288
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2189
2289
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2190
2290
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2197,16 +2297,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2197
2297
|
});
|
|
2198
2298
|
}
|
|
2199
2299
|
}
|
|
2200
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2300
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v418.z.discriminatedUnion("ownershipType", [
|
|
2201
2301
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2202
2302
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2203
2303
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2204
2304
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2205
2305
|
]);
|
|
2206
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2306
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v418.z.object({
|
|
2207
2307
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2208
2308
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2209
|
-
mintStatus:
|
|
2309
|
+
mintStatus: import_v418.z.enum(NFTMintStatuses)
|
|
2210
2310
|
});
|
|
2211
2311
|
|
|
2212
2312
|
// src/tokenscope/assets.ts
|
|
@@ -2222,7 +2322,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2222
2322
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2223
2323
|
if (parsed.error) {
|
|
2224
2324
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2225
|
-
${(0,
|
|
2325
|
+
${(0, import_v419.prettifyError)(parsed.error)}
|
|
2226
2326
|
`);
|
|
2227
2327
|
}
|
|
2228
2328
|
return parsed.data;
|
|
@@ -2232,7 +2332,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2232
2332
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2233
2333
|
if (parsed.error) {
|
|
2234
2334
|
throw new RangeError(`Cannot parse AssetId:
|
|
2235
|
-
${(0,
|
|
2335
|
+
${(0, import_v419.prettifyError)(parsed.error)}
|
|
2236
2336
|
`);
|
|
2237
2337
|
}
|
|
2238
2338
|
return parsed.data;
|
|
@@ -2532,10 +2632,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2532
2632
|
}
|
|
2533
2633
|
|
|
2534
2634
|
// src/ensapi/api/shared/errors/zod-schemas.ts
|
|
2535
|
-
var
|
|
2536
|
-
var ErrorResponseSchema =
|
|
2537
|
-
message:
|
|
2538
|
-
details:
|
|
2635
|
+
var import_v420 = require("zod/v4");
|
|
2636
|
+
var ErrorResponseSchema = import_v420.z.object({
|
|
2637
|
+
message: import_v420.z.string(),
|
|
2638
|
+
details: import_v420.z.optional(import_v420.z.unknown())
|
|
2539
2639
|
});
|
|
2540
2640
|
|
|
2541
2641
|
// src/ensapi/api/name-tokens/response.ts
|
|
@@ -2574,10 +2674,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2574
2674
|
};
|
|
2575
2675
|
|
|
2576
2676
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2577
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2677
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v421.z.object({
|
|
2578
2678
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2579
2679
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2580
|
-
tokens:
|
|
2680
|
+
tokens: import_v421.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2581
2681
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2582
2682
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2583
2683
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2619,32 +2719,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2619
2719
|
});
|
|
2620
2720
|
}
|
|
2621
2721
|
});
|
|
2622
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2623
|
-
responseCode:
|
|
2722
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v421.z.strictObject({
|
|
2723
|
+
responseCode: import_v421.z.literal(NameTokensResponseCodes.Ok),
|
|
2624
2724
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2625
2725
|
});
|
|
2626
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2627
|
-
responseCode:
|
|
2628
|
-
errorCode:
|
|
2726
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v421.z.strictObject({
|
|
2727
|
+
responseCode: import_v421.z.literal(NameTokensResponseCodes.Error),
|
|
2728
|
+
errorCode: import_v421.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2629
2729
|
error: ErrorResponseSchema
|
|
2630
2730
|
});
|
|
2631
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2632
|
-
responseCode:
|
|
2633
|
-
errorCode:
|
|
2731
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v421.z.strictObject({
|
|
2732
|
+
responseCode: import_v421.z.literal(NameTokensResponseCodes.Error),
|
|
2733
|
+
errorCode: import_v421.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2634
2734
|
error: ErrorResponseSchema
|
|
2635
2735
|
});
|
|
2636
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2637
|
-
responseCode:
|
|
2638
|
-
errorCode:
|
|
2736
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v421.z.strictObject({
|
|
2737
|
+
responseCode: import_v421.z.literal(NameTokensResponseCodes.Error),
|
|
2738
|
+
errorCode: import_v421.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2639
2739
|
error: ErrorResponseSchema
|
|
2640
2740
|
});
|
|
2641
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2741
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v421.z.discriminatedUnion("errorCode", [
|
|
2642
2742
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2643
2743
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2644
2744
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2645
2745
|
]);
|
|
2646
2746
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2647
|
-
return
|
|
2747
|
+
return import_v421.z.discriminatedUnion("responseCode", [
|
|
2648
2748
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2649
2749
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2650
2750
|
]);
|
|
@@ -2657,7 +2757,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2657
2757
|
);
|
|
2658
2758
|
if (parsed.error) {
|
|
2659
2759
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2660
|
-
${(0,
|
|
2760
|
+
${(0, import_v422.prettifyError)(parsed.error)}
|
|
2661
2761
|
`);
|
|
2662
2762
|
}
|
|
2663
2763
|
return parsed.data;
|
|
@@ -2731,14 +2831,14 @@ function serializeNameTokensResponse(response) {
|
|
|
2731
2831
|
}
|
|
2732
2832
|
|
|
2733
2833
|
// src/ensapi/api/registrar-actions/deserialize.ts
|
|
2734
|
-
var
|
|
2834
|
+
var import_v426 = require("zod/v4");
|
|
2735
2835
|
|
|
2736
2836
|
// src/ensapi/api/registrar-actions/zod-schemas.ts
|
|
2737
2837
|
var import_ens7 = require("viem/ens");
|
|
2738
|
-
var
|
|
2838
|
+
var import_v425 = require("zod/v4");
|
|
2739
2839
|
|
|
2740
2840
|
// src/registrars/zod-schemas.ts
|
|
2741
|
-
var
|
|
2841
|
+
var import_v423 = require("zod/v4");
|
|
2742
2842
|
|
|
2743
2843
|
// src/registrars/encoded-referrer.ts
|
|
2744
2844
|
var import_viem15 = require("viem");
|
|
@@ -2813,11 +2913,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2813
2913
|
}
|
|
2814
2914
|
|
|
2815
2915
|
// src/registrars/zod-schemas.ts
|
|
2816
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2916
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v423.z.object({
|
|
2817
2917
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2818
2918
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2819
2919
|
});
|
|
2820
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2920
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v423.z.object({
|
|
2821
2921
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2822
2922
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2823
2923
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2833,18 +2933,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2833
2933
|
});
|
|
2834
2934
|
}
|
|
2835
2935
|
}
|
|
2836
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
2936
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v423.z.union([
|
|
2837
2937
|
// pricing available
|
|
2838
|
-
|
|
2938
|
+
import_v423.z.object({
|
|
2839
2939
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2840
2940
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2841
2941
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2842
2942
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2843
2943
|
// pricing unknown
|
|
2844
|
-
|
|
2845
|
-
baseCost:
|
|
2846
|
-
premium:
|
|
2847
|
-
total:
|
|
2944
|
+
import_v423.z.object({
|
|
2945
|
+
baseCost: import_v423.z.null(),
|
|
2946
|
+
premium: import_v423.z.null(),
|
|
2947
|
+
total: import_v423.z.null()
|
|
2848
2948
|
}).transform((v) => v)
|
|
2849
2949
|
]);
|
|
2850
2950
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2867,9 +2967,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2867
2967
|
});
|
|
2868
2968
|
}
|
|
2869
2969
|
}
|
|
2870
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
2970
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v423.z.union([
|
|
2871
2971
|
// referral available
|
|
2872
|
-
|
|
2972
|
+
import_v423.z.object({
|
|
2873
2973
|
encodedReferrer: makeHexStringSchema(
|
|
2874
2974
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2875
2975
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2877,9 +2977,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2877
2977
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2878
2978
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2879
2979
|
// referral not applicable
|
|
2880
|
-
|
|
2881
|
-
encodedReferrer:
|
|
2882
|
-
decodedReferrer:
|
|
2980
|
+
import_v423.z.object({
|
|
2981
|
+
encodedReferrer: import_v423.z.null(),
|
|
2982
|
+
decodedReferrer: import_v423.z.null()
|
|
2883
2983
|
})
|
|
2884
2984
|
]);
|
|
2885
2985
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2892,9 +2992,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2892
2992
|
});
|
|
2893
2993
|
}
|
|
2894
2994
|
}
|
|
2895
|
-
var EventIdSchema =
|
|
2896
|
-
var EventIdsSchema =
|
|
2897
|
-
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") =>
|
|
2995
|
+
var EventIdSchema = import_v423.z.string().nonempty();
|
|
2996
|
+
var EventIdsSchema = import_v423.z.array(EventIdSchema).min(1).transform((v) => v);
|
|
2997
|
+
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v423.z.object({
|
|
2898
2998
|
id: EventIdSchema,
|
|
2899
2999
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
2900
3000
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -2908,38 +3008,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
|
|
|
2908
3008
|
eventIds: EventIdsSchema
|
|
2909
3009
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
2910
3010
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2911
|
-
type:
|
|
3011
|
+
type: import_v423.z.literal(RegistrarActionTypes.Registration)
|
|
2912
3012
|
});
|
|
2913
3013
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2914
|
-
type:
|
|
3014
|
+
type: import_v423.z.literal(RegistrarActionTypes.Renewal)
|
|
2915
3015
|
});
|
|
2916
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
3016
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v423.z.discriminatedUnion("type", [
|
|
2917
3017
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
2918
3018
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
2919
3019
|
]);
|
|
2920
3020
|
|
|
2921
3021
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
2922
|
-
var
|
|
3022
|
+
var import_v424 = require("zod/v4");
|
|
2923
3023
|
|
|
2924
3024
|
// src/ensapi/api/shared/pagination/request.ts
|
|
2925
3025
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
2926
3026
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
2927
3027
|
|
|
2928
3028
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
2929
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3029
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v424.z.object({
|
|
2930
3030
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
2931
3031
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
2932
3032
|
RECORDS_PER_PAGE_MAX,
|
|
2933
3033
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
2934
3034
|
)
|
|
2935
3035
|
});
|
|
2936
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
2937
|
-
totalRecords:
|
|
2938
|
-
totalPages:
|
|
2939
|
-
hasNext:
|
|
2940
|
-
hasPrev:
|
|
2941
|
-
startIndex:
|
|
2942
|
-
endIndex:
|
|
3036
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v424.z.object({
|
|
3037
|
+
totalRecords: import_v424.z.literal(0),
|
|
3038
|
+
totalPages: import_v424.z.literal(1),
|
|
3039
|
+
hasNext: import_v424.z.literal(false),
|
|
3040
|
+
hasPrev: import_v424.z.literal(false),
|
|
3041
|
+
startIndex: import_v424.z.undefined(),
|
|
3042
|
+
endIndex: import_v424.z.undefined()
|
|
2943
3043
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
2944
3044
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
2945
3045
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -2974,15 +3074,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
2974
3074
|
});
|
|
2975
3075
|
}
|
|
2976
3076
|
}
|
|
2977
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3077
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v424.z.object({
|
|
2978
3078
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
2979
3079
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
2980
|
-
hasNext:
|
|
2981
|
-
hasPrev:
|
|
3080
|
+
hasNext: import_v424.z.boolean(),
|
|
3081
|
+
hasPrev: import_v424.z.boolean(),
|
|
2982
3082
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
2983
3083
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
2984
3084
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
2985
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3085
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v424.z.union([
|
|
2986
3086
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
2987
3087
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
2988
3088
|
]);
|
|
@@ -3012,21 +3112,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3012
3112
|
});
|
|
3013
3113
|
}
|
|
3014
3114
|
}
|
|
3015
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3115
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v425.z.object({
|
|
3016
3116
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3017
3117
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3018
3118
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3019
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3020
|
-
responseCode:
|
|
3021
|
-
registrarActions:
|
|
3119
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v425.z.object({
|
|
3120
|
+
responseCode: import_v425.z.literal(RegistrarActionsResponseCodes.Ok),
|
|
3121
|
+
registrarActions: import_v425.z.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
3022
3122
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3023
3123
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
3024
3124
|
});
|
|
3025
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3026
|
-
responseCode:
|
|
3125
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v425.z.strictObject({
|
|
3126
|
+
responseCode: import_v425.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3027
3127
|
error: ErrorResponseSchema
|
|
3028
3128
|
});
|
|
3029
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3129
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v425.z.discriminatedUnion("responseCode", [
|
|
3030
3130
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3031
3131
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3032
3132
|
]);
|
|
@@ -3037,7 +3137,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3037
3137
|
if (parsed.error) {
|
|
3038
3138
|
throw new Error(
|
|
3039
3139
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3040
|
-
${(0,
|
|
3140
|
+
${(0, import_v426.prettifyError)(parsed.error)}
|
|
3041
3141
|
`
|
|
3042
3142
|
);
|
|
3043
3143
|
}
|
|
@@ -3184,12 +3284,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3184
3284
|
}
|
|
3185
3285
|
|
|
3186
3286
|
// src/ensapi/api/shared/errors/deserialize.ts
|
|
3187
|
-
var
|
|
3287
|
+
var import_v427 = require("zod/v4");
|
|
3188
3288
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
3189
3289
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
3190
3290
|
if (parsed.error) {
|
|
3191
3291
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3192
|
-
${(0,
|
|
3292
|
+
${(0, import_v427.prettifyError)(parsed.error)}
|
|
3193
3293
|
`);
|
|
3194
3294
|
}
|
|
3195
3295
|
return parsed.data;
|
|
@@ -3749,7 +3849,7 @@ function serializeEnsIndexerConfigResponse(response) {
|
|
|
3749
3849
|
}
|
|
3750
3850
|
|
|
3751
3851
|
// src/ensindexer/api/indexing-status/deserialize.ts
|
|
3752
|
-
var
|
|
3852
|
+
var import_v429 = require("zod/v4");
|
|
3753
3853
|
|
|
3754
3854
|
// src/ensindexer/api/indexing-status/response.ts
|
|
3755
3855
|
var EnsIndexerIndexingStatusResponseCodes = {
|
|
@@ -3764,23 +3864,23 @@ var EnsIndexerIndexingStatusResponseCodes = {
|
|
|
3764
3864
|
};
|
|
3765
3865
|
|
|
3766
3866
|
// src/ensindexer/api/indexing-status/zod-schemas.ts
|
|
3767
|
-
var
|
|
3768
|
-
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
3769
|
-
responseCode:
|
|
3867
|
+
var import_v428 = require("zod/v4");
|
|
3868
|
+
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v428.z.strictObject({
|
|
3869
|
+
responseCode: import_v428.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3770
3870
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3771
3871
|
});
|
|
3772
|
-
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
3773
|
-
responseCode:
|
|
3872
|
+
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v428.z.strictObject({
|
|
3873
|
+
responseCode: import_v428.z.literal(EnsIndexerIndexingStatusResponseCodes.Error)
|
|
3774
3874
|
});
|
|
3775
|
-
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
3875
|
+
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v428.z.discriminatedUnion("responseCode", [
|
|
3776
3876
|
makeEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3777
3877
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3778
3878
|
]);
|
|
3779
|
-
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
3780
|
-
responseCode:
|
|
3879
|
+
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v428.z.strictObject({
|
|
3880
|
+
responseCode: import_v428.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3781
3881
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3782
3882
|
});
|
|
3783
|
-
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
3883
|
+
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v428.z.discriminatedUnion("responseCode", [
|
|
3784
3884
|
makeSerializedEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3785
3885
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3786
3886
|
]);
|
|
@@ -3802,7 +3902,7 @@ function deserializeEnsIndexerIndexingStatusResponse(maybeResponse) {
|
|
|
3802
3902
|
if (parsed.error) {
|
|
3803
3903
|
throw new Error(
|
|
3804
3904
|
`Cannot deserialize EnsIndexerIndexingStatusResponse:
|
|
3805
|
-
${(0,
|
|
3905
|
+
${(0, import_v429.prettifyError)(parsed.error)}
|
|
3806
3906
|
`
|
|
3807
3907
|
);
|
|
3808
3908
|
}
|
|
@@ -3823,13 +3923,13 @@ function serializeEnsIndexerIndexingStatusResponse(response) {
|
|
|
3823
3923
|
}
|
|
3824
3924
|
|
|
3825
3925
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
3826
|
-
var
|
|
3926
|
+
var import_v431 = require("zod/v4");
|
|
3827
3927
|
|
|
3828
3928
|
// src/ensindexer/api/shared/errors/zod-schemas.ts
|
|
3829
|
-
var
|
|
3830
|
-
var ErrorResponseSchema2 =
|
|
3831
|
-
message:
|
|
3832
|
-
details:
|
|
3929
|
+
var import_v430 = require("zod/v4");
|
|
3930
|
+
var ErrorResponseSchema2 = import_v430.z.object({
|
|
3931
|
+
message: import_v430.z.string(),
|
|
3932
|
+
details: import_v430.z.optional(import_v430.z.unknown())
|
|
3833
3933
|
});
|
|
3834
3934
|
|
|
3835
3935
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
@@ -3837,7 +3937,7 @@ function deserializeErrorResponse2(maybeErrorResponse) {
|
|
|
3837
3937
|
const parsed = ErrorResponseSchema2.safeParse(maybeErrorResponse);
|
|
3838
3938
|
if (parsed.error) {
|
|
3839
3939
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3840
|
-
${(0,
|
|
3940
|
+
${(0, import_v431.prettifyError)(parsed.error)}
|
|
3841
3941
|
`);
|
|
3842
3942
|
}
|
|
3843
3943
|
return parsed.data;
|
|
@@ -4114,14 +4214,14 @@ function isResolvedIdentity(identity) {
|
|
|
4114
4214
|
}
|
|
4115
4215
|
|
|
4116
4216
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
4117
|
-
var
|
|
4217
|
+
var import_v432 = require("zod/v4");
|
|
4118
4218
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4119
4219
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4120
4220
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4121
4221
|
if (parsed.error) {
|
|
4122
4222
|
throw new Error(
|
|
4123
4223
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4124
|
-
${(0,
|
|
4224
|
+
${(0, import_v432.prettifyError)(parsed.error)}
|
|
4125
4225
|
`
|
|
4126
4226
|
);
|
|
4127
4227
|
}
|
|
@@ -4139,38 +4239,12 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4139
4239
|
}
|
|
4140
4240
|
|
|
4141
4241
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4142
|
-
var
|
|
4242
|
+
var import_v433 = require("zod/v4");
|
|
4143
4243
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4144
4244
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4145
4245
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4146
4246
|
if (parsed.error) {
|
|
4147
4247
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4148
|
-
${(0, import_v431.prettifyError)(parsed.error)}
|
|
4149
|
-
`);
|
|
4150
|
-
}
|
|
4151
|
-
return parsed.data;
|
|
4152
|
-
}
|
|
4153
|
-
|
|
4154
|
-
// src/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
4155
|
-
var import_v432 = require("zod/v4");
|
|
4156
|
-
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4157
|
-
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4158
|
-
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4159
|
-
if (parsed.error) {
|
|
4160
|
-
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
4161
|
-
${(0, import_v432.prettifyError)(parsed.error)}
|
|
4162
|
-
`);
|
|
4163
|
-
}
|
|
4164
|
-
return parsed.data;
|
|
4165
|
-
}
|
|
4166
|
-
|
|
4167
|
-
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
4168
|
-
var import_v433 = require("zod/v4");
|
|
4169
|
-
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4170
|
-
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
4171
|
-
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4172
|
-
if (parsed.error) {
|
|
4173
|
-
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
4174
4248
|
${(0, import_v433.prettifyError)(parsed.error)}
|
|
4175
4249
|
`);
|
|
4176
4250
|
}
|
|
@@ -4619,6 +4693,39 @@ var TtlCache = class {
|
|
|
4619
4693
|
}
|
|
4620
4694
|
};
|
|
4621
4695
|
|
|
4696
|
+
// src/shared/config/indexed-blockranges.ts
|
|
4697
|
+
var import_datasources12 = require("@ensnode/datasources");
|
|
4698
|
+
function buildIndexedBlockranges(namespace, pluginsRequiredDatasourceNames) {
|
|
4699
|
+
const indexedBlockranges = /* @__PURE__ */ new Map();
|
|
4700
|
+
for (const [pluginName, requiredDatasourceNames] of pluginsRequiredDatasourceNames) {
|
|
4701
|
+
for (const requiredDatasourceName of requiredDatasourceNames) {
|
|
4702
|
+
const requiredDatasource = (0, import_datasources12.maybeGetDatasource)(namespace, requiredDatasourceName);
|
|
4703
|
+
if (!requiredDatasource) {
|
|
4704
|
+
throw new Error(
|
|
4705
|
+
`Datasource ${requiredDatasourceName} required by plugin ${pluginName} is not defined in namespace ${namespace}.`
|
|
4706
|
+
);
|
|
4707
|
+
}
|
|
4708
|
+
const datasourceChainId = requiredDatasource.chain.id;
|
|
4709
|
+
const datasourceContracts = Object.values(requiredDatasource.contracts);
|
|
4710
|
+
for (const datasourceContract of datasourceContracts) {
|
|
4711
|
+
const currentChainIndexedBlockrange = indexedBlockranges.get(datasourceChainId);
|
|
4712
|
+
const contractIndexedBlockrange = buildBlockNumberRange(
|
|
4713
|
+
datasourceContract.startBlock,
|
|
4714
|
+
datasourceContract.endBlock
|
|
4715
|
+
);
|
|
4716
|
+
const indexedBlockrange = currentChainIndexedBlockrange ? mergeBlockNumberRanges(currentChainIndexedBlockrange, contractIndexedBlockrange) : contractIndexedBlockrange;
|
|
4717
|
+
if (indexedBlockrange.rangeType !== RangeTypeIds.LeftBounded && indexedBlockrange.rangeType !== RangeTypeIds.Bounded) {
|
|
4718
|
+
throw new Error(
|
|
4719
|
+
`Indexed blockrange for chain ${datasourceChainId} is expected to be left-bounded or bounded, but got ${indexedBlockrange.rangeType}.`
|
|
4720
|
+
);
|
|
4721
|
+
}
|
|
4722
|
+
indexedBlockranges.set(datasourceChainId, indexedBlockrange);
|
|
4723
|
+
}
|
|
4724
|
+
}
|
|
4725
|
+
}
|
|
4726
|
+
return indexedBlockranges;
|
|
4727
|
+
}
|
|
4728
|
+
|
|
4622
4729
|
// src/shared/interpretation/interpret-address.ts
|
|
4623
4730
|
var import_viem18 = require("viem");
|
|
4624
4731
|
var interpretAddress = (owner) => (0, import_viem18.isAddressEqual)(import_viem18.zeroAddress, owner) ? null : owner;
|
|
@@ -4735,10 +4842,10 @@ ${JSON.stringify(concrete)}`
|
|
|
4735
4842
|
}
|
|
4736
4843
|
|
|
4737
4844
|
// src/shared/root-registry.ts
|
|
4738
|
-
var
|
|
4739
|
-
var getENSv1Registry = (namespace) => getDatasourceContract(namespace,
|
|
4845
|
+
var import_datasources13 = require("@ensnode/datasources");
|
|
4846
|
+
var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
4740
4847
|
var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
|
|
4741
|
-
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace,
|
|
4848
|
+
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
4742
4849
|
var getENSv2RootRegistryId = (namespace) => makeRegistryId(getENSv2RootRegistry(namespace));
|
|
4743
4850
|
var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
|
|
4744
4851
|
|