@ensnode/ensnode-sdk 0.0.0-next-20260226103642 → 0.0.0-next-20260226210745
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 +15 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +35 -35
- package/dist/index.d.ts +35 -35
- package/dist/index.js +15 -15
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,7 @@ __export(index_exports, {
|
|
|
36
36
|
ATTR_PROTOCOL_STEP_RESULT: () => ATTR_PROTOCOL_STEP_RESULT,
|
|
37
37
|
AssetNamespaces: () => AssetNamespaces,
|
|
38
38
|
BASENAMES_NODE: () => BASENAMES_NODE,
|
|
39
|
-
|
|
39
|
+
BlockRefRangeTypeIds: () => BlockRefRangeTypeIds,
|
|
40
40
|
ChainIndexingStatusIds: () => ChainIndexingStatusIds,
|
|
41
41
|
ClientError: () => ClientError,
|
|
42
42
|
CrossChainIndexingStrategyIds: () => CrossChainIndexingStrategyIds,
|
|
@@ -1068,7 +1068,7 @@ var import_v410 = require("zod/v4");
|
|
|
1068
1068
|
var import_v49 = require("zod/v4");
|
|
1069
1069
|
|
|
1070
1070
|
// src/indexing-status/chain-indexing-status-snapshot.ts
|
|
1071
|
-
var
|
|
1071
|
+
var BlockRefRangeTypeIds = {
|
|
1072
1072
|
/**
|
|
1073
1073
|
* Represents that indexing of the chain should be performed for an indefinite range.
|
|
1074
1074
|
*/
|
|
@@ -1112,13 +1112,13 @@ var ChainIndexingStatusIds = {
|
|
|
1112
1112
|
function createIndexingConfig(startBlock, endBlock) {
|
|
1113
1113
|
if (endBlock) {
|
|
1114
1114
|
return {
|
|
1115
|
-
|
|
1115
|
+
blockRangeType: BlockRefRangeTypeIds.Definite,
|
|
1116
1116
|
startBlock,
|
|
1117
1117
|
endBlock
|
|
1118
1118
|
};
|
|
1119
1119
|
}
|
|
1120
1120
|
return {
|
|
1121
|
-
|
|
1121
|
+
blockRangeType: BlockRefRangeTypeIds.Indefinite,
|
|
1122
1122
|
startBlock
|
|
1123
1123
|
};
|
|
1124
1124
|
}
|
|
@@ -1138,7 +1138,7 @@ function getTimestampForHighestOmnichainKnownBlock(chains) {
|
|
|
1138
1138
|
for (const chain of chains) {
|
|
1139
1139
|
switch (chain.chainStatus) {
|
|
1140
1140
|
case ChainIndexingStatusIds.Queued:
|
|
1141
|
-
if (chain.config.
|
|
1141
|
+
if (chain.config.blockRangeType === BlockRefRangeTypeIds.Definite) {
|
|
1142
1142
|
latestKnownBlockTimestamps.push(chain.config.endBlock.timestamp);
|
|
1143
1143
|
}
|
|
1144
1144
|
break;
|
|
@@ -1296,7 +1296,7 @@ function isBeforeOrEqualTo(blockA, blockB) {
|
|
|
1296
1296
|
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1297
1297
|
function invariant_chainSnapshotQueuedBlocks(ctx) {
|
|
1298
1298
|
const { config } = ctx.value;
|
|
1299
|
-
if (config.
|
|
1299
|
+
if (config.blockRangeType === BlockRefRangeTypeIds.Indefinite) {
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
1302
|
if (isBeforeOrEqualTo(config.startBlock, config.endBlock) === false) {
|
|
@@ -1323,7 +1323,7 @@ function invariant_chainSnapshotBackfillBlocks(ctx) {
|
|
|
1323
1323
|
message: "`latestIndexedBlock` must be before or same as `backfillEndBlock`."
|
|
1324
1324
|
});
|
|
1325
1325
|
}
|
|
1326
|
-
if (config.
|
|
1326
|
+
if (config.blockRangeType === BlockRefRangeTypeIds.Indefinite) {
|
|
1327
1327
|
return;
|
|
1328
1328
|
}
|
|
1329
1329
|
if (isEqualTo(backfillEndBlock, config.endBlock) === false) {
|
|
@@ -1368,31 +1368,31 @@ function invariant_chainSnapshotFollowingBlocks(ctx) {
|
|
|
1368
1368
|
});
|
|
1369
1369
|
}
|
|
1370
1370
|
}
|
|
1371
|
-
var
|
|
1371
|
+
var makeBlockRefRangeSchema = (valueLabel = "Value") => import_v47.z.discriminatedUnion("blockRangeType", [
|
|
1372
1372
|
import_v47.z.object({
|
|
1373
|
-
|
|
1373
|
+
blockRangeType: import_v47.z.literal(BlockRefRangeTypeIds.Indefinite),
|
|
1374
1374
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1375
1375
|
}),
|
|
1376
1376
|
import_v47.z.object({
|
|
1377
|
-
|
|
1377
|
+
blockRangeType: import_v47.z.literal(BlockRefRangeTypeIds.Definite),
|
|
1378
1378
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1379
1379
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1380
1380
|
})
|
|
1381
1381
|
]);
|
|
1382
1382
|
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v47.z.object({
|
|
1383
1383
|
chainStatus: import_v47.z.literal(ChainIndexingStatusIds.Queued),
|
|
1384
|
-
config:
|
|
1384
|
+
config: makeBlockRefRangeSchema(valueLabel)
|
|
1385
1385
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1386
1386
|
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v47.z.object({
|
|
1387
1387
|
chainStatus: import_v47.z.literal(ChainIndexingStatusIds.Backfill),
|
|
1388
|
-
config:
|
|
1388
|
+
config: makeBlockRefRangeSchema(valueLabel),
|
|
1389
1389
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1390
1390
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1391
1391
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1392
1392
|
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => import_v47.z.object({
|
|
1393
1393
|
chainStatus: import_v47.z.literal(ChainIndexingStatusIds.Completed),
|
|
1394
1394
|
config: import_v47.z.object({
|
|
1395
|
-
|
|
1395
|
+
blockRangeType: import_v47.z.literal(BlockRefRangeTypeIds.Definite),
|
|
1396
1396
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1397
1397
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1398
1398
|
}),
|
|
@@ -1401,7 +1401,7 @@ var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => i
|
|
|
1401
1401
|
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => import_v47.z.object({
|
|
1402
1402
|
chainStatus: import_v47.z.literal(ChainIndexingStatusIds.Following),
|
|
1403
1403
|
config: import_v47.z.object({
|
|
1404
|
-
|
|
1404
|
+
blockRangeType: import_v47.z.literal(BlockRefRangeTypeIds.Indefinite),
|
|
1405
1405
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1406
1406
|
}),
|
|
1407
1407
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
@@ -1669,7 +1669,7 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1669
1669
|
const { snapshotTime, omnichainSnapshot } = ctx.value;
|
|
1670
1670
|
const chains = Array.from(omnichainSnapshot.chains.values());
|
|
1671
1671
|
const startBlockTimestamps = chains.map((chain) => chain.config.startBlock.timestamp);
|
|
1672
|
-
const endBlockTimestamps = chains.map((chain) => chain.config).filter((chainConfig) => chainConfig.
|
|
1672
|
+
const endBlockTimestamps = chains.map((chain) => chain.config).filter((chainConfig) => chainConfig.blockRangeType === BlockRefRangeTypeIds.Definite).map((chainConfig) => chainConfig.endBlock.timestamp);
|
|
1673
1673
|
const backfillEndBlockTimestamps = chains.filter((chain) => chain.chainStatus === ChainIndexingStatusIds.Backfill).map((chain) => chain.backfillEndBlock.timestamp);
|
|
1674
1674
|
const latestKnownBlockTimestamps = chains.filter((chain) => chain.chainStatus === ChainIndexingStatusIds.Following).map((chain) => chain.latestKnownBlock.timestamp);
|
|
1675
1675
|
const highestKnownBlockTimestamp = Math.max(
|