@ensnode/ensnode-sdk 0.0.0-next-20260216122402 → 0.0.0-next-20260216164355
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 +418 -418
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +264 -247
- package/dist/index.d.ts +264 -247
- package/dist/index.js +311 -311
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1084,7 +1084,34 @@ function serializeENSIndexerPublicConfig(config) {
|
|
|
1084
1084
|
};
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
1087
|
-
// src/
|
|
1087
|
+
// src/ensapi/config/serialize.ts
|
|
1088
|
+
function serializeENSApiPublicConfig(config) {
|
|
1089
|
+
const { version, theGraphFallback, ensIndexerPublicConfig } = config;
|
|
1090
|
+
return {
|
|
1091
|
+
version,
|
|
1092
|
+
theGraphFallback,
|
|
1093
|
+
ensIndexerPublicConfig: serializeENSIndexerPublicConfig(ensIndexerPublicConfig)
|
|
1094
|
+
};
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
// src/ensapi/api/config/serialize.ts
|
|
1098
|
+
function serializeConfigResponse(response) {
|
|
1099
|
+
return serializeENSApiPublicConfig(response);
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
// src/ensapi/api/indexing-status/deserialize.ts
|
|
1103
|
+
var import_v415 = require("zod/v4");
|
|
1104
|
+
|
|
1105
|
+
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1106
|
+
var import_v413 = require("zod/v4");
|
|
1107
|
+
|
|
1108
|
+
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1109
|
+
var import_v410 = require("zod/v4");
|
|
1110
|
+
|
|
1111
|
+
// src/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1112
|
+
var import_v49 = require("zod/v4");
|
|
1113
|
+
|
|
1114
|
+
// src/indexing-status/chain-indexing-status-snapshot.ts
|
|
1088
1115
|
var ChainIndexingConfigTypeIds = {
|
|
1089
1116
|
/**
|
|
1090
1117
|
* Represents that indexing of the chain should be performed for an indefinite range.
|
|
@@ -1183,7 +1210,7 @@ function sortChainStatusesByStartBlockAsc(chains) {
|
|
|
1183
1210
|
);
|
|
1184
1211
|
}
|
|
1185
1212
|
|
|
1186
|
-
// src/
|
|
1213
|
+
// src/indexing-status/cross-chain-indexing-status-snapshot.ts
|
|
1187
1214
|
var CrossChainIndexingStrategyIds = {
|
|
1188
1215
|
/**
|
|
1189
1216
|
* Represents that the indexing of events across all indexed chains will
|
|
@@ -1212,10 +1239,91 @@ function getLatestIndexedBlockRef(indexingStatus, chainId) {
|
|
|
1212
1239
|
return chainIndexingStatus.latestIndexedBlock;
|
|
1213
1240
|
}
|
|
1214
1241
|
|
|
1215
|
-
// src/
|
|
1242
|
+
// src/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1216
1243
|
var import_v48 = require("zod/v4");
|
|
1217
1244
|
|
|
1218
|
-
// src/
|
|
1245
|
+
// src/indexing-status/omnichain-indexing-status-snapshot.ts
|
|
1246
|
+
var OmnichainIndexingStatusIds = {
|
|
1247
|
+
/**
|
|
1248
|
+
* Represents that omnichain indexing is not ready to begin yet because
|
|
1249
|
+
* ENSIndexer is in its initialization phase and the data to build a "true"
|
|
1250
|
+
* {@link OmnichainIndexingStatusSnapshot} is still being loaded.
|
|
1251
|
+
*/
|
|
1252
|
+
Unstarted: "omnichain-unstarted",
|
|
1253
|
+
/**
|
|
1254
|
+
* Represents that omnichain indexing is in an overall "backfill" status because
|
|
1255
|
+
* - At least one indexed chain has a `chainStatus` of
|
|
1256
|
+
* {@link ChainIndexingStatusIds.Backfill}; and
|
|
1257
|
+
* - No indexed chain has a `chainStatus` of {@link ChainIndexingStatusIds.Following}.
|
|
1258
|
+
*/
|
|
1259
|
+
Backfill: "omnichain-backfill",
|
|
1260
|
+
/**
|
|
1261
|
+
* Represents that omnichain indexing is in an overall "following" status because
|
|
1262
|
+
* at least one indexed chain has a `chainStatus` of
|
|
1263
|
+
* {@link ChainIndexingStatusIds.Following}.
|
|
1264
|
+
*/
|
|
1265
|
+
Following: "omnichain-following",
|
|
1266
|
+
/**
|
|
1267
|
+
* Represents that omnichain indexing has completed because all indexed chains have
|
|
1268
|
+
* a `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
|
|
1269
|
+
*/
|
|
1270
|
+
Completed: "omnichain-completed"
|
|
1271
|
+
};
|
|
1272
|
+
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(chains) {
|
|
1273
|
+
return chains.every((chain) => chain.chainStatus === ChainIndexingStatusIds.Queued);
|
|
1274
|
+
}
|
|
1275
|
+
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(chains) {
|
|
1276
|
+
const atLeastOneChainInTargetStatus = chains.some(
|
|
1277
|
+
(chain) => chain.chainStatus === ChainIndexingStatusIds.Backfill
|
|
1278
|
+
);
|
|
1279
|
+
const otherChainsHaveValidStatuses = chains.every(
|
|
1280
|
+
(chain) => chain.chainStatus === ChainIndexingStatusIds.Queued || chain.chainStatus === ChainIndexingStatusIds.Backfill || chain.chainStatus === ChainIndexingStatusIds.Completed
|
|
1281
|
+
);
|
|
1282
|
+
return atLeastOneChainInTargetStatus && otherChainsHaveValidStatuses;
|
|
1283
|
+
}
|
|
1284
|
+
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(chains) {
|
|
1285
|
+
const allChainsHaveValidStatuses = chains.every(
|
|
1286
|
+
(chain) => chain.chainStatus === ChainIndexingStatusIds.Completed
|
|
1287
|
+
);
|
|
1288
|
+
return allChainsHaveValidStatuses;
|
|
1289
|
+
}
|
|
1290
|
+
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(chains) {
|
|
1291
|
+
const allChainsHaveValidStatuses = chains.some(
|
|
1292
|
+
(chain) => chain.chainStatus === ChainIndexingStatusIds.Following
|
|
1293
|
+
);
|
|
1294
|
+
return allChainsHaveValidStatuses;
|
|
1295
|
+
}
|
|
1296
|
+
function getOmnichainIndexingStatus(chains) {
|
|
1297
|
+
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(chains)) {
|
|
1298
|
+
return OmnichainIndexingStatusIds.Following;
|
|
1299
|
+
}
|
|
1300
|
+
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(chains)) {
|
|
1301
|
+
return OmnichainIndexingStatusIds.Backfill;
|
|
1302
|
+
}
|
|
1303
|
+
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(chains)) {
|
|
1304
|
+
return OmnichainIndexingStatusIds.Unstarted;
|
|
1305
|
+
}
|
|
1306
|
+
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(chains)) {
|
|
1307
|
+
return OmnichainIndexingStatusIds.Completed;
|
|
1308
|
+
}
|
|
1309
|
+
throw new Error(`Unable to determine omnichain indexing status for provided chains.`);
|
|
1310
|
+
}
|
|
1311
|
+
function getOmnichainIndexingCursor(chains) {
|
|
1312
|
+
if (chains.length === 0) {
|
|
1313
|
+
throw new Error(`Unable to determine omnichain indexing cursor when no chains were provided.`);
|
|
1314
|
+
}
|
|
1315
|
+
if (getOmnichainIndexingStatus(chains) === OmnichainIndexingStatusIds.Unstarted) {
|
|
1316
|
+
const earliestStartBlockTimestamps = chains.map((chain) => chain.config.startBlock.timestamp);
|
|
1317
|
+
return Math.min(...earliestStartBlockTimestamps) - 1;
|
|
1318
|
+
}
|
|
1319
|
+
const latestIndexedBlockTimestamps = chains.filter((chain) => chain.chainStatus !== ChainIndexingStatusIds.Queued).map((chain) => chain.latestIndexedBlock.timestamp);
|
|
1320
|
+
if (latestIndexedBlockTimestamps.length < 1) {
|
|
1321
|
+
throw new Error("latestIndexedBlockTimestamps array must include at least one element");
|
|
1322
|
+
}
|
|
1323
|
+
return Math.max(...latestIndexedBlockTimestamps);
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1219
1327
|
var import_v47 = require("zod/v4");
|
|
1220
1328
|
|
|
1221
1329
|
// src/shared/block-ref.ts
|
|
@@ -1229,7 +1337,7 @@ function isBeforeOrEqualTo(blockA, blockB) {
|
|
|
1229
1337
|
return isBefore(blockA, blockB) || isEqualTo(blockA, blockB);
|
|
1230
1338
|
}
|
|
1231
1339
|
|
|
1232
|
-
// src/
|
|
1340
|
+
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1233
1341
|
function invariant_chainSnapshotQueuedBlocks(ctx) {
|
|
1234
1342
|
const { config } = ctx.value;
|
|
1235
1343
|
if (config.configType === ChainIndexingConfigTypeIds.Indefinite) {
|
|
@@ -1350,111 +1458,7 @@ var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v47
|
|
|
1350
1458
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel)
|
|
1351
1459
|
]);
|
|
1352
1460
|
|
|
1353
|
-
// src/
|
|
1354
|
-
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
1355
|
-
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
1356
|
-
const parsed = schema.safeParse(maybeSnapshot);
|
|
1357
|
-
if (parsed.error) {
|
|
1358
|
-
throw new Error(
|
|
1359
|
-
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
1360
|
-
${(0, import_v48.prettifyError)(parsed.error)}
|
|
1361
|
-
`
|
|
1362
|
-
);
|
|
1363
|
-
}
|
|
1364
|
-
return parsed.data;
|
|
1365
|
-
}
|
|
1366
|
-
|
|
1367
|
-
// src/ensindexer/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1368
|
-
var import_v412 = require("zod/v4");
|
|
1369
|
-
|
|
1370
|
-
// src/ensindexer/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1371
|
-
var import_v410 = require("zod/v4");
|
|
1372
|
-
|
|
1373
|
-
// src/ensindexer/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1374
|
-
var import_v49 = require("zod/v4");
|
|
1375
|
-
|
|
1376
|
-
// src/ensindexer/indexing-status/omnichain-indexing-status-snapshot.ts
|
|
1377
|
-
var OmnichainIndexingStatusIds = {
|
|
1378
|
-
/**
|
|
1379
|
-
* Represents that omnichain indexing is not ready to begin yet because
|
|
1380
|
-
* ENSIndexer is in its initialization phase and the data to build a "true"
|
|
1381
|
-
* {@link OmnichainIndexingStatusSnapshot} is still being loaded.
|
|
1382
|
-
*/
|
|
1383
|
-
Unstarted: "omnichain-unstarted",
|
|
1384
|
-
/**
|
|
1385
|
-
* Represents that omnichain indexing is in an overall "backfill" status because
|
|
1386
|
-
* - At least one indexed chain has a `chainStatus` of
|
|
1387
|
-
* {@link ChainIndexingStatusIds.Backfill}; and
|
|
1388
|
-
* - No indexed chain has a `chainStatus` of {@link ChainIndexingStatusIds.Following}.
|
|
1389
|
-
*/
|
|
1390
|
-
Backfill: "omnichain-backfill",
|
|
1391
|
-
/**
|
|
1392
|
-
* Represents that omnichain indexing is in an overall "following" status because
|
|
1393
|
-
* at least one indexed chain has a `chainStatus` of
|
|
1394
|
-
* {@link ChainIndexingStatusIds.Following}.
|
|
1395
|
-
*/
|
|
1396
|
-
Following: "omnichain-following",
|
|
1397
|
-
/**
|
|
1398
|
-
* Represents that omnichain indexing has completed because all indexed chains have
|
|
1399
|
-
* a `chainStatus` of {@link ChainIndexingStatusIds.Completed}.
|
|
1400
|
-
*/
|
|
1401
|
-
Completed: "omnichain-completed"
|
|
1402
|
-
};
|
|
1403
|
-
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(chains) {
|
|
1404
|
-
return chains.every((chain) => chain.chainStatus === ChainIndexingStatusIds.Queued);
|
|
1405
|
-
}
|
|
1406
|
-
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(chains) {
|
|
1407
|
-
const atLeastOneChainInTargetStatus = chains.some(
|
|
1408
|
-
(chain) => chain.chainStatus === ChainIndexingStatusIds.Backfill
|
|
1409
|
-
);
|
|
1410
|
-
const otherChainsHaveValidStatuses = chains.every(
|
|
1411
|
-
(chain) => chain.chainStatus === ChainIndexingStatusIds.Queued || chain.chainStatus === ChainIndexingStatusIds.Backfill || chain.chainStatus === ChainIndexingStatusIds.Completed
|
|
1412
|
-
);
|
|
1413
|
-
return atLeastOneChainInTargetStatus && otherChainsHaveValidStatuses;
|
|
1414
|
-
}
|
|
1415
|
-
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(chains) {
|
|
1416
|
-
const allChainsHaveValidStatuses = chains.every(
|
|
1417
|
-
(chain) => chain.chainStatus === ChainIndexingStatusIds.Completed
|
|
1418
|
-
);
|
|
1419
|
-
return allChainsHaveValidStatuses;
|
|
1420
|
-
}
|
|
1421
|
-
function checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(chains) {
|
|
1422
|
-
const allChainsHaveValidStatuses = chains.some(
|
|
1423
|
-
(chain) => chain.chainStatus === ChainIndexingStatusIds.Following
|
|
1424
|
-
);
|
|
1425
|
-
return allChainsHaveValidStatuses;
|
|
1426
|
-
}
|
|
1427
|
-
function getOmnichainIndexingStatus(chains) {
|
|
1428
|
-
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotFollowing(chains)) {
|
|
1429
|
-
return OmnichainIndexingStatusIds.Following;
|
|
1430
|
-
}
|
|
1431
|
-
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotBackfill(chains)) {
|
|
1432
|
-
return OmnichainIndexingStatusIds.Backfill;
|
|
1433
|
-
}
|
|
1434
|
-
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotUnstarted(chains)) {
|
|
1435
|
-
return OmnichainIndexingStatusIds.Unstarted;
|
|
1436
|
-
}
|
|
1437
|
-
if (checkChainIndexingStatusSnapshotsForOmnichainStatusSnapshotCompleted(chains)) {
|
|
1438
|
-
return OmnichainIndexingStatusIds.Completed;
|
|
1439
|
-
}
|
|
1440
|
-
throw new Error(`Unable to determine omnichain indexing status for provided chains.`);
|
|
1441
|
-
}
|
|
1442
|
-
function getOmnichainIndexingCursor(chains) {
|
|
1443
|
-
if (chains.length === 0) {
|
|
1444
|
-
throw new Error(`Unable to determine omnichain indexing cursor when no chains were provided.`);
|
|
1445
|
-
}
|
|
1446
|
-
if (getOmnichainIndexingStatus(chains) === OmnichainIndexingStatusIds.Unstarted) {
|
|
1447
|
-
const earliestStartBlockTimestamps = chains.map((chain) => chain.config.startBlock.timestamp);
|
|
1448
|
-
return Math.min(...earliestStartBlockTimestamps) - 1;
|
|
1449
|
-
}
|
|
1450
|
-
const latestIndexedBlockTimestamps = chains.filter((chain) => chain.chainStatus !== ChainIndexingStatusIds.Queued).map((chain) => chain.latestIndexedBlock.timestamp);
|
|
1451
|
-
if (latestIndexedBlockTimestamps.length < 1) {
|
|
1452
|
-
throw new Error("latestIndexedBlockTimestamps array must include at least one element");
|
|
1453
|
-
}
|
|
1454
|
-
return Math.max(...latestIndexedBlockTimestamps);
|
|
1455
|
-
}
|
|
1456
|
-
|
|
1457
|
-
// src/ensindexer/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1461
|
+
// src/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1458
1462
|
function invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot(ctx) {
|
|
1459
1463
|
const snapshot = ctx.value;
|
|
1460
1464
|
const chains = Array.from(snapshot.chains.values());
|
|
@@ -1576,11 +1580,11 @@ function invariant_omnichainStatusSnapshotFollowingHasValidChains(ctx) {
|
|
|
1576
1580
|
});
|
|
1577
1581
|
}
|
|
1578
1582
|
}
|
|
1579
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1580
|
-
omnichainStatus:
|
|
1581
|
-
chains:
|
|
1583
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v48.z.object({
|
|
1584
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1585
|
+
chains: import_v48.z.map(
|
|
1582
1586
|
makeChainIdSchema(),
|
|
1583
|
-
|
|
1587
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1584
1588
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1585
1589
|
]),
|
|
1586
1590
|
{
|
|
@@ -1589,11 +1593,11 @@ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_
|
|
|
1589
1593
|
),
|
|
1590
1594
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1591
1595
|
}).check(invariant_omnichainSnapshotUnstartedHasValidChains);
|
|
1592
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1593
|
-
omnichainStatus:
|
|
1594
|
-
chains:
|
|
1596
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v48.z.object({
|
|
1597
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1598
|
+
chains: import_v48.z.map(
|
|
1595
1599
|
makeChainIdSchema(),
|
|
1596
|
-
|
|
1600
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1597
1601
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1598
1602
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1599
1603
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1604,11 +1608,11 @@ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v
|
|
|
1604
1608
|
),
|
|
1605
1609
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1606
1610
|
}).check(invariant_omnichainStatusSnapshotBackfillHasValidChains);
|
|
1607
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1608
|
-
omnichainStatus:
|
|
1609
|
-
chains:
|
|
1611
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v48.z.object({
|
|
1612
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1613
|
+
chains: import_v48.z.map(
|
|
1610
1614
|
makeChainIdSchema(),
|
|
1611
|
-
|
|
1615
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1612
1616
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1613
1617
|
]),
|
|
1614
1618
|
{
|
|
@@ -1617,11 +1621,11 @@ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_
|
|
|
1617
1621
|
),
|
|
1618
1622
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1619
1623
|
}).check(invariant_omnichainStatusSnapshotCompletedHasValidChains);
|
|
1620
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1621
|
-
omnichainStatus:
|
|
1622
|
-
chains:
|
|
1624
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v48.z.object({
|
|
1625
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1626
|
+
chains: import_v48.z.map(
|
|
1623
1627
|
makeChainIdSchema(),
|
|
1624
|
-
|
|
1628
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1625
1629
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1626
1630
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1627
1631
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1633,7 +1637,7 @@ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_
|
|
|
1633
1637
|
),
|
|
1634
1638
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1635
1639
|
}).check(invariant_omnichainStatusSnapshotFollowingHasValidChains);
|
|
1636
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1640
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v48.z.discriminatedUnion("omnichainStatus", [
|
|
1637
1641
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1638
1642
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1639
1643
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1641,21 +1645,21 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1641
1645
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1642
1646
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1643
1647
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1644
|
-
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1645
|
-
omnichainStatus:
|
|
1646
|
-
chains:
|
|
1648
|
+
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v48.z.object({
|
|
1649
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1650
|
+
chains: import_v48.z.record(
|
|
1647
1651
|
makeChainIdStringSchema(),
|
|
1648
|
-
|
|
1652
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1649
1653
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1650
1654
|
])
|
|
1651
1655
|
),
|
|
1652
1656
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1653
1657
|
});
|
|
1654
|
-
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1655
|
-
omnichainStatus:
|
|
1656
|
-
chains:
|
|
1658
|
+
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v48.z.object({
|
|
1659
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1660
|
+
chains: import_v48.z.record(
|
|
1657
1661
|
makeChainIdStringSchema(),
|
|
1658
|
-
|
|
1662
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1659
1663
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1660
1664
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1661
1665
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1663,21 +1667,21 @@ var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =
|
|
|
1663
1667
|
),
|
|
1664
1668
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1665
1669
|
});
|
|
1666
|
-
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1667
|
-
omnichainStatus:
|
|
1668
|
-
chains:
|
|
1670
|
+
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v48.z.object({
|
|
1671
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1672
|
+
chains: import_v48.z.record(
|
|
1669
1673
|
makeChainIdStringSchema(),
|
|
1670
|
-
|
|
1674
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1671
1675
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1672
1676
|
])
|
|
1673
1677
|
),
|
|
1674
1678
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1675
1679
|
});
|
|
1676
|
-
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1677
|
-
omnichainStatus:
|
|
1678
|
-
chains:
|
|
1680
|
+
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v48.z.object({
|
|
1681
|
+
omnichainStatus: import_v48.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1682
|
+
chains: import_v48.z.record(
|
|
1679
1683
|
makeChainIdStringSchema(),
|
|
1680
|
-
|
|
1684
|
+
import_v48.z.discriminatedUnion("chainStatus", [
|
|
1681
1685
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1682
1686
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1683
1687
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1686,14 +1690,14 @@ var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel)
|
|
|
1686
1690
|
),
|
|
1687
1691
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1688
1692
|
});
|
|
1689
|
-
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1693
|
+
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v48.z.discriminatedUnion("omnichainStatus", [
|
|
1690
1694
|
makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1691
1695
|
makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1692
1696
|
makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
1693
1697
|
makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema(valueLabel)
|
|
1694
1698
|
]);
|
|
1695
1699
|
|
|
1696
|
-
// src/
|
|
1700
|
+
// src/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1697
1701
|
function invariant_slowestChainEqualsToOmnichainSnapshotTime(ctx) {
|
|
1698
1702
|
const { slowestChainIndexingCursor, omnichainSnapshot } = ctx.value;
|
|
1699
1703
|
const { omnichainIndexingCursor } = omnichainSnapshot;
|
|
@@ -1726,23 +1730,61 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1726
1730
|
});
|
|
1727
1731
|
}
|
|
1728
1732
|
}
|
|
1729
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1730
|
-
strategy:
|
|
1733
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v49.z.object({
|
|
1734
|
+
strategy: import_v49.z.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1731
1735
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1732
1736
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1733
1737
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1734
1738
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1735
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1739
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v49.z.discriminatedUnion("strategy", [
|
|
1736
1740
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1737
1741
|
]);
|
|
1738
|
-
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") =>
|
|
1739
|
-
strategy:
|
|
1742
|
+
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") => import_v49.z.object({
|
|
1743
|
+
strategy: import_v49.z.enum(CrossChainIndexingStrategyIds),
|
|
1740
1744
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1741
1745
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1742
1746
|
omnichainSnapshot: makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1743
1747
|
});
|
|
1744
1748
|
|
|
1745
|
-
// src/
|
|
1749
|
+
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1750
|
+
function invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime(ctx) {
|
|
1751
|
+
const projection = ctx.value;
|
|
1752
|
+
const { snapshot, projectedAt } = projection;
|
|
1753
|
+
if (snapshot.snapshotTime > projectedAt) {
|
|
1754
|
+
ctx.issues.push({
|
|
1755
|
+
code: "custom",
|
|
1756
|
+
input: projection,
|
|
1757
|
+
message: "`projectedAt` must be after or same as `snapshot.snapshotTime`."
|
|
1758
|
+
});
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ctx) {
|
|
1762
|
+
const projection = ctx.value;
|
|
1763
|
+
const { projectedAt, snapshot, worstCaseDistance } = projection;
|
|
1764
|
+
const expectedWorstCaseDistance = projectedAt - snapshot.slowestChainIndexingCursor;
|
|
1765
|
+
if (worstCaseDistance !== expectedWorstCaseDistance) {
|
|
1766
|
+
ctx.issues.push({
|
|
1767
|
+
code: "custom",
|
|
1768
|
+
input: projection,
|
|
1769
|
+
message: "`worstCaseDistance` must be the exact difference between `projectedAt` and `snapshot.slowestChainIndexingCursor`."
|
|
1770
|
+
});
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v410.z.object({
|
|
1774
|
+
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1775
|
+
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1776
|
+
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
1777
|
+
}).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
|
|
1778
|
+
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v410.z.object({
|
|
1779
|
+
snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
|
|
1780
|
+
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1781
|
+
worstCaseDistance: makeDurationSchema(valueLabel)
|
|
1782
|
+
});
|
|
1783
|
+
|
|
1784
|
+
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1785
|
+
var import_v412 = require("zod/v4");
|
|
1786
|
+
|
|
1787
|
+
// src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
|
|
1746
1788
|
var import_v411 = require("zod/v4");
|
|
1747
1789
|
function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1748
1790
|
const chains = /* @__PURE__ */ new Map();
|
|
@@ -1771,7 +1813,7 @@ ${(0, import_v411.prettifyError)(parsed.error)}
|
|
|
1771
1813
|
return parsed.data;
|
|
1772
1814
|
}
|
|
1773
1815
|
|
|
1774
|
-
// src/
|
|
1816
|
+
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1775
1817
|
function buildUnvalidatedCrossChainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1776
1818
|
return {
|
|
1777
1819
|
...serializedSnapshot,
|
|
@@ -1793,46 +1835,7 @@ ${(0, import_v412.prettifyError)(parsed.error)}
|
|
|
1793
1835
|
return parsed.data;
|
|
1794
1836
|
}
|
|
1795
1837
|
|
|
1796
|
-
// src/
|
|
1797
|
-
var import_v414 = require("zod/v4");
|
|
1798
|
-
|
|
1799
|
-
// src/ensindexer/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1800
|
-
var import_v413 = require("zod/v4");
|
|
1801
|
-
function invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime(ctx) {
|
|
1802
|
-
const projection = ctx.value;
|
|
1803
|
-
const { snapshot, projectedAt } = projection;
|
|
1804
|
-
if (snapshot.snapshotTime > projectedAt) {
|
|
1805
|
-
ctx.issues.push({
|
|
1806
|
-
code: "custom",
|
|
1807
|
-
input: projection,
|
|
1808
|
-
message: "`projectedAt` must be after or same as `snapshot.snapshotTime`."
|
|
1809
|
-
});
|
|
1810
|
-
}
|
|
1811
|
-
}
|
|
1812
|
-
function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ctx) {
|
|
1813
|
-
const projection = ctx.value;
|
|
1814
|
-
const { projectedAt, snapshot, worstCaseDistance } = projection;
|
|
1815
|
-
const expectedWorstCaseDistance = projectedAt - snapshot.slowestChainIndexingCursor;
|
|
1816
|
-
if (worstCaseDistance !== expectedWorstCaseDistance) {
|
|
1817
|
-
ctx.issues.push({
|
|
1818
|
-
code: "custom",
|
|
1819
|
-
input: projection,
|
|
1820
|
-
message: "`worstCaseDistance` must be the exact difference between `projectedAt` and `snapshot.slowestChainIndexingCursor`."
|
|
1821
|
-
});
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v413.z.object({
|
|
1825
|
-
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1826
|
-
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1827
|
-
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
1828
|
-
}).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
|
|
1829
|
-
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v413.z.object({
|
|
1830
|
-
snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
|
|
1831
|
-
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1832
|
-
worstCaseDistance: makeDurationSchema(valueLabel)
|
|
1833
|
-
});
|
|
1834
|
-
|
|
1835
|
-
// src/ensindexer/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1838
|
+
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1836
1839
|
function buildUnvalidatedRealtimeIndexingStatusProjection(serializedProjection) {
|
|
1837
1840
|
return {
|
|
1838
1841
|
...serializedProjection,
|
|
@@ -1845,22 +1848,68 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1845
1848
|
if (parsed.error) {
|
|
1846
1849
|
throw new Error(
|
|
1847
1850
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1848
|
-
${(0,
|
|
1851
|
+
${(0, import_v413.prettifyError)(parsed.error)}
|
|
1849
1852
|
`
|
|
1850
1853
|
);
|
|
1851
1854
|
}
|
|
1852
1855
|
return parsed.data;
|
|
1853
1856
|
}
|
|
1854
1857
|
|
|
1855
|
-
// src/
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
+
// src/ensapi/api/indexing-status/response.ts
|
|
1859
|
+
var IndexingStatusResponseCodes = {
|
|
1860
|
+
/**
|
|
1861
|
+
* Represents that the indexing status is available.
|
|
1862
|
+
*/
|
|
1863
|
+
Ok: "ok",
|
|
1864
|
+
/**
|
|
1865
|
+
* Represents that the indexing status is unavailable.
|
|
1866
|
+
*/
|
|
1867
|
+
Error: "error"
|
|
1868
|
+
};
|
|
1869
|
+
|
|
1870
|
+
// src/ensapi/api/indexing-status/zod-schemas.ts
|
|
1871
|
+
var import_v414 = require("zod/v4");
|
|
1872
|
+
var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v414.z.strictObject({
|
|
1873
|
+
responseCode: import_v414.z.literal(IndexingStatusResponseCodes.Ok),
|
|
1874
|
+
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1875
|
+
});
|
|
1876
|
+
var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v414.z.strictObject({
|
|
1877
|
+
responseCode: import_v414.z.literal(IndexingStatusResponseCodes.Error)
|
|
1878
|
+
});
|
|
1879
|
+
var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v414.z.discriminatedUnion("responseCode", [
|
|
1880
|
+
makeIndexingStatusResponseOkSchema(valueLabel),
|
|
1881
|
+
makeIndexingStatusResponseErrorSchema(valueLabel)
|
|
1882
|
+
]);
|
|
1883
|
+
var makeSerializedIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v414.z.strictObject({
|
|
1884
|
+
responseCode: import_v414.z.literal(IndexingStatusResponseCodes.Ok),
|
|
1885
|
+
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1886
|
+
});
|
|
1887
|
+
var makeSerializedIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v414.z.discriminatedUnion("responseCode", [
|
|
1888
|
+
makeSerializedIndexingStatusResponseOkSchema(valueLabel),
|
|
1889
|
+
makeIndexingStatusResponseErrorSchema(valueLabel)
|
|
1890
|
+
]);
|
|
1891
|
+
|
|
1892
|
+
// src/ensapi/api/indexing-status/deserialize.ts
|
|
1893
|
+
function buildUnvalidatedIndexingStatusResponse(serializedResponse) {
|
|
1894
|
+
if (serializedResponse.responseCode !== IndexingStatusResponseCodes.Ok) {
|
|
1895
|
+
return serializedResponse;
|
|
1896
|
+
}
|
|
1858
1897
|
return {
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1898
|
+
...serializedResponse,
|
|
1899
|
+
realtimeProjection: buildUnvalidatedRealtimeIndexingStatusProjection(
|
|
1900
|
+
serializedResponse.realtimeProjection
|
|
1901
|
+
)
|
|
1862
1902
|
};
|
|
1863
1903
|
}
|
|
1904
|
+
function deserializeIndexingStatusResponse(maybeResponse) {
|
|
1905
|
+
const parsed = makeSerializedIndexingStatusResponseSchema().transform(buildUnvalidatedIndexingStatusResponse).pipe(makeIndexingStatusResponseSchema()).safeParse(maybeResponse);
|
|
1906
|
+
if (parsed.error) {
|
|
1907
|
+
throw new Error(`Cannot deserialize IndexingStatusResponse:
|
|
1908
|
+
${(0, import_v415.prettifyError)(parsed.error)}
|
|
1909
|
+
`);
|
|
1910
|
+
}
|
|
1911
|
+
return parsed.data;
|
|
1912
|
+
}
|
|
1864
1913
|
|
|
1865
1914
|
// src/shared/serialize.ts
|
|
1866
1915
|
var import_caip2 = require("caip");
|
|
@@ -1906,7 +1955,7 @@ function formatAssetId({
|
|
|
1906
1955
|
}).toLowerCase();
|
|
1907
1956
|
}
|
|
1908
1957
|
|
|
1909
|
-
// src/
|
|
1958
|
+
// src/indexing-status/serialize/chain-indexing-status-snapshot.ts
|
|
1910
1959
|
function serializeChainIndexingSnapshots(chains) {
|
|
1911
1960
|
const serializedSnapshots = {};
|
|
1912
1961
|
for (const [chainId, snapshot] of chains.entries()) {
|
|
@@ -1915,7 +1964,7 @@ function serializeChainIndexingSnapshots(chains) {
|
|
|
1915
1964
|
return serializedSnapshots;
|
|
1916
1965
|
}
|
|
1917
1966
|
|
|
1918
|
-
// src/
|
|
1967
|
+
// src/indexing-status/serialize/omnichain-indexing-status-snapshot.ts
|
|
1919
1968
|
function serializeOmnichainIndexingStatusSnapshot(indexingStatus) {
|
|
1920
1969
|
switch (indexingStatus.omnichainStatus) {
|
|
1921
1970
|
case OmnichainIndexingStatusIds.Unstarted:
|
|
@@ -1946,7 +1995,7 @@ function serializeOmnichainIndexingStatusSnapshot(indexingStatus) {
|
|
|
1946
1995
|
}
|
|
1947
1996
|
}
|
|
1948
1997
|
|
|
1949
|
-
// src/
|
|
1998
|
+
// src/indexing-status/serialize/cross-chain-indexing-status-snapshot.ts
|
|
1950
1999
|
function serializeCrossChainIndexingStatusSnapshotOmnichain({
|
|
1951
2000
|
strategy,
|
|
1952
2001
|
slowestChainIndexingCursor,
|
|
@@ -1961,7 +2010,7 @@ function serializeCrossChainIndexingStatusSnapshotOmnichain({
|
|
|
1961
2010
|
};
|
|
1962
2011
|
}
|
|
1963
2012
|
|
|
1964
|
-
// src/
|
|
2013
|
+
// src/indexing-status/serialize/realtime-indexing-status-projection.ts
|
|
1965
2014
|
function serializeRealtimeIndexingStatusProjection(indexingProjection) {
|
|
1966
2015
|
return {
|
|
1967
2016
|
projectedAt: indexingProjection.projectedAt,
|
|
@@ -1970,132 +2019,6 @@ function serializeRealtimeIndexingStatusProjection(indexingProjection) {
|
|
|
1970
2019
|
};
|
|
1971
2020
|
}
|
|
1972
2021
|
|
|
1973
|
-
// src/ensindexer/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
1974
|
-
var import_v415 = require("zod/v4");
|
|
1975
|
-
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1976
|
-
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
1977
|
-
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1978
|
-
if (parsed.error) {
|
|
1979
|
-
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
1980
|
-
${(0, import_v415.prettifyError)(parsed.error)}
|
|
1981
|
-
`);
|
|
1982
|
-
}
|
|
1983
|
-
return parsed.data;
|
|
1984
|
-
}
|
|
1985
|
-
|
|
1986
|
-
// src/ensindexer/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
1987
|
-
var import_v416 = require("zod/v4");
|
|
1988
|
-
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1989
|
-
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
1990
|
-
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1991
|
-
if (parsed.error) {
|
|
1992
|
-
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
1993
|
-
${(0, import_v416.prettifyError)(parsed.error)}
|
|
1994
|
-
`);
|
|
1995
|
-
}
|
|
1996
|
-
return parsed.data;
|
|
1997
|
-
}
|
|
1998
|
-
|
|
1999
|
-
// src/ensindexer/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
2000
|
-
var import_v417 = require("zod/v4");
|
|
2001
|
-
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
2002
|
-
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
2003
|
-
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
2004
|
-
if (parsed.error) {
|
|
2005
|
-
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
2006
|
-
${(0, import_v417.prettifyError)(parsed.error)}
|
|
2007
|
-
`);
|
|
2008
|
-
}
|
|
2009
|
-
return parsed.data;
|
|
2010
|
-
}
|
|
2011
|
-
|
|
2012
|
-
// src/ensindexer/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
2013
|
-
var import_v418 = require("zod/v4");
|
|
2014
|
-
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
2015
|
-
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
2016
|
-
const parsed = schema.safeParse(unvalidatedProjection);
|
|
2017
|
-
if (parsed.error) {
|
|
2018
|
-
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
2019
|
-
${(0, import_v418.prettifyError)(parsed.error)}
|
|
2020
|
-
`);
|
|
2021
|
-
}
|
|
2022
|
-
return parsed.data;
|
|
2023
|
-
}
|
|
2024
|
-
|
|
2025
|
-
// src/ensapi/config/serialize.ts
|
|
2026
|
-
function serializeENSApiPublicConfig(config) {
|
|
2027
|
-
const { version, theGraphFallback, ensIndexerPublicConfig } = config;
|
|
2028
|
-
return {
|
|
2029
|
-
version,
|
|
2030
|
-
theGraphFallback,
|
|
2031
|
-
ensIndexerPublicConfig: serializeENSIndexerPublicConfig(ensIndexerPublicConfig)
|
|
2032
|
-
};
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
// src/ensapi/api/config/serialize.ts
|
|
2036
|
-
function serializeConfigResponse(response) {
|
|
2037
|
-
return serializeENSApiPublicConfig(response);
|
|
2038
|
-
}
|
|
2039
|
-
|
|
2040
|
-
// src/ensapi/api/indexing-status/deserialize.ts
|
|
2041
|
-
var import_v420 = require("zod/v4");
|
|
2042
|
-
|
|
2043
|
-
// src/ensapi/api/indexing-status/response.ts
|
|
2044
|
-
var IndexingStatusResponseCodes = {
|
|
2045
|
-
/**
|
|
2046
|
-
* Represents that the indexing status is available.
|
|
2047
|
-
*/
|
|
2048
|
-
Ok: "ok",
|
|
2049
|
-
/**
|
|
2050
|
-
* Represents that the indexing status is unavailable.
|
|
2051
|
-
*/
|
|
2052
|
-
Error: "error"
|
|
2053
|
-
};
|
|
2054
|
-
|
|
2055
|
-
// src/ensapi/api/indexing-status/zod-schemas.ts
|
|
2056
|
-
var import_v419 = require("zod/v4");
|
|
2057
|
-
var makeIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v419.z.strictObject({
|
|
2058
|
-
responseCode: import_v419.z.literal(IndexingStatusResponseCodes.Ok),
|
|
2059
|
-
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2060
|
-
});
|
|
2061
|
-
var makeIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v419.z.strictObject({
|
|
2062
|
-
responseCode: import_v419.z.literal(IndexingStatusResponseCodes.Error)
|
|
2063
|
-
});
|
|
2064
|
-
var makeIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v419.z.discriminatedUnion("responseCode", [
|
|
2065
|
-
makeIndexingStatusResponseOkSchema(valueLabel),
|
|
2066
|
-
makeIndexingStatusResponseErrorSchema(valueLabel)
|
|
2067
|
-
]);
|
|
2068
|
-
var makeSerializedIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v419.z.strictObject({
|
|
2069
|
-
responseCode: import_v419.z.literal(IndexingStatusResponseCodes.Ok),
|
|
2070
|
-
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
2071
|
-
});
|
|
2072
|
-
var makeSerializedIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v419.z.discriminatedUnion("responseCode", [
|
|
2073
|
-
makeSerializedIndexingStatusResponseOkSchema(valueLabel),
|
|
2074
|
-
makeIndexingStatusResponseErrorSchema(valueLabel)
|
|
2075
|
-
]);
|
|
2076
|
-
|
|
2077
|
-
// src/ensapi/api/indexing-status/deserialize.ts
|
|
2078
|
-
function buildUnvalidatedIndexingStatusResponse(serializedResponse) {
|
|
2079
|
-
if (serializedResponse.responseCode !== IndexingStatusResponseCodes.Ok) {
|
|
2080
|
-
return serializedResponse;
|
|
2081
|
-
}
|
|
2082
|
-
return {
|
|
2083
|
-
...serializedResponse,
|
|
2084
|
-
realtimeProjection: buildUnvalidatedRealtimeIndexingStatusProjection(
|
|
2085
|
-
serializedResponse.realtimeProjection
|
|
2086
|
-
)
|
|
2087
|
-
};
|
|
2088
|
-
}
|
|
2089
|
-
function deserializeIndexingStatusResponse(maybeResponse) {
|
|
2090
|
-
const parsed = makeSerializedIndexingStatusResponseSchema().transform(buildUnvalidatedIndexingStatusResponse).pipe(makeIndexingStatusResponseSchema()).safeParse(maybeResponse);
|
|
2091
|
-
if (parsed.error) {
|
|
2092
|
-
throw new Error(`Cannot deserialize IndexingStatusResponse:
|
|
2093
|
-
${(0, import_v420.prettifyError)(parsed.error)}
|
|
2094
|
-
`);
|
|
2095
|
-
}
|
|
2096
|
-
return parsed.data;
|
|
2097
|
-
}
|
|
2098
|
-
|
|
2099
2022
|
// src/ensapi/api/indexing-status/serialize.ts
|
|
2100
2023
|
function serializeIndexingStatusResponse(response) {
|
|
2101
2024
|
switch (response.responseCode) {
|
|
@@ -2110,11 +2033,11 @@ function serializeIndexingStatusResponse(response) {
|
|
|
2110
2033
|
}
|
|
2111
2034
|
|
|
2112
2035
|
// src/ensapi/api/name-tokens/deserialize.ts
|
|
2113
|
-
var
|
|
2036
|
+
var import_v420 = require("zod/v4");
|
|
2114
2037
|
|
|
2115
2038
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2116
2039
|
var import_viem14 = require("viem");
|
|
2117
|
-
var
|
|
2040
|
+
var import_v419 = require("zod/v4");
|
|
2118
2041
|
|
|
2119
2042
|
// src/tokenscope/name-token.ts
|
|
2120
2043
|
var import_viem13 = require("viem");
|
|
@@ -2154,12 +2077,12 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2154
2077
|
|
|
2155
2078
|
// src/tokenscope/assets.ts
|
|
2156
2079
|
var import_viem12 = require("viem");
|
|
2157
|
-
var
|
|
2080
|
+
var import_v417 = require("zod/v4");
|
|
2158
2081
|
|
|
2159
2082
|
// src/tokenscope/zod-schemas.ts
|
|
2160
2083
|
var import_caip3 = require("caip");
|
|
2161
2084
|
var import_viem11 = require("viem");
|
|
2162
|
-
var
|
|
2085
|
+
var import_v416 = require("zod/v4");
|
|
2163
2086
|
|
|
2164
2087
|
// src/shared/types.ts
|
|
2165
2088
|
var AssetNamespaces = {
|
|
@@ -2168,10 +2091,10 @@ var AssetNamespaces = {
|
|
|
2168
2091
|
};
|
|
2169
2092
|
|
|
2170
2093
|
// src/tokenscope/zod-schemas.ts
|
|
2171
|
-
var tokenIdSchemaSerializable =
|
|
2172
|
-
var tokenIdSchemaNative =
|
|
2094
|
+
var tokenIdSchemaSerializable = import_v416.z.string();
|
|
2095
|
+
var tokenIdSchemaNative = import_v416.z.preprocess(
|
|
2173
2096
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2174
|
-
|
|
2097
|
+
import_v416.z.bigint().positive()
|
|
2175
2098
|
);
|
|
2176
2099
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2177
2100
|
if (serializable) {
|
|
@@ -2181,13 +2104,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2181
2104
|
}
|
|
2182
2105
|
}
|
|
2183
2106
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2184
|
-
return
|
|
2185
|
-
assetNamespace:
|
|
2107
|
+
return import_v416.z.object({
|
|
2108
|
+
assetNamespace: import_v416.z.enum(AssetNamespaces),
|
|
2186
2109
|
contract: makeAccountIdSchema(valueLabel),
|
|
2187
2110
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2188
2111
|
});
|
|
2189
2112
|
};
|
|
2190
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2113
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v416.z.preprocess((v) => {
|
|
2191
2114
|
if (typeof v === "string") {
|
|
2192
2115
|
const result = new import_caip3.AssetId(v);
|
|
2193
2116
|
return {
|
|
@@ -2211,20 +2134,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2211
2134
|
});
|
|
2212
2135
|
}
|
|
2213
2136
|
}
|
|
2214
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2215
|
-
ownershipType:
|
|
2137
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v416.z.object({
|
|
2138
|
+
ownershipType: import_v416.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2216
2139
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2217
2140
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2218
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2219
|
-
ownershipType:
|
|
2141
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v416.z.object({
|
|
2142
|
+
ownershipType: import_v416.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2220
2143
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2221
2144
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2222
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2223
|
-
ownershipType:
|
|
2145
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v416.z.object({
|
|
2146
|
+
ownershipType: import_v416.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2224
2147
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2225
2148
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2226
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2227
|
-
ownershipType:
|
|
2149
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v416.z.object({
|
|
2150
|
+
ownershipType: import_v416.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2228
2151
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2229
2152
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2230
2153
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2237,16 +2160,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2237
2160
|
});
|
|
2238
2161
|
}
|
|
2239
2162
|
}
|
|
2240
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2163
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v416.z.discriminatedUnion("ownershipType", [
|
|
2241
2164
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2242
2165
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2243
2166
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2244
2167
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2245
2168
|
]);
|
|
2246
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2169
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v416.z.object({
|
|
2247
2170
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2248
2171
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2249
|
-
mintStatus:
|
|
2172
|
+
mintStatus: import_v416.z.enum(NFTMintStatuses)
|
|
2250
2173
|
});
|
|
2251
2174
|
|
|
2252
2175
|
// src/tokenscope/assets.ts
|
|
@@ -2262,7 +2185,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2262
2185
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2263
2186
|
if (parsed.error) {
|
|
2264
2187
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2265
|
-
${(0,
|
|
2188
|
+
${(0, import_v417.prettifyError)(parsed.error)}
|
|
2266
2189
|
`);
|
|
2267
2190
|
}
|
|
2268
2191
|
return parsed.data;
|
|
@@ -2272,7 +2195,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2272
2195
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2273
2196
|
if (parsed.error) {
|
|
2274
2197
|
throw new RangeError(`Cannot parse AssetId:
|
|
2275
|
-
${(0,
|
|
2198
|
+
${(0, import_v417.prettifyError)(parsed.error)}
|
|
2276
2199
|
`);
|
|
2277
2200
|
}
|
|
2278
2201
|
return parsed.data;
|
|
@@ -2572,10 +2495,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2572
2495
|
}
|
|
2573
2496
|
|
|
2574
2497
|
// src/ensapi/api/shared/errors/zod-schemas.ts
|
|
2575
|
-
var
|
|
2576
|
-
var ErrorResponseSchema =
|
|
2577
|
-
message:
|
|
2578
|
-
details:
|
|
2498
|
+
var import_v418 = require("zod/v4");
|
|
2499
|
+
var ErrorResponseSchema = import_v418.z.object({
|
|
2500
|
+
message: import_v418.z.string(),
|
|
2501
|
+
details: import_v418.z.optional(import_v418.z.unknown())
|
|
2579
2502
|
});
|
|
2580
2503
|
|
|
2581
2504
|
// src/ensapi/api/name-tokens/response.ts
|
|
@@ -2614,10 +2537,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2614
2537
|
};
|
|
2615
2538
|
|
|
2616
2539
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2617
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2540
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v419.z.object({
|
|
2618
2541
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2619
2542
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2620
|
-
tokens:
|
|
2543
|
+
tokens: import_v419.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2621
2544
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2622
2545
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2623
2546
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2659,32 +2582,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2659
2582
|
});
|
|
2660
2583
|
}
|
|
2661
2584
|
});
|
|
2662
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2663
|
-
responseCode:
|
|
2585
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v419.z.strictObject({
|
|
2586
|
+
responseCode: import_v419.z.literal(NameTokensResponseCodes.Ok),
|
|
2664
2587
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2665
2588
|
});
|
|
2666
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2667
|
-
responseCode:
|
|
2668
|
-
errorCode:
|
|
2589
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v419.z.strictObject({
|
|
2590
|
+
responseCode: import_v419.z.literal(NameTokensResponseCodes.Error),
|
|
2591
|
+
errorCode: import_v419.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2669
2592
|
error: ErrorResponseSchema
|
|
2670
2593
|
});
|
|
2671
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2672
|
-
responseCode:
|
|
2673
|
-
errorCode:
|
|
2594
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v419.z.strictObject({
|
|
2595
|
+
responseCode: import_v419.z.literal(NameTokensResponseCodes.Error),
|
|
2596
|
+
errorCode: import_v419.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2674
2597
|
error: ErrorResponseSchema
|
|
2675
2598
|
});
|
|
2676
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2677
|
-
responseCode:
|
|
2678
|
-
errorCode:
|
|
2599
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v419.z.strictObject({
|
|
2600
|
+
responseCode: import_v419.z.literal(NameTokensResponseCodes.Error),
|
|
2601
|
+
errorCode: import_v419.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2679
2602
|
error: ErrorResponseSchema
|
|
2680
2603
|
});
|
|
2681
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2604
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v419.z.discriminatedUnion("errorCode", [
|
|
2682
2605
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2683
2606
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2684
2607
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2685
2608
|
]);
|
|
2686
2609
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2687
|
-
return
|
|
2610
|
+
return import_v419.z.discriminatedUnion("responseCode", [
|
|
2688
2611
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2689
2612
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2690
2613
|
]);
|
|
@@ -2697,7 +2620,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2697
2620
|
);
|
|
2698
2621
|
if (parsed.error) {
|
|
2699
2622
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2700
|
-
${(0,
|
|
2623
|
+
${(0, import_v420.prettifyError)(parsed.error)}
|
|
2701
2624
|
`);
|
|
2702
2625
|
}
|
|
2703
2626
|
return parsed.data;
|
|
@@ -2771,14 +2694,14 @@ function serializeNameTokensResponse(response) {
|
|
|
2771
2694
|
}
|
|
2772
2695
|
|
|
2773
2696
|
// src/ensapi/api/registrar-actions/deserialize.ts
|
|
2774
|
-
var
|
|
2697
|
+
var import_v424 = require("zod/v4");
|
|
2775
2698
|
|
|
2776
2699
|
// src/ensapi/api/registrar-actions/zod-schemas.ts
|
|
2777
2700
|
var import_ens7 = require("viem/ens");
|
|
2778
|
-
var
|
|
2701
|
+
var import_v423 = require("zod/v4");
|
|
2779
2702
|
|
|
2780
2703
|
// src/registrars/zod-schemas.ts
|
|
2781
|
-
var
|
|
2704
|
+
var import_v421 = require("zod/v4");
|
|
2782
2705
|
|
|
2783
2706
|
// src/registrars/encoded-referrer.ts
|
|
2784
2707
|
var import_viem15 = require("viem");
|
|
@@ -2853,11 +2776,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2853
2776
|
}
|
|
2854
2777
|
|
|
2855
2778
|
// src/registrars/zod-schemas.ts
|
|
2856
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2779
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v421.z.object({
|
|
2857
2780
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2858
2781
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2859
2782
|
});
|
|
2860
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2783
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v421.z.object({
|
|
2861
2784
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2862
2785
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2863
2786
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2873,18 +2796,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2873
2796
|
});
|
|
2874
2797
|
}
|
|
2875
2798
|
}
|
|
2876
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
2799
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v421.z.union([
|
|
2877
2800
|
// pricing available
|
|
2878
|
-
|
|
2801
|
+
import_v421.z.object({
|
|
2879
2802
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2880
2803
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2881
2804
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2882
2805
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2883
2806
|
// pricing unknown
|
|
2884
|
-
|
|
2885
|
-
baseCost:
|
|
2886
|
-
premium:
|
|
2887
|
-
total:
|
|
2807
|
+
import_v421.z.object({
|
|
2808
|
+
baseCost: import_v421.z.null(),
|
|
2809
|
+
premium: import_v421.z.null(),
|
|
2810
|
+
total: import_v421.z.null()
|
|
2888
2811
|
}).transform((v) => v)
|
|
2889
2812
|
]);
|
|
2890
2813
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2907,9 +2830,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2907
2830
|
});
|
|
2908
2831
|
}
|
|
2909
2832
|
}
|
|
2910
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
2833
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v421.z.union([
|
|
2911
2834
|
// referral available
|
|
2912
|
-
|
|
2835
|
+
import_v421.z.object({
|
|
2913
2836
|
encodedReferrer: makeHexStringSchema(
|
|
2914
2837
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2915
2838
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2917,9 +2840,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2917
2840
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2918
2841
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2919
2842
|
// referral not applicable
|
|
2920
|
-
|
|
2921
|
-
encodedReferrer:
|
|
2922
|
-
decodedReferrer:
|
|
2843
|
+
import_v421.z.object({
|
|
2844
|
+
encodedReferrer: import_v421.z.null(),
|
|
2845
|
+
decodedReferrer: import_v421.z.null()
|
|
2923
2846
|
})
|
|
2924
2847
|
]);
|
|
2925
2848
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2932,9 +2855,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2932
2855
|
});
|
|
2933
2856
|
}
|
|
2934
2857
|
}
|
|
2935
|
-
var EventIdSchema =
|
|
2936
|
-
var EventIdsSchema =
|
|
2937
|
-
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") =>
|
|
2858
|
+
var EventIdSchema = import_v421.z.string().nonempty();
|
|
2859
|
+
var EventIdsSchema = import_v421.z.array(EventIdSchema).min(1).transform((v) => v);
|
|
2860
|
+
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v421.z.object({
|
|
2938
2861
|
id: EventIdSchema,
|
|
2939
2862
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
2940
2863
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -2948,38 +2871,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
|
|
|
2948
2871
|
eventIds: EventIdsSchema
|
|
2949
2872
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
2950
2873
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2951
|
-
type:
|
|
2874
|
+
type: import_v421.z.literal(RegistrarActionTypes.Registration)
|
|
2952
2875
|
});
|
|
2953
2876
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2954
|
-
type:
|
|
2877
|
+
type: import_v421.z.literal(RegistrarActionTypes.Renewal)
|
|
2955
2878
|
});
|
|
2956
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
2879
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v421.z.discriminatedUnion("type", [
|
|
2957
2880
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
2958
2881
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
2959
2882
|
]);
|
|
2960
2883
|
|
|
2961
2884
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
2962
|
-
var
|
|
2885
|
+
var import_v422 = require("zod/v4");
|
|
2963
2886
|
|
|
2964
2887
|
// src/ensapi/api/shared/pagination/request.ts
|
|
2965
2888
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
2966
2889
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
2967
2890
|
|
|
2968
2891
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
2969
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
2892
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v422.z.object({
|
|
2970
2893
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
2971
2894
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
2972
2895
|
RECORDS_PER_PAGE_MAX,
|
|
2973
2896
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
2974
2897
|
)
|
|
2975
2898
|
});
|
|
2976
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
2977
|
-
totalRecords:
|
|
2978
|
-
totalPages:
|
|
2979
|
-
hasNext:
|
|
2980
|
-
hasPrev:
|
|
2981
|
-
startIndex:
|
|
2982
|
-
endIndex:
|
|
2899
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v422.z.object({
|
|
2900
|
+
totalRecords: import_v422.z.literal(0),
|
|
2901
|
+
totalPages: import_v422.z.literal(1),
|
|
2902
|
+
hasNext: import_v422.z.literal(false),
|
|
2903
|
+
hasPrev: import_v422.z.literal(false),
|
|
2904
|
+
startIndex: import_v422.z.undefined(),
|
|
2905
|
+
endIndex: import_v422.z.undefined()
|
|
2983
2906
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
2984
2907
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
2985
2908
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -3014,15 +2937,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
3014
2937
|
});
|
|
3015
2938
|
}
|
|
3016
2939
|
}
|
|
3017
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
2940
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v422.z.object({
|
|
3018
2941
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
3019
2942
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
3020
|
-
hasNext:
|
|
3021
|
-
hasPrev:
|
|
2943
|
+
hasNext: import_v422.z.boolean(),
|
|
2944
|
+
hasPrev: import_v422.z.boolean(),
|
|
3022
2945
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
3023
2946
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
3024
2947
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
3025
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
2948
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v422.z.union([
|
|
3026
2949
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
3027
2950
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
3028
2951
|
]);
|
|
@@ -3052,21 +2975,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
3052
2975
|
});
|
|
3053
2976
|
}
|
|
3054
2977
|
}
|
|
3055
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
2978
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v423.z.object({
|
|
3056
2979
|
action: makeRegistrarActionSchema(valueLabel),
|
|
3057
2980
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
3058
2981
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
3059
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
3060
|
-
responseCode:
|
|
3061
|
-
registrarActions:
|
|
2982
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v423.z.object({
|
|
2983
|
+
responseCode: import_v423.z.literal(RegistrarActionsResponseCodes.Ok),
|
|
2984
|
+
registrarActions: import_v423.z.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
3062
2985
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
3063
2986
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
3064
2987
|
});
|
|
3065
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
3066
|
-
responseCode:
|
|
2988
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v423.z.strictObject({
|
|
2989
|
+
responseCode: import_v423.z.literal(RegistrarActionsResponseCodes.Error),
|
|
3067
2990
|
error: ErrorResponseSchema
|
|
3068
2991
|
});
|
|
3069
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
2992
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v423.z.discriminatedUnion("responseCode", [
|
|
3070
2993
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
3071
2994
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
3072
2995
|
]);
|
|
@@ -3077,7 +3000,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3077
3000
|
if (parsed.error) {
|
|
3078
3001
|
throw new Error(
|
|
3079
3002
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3080
|
-
${(0,
|
|
3003
|
+
${(0, import_v424.prettifyError)(parsed.error)}
|
|
3081
3004
|
`
|
|
3082
3005
|
);
|
|
3083
3006
|
}
|
|
@@ -3224,12 +3147,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3224
3147
|
}
|
|
3225
3148
|
|
|
3226
3149
|
// src/ensapi/api/shared/errors/deserialize.ts
|
|
3227
|
-
var
|
|
3150
|
+
var import_v425 = require("zod/v4");
|
|
3228
3151
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
3229
3152
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
3230
3153
|
if (parsed.error) {
|
|
3231
3154
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3232
|
-
${(0,
|
|
3155
|
+
${(0, import_v425.prettifyError)(parsed.error)}
|
|
3233
3156
|
`);
|
|
3234
3157
|
}
|
|
3235
3158
|
return parsed.data;
|
|
@@ -3797,6 +3720,83 @@ function isResolvedIdentity(identity) {
|
|
|
3797
3720
|
return identity.resolutionStatus !== ResolutionStatusIds.Unresolved;
|
|
3798
3721
|
}
|
|
3799
3722
|
|
|
3723
|
+
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
3724
|
+
var import_v426 = require("zod/v4");
|
|
3725
|
+
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
3726
|
+
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
3727
|
+
const parsed = schema.safeParse(maybeSnapshot);
|
|
3728
|
+
if (parsed.error) {
|
|
3729
|
+
throw new Error(
|
|
3730
|
+
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
3731
|
+
${(0, import_v426.prettifyError)(parsed.error)}
|
|
3732
|
+
`
|
|
3733
|
+
);
|
|
3734
|
+
}
|
|
3735
|
+
return parsed.data;
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
// src/indexing-status/realtime-indexing-status-projection.ts
|
|
3739
|
+
function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
3740
|
+
const projectedAt = Math.max(now, snapshot.snapshotTime);
|
|
3741
|
+
return {
|
|
3742
|
+
projectedAt,
|
|
3743
|
+
worstCaseDistance: projectedAt - snapshot.slowestChainIndexingCursor,
|
|
3744
|
+
snapshot
|
|
3745
|
+
};
|
|
3746
|
+
}
|
|
3747
|
+
|
|
3748
|
+
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
3749
|
+
var import_v427 = require("zod/v4");
|
|
3750
|
+
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
3751
|
+
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
3752
|
+
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
3753
|
+
if (parsed.error) {
|
|
3754
|
+
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
3755
|
+
${(0, import_v427.prettifyError)(parsed.error)}
|
|
3756
|
+
`);
|
|
3757
|
+
}
|
|
3758
|
+
return parsed.data;
|
|
3759
|
+
}
|
|
3760
|
+
|
|
3761
|
+
// src/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
3762
|
+
var import_v428 = require("zod/v4");
|
|
3763
|
+
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
3764
|
+
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
3765
|
+
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
3766
|
+
if (parsed.error) {
|
|
3767
|
+
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
3768
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
3769
|
+
`);
|
|
3770
|
+
}
|
|
3771
|
+
return parsed.data;
|
|
3772
|
+
}
|
|
3773
|
+
|
|
3774
|
+
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
3775
|
+
var import_v429 = require("zod/v4");
|
|
3776
|
+
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
3777
|
+
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
3778
|
+
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
3779
|
+
if (parsed.error) {
|
|
3780
|
+
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
3781
|
+
${(0, import_v429.prettifyError)(parsed.error)}
|
|
3782
|
+
`);
|
|
3783
|
+
}
|
|
3784
|
+
return parsed.data;
|
|
3785
|
+
}
|
|
3786
|
+
|
|
3787
|
+
// src/indexing-status/validate/realtime-indexing-status-projection.ts
|
|
3788
|
+
var import_v430 = require("zod/v4");
|
|
3789
|
+
function validateRealtimeIndexingStatusProjection(unvalidatedProjection, valueLabel) {
|
|
3790
|
+
const schema = makeRealtimeIndexingStatusProjectionSchema(valueLabel);
|
|
3791
|
+
const parsed = schema.safeParse(unvalidatedProjection);
|
|
3792
|
+
if (parsed.error) {
|
|
3793
|
+
throw new Error(`Invalid RealtimeIndexingStatusProjection:
|
|
3794
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
3795
|
+
`);
|
|
3796
|
+
}
|
|
3797
|
+
return parsed.data;
|
|
3798
|
+
}
|
|
3799
|
+
|
|
3800
3800
|
// src/registrars/basenames-subregistry.ts
|
|
3801
3801
|
var import_datasources8 = require("@ensnode/datasources");
|
|
3802
3802
|
function getBasenamesSubregistryId(namespace) {
|
|
@@ -4126,7 +4126,7 @@ var SWRCache = class {
|
|
|
4126
4126
|
backgroundInterval = null;
|
|
4127
4127
|
async revalidate() {
|
|
4128
4128
|
if (!this.inProgressRevalidate) {
|
|
4129
|
-
this.inProgressRevalidate = this.options.fn().then((result) => {
|
|
4129
|
+
this.inProgressRevalidate = this.options.fn(this.cache ?? void 0).then((result) => {
|
|
4130
4130
|
this.cache = {
|
|
4131
4131
|
result,
|
|
4132
4132
|
updatedAt: (0, import_getUnixTime2.getUnixTime)(/* @__PURE__ */ new Date())
|