@ensnode/ensnode-sdk 0.0.0-next-20260216100641 → 0.0.0-next-20260216102612

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 CHANGED
@@ -97,6 +97,9 @@ __export(index_exports, {
97
97
  buildLabelSetVersion: () => buildLabelSetVersion,
98
98
  buildPageContext: () => buildPageContext,
99
99
  buildUnresolvedIdentity: () => buildUnresolvedIdentity,
100
+ buildUnvalidatedCrossChainIndexingStatusSnapshot: () => buildUnvalidatedCrossChainIndexingStatusSnapshot,
101
+ buildUnvalidatedOmnichainIndexingStatusSnapshot: () => buildUnvalidatedOmnichainIndexingStatusSnapshot,
102
+ buildUnvalidatedRealtimeIndexingStatusProjection: () => buildUnvalidatedRealtimeIndexingStatusProjection,
100
103
  checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill: () => checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill,
101
104
  checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted: () => checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted,
102
105
  checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing: () => checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing,
@@ -266,6 +269,9 @@ __export(index_exports, {
266
269
  uint256ToHex32: () => uint256ToHex32,
267
270
  uniq: () => uniq,
268
271
  validateChainIndexingStatusSnapshot: () => validateChainIndexingStatusSnapshot,
272
+ validateCrossChainIndexingStatusSnapshot: () => validateCrossChainIndexingStatusSnapshot,
273
+ validateOmnichainIndexingStatusSnapshot: () => validateOmnichainIndexingStatusSnapshot,
274
+ validateRealtimeIndexingStatusProjection: () => validateRealtimeIndexingStatusProjection,
269
275
  validateSupportedLabelSetAndVersion: () => validateSupportedLabelSetAndVersion
270
276
  });
271
277
  module.exports = __toCommonJS(index_exports);
@@ -1307,11 +1313,10 @@ var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v47
1307
1313
  makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
1308
1314
  makeChainIndexingStatusSnapshotFollowingSchema(valueLabel)
1309
1315
  ]);
1310
- var makeSerializedChainIndexingStatusSnapshotSchema = makeChainIndexingStatusSnapshotSchema;
1311
1316
 
1312
1317
  // src/ensindexer/indexing-status/deserialize/chain-indexing-status-snapshot.ts
1313
1318
  function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
1314
- const schema = makeSerializedChainIndexingStatusSnapshotSchema(valueLabel);
1319
+ const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
1315
1320
  const parsed = schema.safeParse(maybeSnapshot);
1316
1321
  if (parsed.error) {
1317
1322
  throw new Error(
@@ -1327,133 +1332,10 @@ ${(0, import_v48.prettifyError)(parsed.error)}
1327
1332
  var import_v412 = require("zod/v4");
1328
1333
 
1329
1334
  // src/ensindexer/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
1330
- var import_v411 = require("zod/v4");
1331
-
1332
- // src/ensindexer/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
1333
1335
  var import_v410 = require("zod/v4");
1334
1336
 
1335
- // src/shared/deserialize.ts
1336
- var import_v49 = __toESM(require("zod/v4"), 1);
1337
- function deserializeChainId(maybeChainId, valueLabel) {
1338
- const schema = makeChainIdStringSchema(valueLabel);
1339
- const parsed = schema.safeParse(maybeChainId);
1340
- if (parsed.error) {
1341
- throw new Error(`Cannot deserialize ChainId:
1342
- ${(0, import_v49.prettifyError)(parsed.error)}
1343
- `);
1344
- }
1345
- return parsed.data;
1346
- }
1347
- function deserializeDatetime(maybeDatetime, valueLabel) {
1348
- const schema = makeDatetimeSchema(valueLabel);
1349
- const parsed = schema.safeParse(maybeDatetime);
1350
- if (parsed.error) {
1351
- throw new Error(`Cannot deserialize Datetime:
1352
- ${(0, import_v49.prettifyError)(parsed.error)}
1353
- `);
1354
- }
1355
- return parsed.data;
1356
- }
1357
- function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
1358
- const schema = makeUnixTimestampSchema(valueLabel);
1359
- const parsed = schema.safeParse(maybeTimestamp);
1360
- if (parsed.error) {
1361
- throw new Error(`Cannot deserialize Unix Timestamp:
1362
- ${(0, import_v49.prettifyError)(parsed.error)}
1363
- `);
1364
- }
1365
- return parsed.data;
1366
- }
1367
- function deserializeUrl(maybeUrl, valueLabel) {
1368
- const schema = makeUrlSchema(valueLabel);
1369
- const parsed = schema.safeParse(maybeUrl);
1370
- if (parsed.error) {
1371
- throw new Error(`Cannot deserialize URL:
1372
- ${(0, import_v49.prettifyError)(parsed.error)}
1373
- `);
1374
- }
1375
- return parsed.data;
1376
- }
1377
- function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
1378
- const schema = makeBlockNumberSchema(valueLabel);
1379
- const parsed = schema.safeParse(maybeBlockNumber);
1380
- if (parsed.error) {
1381
- throw new Error(`Cannot deserialize BlockNumber:
1382
- ${(0, import_v49.prettifyError)(parsed.error)}
1383
- `);
1384
- }
1385
- return parsed.data;
1386
- }
1387
- function deserializeBlockrange(maybeBlockrange, valueLabel) {
1388
- const schema = makeBlockrangeSchema(valueLabel);
1389
- const parsed = schema.safeParse(maybeBlockrange);
1390
- if (parsed.error) {
1391
- throw new Error(`Cannot deserialize Blockrange:
1392
- ${(0, import_v49.prettifyError)(parsed.error)}
1393
- `);
1394
- }
1395
- return parsed.data;
1396
- }
1397
- function deserializeBlockRef(maybeBlockRef, valueLabel) {
1398
- const schema = makeBlockRefSchema(valueLabel);
1399
- const parsed = schema.safeParse(maybeBlockRef);
1400
- if (parsed.error) {
1401
- throw new Error(`Cannot deserialize BlockRef:
1402
- ${(0, import_v49.prettifyError)(parsed.error)}
1403
- `);
1404
- }
1405
- return parsed.data;
1406
- }
1407
- function deserializeDuration(maybeDuration, valueLabel) {
1408
- const schema = import_v49.default.coerce.number().pipe(makeDurationSchema(valueLabel));
1409
- const parsed = schema.safeParse(maybeDuration);
1410
- if (parsed.error) {
1411
- throw new RangeError(`Cannot deserialize Duration:
1412
- ${(0, import_v49.prettifyError)(parsed.error)}
1413
- `);
1414
- }
1415
- return parsed.data;
1416
- }
1417
- function parseAccountId(maybeAccountId, valueLabel) {
1418
- const schema = makeAccountIdStringSchema(valueLabel);
1419
- const parsed = schema.safeParse(maybeAccountId);
1420
- if (parsed.error) {
1421
- throw new RangeError(`Cannot deserialize AccountId:
1422
- ${(0, import_v49.prettifyError)(parsed.error)}
1423
- `);
1424
- }
1425
- return parsed.data;
1426
- }
1427
- function deserializePriceEth(maybePrice, valueLabel) {
1428
- const schema = makePriceEthSchema(valueLabel);
1429
- const parsed = schema.safeParse(maybePrice);
1430
- if (parsed.error) {
1431
- throw new Error(`Cannot deserialize PriceEth:
1432
- ${(0, import_v49.prettifyError)(parsed.error)}
1433
- `);
1434
- }
1435
- return parsed.data;
1436
- }
1437
- function deserializePriceUsdc(maybePrice, valueLabel) {
1438
- const schema = makePriceUsdcSchema(valueLabel);
1439
- const parsed = schema.safeParse(maybePrice);
1440
- if (parsed.error) {
1441
- throw new Error(`Cannot deserialize PriceUsdc:
1442
- ${(0, import_v49.prettifyError)(parsed.error)}
1443
- `);
1444
- }
1445
- return parsed.data;
1446
- }
1447
- function deserializePriceDai(maybePrice, valueLabel) {
1448
- const schema = makePriceDaiSchema(valueLabel);
1449
- const parsed = schema.safeParse(maybePrice);
1450
- if (parsed.error) {
1451
- throw new Error(`Cannot deserialize PriceDai:
1452
- ${(0, import_v49.prettifyError)(parsed.error)}
1453
- `);
1454
- }
1455
- return parsed.data;
1456
- }
1337
+ // src/ensindexer/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
1338
+ var import_v49 = require("zod/v4");
1457
1339
 
1458
1340
  // src/ensindexer/indexing-status/omnichain-indexing-status-snapshot.ts
1459
1341
  var OmnichainIndexingStatusIds = {
@@ -1607,76 +1489,115 @@ function invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcro
1607
1489
  }
1608
1490
  }
1609
1491
  function invariant_omnichainSnapshotUnstartedHasValidChains(ctx) {
1610
- const chains = ctx.value;
1492
+ const snapshot = ctx.value;
1611
1493
  const hasValidChains = checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(
1612
- Array.from(chains.values())
1494
+ Array.from(snapshot.chains.values())
1613
1495
  );
1614
1496
  if (hasValidChains === false) {
1615
1497
  ctx.issues.push({
1616
1498
  code: "custom",
1617
- input: chains,
1499
+ input: snapshot,
1618
1500
  message: `For omnichain status snapshot 'unstarted', all chains must have "queued" status.`
1619
1501
  });
1620
1502
  }
1621
1503
  }
1622
1504
  function invariant_omnichainStatusSnapshotBackfillHasValidChains(ctx) {
1623
- const chains = ctx.value;
1505
+ const snapshot = ctx.value;
1624
1506
  const hasValidChains = checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(
1625
- Array.from(chains.values())
1507
+ Array.from(snapshot.chains.values())
1626
1508
  );
1627
1509
  if (hasValidChains === false) {
1628
1510
  ctx.issues.push({
1629
1511
  code: "custom",
1630
- input: chains,
1512
+ input: snapshot,
1631
1513
  message: `For omnichain status snapshot 'backfill', at least one chain must be in "backfill" status and each chain has to have a status of either "queued", "backfill" or "completed".`
1632
1514
  });
1633
1515
  }
1634
1516
  }
1635
1517
  function invariant_omnichainStatusSnapshotCompletedHasValidChains(ctx) {
1636
- const chains = ctx.value;
1518
+ const snapshot = ctx.value;
1637
1519
  const hasValidChains = checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(
1638
- Array.from(chains.values())
1520
+ Array.from(snapshot.chains.values())
1639
1521
  );
1640
1522
  if (hasValidChains === false) {
1641
1523
  ctx.issues.push({
1642
1524
  code: "custom",
1643
- input: chains,
1525
+ input: snapshot,
1644
1526
  message: `For omnichain status snapshot 'completed', all chains must have "completed" status.`
1645
1527
  });
1646
1528
  }
1647
1529
  }
1648
- var makeChainIndexingStatusesSchema = (valueLabel = "Value") => import_v410.z.record(makeChainIdStringSchema(), makeChainIndexingStatusSnapshotSchema(valueLabel), {
1649
- error: "Chains indexing statuses must be an object mapping valid chain IDs to their indexing status snapshots."
1650
- }).transform((serializedChainsIndexingStatus) => {
1651
- const chainsIndexingStatus = /* @__PURE__ */ new Map();
1652
- for (const [chainIdString, chainStatus] of Object.entries(serializedChainsIndexingStatus)) {
1653
- chainsIndexingStatus.set(deserializeChainId(chainIdString), chainStatus);
1530
+ function invariant_omnichainStatusSnapshotFollowingHasValidChains(ctx) {
1531
+ const snapshot = ctx.value;
1532
+ const hasValidChains = checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(
1533
+ Array.from(snapshot.chains.values())
1534
+ );
1535
+ if (hasValidChains === false) {
1536
+ ctx.issues.push({
1537
+ code: "custom",
1538
+ input: snapshot,
1539
+ message: "For omnichainStatus 'following', at least one chain must be in 'following' status."
1540
+ });
1654
1541
  }
1655
- return chainsIndexingStatus;
1656
- });
1657
- var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v410.z.strictObject({
1658
- omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Unstarted),
1659
- chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainSnapshotUnstartedHasValidChains).transform((chains) => chains),
1542
+ }
1543
+ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v49.z.object({
1544
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Unstarted),
1545
+ chains: import_v49.z.map(
1546
+ makeChainIdSchema(),
1547
+ import_v49.z.discriminatedUnion("chainStatus", [
1548
+ makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
1549
+ ]),
1550
+ {
1551
+ error: "Chains indexing statuses must be a Map with ChainId as keys and ChainIndexingStatusSnapshot as values."
1552
+ }
1553
+ ),
1660
1554
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1661
- });
1662
- var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v410.z.strictObject({
1663
- omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Backfill),
1664
- chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotBackfillHasValidChains).transform(
1665
- (chains) => chains
1555
+ }).check(invariant_omnichainSnapshotUnstartedHasValidChains);
1556
+ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v49.z.object({
1557
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Backfill),
1558
+ chains: import_v49.z.map(
1559
+ makeChainIdSchema(),
1560
+ import_v49.z.discriminatedUnion("chainStatus", [
1561
+ makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
1562
+ makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
1563
+ makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
1564
+ ]),
1565
+ {
1566
+ error: "Chains indexing statuses must be a Map with ChainId as keys and ChainIndexingStatusSnapshot as values."
1567
+ }
1666
1568
  ),
1667
1569
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1668
- });
1669
- var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v410.z.strictObject({
1670
- omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Completed),
1671
- chains: makeChainIndexingStatusesSchema(valueLabel).check(invariant_omnichainStatusSnapshotCompletedHasValidChains).transform((chains) => chains),
1570
+ }).check(invariant_omnichainStatusSnapshotBackfillHasValidChains);
1571
+ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v49.z.object({
1572
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Completed),
1573
+ chains: import_v49.z.map(
1574
+ makeChainIdSchema(),
1575
+ import_v49.z.discriminatedUnion("chainStatus", [
1576
+ makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
1577
+ ]),
1578
+ {
1579
+ error: "Chains indexing statuses must be a Map with ChainId as keys and ChainIndexingStatusSnapshot as values."
1580
+ }
1581
+ ),
1672
1582
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1673
- });
1674
- var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v410.z.strictObject({
1675
- omnichainStatus: import_v410.z.literal(OmnichainIndexingStatusIds.Following),
1676
- chains: makeChainIndexingStatusesSchema(valueLabel),
1583
+ }).check(invariant_omnichainStatusSnapshotCompletedHasValidChains);
1584
+ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v49.z.object({
1585
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Following),
1586
+ chains: import_v49.z.map(
1587
+ makeChainIdSchema(),
1588
+ import_v49.z.discriminatedUnion("chainStatus", [
1589
+ makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
1590
+ makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
1591
+ makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
1592
+ makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
1593
+ ]),
1594
+ {
1595
+ error: "Chains indexing statuses must be a Map with ChainId as keys and ChainIndexingStatusSnapshot as values."
1596
+ }
1597
+ ),
1677
1598
  omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1678
- });
1679
- var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v410.z.discriminatedUnion("omnichainStatus", [
1599
+ }).check(invariant_omnichainStatusSnapshotFollowingHasValidChains);
1600
+ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v49.z.discriminatedUnion("omnichainStatus", [
1680
1601
  makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
1681
1602
  makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
1682
1603
  makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
@@ -1684,16 +1605,63 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
1684
1605
  ]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
1685
1606
  invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
1686
1607
  ).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
1608
+ var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v49.z.object({
1609
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Unstarted),
1610
+ chains: import_v49.z.record(
1611
+ makeChainIdStringSchema(),
1612
+ import_v49.z.discriminatedUnion("chainStatus", [
1613
+ makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
1614
+ ])
1615
+ ),
1616
+ omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1617
+ });
1618
+ var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v49.z.object({
1619
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Backfill),
1620
+ chains: import_v49.z.record(
1621
+ makeChainIdStringSchema(),
1622
+ import_v49.z.discriminatedUnion("chainStatus", [
1623
+ makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
1624
+ makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
1625
+ makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
1626
+ ])
1627
+ ),
1628
+ omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1629
+ });
1630
+ var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v49.z.object({
1631
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Completed),
1632
+ chains: import_v49.z.record(
1633
+ makeChainIdStringSchema(),
1634
+ import_v49.z.discriminatedUnion("chainStatus", [
1635
+ makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
1636
+ ])
1637
+ ),
1638
+ omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1639
+ });
1640
+ var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v49.z.object({
1641
+ omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Following),
1642
+ chains: import_v49.z.record(
1643
+ makeChainIdStringSchema(),
1644
+ import_v49.z.discriminatedUnion("chainStatus", [
1645
+ makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
1646
+ makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
1647
+ makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
1648
+ makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
1649
+ ])
1650
+ ),
1651
+ omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
1652
+ });
1653
+ var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v49.z.discriminatedUnion("omnichainStatus", [
1654
+ makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
1655
+ makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
1656
+ makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
1657
+ makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema(valueLabel)
1658
+ ]);
1687
1659
 
1688
1660
  // src/ensindexer/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
1689
1661
  function invariant_slowestChainEqualsToOmnichainSnapshotTime(ctx) {
1690
1662
  const { slowestChainIndexingCursor, omnichainSnapshot } = ctx.value;
1691
1663
  const { omnichainIndexingCursor } = omnichainSnapshot;
1692
1664
  if (slowestChainIndexingCursor !== omnichainIndexingCursor) {
1693
- console.log("invariant_slowestChainEqualsToOmnichainSnapshotTime", {
1694
- slowestChainIndexingCursor,
1695
- omnichainIndexingCursor
1696
- });
1697
1665
  ctx.issues.push({
1698
1666
  code: "custom",
1699
1667
  input: ctx.value,
@@ -1722,39 +1690,67 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
1722
1690
  });
1723
1691
  }
1724
1692
  }
1725
- var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v411.z.strictObject({
1726
- strategy: import_v411.z.literal(CrossChainIndexingStrategyIds.Omnichain),
1693
+ var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v410.z.object({
1694
+ strategy: import_v410.z.literal(CrossChainIndexingStrategyIds.Omnichain),
1727
1695
  slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
1728
1696
  snapshotTime: makeUnixTimestampSchema(valueLabel),
1729
1697
  omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
1730
1698
  }).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
1731
- var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v411.z.discriminatedUnion("strategy", [
1699
+ var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v410.z.discriminatedUnion("strategy", [
1732
1700
  makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
1733
1701
  ]);
1702
+ var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") => import_v410.z.object({
1703
+ strategy: import_v410.z.enum(CrossChainIndexingStrategyIds),
1704
+ slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
1705
+ snapshotTime: makeUnixTimestampSchema(valueLabel),
1706
+ omnichainSnapshot: makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel)
1707
+ });
1734
1708
 
1735
- // src/ensindexer/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
1736
- function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
1737
- const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
1738
- const parsed = schema.safeParse(maybeSnapshot);
1709
+ // src/ensindexer/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
1710
+ var import_v411 = require("zod/v4");
1711
+ function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
1712
+ const chains = /* @__PURE__ */ new Map();
1713
+ for (const [chainIdString, chainIndexingStatusSnapshot] of Object.entries(
1714
+ serializedSnapshot.chains
1715
+ )) {
1716
+ const chainId = Number(chainIdString);
1717
+ chains.set(chainId, chainIndexingStatusSnapshot);
1718
+ }
1719
+ const unvalidatedSnapshot = {
1720
+ ...serializedSnapshot,
1721
+ chains
1722
+ };
1723
+ return unvalidatedSnapshot;
1724
+ }
1725
+ function deserializeOmnichainIndexingStatusSnapshot(data, valueLabel) {
1726
+ const schema = makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel).transform(buildUnvalidatedOmnichainIndexingStatusSnapshot).pipe(makeOmnichainIndexingStatusSnapshotSchema(valueLabel));
1727
+ const parsed = schema.safeParse(data);
1739
1728
  if (parsed.error) {
1740
1729
  throw new Error(
1741
- `Cannot deserialize into CrossChainIndexingStatusSnapshot:
1742
- ${(0, import_v412.prettifyError)(parsed.error)}
1730
+ `Cannot deserialize into OmnichainIndexingStatusSnapshot:
1731
+ ${(0, import_v411.prettifyError)(parsed.error)}
1743
1732
  `
1744
1733
  );
1745
1734
  }
1746
1735
  return parsed.data;
1747
1736
  }
1748
1737
 
1749
- // src/ensindexer/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
1750
- var import_v413 = require("zod/v4");
1751
- function deserializeOmnichainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
1752
- const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
1738
+ // src/ensindexer/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
1739
+ function buildUnvalidatedCrossChainIndexingStatusSnapshot(serializedSnapshot) {
1740
+ return {
1741
+ ...serializedSnapshot,
1742
+ omnichainSnapshot: buildUnvalidatedOmnichainIndexingStatusSnapshot(
1743
+ serializedSnapshot.omnichainSnapshot
1744
+ )
1745
+ };
1746
+ }
1747
+ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
1748
+ const schema = makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel).transform(buildUnvalidatedCrossChainIndexingStatusSnapshot).pipe(makeCrossChainIndexingStatusSnapshotSchema(valueLabel));
1753
1749
  const parsed = schema.safeParse(maybeSnapshot);
1754
1750
  if (parsed.error) {
1755
1751
  throw new Error(
1756
- `Cannot deserialize into OmnichainIndexingStatusSnapshot:
1757
- ${(0, import_v413.prettifyError)(parsed.error)}
1752
+ `Cannot deserialize into CrossChainIndexingStatusSnapshot:
1753
+ ${(0, import_v412.prettifyError)(parsed.error)}
1758
1754
  `
1759
1755
  );
1760
1756
  }
@@ -1762,10 +1758,10 @@ ${(0, import_v413.prettifyError)(parsed.error)}
1762
1758
  }
1763
1759
 
1764
1760
  // src/ensindexer/indexing-status/deserialize/realtime-indexing-status-projection.ts
1765
- var import_v415 = require("zod/v4");
1761
+ var import_v414 = require("zod/v4");
1766
1762
 
1767
1763
  // src/ensindexer/indexing-status/zod-schema/realtime-indexing-status-projection.ts
1768
- var import_v414 = require("zod/v4");
1764
+ var import_v413 = require("zod/v4");
1769
1765
  function invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime(ctx) {
1770
1766
  const projection = ctx.value;
1771
1767
  const { snapshot, projectedAt } = projection;
@@ -1789,20 +1785,31 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
1789
1785
  });
1790
1786
  }
1791
1787
  }
1792
- var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v414.z.strictObject({
1788
+ var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v413.z.object({
1793
1789
  projectedAt: makeUnixTimestampSchema(valueLabel),
1794
1790
  worstCaseDistance: makeDurationSchema(valueLabel),
1795
1791
  snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
1796
1792
  }).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
1793
+ var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v413.z.object({
1794
+ snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
1795
+ projectedAt: makeUnixTimestampSchema(valueLabel),
1796
+ worstCaseDistance: makeDurationSchema(valueLabel)
1797
+ });
1797
1798
 
1798
1799
  // src/ensindexer/indexing-status/deserialize/realtime-indexing-status-projection.ts
1800
+ function buildUnvalidatedRealtimeIndexingStatusProjection(serializedProjection) {
1801
+ return {
1802
+ ...serializedProjection,
1803
+ snapshot: buildUnvalidatedCrossChainIndexingStatusSnapshot(serializedProjection.snapshot)
1804
+ };
1805
+ }
1799
1806
  function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel) {
1800
- const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
1807
+ const schema = makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel).transform(buildUnvalidatedRealtimeIndexingStatusProjection).pipe(makeRealtimeIndexingStatusProjectionSchema(valueLabel));
1801
1808
  const parsed = schema.safeParse(maybeProjection);
1802
1809
  if (parsed.error) {
1803
1810
  throw new Error(
1804
1811
  `Cannot deserialize into RealtimeIndexingStatusProjection:
1805
- ${(0, import_v415.prettifyError)(parsed.error)}
1812
+ ${(0, import_v414.prettifyError)(parsed.error)}
1806
1813
  `
1807
1814
  );
1808
1815
  }
@@ -1928,18 +1935,57 @@ function serializeRealtimeIndexingStatusProjection(indexingProjection) {
1928
1935
  }
1929
1936
 
1930
1937
  // src/ensindexer/indexing-status/validate/chain-indexing-status-snapshot.ts
1931
- var import_v416 = require("zod/v4");
1938
+ var import_v415 = require("zod/v4");
1932
1939
  function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
1933
1940
  const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
1934
1941
  const parsed = schema.safeParse(unvalidatedSnapshot);
1935
1942
  if (parsed.error) {
1936
1943
  throw new Error(`Invalid ChainIndexingStatusSnapshot:
1944
+ ${(0, import_v415.prettifyError)(parsed.error)}
1945
+ `);
1946
+ }
1947
+ return parsed.data;
1948
+ }
1949
+
1950
+ // src/ensindexer/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
1951
+ var import_v416 = require("zod/v4");
1952
+ function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
1953
+ const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
1954
+ const parsed = schema.safeParse(unvalidatedSnapshot);
1955
+ if (parsed.error) {
1956
+ throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
1937
1957
  ${(0, import_v416.prettifyError)(parsed.error)}
1938
1958
  `);
1939
1959
  }
1940
1960
  return parsed.data;
1941
1961
  }
1942
1962
 
1963
+ // src/ensindexer/indexing-status/validate/omnichain-indexing-status-snapshot.ts
1964
+ var import_v417 = require("zod/v4");
1965
+ function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
1966
+ const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
1967
+ const parsed = schema.safeParse(unvalidatedSnapshot);
1968
+ if (parsed.error) {
1969
+ throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
1970
+ ${(0, import_v417.prettifyError)(parsed.error)}
1971
+ `);
1972
+ }
1973
+ return parsed.data;
1974
+ }
1975
+
1976
+ // src/ensindexer/indexing-status/validate/realtime-indexing-status-projection.ts
1977
+ var import_v418 = require("zod/v4");
1978
+ function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
1979
+ const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
1980
+ const parsed = schema.safeParse(unvalidatedProjection);
1981
+ if (parsed.error) {
1982
+ throw new Error(`Invalid RealtimeIndexingStatusProjection:
1983
+ ${(0, import_v418.prettifyError)(parsed.error)}
1984
+ `);
1985
+ }
1986
+ return parsed.data;
1987
+ }
1988
+
1943
1989
  // src/ensapi/config/serialize.ts
1944
1990
  function serializeENSApiPublicConfig(config) {
1945
1991
  const { version, theGraphFallback, ensIndexerPublicConfig } = config;
@@ -1961,10 +2007,7 @@ function serializeConfigResponse(response) {
1961
2007
  }
1962
2008
 
1963
2009
  // src/api/indexing-status/deserialize.ts
1964
- var import_v418 = require("zod/v4");
1965
-
1966
- // src/api/indexing-status/zod-schemas.ts
1967
- var import_v417 = require("zod/v4");
2010
+ var import_v420 = require("zod/v4");
1968
2011
 
1969
2012
  // src/api/indexing-status/response.ts
1970
2013
  var IndexingStatusResponseCodes = {
@@ -1979,24 +2022,44 @@ var IndexingStatusResponseCodes = {
1979
2022
  };
1980
2023
 
1981
2024
  // src/api/indexing-status/zod-schemas.ts
1982
- var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v417.z.strictObject({
1983
- responseCode: import_v417.z.literal(IndexingStatusResponseCodes.Ok),
2025
+ var import_v419 = require("zod/v4");
2026
+ var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v419.z.strictObject({
2027
+ responseCode: import_v419.z.literal(IndexingStatusResponseCodes.Ok),
1984
2028
  realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
1985
2029
  });
1986
- var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v417.z.strictObject({
1987
- responseCode: import_v417.z.literal(IndexingStatusResponseCodes.Error)
2030
+ var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v419.z.strictObject({
2031
+ responseCode: import_v419.z.literal(IndexingStatusResponseCodes.Error)
1988
2032
  });
1989
- var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v417.z.discriminatedUnion("responseCode", [
2033
+ var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v419.z.discriminatedUnion("responseCode", [
1990
2034
  makeIndexingStatusResponseOkSchema(valueLabel),
1991
2035
  makeIndexingStatusResponseErrorSchema(valueLabel)
1992
2036
  ]);
2037
+ var makeSerializedIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v419.z.strictObject({
2038
+ responseCode: import_v419.z.literal(IndexingStatusResponseCodes.Ok),
2039
+ realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
2040
+ });
2041
+ var makeSerializedIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v419.z.discriminatedUnion("responseCode", [
2042
+ makeSerializedIndexingStatusResponseOkSchema(valueLabel),
2043
+ makeIndexingStatusResponseErrorSchema(valueLabel)
2044
+ ]);
1993
2045
 
1994
2046
  // src/api/indexing-status/deserialize.ts
2047
+ function buildUnvalidatedIndexingStatusResponse(serializedResponse) {
2048
+ if (serializedResponse.responseCode !== IndexingStatusResponseCodes.Ok) {
2049
+ return serializedResponse;
2050
+ }
2051
+ return {
2052
+ ...serializedResponse,
2053
+ realtimeProjection: buildUnvalidatedRealtimeIndexingStatusProjection(
2054
+ serializedResponse.realtimeProjection
2055
+ )
2056
+ };
2057
+ }
1995
2058
  function deserializeIndexingStatusResponse(maybeResponse) {
1996
- const parsed = makeIndexingStatusResponseSchema().safeParse(maybeResponse);
2059
+ const parsed = makeSerializedIndexingStatusResponseSchema().transform(buildUnvalidatedIndexingStatusResponse).pipe(makeIndexingStatusResponseSchema()).safeParse(maybeResponse);
1997
2060
  if (parsed.error) {
1998
2061
  throw new Error(`Cannot deserialize IndexingStatusResponse:
1999
- ${(0, import_v418.prettifyError)(parsed.error)}
2062
+ ${(0, import_v420.prettifyError)(parsed.error)}
2000
2063
  `);
2001
2064
  }
2002
2065
  return parsed.data;
@@ -2016,20 +2079,20 @@ function serializeIndexingStatusResponse(response) {
2016
2079
  }
2017
2080
 
2018
2081
  // src/api/name-tokens/deserialize.ts
2019
- var import_v423 = require("zod/v4");
2082
+ var import_v425 = require("zod/v4");
2020
2083
 
2021
2084
  // src/api/name-tokens/zod-schemas.ts
2022
2085
  var import_viem14 = require("viem");
2023
- var import_v422 = require("zod/v4");
2086
+ var import_v424 = require("zod/v4");
2024
2087
 
2025
2088
  // src/tokenscope/assets.ts
2026
2089
  var import_viem13 = require("viem");
2027
- var import_v420 = require("zod/v4");
2090
+ var import_v422 = require("zod/v4");
2028
2091
 
2029
2092
  // src/tokenscope/zod-schemas.ts
2030
2093
  var import_caip3 = require("caip");
2031
2094
  var import_viem12 = require("viem");
2032
- var import_v419 = require("zod/v4");
2095
+ var import_v421 = require("zod/v4");
2033
2096
 
2034
2097
  // src/shared/types.ts
2035
2098
  var AssetNamespaces = {
@@ -2152,10 +2215,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
2152
2215
  }
2153
2216
 
2154
2217
  // src/tokenscope/zod-schemas.ts
2155
- var tokenIdSchemaSerializable = import_v419.z.string();
2156
- var tokenIdSchemaNative = import_v419.z.preprocess(
2218
+ var tokenIdSchemaSerializable = import_v421.z.string();
2219
+ var tokenIdSchemaNative = import_v421.z.preprocess(
2157
2220
  (v) => typeof v === "string" ? BigInt(v) : v,
2158
- import_v419.z.bigint().positive()
2221
+ import_v421.z.bigint().positive()
2159
2222
  );
2160
2223
  function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
2161
2224
  if (serializable) {
@@ -2165,13 +2228,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
2165
2228
  }
2166
2229
  }
2167
2230
  var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
2168
- return import_v419.z.object({
2169
- assetNamespace: import_v419.z.enum(AssetNamespaces),
2231
+ return import_v421.z.object({
2232
+ assetNamespace: import_v421.z.enum(AssetNamespaces),
2170
2233
  contract: makeAccountIdSchema(valueLabel),
2171
2234
  tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
2172
2235
  });
2173
2236
  };
2174
- var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v419.z.preprocess((v) => {
2237
+ var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v421.z.preprocess((v) => {
2175
2238
  if (typeof v === "string") {
2176
2239
  const result = new import_caip3.AssetId(v);
2177
2240
  return {
@@ -2195,20 +2258,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
2195
2258
  });
2196
2259
  }
2197
2260
  }
2198
- var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v419.z.object({
2199
- ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.NameWrapper),
2261
+ var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v421.z.object({
2262
+ ownershipType: import_v421.z.literal(NameTokenOwnershipTypes.NameWrapper),
2200
2263
  owner: makeAccountIdSchema(`${valueLabel}.owner`)
2201
2264
  }).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
2202
- var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v419.z.object({
2203
- ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.FullyOnchain),
2265
+ var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v421.z.object({
2266
+ ownershipType: import_v421.z.literal(NameTokenOwnershipTypes.FullyOnchain),
2204
2267
  owner: makeAccountIdSchema(`${valueLabel}.owner`)
2205
2268
  }).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
2206
- var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v419.z.object({
2207
- ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.Burned),
2269
+ var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v421.z.object({
2270
+ ownershipType: import_v421.z.literal(NameTokenOwnershipTypes.Burned),
2208
2271
  owner: makeAccountIdSchema(`${valueLabel}.owner`)
2209
2272
  }).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
2210
- var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v419.z.object({
2211
- ownershipType: import_v419.z.literal(NameTokenOwnershipTypes.Unknown),
2273
+ var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v421.z.object({
2274
+ ownershipType: import_v421.z.literal(NameTokenOwnershipTypes.Unknown),
2212
2275
  owner: makeAccountIdSchema(`${valueLabel}.owner`)
2213
2276
  }).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
2214
2277
  function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
@@ -2221,16 +2284,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
2221
2284
  });
2222
2285
  }
2223
2286
  }
2224
- var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v419.z.discriminatedUnion("ownershipType", [
2287
+ var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v421.z.discriminatedUnion("ownershipType", [
2225
2288
  makeNameTokenOwnershipNameWrapperSchema(valueLabel),
2226
2289
  makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
2227
2290
  makeNameTokenOwnershipBurnedSchema(valueLabel),
2228
2291
  makeNameTokenOwnershipUnknownSchema(valueLabel)
2229
2292
  ]);
2230
- var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v419.z.object({
2293
+ var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v421.z.object({
2231
2294
  token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
2232
2295
  ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
2233
- mintStatus: import_v419.z.enum(NFTMintStatuses)
2296
+ mintStatus: import_v421.z.enum(NFTMintStatuses)
2234
2297
  });
2235
2298
 
2236
2299
  // src/tokenscope/assets.ts
@@ -2246,7 +2309,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
2246
2309
  const parsed = schema.safeParse(maybeAssetId);
2247
2310
  if (parsed.error) {
2248
2311
  throw new RangeError(`Cannot deserialize AssetId:
2249
- ${(0, import_v420.prettifyError)(parsed.error)}
2312
+ ${(0, import_v422.prettifyError)(parsed.error)}
2250
2313
  `);
2251
2314
  }
2252
2315
  return parsed.data;
@@ -2256,7 +2319,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
2256
2319
  const parsed = schema.safeParse(maybeAssetId);
2257
2320
  if (parsed.error) {
2258
2321
  throw new RangeError(`Cannot parse AssetId:
2259
- ${(0, import_v420.prettifyError)(parsed.error)}
2322
+ ${(0, import_v422.prettifyError)(parsed.error)}
2260
2323
  `);
2261
2324
  }
2262
2325
  return parsed.data;
@@ -2478,10 +2541,10 @@ ${formatNFTTransferEventMetadata(metadata)}`
2478
2541
  };
2479
2542
 
2480
2543
  // src/api/shared/errors/zod-schemas.ts
2481
- var import_v421 = require("zod/v4");
2482
- var ErrorResponseSchema = import_v421.z.object({
2483
- message: import_v421.z.string(),
2484
- details: import_v421.z.optional(import_v421.z.unknown())
2544
+ var import_v423 = require("zod/v4");
2545
+ var ErrorResponseSchema = import_v423.z.object({
2546
+ message: import_v423.z.string(),
2547
+ details: import_v423.z.optional(import_v423.z.unknown())
2485
2548
  });
2486
2549
 
2487
2550
  // src/api/name-tokens/response.ts
@@ -2520,10 +2583,10 @@ var NameTokensResponseErrorCodes = {
2520
2583
  };
2521
2584
 
2522
2585
  // src/api/name-tokens/zod-schemas.ts
2523
- var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v422.z.object({
2586
+ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v424.z.object({
2524
2587
  domainId: makeNodeSchema(`${valueLabel}.domainId`),
2525
2588
  name: makeReinterpretedNameSchema(valueLabel),
2526
- tokens: import_v422.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
2589
+ tokens: import_v424.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
2527
2590
  expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
2528
2591
  accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
2529
2592
  }).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
@@ -2565,32 +2628,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
2565
2628
  });
2566
2629
  }
2567
2630
  });
2568
- var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v422.z.strictObject({
2569
- responseCode: import_v422.z.literal(NameTokensResponseCodes.Ok),
2631
+ var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v424.z.strictObject({
2632
+ responseCode: import_v424.z.literal(NameTokensResponseCodes.Ok),
2570
2633
  registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
2571
2634
  });
2572
- var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v422.z.strictObject({
2573
- responseCode: import_v422.z.literal(NameTokensResponseCodes.Error),
2574
- errorCode: import_v422.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
2635
+ var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v424.z.strictObject({
2636
+ responseCode: import_v424.z.literal(NameTokensResponseCodes.Error),
2637
+ errorCode: import_v424.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
2575
2638
  error: ErrorResponseSchema
2576
2639
  });
2577
- var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v422.z.strictObject({
2578
- responseCode: import_v422.z.literal(NameTokensResponseCodes.Error),
2579
- errorCode: import_v422.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
2640
+ var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v424.z.strictObject({
2641
+ responseCode: import_v424.z.literal(NameTokensResponseCodes.Error),
2642
+ errorCode: import_v424.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
2580
2643
  error: ErrorResponseSchema
2581
2644
  });
2582
- var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v422.z.strictObject({
2583
- responseCode: import_v422.z.literal(NameTokensResponseCodes.Error),
2584
- errorCode: import_v422.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
2645
+ var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v424.z.strictObject({
2646
+ responseCode: import_v424.z.literal(NameTokensResponseCodes.Error),
2647
+ errorCode: import_v424.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
2585
2648
  error: ErrorResponseSchema
2586
2649
  });
2587
- var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v422.z.discriminatedUnion("errorCode", [
2650
+ var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v424.z.discriminatedUnion("errorCode", [
2588
2651
  makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
2589
2652
  makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
2590
2653
  makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
2591
2654
  ]);
2592
2655
  var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
2593
- return import_v422.z.discriminatedUnion("responseCode", [
2656
+ return import_v424.z.discriminatedUnion("responseCode", [
2594
2657
  makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
2595
2658
  makeNameTokensResponseErrorSchema(valueLabel)
2596
2659
  ]);
@@ -2603,7 +2666,7 @@ function deserializedNameTokensResponse(maybeResponse) {
2603
2666
  );
2604
2667
  if (parsed.error) {
2605
2668
  throw new Error(`Cannot deserialize NameTokensResponse:
2606
- ${(0, import_v423.prettifyError)(parsed.error)}
2669
+ ${(0, import_v425.prettifyError)(parsed.error)}
2607
2670
  `);
2608
2671
  }
2609
2672
  return parsed.data;
@@ -2677,14 +2740,14 @@ function serializeNameTokensResponse(response) {
2677
2740
  }
2678
2741
 
2679
2742
  // src/api/registrar-actions/deserialize.ts
2680
- var import_v427 = require("zod/v4");
2743
+ var import_v429 = require("zod/v4");
2681
2744
 
2682
2745
  // src/api/registrar-actions/zod-schemas.ts
2683
2746
  var import_ens7 = require("viem/ens");
2684
- var import_v426 = require("zod/v4");
2747
+ var import_v428 = require("zod/v4");
2685
2748
 
2686
2749
  // src/registrars/zod-schemas.ts
2687
- var import_v424 = require("zod/v4");
2750
+ var import_v426 = require("zod/v4");
2688
2751
 
2689
2752
  // src/registrars/encoded-referrer.ts
2690
2753
  var import_viem15 = require("viem");
@@ -2759,11 +2822,11 @@ function serializeRegistrarAction(registrarAction) {
2759
2822
  }
2760
2823
 
2761
2824
  // src/registrars/zod-schemas.ts
2762
- var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v424.z.object({
2825
+ var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v426.z.object({
2763
2826
  subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
2764
2827
  node: makeNodeSchema(`${valueLabel} Node`)
2765
2828
  });
2766
- var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v424.z.object({
2829
+ var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v426.z.object({
2767
2830
  subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
2768
2831
  node: makeNodeSchema(`${valueLabel} Node`),
2769
2832
  expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
@@ -2779,18 +2842,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
2779
2842
  });
2780
2843
  }
2781
2844
  }
2782
- var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v424.z.union([
2845
+ var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v426.z.union([
2783
2846
  // pricing available
2784
- import_v424.z.object({
2847
+ import_v426.z.object({
2785
2848
  baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
2786
2849
  premium: makePriceEthSchema(`${valueLabel} Premium`),
2787
2850
  total: makePriceEthSchema(`${valueLabel} Total`)
2788
2851
  }).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
2789
2852
  // pricing unknown
2790
- import_v424.z.object({
2791
- baseCost: import_v424.z.null(),
2792
- premium: import_v424.z.null(),
2793
- total: import_v424.z.null()
2853
+ import_v426.z.object({
2854
+ baseCost: import_v426.z.null(),
2855
+ premium: import_v426.z.null(),
2856
+ total: import_v426.z.null()
2794
2857
  }).transform((v) => v)
2795
2858
  ]);
2796
2859
  function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
@@ -2813,9 +2876,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
2813
2876
  });
2814
2877
  }
2815
2878
  }
2816
- var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v424.z.union([
2879
+ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v426.z.union([
2817
2880
  // referral available
2818
- import_v424.z.object({
2881
+ import_v426.z.object({
2819
2882
  encodedReferrer: makeHexStringSchema(
2820
2883
  { bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
2821
2884
  `${valueLabel} Encoded Referrer`
@@ -2823,9 +2886,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
2823
2886
  decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
2824
2887
  }).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
2825
2888
  // referral not applicable
2826
- import_v424.z.object({
2827
- encodedReferrer: import_v424.z.null(),
2828
- decodedReferrer: import_v424.z.null()
2889
+ import_v426.z.object({
2890
+ encodedReferrer: import_v426.z.null(),
2891
+ decodedReferrer: import_v426.z.null()
2829
2892
  })
2830
2893
  ]);
2831
2894
  function invariant_eventIdsInitialElementIsTheActionId(ctx) {
@@ -2838,9 +2901,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
2838
2901
  });
2839
2902
  }
2840
2903
  }
2841
- var EventIdSchema = import_v424.z.string().nonempty();
2842
- var EventIdsSchema = import_v424.z.array(EventIdSchema).min(1).transform((v) => v);
2843
- var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v424.z.object({
2904
+ var EventIdSchema = import_v426.z.string().nonempty();
2905
+ var EventIdsSchema = import_v426.z.array(EventIdSchema).min(1).transform((v) => v);
2906
+ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v426.z.object({
2844
2907
  id: EventIdSchema,
2845
2908
  incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
2846
2909
  registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
@@ -2854,38 +2917,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
2854
2917
  eventIds: EventIdsSchema
2855
2918
  }).check(invariant_eventIdsInitialElementIsTheActionId);
2856
2919
  var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
2857
- type: import_v424.z.literal(RegistrarActionTypes.Registration)
2920
+ type: import_v426.z.literal(RegistrarActionTypes.Registration)
2858
2921
  });
2859
2922
  var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
2860
- type: import_v424.z.literal(RegistrarActionTypes.Renewal)
2923
+ type: import_v426.z.literal(RegistrarActionTypes.Renewal)
2861
2924
  });
2862
- var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v424.z.discriminatedUnion("type", [
2925
+ var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v426.z.discriminatedUnion("type", [
2863
2926
  makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
2864
2927
  makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
2865
2928
  ]);
2866
2929
 
2867
2930
  // src/api/shared/pagination/zod-schemas.ts
2868
- var import_v425 = require("zod/v4");
2931
+ var import_v427 = require("zod/v4");
2869
2932
 
2870
2933
  // src/api/shared/pagination/request.ts
2871
2934
  var RECORDS_PER_PAGE_DEFAULT = 10;
2872
2935
  var RECORDS_PER_PAGE_MAX = 100;
2873
2936
 
2874
2937
  // src/api/shared/pagination/zod-schemas.ts
2875
- var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v425.z.object({
2938
+ var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v427.z.object({
2876
2939
  page: makePositiveIntegerSchema(`${valueLabel}.page`),
2877
2940
  recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
2878
2941
  RECORDS_PER_PAGE_MAX,
2879
2942
  `${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
2880
2943
  )
2881
2944
  });
2882
- var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v425.z.object({
2883
- totalRecords: import_v425.z.literal(0),
2884
- totalPages: import_v425.z.literal(1),
2885
- hasNext: import_v425.z.literal(false),
2886
- hasPrev: import_v425.z.literal(false),
2887
- startIndex: import_v425.z.undefined(),
2888
- endIndex: import_v425.z.undefined()
2945
+ var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v427.z.object({
2946
+ totalRecords: import_v427.z.literal(0),
2947
+ totalPages: import_v427.z.literal(1),
2948
+ hasNext: import_v427.z.literal(false),
2949
+ hasPrev: import_v427.z.literal(false),
2950
+ startIndex: import_v427.z.undefined(),
2951
+ endIndex: import_v427.z.undefined()
2889
2952
  }).extend(makeRequestPageParamsSchema(valueLabel).shape);
2890
2953
  function invariant_responsePageWithRecordsIsCorrect(ctx) {
2891
2954
  const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
@@ -2920,15 +2983,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
2920
2983
  });
2921
2984
  }
2922
2985
  }
2923
- var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v425.z.object({
2986
+ var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v427.z.object({
2924
2987
  totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
2925
2988
  totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
2926
- hasNext: import_v425.z.boolean(),
2927
- hasPrev: import_v425.z.boolean(),
2989
+ hasNext: import_v427.z.boolean(),
2990
+ hasPrev: import_v427.z.boolean(),
2928
2991
  startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
2929
2992
  endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
2930
2993
  }).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
2931
- var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v425.z.union([
2994
+ var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v427.z.union([
2932
2995
  makeResponsePageContextSchemaWithNoRecords(valueLabel),
2933
2996
  makeResponsePageContextSchemaWithRecords(valueLabel)
2934
2997
  ]);
@@ -2958,21 +3021,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
2958
3021
  });
2959
3022
  }
2960
3023
  }
2961
- var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v426.z.object({
3024
+ var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v428.z.object({
2962
3025
  action: makeRegistrarActionSchema(valueLabel),
2963
3026
  name: makeReinterpretedNameSchema(valueLabel)
2964
3027
  }).check(invariant_registrationLifecycleNodeMatchesName);
2965
- var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v426.z.object({
2966
- responseCode: import_v426.z.literal(RegistrarActionsResponseCodes.Ok),
2967
- registrarActions: import_v426.z.array(makeNamedRegistrarActionSchema(valueLabel)),
3028
+ var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v428.z.object({
3029
+ responseCode: import_v428.z.literal(RegistrarActionsResponseCodes.Ok),
3030
+ registrarActions: import_v428.z.array(makeNamedRegistrarActionSchema(valueLabel)),
2968
3031
  pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
2969
3032
  accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
2970
3033
  });
2971
- var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v426.z.strictObject({
2972
- responseCode: import_v426.z.literal(RegistrarActionsResponseCodes.Error),
3034
+ var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v428.z.strictObject({
3035
+ responseCode: import_v428.z.literal(RegistrarActionsResponseCodes.Error),
2973
3036
  error: ErrorResponseSchema
2974
3037
  });
2975
- var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v426.z.discriminatedUnion("responseCode", [
3038
+ var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v428.z.discriminatedUnion("responseCode", [
2976
3039
  makeRegistrarActionsResponseOkSchema(valueLabel),
2977
3040
  makeRegistrarActionsResponseErrorSchema(valueLabel)
2978
3041
  ]);
@@ -2983,7 +3046,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
2983
3046
  if (parsed.error) {
2984
3047
  throw new Error(
2985
3048
  `Cannot deserialize RegistrarActionsResponse:
2986
- ${(0, import_v427.prettifyError)(parsed.error)}
3049
+ ${(0, import_v429.prettifyError)(parsed.error)}
2987
3050
  `
2988
3051
  );
2989
3052
  }
@@ -3231,12 +3294,12 @@ function serializeRegistrarActionsResponse(response) {
3231
3294
  }
3232
3295
 
3233
3296
  // src/api/shared/errors/deserialize.ts
3234
- var import_v428 = require("zod/v4");
3297
+ var import_v430 = require("zod/v4");
3235
3298
  function deserializeErrorResponse(maybeErrorResponse) {
3236
3299
  const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
3237
3300
  if (parsed.error) {
3238
3301
  throw new Error(`Cannot deserialize ErrorResponse:
3239
- ${(0, import_v428.prettifyError)(parsed.error)}
3302
+ ${(0, import_v430.prettifyError)(parsed.error)}
3240
3303
  `);
3241
3304
  }
3242
3305
  return parsed.data;
@@ -3904,6 +3967,131 @@ var import_getUnixTime2 = require("date-fns/getUnixTime");
3904
3967
 
3905
3968
  // src/shared/datetime.ts
3906
3969
  var import_getUnixTime = require("date-fns/getUnixTime");
3970
+
3971
+ // src/shared/deserialize.ts
3972
+ var import_v431 = __toESM(require("zod/v4"), 1);
3973
+ function deserializeChainId(maybeChainId, valueLabel) {
3974
+ const schema = makeChainIdStringSchema(valueLabel);
3975
+ const parsed = schema.safeParse(maybeChainId);
3976
+ if (parsed.error) {
3977
+ throw new Error(`Cannot deserialize ChainId:
3978
+ ${(0, import_v431.prettifyError)(parsed.error)}
3979
+ `);
3980
+ }
3981
+ return parsed.data;
3982
+ }
3983
+ function deserializeDatetime(maybeDatetime, valueLabel) {
3984
+ const schema = makeDatetimeSchema(valueLabel);
3985
+ const parsed = schema.safeParse(maybeDatetime);
3986
+ if (parsed.error) {
3987
+ throw new Error(`Cannot deserialize Datetime:
3988
+ ${(0, import_v431.prettifyError)(parsed.error)}
3989
+ `);
3990
+ }
3991
+ return parsed.data;
3992
+ }
3993
+ function deserializeUnixTimestamp(maybeTimestamp, valueLabel) {
3994
+ const schema = makeUnixTimestampSchema(valueLabel);
3995
+ const parsed = schema.safeParse(maybeTimestamp);
3996
+ if (parsed.error) {
3997
+ throw new Error(`Cannot deserialize Unix Timestamp:
3998
+ ${(0, import_v431.prettifyError)(parsed.error)}
3999
+ `);
4000
+ }
4001
+ return parsed.data;
4002
+ }
4003
+ function deserializeUrl(maybeUrl, valueLabel) {
4004
+ const schema = makeUrlSchema(valueLabel);
4005
+ const parsed = schema.safeParse(maybeUrl);
4006
+ if (parsed.error) {
4007
+ throw new Error(`Cannot deserialize URL:
4008
+ ${(0, import_v431.prettifyError)(parsed.error)}
4009
+ `);
4010
+ }
4011
+ return parsed.data;
4012
+ }
4013
+ function deserializeBlockNumber(maybeBlockNumber, valueLabel) {
4014
+ const schema = makeBlockNumberSchema(valueLabel);
4015
+ const parsed = schema.safeParse(maybeBlockNumber);
4016
+ if (parsed.error) {
4017
+ throw new Error(`Cannot deserialize BlockNumber:
4018
+ ${(0, import_v431.prettifyError)(parsed.error)}
4019
+ `);
4020
+ }
4021
+ return parsed.data;
4022
+ }
4023
+ function deserializeBlockrange(maybeBlockrange, valueLabel) {
4024
+ const schema = makeBlockrangeSchema(valueLabel);
4025
+ const parsed = schema.safeParse(maybeBlockrange);
4026
+ if (parsed.error) {
4027
+ throw new Error(`Cannot deserialize Blockrange:
4028
+ ${(0, import_v431.prettifyError)(parsed.error)}
4029
+ `);
4030
+ }
4031
+ return parsed.data;
4032
+ }
4033
+ function deserializeBlockRef(maybeBlockRef, valueLabel) {
4034
+ const schema = makeBlockRefSchema(valueLabel);
4035
+ const parsed = schema.safeParse(maybeBlockRef);
4036
+ if (parsed.error) {
4037
+ throw new Error(`Cannot deserialize BlockRef:
4038
+ ${(0, import_v431.prettifyError)(parsed.error)}
4039
+ `);
4040
+ }
4041
+ return parsed.data;
4042
+ }
4043
+ function deserializeDuration(maybeDuration, valueLabel) {
4044
+ const schema = import_v431.default.coerce.number().pipe(makeDurationSchema(valueLabel));
4045
+ const parsed = schema.safeParse(maybeDuration);
4046
+ if (parsed.error) {
4047
+ throw new RangeError(`Cannot deserialize Duration:
4048
+ ${(0, import_v431.prettifyError)(parsed.error)}
4049
+ `);
4050
+ }
4051
+ return parsed.data;
4052
+ }
4053
+ function parseAccountId(maybeAccountId, valueLabel) {
4054
+ const schema = makeAccountIdStringSchema(valueLabel);
4055
+ const parsed = schema.safeParse(maybeAccountId);
4056
+ if (parsed.error) {
4057
+ throw new RangeError(`Cannot deserialize AccountId:
4058
+ ${(0, import_v431.prettifyError)(parsed.error)}
4059
+ `);
4060
+ }
4061
+ return parsed.data;
4062
+ }
4063
+ function deserializePriceEth(maybePrice, valueLabel) {
4064
+ const schema = makePriceEthSchema(valueLabel);
4065
+ const parsed = schema.safeParse(maybePrice);
4066
+ if (parsed.error) {
4067
+ throw new Error(`Cannot deserialize PriceEth:
4068
+ ${(0, import_v431.prettifyError)(parsed.error)}
4069
+ `);
4070
+ }
4071
+ return parsed.data;
4072
+ }
4073
+ function deserializePriceUsdc(maybePrice, valueLabel) {
4074
+ const schema = makePriceUsdcSchema(valueLabel);
4075
+ const parsed = schema.safeParse(maybePrice);
4076
+ if (parsed.error) {
4077
+ throw new Error(`Cannot deserialize PriceUsdc:
4078
+ ${(0, import_v431.prettifyError)(parsed.error)}
4079
+ `);
4080
+ }
4081
+ return parsed.data;
4082
+ }
4083
+ function deserializePriceDai(maybePrice, valueLabel) {
4084
+ const schema = makePriceDaiSchema(valueLabel);
4085
+ const parsed = schema.safeParse(maybePrice);
4086
+ if (parsed.error) {
4087
+ throw new Error(`Cannot deserialize PriceDai:
4088
+ ${(0, import_v431.prettifyError)(parsed.error)}
4089
+ `);
4090
+ }
4091
+ return parsed.data;
4092
+ }
4093
+
4094
+ // src/shared/datetime.ts
3907
4095
  function durationBetween(start, end) {
3908
4096
  return deserializeDuration(end - start, "Duration");
3909
4097
  }