@ensnode/ensnode-sdk 0.0.0-next-20260227190633 → 0.0.0-next-20260301131020
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 +408 -283
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +159 -79
- package/dist/index.d.ts +159 -79
- package/dist/index.js +251 -124
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -36,7 +36,6 @@ __export(index_exports, {
|
|
|
36
36
|
ATTR_PROTOCOL_STEP_RESULT: () => ATTR_PROTOCOL_STEP_RESULT,
|
|
37
37
|
AssetNamespaces: () => AssetNamespaces,
|
|
38
38
|
BASENAMES_NODE: () => BASENAMES_NODE,
|
|
39
|
-
BlockRefRangeTypeIds: () => BlockRefRangeTypeIds,
|
|
40
39
|
ChainIndexingStatusIds: () => ChainIndexingStatusIds,
|
|
41
40
|
ClientError: () => ClientError,
|
|
42
41
|
CrossChainIndexingStrategyIds: () => CrossChainIndexingStrategyIds,
|
|
@@ -75,6 +74,7 @@ __export(index_exports, {
|
|
|
75
74
|
RECORDS_PER_PAGE_MAX: () => RECORDS_PER_PAGE_MAX,
|
|
76
75
|
ROOT_NODE: () => ROOT_NODE,
|
|
77
76
|
ROOT_RESOURCE: () => ROOT_RESOURCE,
|
|
77
|
+
RangeTypeIds: () => RangeTypeIds,
|
|
78
78
|
RegistrarActionTypes: () => RegistrarActionTypes,
|
|
79
79
|
RegistrarActionsFilterTypes: () => RegistrarActionsFilterTypes,
|
|
80
80
|
RegistrarActionsOrders: () => RegistrarActionsOrders,
|
|
@@ -96,10 +96,14 @@ __export(index_exports, {
|
|
|
96
96
|
bigIntToNumber: () => bigIntToNumber,
|
|
97
97
|
bigintToCoinType: () => bigintToCoinType,
|
|
98
98
|
buildAssetId: () => buildAssetId,
|
|
99
|
+
buildBlockNumberRange: () => buildBlockNumberRange,
|
|
100
|
+
buildBlockRefRange: () => buildBlockRefRange,
|
|
99
101
|
buildEncodedReferrer: () => buildEncodedReferrer,
|
|
100
102
|
buildEnsRainbowClientLabelSet: () => buildEnsRainbowClientLabelSet,
|
|
103
|
+
buildIndexedBlockranges: () => buildIndexedBlockranges,
|
|
101
104
|
buildLabelSetId: () => buildLabelSetId,
|
|
102
105
|
buildLabelSetVersion: () => buildLabelSetVersion,
|
|
106
|
+
buildOmnichainIndexingStatusSnapshot: () => buildOmnichainIndexingStatusSnapshot,
|
|
103
107
|
buildPageContext: () => buildPageContext,
|
|
104
108
|
buildUnresolvedIdentity: () => buildUnresolvedIdentity,
|
|
105
109
|
buildUnvalidatedCrossChainIndexingStatusSnapshot: () => buildUnvalidatedCrossChainIndexingStatusSnapshot,
|
|
@@ -113,7 +117,6 @@ __export(index_exports, {
|
|
|
113
117
|
coinTypeReverseLabel: () => coinTypeReverseLabel,
|
|
114
118
|
coinTypeToEvmChainId: () => coinTypeToEvmChainId,
|
|
115
119
|
constructSubInterpretedName: () => constructSubInterpretedName,
|
|
116
|
-
createIndexingConfig: () => createIndexingConfig,
|
|
117
120
|
createRealtimeIndexingStatusProjection: () => createRealtimeIndexingStatusProjection,
|
|
118
121
|
decodeDNSEncodedLiteralName: () => decodeDNSEncodedLiteralName,
|
|
119
122
|
decodeDNSEncodedName: () => decodeDNSEncodedName,
|
|
@@ -121,7 +124,6 @@ __export(index_exports, {
|
|
|
121
124
|
deserializeAssetId: () => deserializeAssetId,
|
|
122
125
|
deserializeBlockNumber: () => deserializeBlockNumber,
|
|
123
126
|
deserializeBlockRef: () => deserializeBlockRef,
|
|
124
|
-
deserializeBlockrange: () => deserializeBlockrange,
|
|
125
127
|
deserializeChainId: () => deserializeChainId,
|
|
126
128
|
deserializeChainIndexingStatusSnapshot: () => deserializeChainIndexingStatusSnapshot,
|
|
127
129
|
deserializeConfigResponse: () => deserializeConfigResponse,
|
|
@@ -233,6 +235,7 @@ __export(index_exports, {
|
|
|
233
235
|
makeSerializedEnsApiPublicConfigSchema: () => makeSerializedEnsApiPublicConfigSchema,
|
|
234
236
|
makeSubdomainNode: () => makeSubdomainNode,
|
|
235
237
|
maybeGetDatasourceContract: () => maybeGetDatasourceContract,
|
|
238
|
+
mergeBlockNumberRanges: () => mergeBlockNumberRanges,
|
|
236
239
|
nameTokensPrerequisites: () => nameTokensPrerequisites,
|
|
237
240
|
parseAccountId: () => parseAccountId,
|
|
238
241
|
parseAssetId: () => parseAssetId,
|
|
@@ -742,23 +745,6 @@ var makeUrlSchema = (valueLabel = "Value") => import_v4.z.url({
|
|
|
742
745
|
abort: true
|
|
743
746
|
}).transform((v) => new URL(v));
|
|
744
747
|
var makeBlockNumberSchema = (valueLabel = "Block number") => makeNonNegativeIntegerSchema(valueLabel);
|
|
745
|
-
var makeBlockrangeSchema = (valueLabel = "Value") => import_v4.z.strictObject(
|
|
746
|
-
{
|
|
747
|
-
startBlock: makeBlockNumberSchema(`${valueLabel}.startBlock`).optional(),
|
|
748
|
-
endBlock: makeBlockNumberSchema(`${valueLabel}.endBlock`).optional()
|
|
749
|
-
},
|
|
750
|
-
{
|
|
751
|
-
error: `${valueLabel} must be a valid Blockrange object.`
|
|
752
|
-
}
|
|
753
|
-
).refine(
|
|
754
|
-
(v) => {
|
|
755
|
-
if (v.startBlock && v.endBlock) {
|
|
756
|
-
return v.startBlock <= v.endBlock;
|
|
757
|
-
}
|
|
758
|
-
return true;
|
|
759
|
-
},
|
|
760
|
-
{ error: `${valueLabel}: startBlock must be before or equal to endBlock` }
|
|
761
|
-
);
|
|
762
748
|
var makeBlockRefSchema = (valueLabel = "Value") => import_v4.z.strictObject(
|
|
763
749
|
{
|
|
764
750
|
timestamp: makeUnixTimestampSchema(`${valueLabel}.timestamp`),
|
|
@@ -1089,28 +1075,119 @@ function serializeEnsApiConfigResponse(response) {
|
|
|
1089
1075
|
var serializeConfigResponse = serializeEnsApiConfigResponse;
|
|
1090
1076
|
|
|
1091
1077
|
// src/ensapi/api/indexing-status/deserialize.ts
|
|
1092
|
-
var
|
|
1078
|
+
var import_v416 = require("zod/v4");
|
|
1093
1079
|
|
|
1094
1080
|
// src/indexing-status/deserialize/realtime-indexing-status-projection.ts
|
|
1095
|
-
var
|
|
1081
|
+
var import_v414 = require("zod/v4");
|
|
1096
1082
|
|
|
1097
1083
|
// src/indexing-status/zod-schema/realtime-indexing-status-projection.ts
|
|
1098
|
-
var
|
|
1084
|
+
var import_v411 = require("zod/v4");
|
|
1099
1085
|
|
|
1100
1086
|
// src/indexing-status/zod-schema/cross-chain-indexing-status-snapshot.ts
|
|
1101
|
-
var
|
|
1087
|
+
var import_v410 = require("zod/v4");
|
|
1102
1088
|
|
|
1103
|
-
// src/
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1089
|
+
// src/shared/block-ref.ts
|
|
1090
|
+
function isBefore(blockA, blockB) {
|
|
1091
|
+
return blockA.number < blockB.number && blockA.timestamp < blockB.timestamp;
|
|
1092
|
+
}
|
|
1093
|
+
function isEqualTo(blockA, blockB) {
|
|
1094
|
+
return blockA.number === blockB.number && blockA.timestamp === blockB.timestamp;
|
|
1095
|
+
}
|
|
1096
|
+
function isBeforeOrEqualTo(blockA, blockB) {
|
|
1097
|
+
return isBefore(blockA, blockB) || isEqualTo(blockA, blockB);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
// src/shared/blockrange.ts
|
|
1101
|
+
var RangeTypeIds = {
|
|
1102
|
+
Unbounded: "unbounded",
|
|
1103
|
+
LeftBounded: "left-bounded",
|
|
1104
|
+
RightBounded: "right-bounded",
|
|
1105
|
+
Bounded: "bounded"
|
|
1113
1106
|
};
|
|
1107
|
+
function buildBlockNumberRange(startBlock, endBlock) {
|
|
1108
|
+
if (startBlock === void 0 && endBlock === void 0) {
|
|
1109
|
+
return {
|
|
1110
|
+
rangeType: RangeTypeIds.Unbounded
|
|
1111
|
+
};
|
|
1112
|
+
}
|
|
1113
|
+
if (startBlock !== void 0 && endBlock === void 0) {
|
|
1114
|
+
return {
|
|
1115
|
+
rangeType: RangeTypeIds.LeftBounded,
|
|
1116
|
+
startBlock
|
|
1117
|
+
};
|
|
1118
|
+
}
|
|
1119
|
+
if (startBlock === void 0 && endBlock !== void 0) {
|
|
1120
|
+
return {
|
|
1121
|
+
rangeType: RangeTypeIds.RightBounded,
|
|
1122
|
+
endBlock
|
|
1123
|
+
};
|
|
1124
|
+
}
|
|
1125
|
+
if (startBlock !== void 0 && endBlock !== void 0) {
|
|
1126
|
+
if (startBlock > endBlock) {
|
|
1127
|
+
throw new Error(
|
|
1128
|
+
`For a block number range startBlock must be lower than or equal to endBlock.`
|
|
1129
|
+
);
|
|
1130
|
+
}
|
|
1131
|
+
return {
|
|
1132
|
+
rangeType: RangeTypeIds.Bounded,
|
|
1133
|
+
startBlock,
|
|
1134
|
+
endBlock
|
|
1135
|
+
};
|
|
1136
|
+
}
|
|
1137
|
+
throw new Error("Invalid block number range. This should be unreachable.");
|
|
1138
|
+
}
|
|
1139
|
+
function mergeBlockNumberRanges(...ranges) {
|
|
1140
|
+
if (ranges.length === 0) {
|
|
1141
|
+
return buildBlockNumberRange(void 0, void 0);
|
|
1142
|
+
}
|
|
1143
|
+
let minStartBlock;
|
|
1144
|
+
let maxEndBlock;
|
|
1145
|
+
for (const range of ranges) {
|
|
1146
|
+
if (range.startBlock !== void 0) {
|
|
1147
|
+
if (minStartBlock === void 0 || range.startBlock < minStartBlock) {
|
|
1148
|
+
minStartBlock = range.startBlock;
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
if (range.endBlock !== void 0) {
|
|
1152
|
+
if (maxEndBlock === void 0 || range.endBlock > maxEndBlock) {
|
|
1153
|
+
maxEndBlock = range.endBlock;
|
|
1154
|
+
}
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
return buildBlockNumberRange(minStartBlock, maxEndBlock);
|
|
1158
|
+
}
|
|
1159
|
+
function buildBlockRefRange(startBlock, endBlock) {
|
|
1160
|
+
if (startBlock === void 0 && endBlock === void 0) {
|
|
1161
|
+
return {
|
|
1162
|
+
rangeType: RangeTypeIds.Unbounded
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1165
|
+
if (startBlock !== void 0 && endBlock === void 0) {
|
|
1166
|
+
return {
|
|
1167
|
+
rangeType: RangeTypeIds.LeftBounded,
|
|
1168
|
+
startBlock
|
|
1169
|
+
};
|
|
1170
|
+
}
|
|
1171
|
+
if (startBlock === void 0 && endBlock !== void 0) {
|
|
1172
|
+
return {
|
|
1173
|
+
rangeType: RangeTypeIds.RightBounded,
|
|
1174
|
+
endBlock
|
|
1175
|
+
};
|
|
1176
|
+
}
|
|
1177
|
+
if (startBlock !== void 0 && endBlock !== void 0) {
|
|
1178
|
+
if (isBeforeOrEqualTo(startBlock, endBlock) === false) {
|
|
1179
|
+
throw new Error(`For a block ref range startBlock must be before or equal to endBlock.`);
|
|
1180
|
+
}
|
|
1181
|
+
return {
|
|
1182
|
+
rangeType: RangeTypeIds.Bounded,
|
|
1183
|
+
startBlock,
|
|
1184
|
+
endBlock
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
throw new Error("Invalid block ref range. This should be unreachable.");
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
// src/indexing-status/chain-indexing-status-snapshot.ts
|
|
1114
1191
|
var ChainIndexingStatusIds = {
|
|
1115
1192
|
/**
|
|
1116
1193
|
* Represents that indexing of the chain is not ready to begin yet because:
|
|
@@ -1142,19 +1219,6 @@ var ChainIndexingStatusIds = {
|
|
|
1142
1219
|
*/
|
|
1143
1220
|
Completed: "chain-completed"
|
|
1144
1221
|
};
|
|
1145
|
-
function createIndexingConfig(startBlock, endBlock) {
|
|
1146
|
-
if (endBlock) {
|
|
1147
|
-
return {
|
|
1148
|
-
blockRangeType: BlockRefRangeTypeIds.Definite,
|
|
1149
|
-
startBlock,
|
|
1150
|
-
endBlock
|
|
1151
|
-
};
|
|
1152
|
-
}
|
|
1153
|
-
return {
|
|
1154
|
-
blockRangeType: BlockRefRangeTypeIds.Indefinite,
|
|
1155
|
-
startBlock
|
|
1156
|
-
};
|
|
1157
|
-
}
|
|
1158
1222
|
function getTimestampForLowestOmnichainStartBlock(chains) {
|
|
1159
1223
|
const earliestKnownBlockTimestamps = chains.map(
|
|
1160
1224
|
(chain) => chain.config.startBlock.timestamp
|
|
@@ -1171,7 +1235,7 @@ function getTimestampForHighestOmnichainKnownBlock(chains) {
|
|
|
1171
1235
|
for (const chain of chains) {
|
|
1172
1236
|
switch (chain.chainStatus) {
|
|
1173
1237
|
case ChainIndexingStatusIds.Queued:
|
|
1174
|
-
if (chain.config.
|
|
1238
|
+
if (chain.config.rangeType === RangeTypeIds.Bounded) {
|
|
1175
1239
|
latestKnownBlockTimestamps.push(chain.config.endBlock.timestamp);
|
|
1176
1240
|
}
|
|
1177
1241
|
break;
|
|
@@ -1229,7 +1293,20 @@ function getLatestIndexedBlockRef(indexingStatus, chainId) {
|
|
|
1229
1293
|
}
|
|
1230
1294
|
|
|
1231
1295
|
// src/indexing-status/zod-schema/omnichain-indexing-status-snapshot.ts
|
|
1232
|
-
var
|
|
1296
|
+
var import_v49 = require("zod/v4");
|
|
1297
|
+
|
|
1298
|
+
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
1299
|
+
var import_v47 = require("zod/v4");
|
|
1300
|
+
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
1301
|
+
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
1302
|
+
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
1303
|
+
if (parsed.error) {
|
|
1304
|
+
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
1305
|
+
${(0, import_v47.prettifyError)(parsed.error)}
|
|
1306
|
+
`);
|
|
1307
|
+
}
|
|
1308
|
+
return parsed.data;
|
|
1309
|
+
}
|
|
1233
1310
|
|
|
1234
1311
|
// src/indexing-status/omnichain-indexing-status-snapshot.ts
|
|
1235
1312
|
var OmnichainIndexingStatusIds = {
|
|
@@ -1311,25 +1388,54 @@ function getOmnichainIndexingCursor(chains) {
|
|
|
1311
1388
|
}
|
|
1312
1389
|
return Math.max(...latestIndexedBlockTimestamps);
|
|
1313
1390
|
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1391
|
+
function buildOmnichainIndexingStatusSnapshot(chainStatusSnapshots) {
|
|
1392
|
+
if (chainStatusSnapshots.size === 0) {
|
|
1393
|
+
throw new Error(
|
|
1394
|
+
"At least one chain indexing status snapshot is required to build an OmnichainIndexingStatusSnapshot"
|
|
1395
|
+
);
|
|
1396
|
+
}
|
|
1397
|
+
const chains = Array.from(chainStatusSnapshots.values());
|
|
1398
|
+
const omnichainStatus = getOmnichainIndexingStatus(chains);
|
|
1399
|
+
const omnichainIndexingCursor = getOmnichainIndexingCursor(chains);
|
|
1400
|
+
switch (omnichainStatus) {
|
|
1401
|
+
case OmnichainIndexingStatusIds.Unstarted: {
|
|
1402
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1403
|
+
omnichainStatus: OmnichainIndexingStatusIds.Unstarted,
|
|
1404
|
+
chains: chainStatusSnapshots,
|
|
1405
|
+
// narrowing the type here, will be validated in the following 'check' step
|
|
1406
|
+
omnichainIndexingCursor
|
|
1407
|
+
});
|
|
1408
|
+
}
|
|
1409
|
+
case OmnichainIndexingStatusIds.Backfill: {
|
|
1410
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1411
|
+
omnichainStatus: OmnichainIndexingStatusIds.Backfill,
|
|
1412
|
+
chains: chainStatusSnapshots,
|
|
1413
|
+
// narrowing the type here, will be validated in the following 'check' step
|
|
1414
|
+
omnichainIndexingCursor
|
|
1415
|
+
});
|
|
1416
|
+
}
|
|
1417
|
+
case OmnichainIndexingStatusIds.Completed: {
|
|
1418
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1419
|
+
omnichainStatus: OmnichainIndexingStatusIds.Completed,
|
|
1420
|
+
chains: chainStatusSnapshots,
|
|
1421
|
+
// narrowing the type here, will be validated in the following 'check' step
|
|
1422
|
+
omnichainIndexingCursor
|
|
1423
|
+
});
|
|
1424
|
+
}
|
|
1425
|
+
case OmnichainIndexingStatusIds.Following:
|
|
1426
|
+
return validateOmnichainIndexingStatusSnapshot({
|
|
1427
|
+
omnichainStatus: OmnichainIndexingStatusIds.Following,
|
|
1428
|
+
chains: chainStatusSnapshots,
|
|
1429
|
+
omnichainIndexingCursor
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1327
1432
|
}
|
|
1328
1433
|
|
|
1329
1434
|
// src/indexing-status/zod-schema/chain-indexing-status-snapshot.ts
|
|
1435
|
+
var import_v48 = require("zod/v4");
|
|
1330
1436
|
function invariant_chainSnapshotQueuedBlocks(ctx) {
|
|
1331
1437
|
const { config } = ctx.value;
|
|
1332
|
-
if (config.
|
|
1438
|
+
if (config.rangeType === RangeTypeIds.LeftBounded) {
|
|
1333
1439
|
return;
|
|
1334
1440
|
}
|
|
1335
1441
|
if (isBeforeOrEqualTo(config.startBlock, config.endBlock) === false) {
|
|
@@ -1356,7 +1462,7 @@ function invariant_chainSnapshotBackfillBlocks(ctx) {
|
|
|
1356
1462
|
message: "`latestIndexedBlock` must be before or same as `backfillEndBlock`."
|
|
1357
1463
|
});
|
|
1358
1464
|
}
|
|
1359
|
-
if (config.
|
|
1465
|
+
if (config.rangeType === RangeTypeIds.LeftBounded) {
|
|
1360
1466
|
return;
|
|
1361
1467
|
}
|
|
1362
1468
|
if (isEqualTo(backfillEndBlock, config.endBlock) === false) {
|
|
@@ -1401,46 +1507,55 @@ function invariant_chainSnapshotFollowingBlocks(ctx) {
|
|
|
1401
1507
|
});
|
|
1402
1508
|
}
|
|
1403
1509
|
}
|
|
1404
|
-
var
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
config: makeBlockRefRangeSchema(valueLabel)
|
|
1510
|
+
var makeChainIndexingStatusSnapshotQueuedSchema = (valueLabel = "Value") => import_v48.z.object({
|
|
1511
|
+
chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Queued),
|
|
1512
|
+
config: import_v48.z.discriminatedUnion("rangeType", [
|
|
1513
|
+
import_v48.z.object({
|
|
1514
|
+
rangeType: import_v48.z.literal(RangeTypeIds.LeftBounded),
|
|
1515
|
+
startBlock: makeBlockRefSchema(valueLabel)
|
|
1516
|
+
}),
|
|
1517
|
+
import_v48.z.object({
|
|
1518
|
+
rangeType: import_v48.z.literal(RangeTypeIds.Bounded),
|
|
1519
|
+
startBlock: makeBlockRefSchema(valueLabel),
|
|
1520
|
+
endBlock: makeBlockRefSchema(valueLabel)
|
|
1521
|
+
})
|
|
1522
|
+
])
|
|
1418
1523
|
}).check(invariant_chainSnapshotQueuedBlocks);
|
|
1419
|
-
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") =>
|
|
1420
|
-
chainStatus:
|
|
1421
|
-
config:
|
|
1524
|
+
var makeChainIndexingStatusSnapshotBackfillSchema = (valueLabel = "Value") => import_v48.z.object({
|
|
1525
|
+
chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Backfill),
|
|
1526
|
+
config: import_v48.z.discriminatedUnion("rangeType", [
|
|
1527
|
+
import_v48.z.object({
|
|
1528
|
+
rangeType: import_v48.z.literal(RangeTypeIds.LeftBounded),
|
|
1529
|
+
startBlock: makeBlockRefSchema(valueLabel)
|
|
1530
|
+
}),
|
|
1531
|
+
import_v48.z.object({
|
|
1532
|
+
rangeType: import_v48.z.literal(RangeTypeIds.Bounded),
|
|
1533
|
+
startBlock: makeBlockRefSchema(valueLabel),
|
|
1534
|
+
endBlock: makeBlockRefSchema(valueLabel)
|
|
1535
|
+
})
|
|
1536
|
+
]),
|
|
1422
1537
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1423
1538
|
backfillEndBlock: makeBlockRefSchema(valueLabel)
|
|
1424
1539
|
}).check(invariant_chainSnapshotBackfillBlocks);
|
|
1425
|
-
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") =>
|
|
1426
|
-
chainStatus:
|
|
1427
|
-
config:
|
|
1428
|
-
|
|
1540
|
+
var makeChainIndexingStatusSnapshotCompletedSchema = (valueLabel = "Value") => import_v48.z.object({
|
|
1541
|
+
chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Completed),
|
|
1542
|
+
config: import_v48.z.object({
|
|
1543
|
+
rangeType: import_v48.z.literal(RangeTypeIds.Bounded),
|
|
1429
1544
|
startBlock: makeBlockRefSchema(valueLabel),
|
|
1430
1545
|
endBlock: makeBlockRefSchema(valueLabel)
|
|
1431
1546
|
}),
|
|
1432
1547
|
latestIndexedBlock: makeBlockRefSchema(valueLabel)
|
|
1433
1548
|
}).check(invariant_chainSnapshotCompletedBlocks);
|
|
1434
|
-
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") =>
|
|
1435
|
-
chainStatus:
|
|
1436
|
-
config:
|
|
1437
|
-
|
|
1549
|
+
var makeChainIndexingStatusSnapshotFollowingSchema = (valueLabel = "Value") => import_v48.z.object({
|
|
1550
|
+
chainStatus: import_v48.z.literal(ChainIndexingStatusIds.Following),
|
|
1551
|
+
config: import_v48.z.object({
|
|
1552
|
+
rangeType: import_v48.z.literal(RangeTypeIds.LeftBounded),
|
|
1438
1553
|
startBlock: makeBlockRefSchema(valueLabel)
|
|
1439
1554
|
}),
|
|
1440
1555
|
latestIndexedBlock: makeBlockRefSchema(valueLabel),
|
|
1441
1556
|
latestKnownBlock: makeBlockRefSchema(valueLabel)
|
|
1442
1557
|
}).check(invariant_chainSnapshotFollowingBlocks);
|
|
1443
|
-
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1558
|
+
var makeChainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v48.z.discriminatedUnion("chainStatus", [
|
|
1444
1559
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1445
1560
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1446
1561
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1569,11 +1684,11 @@ function invariant_omnichainStatusSnapshotFollowingHasValidChains(ctx) {
|
|
|
1569
1684
|
});
|
|
1570
1685
|
}
|
|
1571
1686
|
}
|
|
1572
|
-
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1573
|
-
omnichainStatus:
|
|
1574
|
-
chains:
|
|
1687
|
+
var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v49.z.object({
|
|
1688
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1689
|
+
chains: import_v49.z.map(
|
|
1575
1690
|
makeChainIdSchema(),
|
|
1576
|
-
|
|
1691
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1577
1692
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1578
1693
|
]),
|
|
1579
1694
|
{
|
|
@@ -1582,11 +1697,11 @@ var makeOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_
|
|
|
1582
1697
|
),
|
|
1583
1698
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1584
1699
|
}).check(invariant_omnichainSnapshotUnstartedHasValidChains);
|
|
1585
|
-
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1586
|
-
omnichainStatus:
|
|
1587
|
-
chains:
|
|
1700
|
+
var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v49.z.object({
|
|
1701
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1702
|
+
chains: import_v49.z.map(
|
|
1588
1703
|
makeChainIdSchema(),
|
|
1589
|
-
|
|
1704
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1590
1705
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1591
1706
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1592
1707
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1597,11 +1712,11 @@ var makeOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v
|
|
|
1597
1712
|
),
|
|
1598
1713
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1599
1714
|
}).check(invariant_omnichainStatusSnapshotBackfillHasValidChains);
|
|
1600
|
-
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1601
|
-
omnichainStatus:
|
|
1602
|
-
chains:
|
|
1715
|
+
var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v49.z.object({
|
|
1716
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1717
|
+
chains: import_v49.z.map(
|
|
1603
1718
|
makeChainIdSchema(),
|
|
1604
|
-
|
|
1719
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1605
1720
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1606
1721
|
]),
|
|
1607
1722
|
{
|
|
@@ -1610,11 +1725,11 @@ var makeOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_
|
|
|
1610
1725
|
),
|
|
1611
1726
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1612
1727
|
}).check(invariant_omnichainStatusSnapshotCompletedHasValidChains);
|
|
1613
|
-
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1614
|
-
omnichainStatus:
|
|
1615
|
-
chains:
|
|
1728
|
+
var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v49.z.object({
|
|
1729
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1730
|
+
chains: import_v49.z.map(
|
|
1616
1731
|
makeChainIdSchema(),
|
|
1617
|
-
|
|
1732
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1618
1733
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1619
1734
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1620
1735
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1626,7 +1741,7 @@ var makeOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_
|
|
|
1626
1741
|
),
|
|
1627
1742
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1628
1743
|
}).check(invariant_omnichainStatusSnapshotFollowingHasValidChains);
|
|
1629
|
-
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") =>
|
|
1744
|
+
var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexing Snapshot") => import_v49.z.discriminatedUnion("omnichainStatus", [
|
|
1630
1745
|
makeOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1631
1746
|
makeOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1632
1747
|
makeOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1634,21 +1749,21 @@ var makeOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Omnichain Indexin
|
|
|
1634
1749
|
]).check(invariant_omnichainSnapshotStatusIsConsistentWithChainSnapshot).check(invariant_omnichainIndexingCursorLowerThanEarliestStartBlockAcrossQueuedChains).check(
|
|
1635
1750
|
invariant_omnichainIndexingCursorLowerThanOrEqualToLatestBackfillEndBlockAcrossBackfillChains
|
|
1636
1751
|
).check(invariant_omnichainIndexingCursorIsEqualToHighestLatestIndexedBlockAcrossIndexedChain);
|
|
1637
|
-
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) =>
|
|
1638
|
-
omnichainStatus:
|
|
1639
|
-
chains:
|
|
1752
|
+
var makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema = (valueLabel) => import_v49.z.object({
|
|
1753
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Unstarted),
|
|
1754
|
+
chains: import_v49.z.record(
|
|
1640
1755
|
makeChainIdStringSchema(),
|
|
1641
|
-
|
|
1756
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1642
1757
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel)
|
|
1643
1758
|
])
|
|
1644
1759
|
),
|
|
1645
1760
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1646
1761
|
});
|
|
1647
|
-
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =>
|
|
1648
|
-
omnichainStatus:
|
|
1649
|
-
chains:
|
|
1762
|
+
var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) => import_v49.z.object({
|
|
1763
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Backfill),
|
|
1764
|
+
chains: import_v49.z.record(
|
|
1650
1765
|
makeChainIdStringSchema(),
|
|
1651
|
-
|
|
1766
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1652
1767
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1653
1768
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1654
1769
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
@@ -1656,21 +1771,21 @@ var makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema = (valueLabel) =
|
|
|
1656
1771
|
),
|
|
1657
1772
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1658
1773
|
});
|
|
1659
|
-
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) =>
|
|
1660
|
-
omnichainStatus:
|
|
1661
|
-
chains:
|
|
1774
|
+
var makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema = (valueLabel) => import_v49.z.object({
|
|
1775
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Completed),
|
|
1776
|
+
chains: import_v49.z.record(
|
|
1662
1777
|
makeChainIdStringSchema(),
|
|
1663
|
-
|
|
1778
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1664
1779
|
makeChainIndexingStatusSnapshotCompletedSchema(valueLabel)
|
|
1665
1780
|
])
|
|
1666
1781
|
),
|
|
1667
1782
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1668
1783
|
});
|
|
1669
|
-
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) =>
|
|
1670
|
-
omnichainStatus:
|
|
1671
|
-
chains:
|
|
1784
|
+
var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel) => import_v49.z.object({
|
|
1785
|
+
omnichainStatus: import_v49.z.literal(OmnichainIndexingStatusIds.Following),
|
|
1786
|
+
chains: import_v49.z.record(
|
|
1672
1787
|
makeChainIdStringSchema(),
|
|
1673
|
-
|
|
1788
|
+
import_v49.z.discriminatedUnion("chainStatus", [
|
|
1674
1789
|
makeChainIndexingStatusSnapshotQueuedSchema(valueLabel),
|
|
1675
1790
|
makeChainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1676
1791
|
makeChainIndexingStatusSnapshotFollowingSchema(valueLabel),
|
|
@@ -1679,7 +1794,7 @@ var makeSerializedOmnichainIndexingStatusSnapshotFollowingSchema = (valueLabel)
|
|
|
1679
1794
|
),
|
|
1680
1795
|
omnichainIndexingCursor: makeUnixTimestampSchema(valueLabel)
|
|
1681
1796
|
});
|
|
1682
|
-
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") =>
|
|
1797
|
+
var makeSerializedOmnichainIndexingStatusSnapshotSchema = (valueLabel = "Value") => import_v49.z.discriminatedUnion("omnichainStatus", [
|
|
1683
1798
|
makeSerializedOmnichainIndexingStatusSnapshotUnstartedSchema(valueLabel),
|
|
1684
1799
|
makeSerializedOmnichainIndexingStatusSnapshotBackfillSchema(valueLabel),
|
|
1685
1800
|
makeSerializedOmnichainIndexingStatusSnapshotCompletedSchema(valueLabel),
|
|
@@ -1702,7 +1817,7 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1702
1817
|
const { snapshotTime, omnichainSnapshot } = ctx.value;
|
|
1703
1818
|
const chains = Array.from(omnichainSnapshot.chains.values());
|
|
1704
1819
|
const startBlockTimestamps = chains.map((chain) => chain.config.startBlock.timestamp);
|
|
1705
|
-
const endBlockTimestamps = chains.map((chain) => chain.config).filter((chainConfig) => chainConfig.
|
|
1820
|
+
const endBlockTimestamps = chains.map((chain) => chain.config).filter((chainConfig) => chainConfig.rangeType === RangeTypeIds.Bounded).map((chainConfig) => chainConfig.endBlock.timestamp);
|
|
1706
1821
|
const backfillEndBlockTimestamps = chains.filter((chain) => chain.chainStatus === ChainIndexingStatusIds.Backfill).map((chain) => chain.backfillEndBlock.timestamp);
|
|
1707
1822
|
const latestKnownBlockTimestamps = chains.filter((chain) => chain.chainStatus === ChainIndexingStatusIds.Following).map((chain) => chain.latestKnownBlock.timestamp);
|
|
1708
1823
|
const highestKnownBlockTimestamp = Math.max(
|
|
@@ -1719,17 +1834,17 @@ function invariant_snapshotTimeIsTheHighestKnownBlockTimestamp(ctx) {
|
|
|
1719
1834
|
});
|
|
1720
1835
|
}
|
|
1721
1836
|
}
|
|
1722
|
-
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") =>
|
|
1723
|
-
strategy:
|
|
1837
|
+
var makeCrossChainIndexingStatusSnapshotOmnichainSchema = (valueLabel = "Cross-chain Indexing Status Snapshot Omnichain") => import_v410.z.object({
|
|
1838
|
+
strategy: import_v410.z.literal(CrossChainIndexingStrategyIds.Omnichain),
|
|
1724
1839
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1725
1840
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1726
1841
|
omnichainSnapshot: makeOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
1727
1842
|
}).check(invariant_slowestChainEqualsToOmnichainSnapshotTime).check(invariant_snapshotTimeIsTheHighestKnownBlockTimestamp);
|
|
1728
|
-
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") =>
|
|
1843
|
+
var makeCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Cross-chain Indexing Status Snapshot") => import_v410.z.discriminatedUnion("strategy", [
|
|
1729
1844
|
makeCrossChainIndexingStatusSnapshotOmnichainSchema(valueLabel)
|
|
1730
1845
|
]);
|
|
1731
|
-
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") =>
|
|
1732
|
-
strategy:
|
|
1846
|
+
var makeSerializedCrossChainIndexingStatusSnapshotSchema = (valueLabel = "Serialized Cross-chain Indexing Status Snapshot") => import_v410.z.object({
|
|
1847
|
+
strategy: import_v410.z.enum(CrossChainIndexingStrategyIds),
|
|
1733
1848
|
slowestChainIndexingCursor: makeUnixTimestampSchema(valueLabel),
|
|
1734
1849
|
snapshotTime: makeUnixTimestampSchema(valueLabel),
|
|
1735
1850
|
omnichainSnapshot: makeSerializedOmnichainIndexingStatusSnapshotSchema(valueLabel)
|
|
@@ -1759,22 +1874,22 @@ function invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect(ct
|
|
|
1759
1874
|
});
|
|
1760
1875
|
}
|
|
1761
1876
|
}
|
|
1762
|
-
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") =>
|
|
1877
|
+
var makeRealtimeIndexingStatusProjectionSchema = (valueLabel = "Realtime Indexing Status Projection") => import_v411.z.object({
|
|
1763
1878
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1764
1879
|
worstCaseDistance: makeDurationSchema(valueLabel),
|
|
1765
1880
|
snapshot: makeCrossChainIndexingStatusSnapshotSchema(valueLabel)
|
|
1766
1881
|
}).check(invariant_realtimeIndexingStatusProjectionProjectedAtIsAfterOrEqualToSnapshotTime).check(invariant_realtimeIndexingStatusProjectionWorstCaseDistanceIsCorrect);
|
|
1767
|
-
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") =>
|
|
1882
|
+
var makeSerializedRealtimeIndexingStatusProjectionSchema = (valueLabel = "Value") => import_v411.z.object({
|
|
1768
1883
|
snapshot: makeSerializedCrossChainIndexingStatusSnapshotSchema(valueLabel),
|
|
1769
1884
|
projectedAt: makeUnixTimestampSchema(valueLabel),
|
|
1770
1885
|
worstCaseDistance: makeDurationSchema(valueLabel)
|
|
1771
1886
|
});
|
|
1772
1887
|
|
|
1773
1888
|
// src/indexing-status/deserialize/cross-chain-indexing-status-snapshot.ts
|
|
1774
|
-
var
|
|
1889
|
+
var import_v413 = require("zod/v4");
|
|
1775
1890
|
|
|
1776
1891
|
// src/indexing-status/deserialize/omnichain-indexing-status-snapshot.ts
|
|
1777
|
-
var
|
|
1892
|
+
var import_v412 = require("zod/v4");
|
|
1778
1893
|
function buildUnvalidatedOmnichainIndexingStatusSnapshot(serializedSnapshot) {
|
|
1779
1894
|
const chains = /* @__PURE__ */ new Map();
|
|
1780
1895
|
for (const [chainIdString, chainIndexingStatusSnapshot] of Object.entries(
|
|
@@ -1795,7 +1910,7 @@ function deserializeOmnichainIndexingStatusSnapshot(data, valueLabel) {
|
|
|
1795
1910
|
if (parsed.error) {
|
|
1796
1911
|
throw new Error(
|
|
1797
1912
|
`Cannot deserialize into OmnichainIndexingStatusSnapshot:
|
|
1798
|
-
${(0,
|
|
1913
|
+
${(0, import_v412.prettifyError)(parsed.error)}
|
|
1799
1914
|
`
|
|
1800
1915
|
);
|
|
1801
1916
|
}
|
|
@@ -1817,7 +1932,7 @@ function deserializeCrossChainIndexingStatusSnapshot(maybeSnapshot, valueLabel)
|
|
|
1817
1932
|
if (parsed.error) {
|
|
1818
1933
|
throw new Error(
|
|
1819
1934
|
`Cannot deserialize into CrossChainIndexingStatusSnapshot:
|
|
1820
|
-
${(0,
|
|
1935
|
+
${(0, import_v413.prettifyError)(parsed.error)}
|
|
1821
1936
|
`
|
|
1822
1937
|
);
|
|
1823
1938
|
}
|
|
@@ -1837,7 +1952,7 @@ function deserializeRealtimeIndexingStatusProjection(maybeProjection, valueLabel
|
|
|
1837
1952
|
if (parsed.error) {
|
|
1838
1953
|
throw new Error(
|
|
1839
1954
|
`Cannot deserialize into RealtimeIndexingStatusProjection:
|
|
1840
|
-
${(0,
|
|
1955
|
+
${(0, import_v414.prettifyError)(parsed.error)}
|
|
1841
1956
|
`
|
|
1842
1957
|
);
|
|
1843
1958
|
}
|
|
@@ -1858,23 +1973,23 @@ var EnsApiIndexingStatusResponseCodes = {
|
|
|
1858
1973
|
var IndexingStatusResponseCodes = EnsApiIndexingStatusResponseCodes;
|
|
1859
1974
|
|
|
1860
1975
|
// src/ensapi/api/indexing-status/zod-schemas.ts
|
|
1861
|
-
var
|
|
1862
|
-
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
1863
|
-
responseCode:
|
|
1976
|
+
var import_v415 = require("zod/v4");
|
|
1977
|
+
var makeEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v415.z.strictObject({
|
|
1978
|
+
responseCode: import_v415.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
1864
1979
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1865
1980
|
});
|
|
1866
|
-
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
1867
|
-
responseCode:
|
|
1981
|
+
var makeEnsApiIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v415.z.strictObject({
|
|
1982
|
+
responseCode: import_v415.z.literal(EnsApiIndexingStatusResponseCodes.Error)
|
|
1868
1983
|
});
|
|
1869
|
-
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
1984
|
+
var makeEnsApiIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v415.z.discriminatedUnion("responseCode", [
|
|
1870
1985
|
makeEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
1871
1986
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
1872
1987
|
]);
|
|
1873
|
-
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
1874
|
-
responseCode:
|
|
1988
|
+
var makeSerializedEnsApiIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v415.z.strictObject({
|
|
1989
|
+
responseCode: import_v415.z.literal(EnsApiIndexingStatusResponseCodes.Ok),
|
|
1875
1990
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
1876
1991
|
});
|
|
1877
|
-
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
1992
|
+
var makeSerializedEnsApiIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v415.z.discriminatedUnion("responseCode", [
|
|
1878
1993
|
makeSerializedEnsApiIndexingStatusResponseOkSchema(valueLabel),
|
|
1879
1994
|
makeEnsApiIndexingStatusResponseErrorSchema(valueLabel)
|
|
1880
1995
|
]);
|
|
@@ -1896,7 +2011,7 @@ function deserializeEnsApiIndexingStatusResponse(maybeResponse) {
|
|
|
1896
2011
|
if (parsed.error) {
|
|
1897
2012
|
throw new Error(
|
|
1898
2013
|
`Cannot deserialize EnsApiIndexingStatusResponse:
|
|
1899
|
-
${(0,
|
|
2014
|
+
${(0, import_v416.prettifyError)(parsed.error)}
|
|
1900
2015
|
`
|
|
1901
2016
|
);
|
|
1902
2017
|
}
|
|
@@ -2033,11 +2148,11 @@ function serializeEnsApiIndexingStatusResponse(response) {
|
|
|
2033
2148
|
var serializeIndexingStatusResponse = serializeEnsApiIndexingStatusResponse;
|
|
2034
2149
|
|
|
2035
2150
|
// src/ensapi/api/name-tokens/deserialize.ts
|
|
2036
|
-
var
|
|
2151
|
+
var import_v421 = require("zod/v4");
|
|
2037
2152
|
|
|
2038
2153
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2039
2154
|
var import_viem14 = require("viem");
|
|
2040
|
-
var
|
|
2155
|
+
var import_v420 = require("zod/v4");
|
|
2041
2156
|
|
|
2042
2157
|
// src/tokenscope/name-token.ts
|
|
2043
2158
|
var import_viem13 = require("viem");
|
|
@@ -2077,12 +2192,12 @@ var makeContractMatcher = (namespace, b) => (datasourceName, contractName) => {
|
|
|
2077
2192
|
|
|
2078
2193
|
// src/tokenscope/assets.ts
|
|
2079
2194
|
var import_viem12 = require("viem");
|
|
2080
|
-
var
|
|
2195
|
+
var import_v418 = require("zod/v4");
|
|
2081
2196
|
|
|
2082
2197
|
// src/tokenscope/zod-schemas.ts
|
|
2083
2198
|
var import_caip3 = require("caip");
|
|
2084
2199
|
var import_viem11 = require("viem");
|
|
2085
|
-
var
|
|
2200
|
+
var import_v417 = require("zod/v4");
|
|
2086
2201
|
|
|
2087
2202
|
// src/shared/types.ts
|
|
2088
2203
|
var AssetNamespaces = {
|
|
@@ -2091,10 +2206,10 @@ var AssetNamespaces = {
|
|
|
2091
2206
|
};
|
|
2092
2207
|
|
|
2093
2208
|
// src/tokenscope/zod-schemas.ts
|
|
2094
|
-
var tokenIdSchemaSerializable =
|
|
2095
|
-
var tokenIdSchemaNative =
|
|
2209
|
+
var tokenIdSchemaSerializable = import_v417.z.string();
|
|
2210
|
+
var tokenIdSchemaNative = import_v417.z.preprocess(
|
|
2096
2211
|
(v) => typeof v === "string" ? BigInt(v) : v,
|
|
2097
|
-
|
|
2212
|
+
import_v417.z.bigint().positive()
|
|
2098
2213
|
);
|
|
2099
2214
|
function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false) {
|
|
2100
2215
|
if (serializable) {
|
|
@@ -2104,13 +2219,13 @@ function makeTokenIdSchema(_valueLabel = "Token ID Schema", serializable = false
|
|
|
2104
2219
|
}
|
|
2105
2220
|
}
|
|
2106
2221
|
var makeAssetIdSchema = (valueLabel = "Asset ID Schema", serializable) => {
|
|
2107
|
-
return
|
|
2108
|
-
assetNamespace:
|
|
2222
|
+
return import_v417.z.object({
|
|
2223
|
+
assetNamespace: import_v417.z.enum(AssetNamespaces),
|
|
2109
2224
|
contract: makeAccountIdSchema(valueLabel),
|
|
2110
2225
|
tokenId: makeTokenIdSchema(valueLabel, serializable ?? false)
|
|
2111
2226
|
});
|
|
2112
2227
|
};
|
|
2113
|
-
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") =>
|
|
2228
|
+
var makeAssetIdStringSchema = (valueLabel = "Asset ID String Schema") => import_v417.z.preprocess((v) => {
|
|
2114
2229
|
if (typeof v === "string") {
|
|
2115
2230
|
const result = new import_caip3.AssetId(v);
|
|
2116
2231
|
return {
|
|
@@ -2134,20 +2249,20 @@ function invariant_nameTokenOwnershipHasNonZeroAddressOwner(ctx) {
|
|
|
2134
2249
|
});
|
|
2135
2250
|
}
|
|
2136
2251
|
}
|
|
2137
|
-
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") =>
|
|
2138
|
-
ownershipType:
|
|
2252
|
+
var makeNameTokenOwnershipNameWrapperSchema = (valueLabel = "Name Token Ownership NameWrapper") => import_v417.z.object({
|
|
2253
|
+
ownershipType: import_v417.z.literal(NameTokenOwnershipTypes.NameWrapper),
|
|
2139
2254
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2140
2255
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2141
|
-
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") =>
|
|
2142
|
-
ownershipType:
|
|
2256
|
+
var makeNameTokenOwnershipFullyOnchainSchema = (valueLabel = "Name Token Ownership Fully Onchain") => import_v417.z.object({
|
|
2257
|
+
ownershipType: import_v417.z.literal(NameTokenOwnershipTypes.FullyOnchain),
|
|
2143
2258
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2144
2259
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2145
|
-
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") =>
|
|
2146
|
-
ownershipType:
|
|
2260
|
+
var makeNameTokenOwnershipBurnedSchema = (valueLabel = "Name Token Ownership Burned") => import_v417.z.object({
|
|
2261
|
+
ownershipType: import_v417.z.literal(NameTokenOwnershipTypes.Burned),
|
|
2147
2262
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2148
2263
|
}).check(invariant_nameTokenOwnershipHasZeroAddressOwner);
|
|
2149
|
-
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") =>
|
|
2150
|
-
ownershipType:
|
|
2264
|
+
var makeNameTokenOwnershipUnknownSchema = (valueLabel = "Name Token Ownership Unknown") => import_v417.z.object({
|
|
2265
|
+
ownershipType: import_v417.z.literal(NameTokenOwnershipTypes.Unknown),
|
|
2151
2266
|
owner: makeAccountIdSchema(`${valueLabel}.owner`)
|
|
2152
2267
|
}).check(invariant_nameTokenOwnershipHasNonZeroAddressOwner);
|
|
2153
2268
|
function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
@@ -2160,16 +2275,16 @@ function invariant_nameTokenOwnershipHasZeroAddressOwner(ctx) {
|
|
|
2160
2275
|
});
|
|
2161
2276
|
}
|
|
2162
2277
|
}
|
|
2163
|
-
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") =>
|
|
2278
|
+
var makeNameTokenOwnershipSchema = (valueLabel = "Name Token Ownership") => import_v417.z.discriminatedUnion("ownershipType", [
|
|
2164
2279
|
makeNameTokenOwnershipNameWrapperSchema(valueLabel),
|
|
2165
2280
|
makeNameTokenOwnershipFullyOnchainSchema(valueLabel),
|
|
2166
2281
|
makeNameTokenOwnershipBurnedSchema(valueLabel),
|
|
2167
2282
|
makeNameTokenOwnershipUnknownSchema(valueLabel)
|
|
2168
2283
|
]);
|
|
2169
|
-
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) =>
|
|
2284
|
+
var makeNameTokenSchema = (valueLabel = "Name Token Schema", serializable) => import_v417.z.object({
|
|
2170
2285
|
token: makeAssetIdSchema(`${valueLabel}.token`, serializable),
|
|
2171
2286
|
ownership: makeNameTokenOwnershipSchema(`${valueLabel}.ownership`),
|
|
2172
|
-
mintStatus:
|
|
2287
|
+
mintStatus: import_v417.z.enum(NFTMintStatuses)
|
|
2173
2288
|
});
|
|
2174
2289
|
|
|
2175
2290
|
// src/tokenscope/assets.ts
|
|
@@ -2185,7 +2300,7 @@ function deserializeAssetId(maybeAssetId, valueLabel) {
|
|
|
2185
2300
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2186
2301
|
if (parsed.error) {
|
|
2187
2302
|
throw new RangeError(`Cannot deserialize AssetId:
|
|
2188
|
-
${(0,
|
|
2303
|
+
${(0, import_v418.prettifyError)(parsed.error)}
|
|
2189
2304
|
`);
|
|
2190
2305
|
}
|
|
2191
2306
|
return parsed.data;
|
|
@@ -2195,7 +2310,7 @@ function parseAssetId(maybeAssetId, valueLabel) {
|
|
|
2195
2310
|
const parsed = schema.safeParse(maybeAssetId);
|
|
2196
2311
|
if (parsed.error) {
|
|
2197
2312
|
throw new RangeError(`Cannot parse AssetId:
|
|
2198
|
-
${(0,
|
|
2313
|
+
${(0, import_v418.prettifyError)(parsed.error)}
|
|
2199
2314
|
`);
|
|
2200
2315
|
}
|
|
2201
2316
|
return parsed.data;
|
|
@@ -2495,10 +2610,10 @@ function getNameTokenOwnership(namespaceId, name, owner) {
|
|
|
2495
2610
|
}
|
|
2496
2611
|
|
|
2497
2612
|
// src/ensapi/api/shared/errors/zod-schemas.ts
|
|
2498
|
-
var
|
|
2499
|
-
var ErrorResponseSchema =
|
|
2500
|
-
message:
|
|
2501
|
-
details:
|
|
2613
|
+
var import_v419 = require("zod/v4");
|
|
2614
|
+
var ErrorResponseSchema = import_v419.z.object({
|
|
2615
|
+
message: import_v419.z.string(),
|
|
2616
|
+
details: import_v419.z.optional(import_v419.z.unknown())
|
|
2502
2617
|
});
|
|
2503
2618
|
|
|
2504
2619
|
// src/ensapi/api/name-tokens/response.ts
|
|
@@ -2537,10 +2652,10 @@ var NameTokensResponseErrorCodes = {
|
|
|
2537
2652
|
};
|
|
2538
2653
|
|
|
2539
2654
|
// src/ensapi/api/name-tokens/zod-schemas.ts
|
|
2540
|
-
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) =>
|
|
2655
|
+
var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", serializable) => import_v420.z.object({
|
|
2541
2656
|
domainId: makeNodeSchema(`${valueLabel}.domainId`),
|
|
2542
2657
|
name: makeReinterpretedNameSchema(valueLabel),
|
|
2543
|
-
tokens:
|
|
2658
|
+
tokens: import_v420.z.array(makeNameTokenSchema(`${valueLabel}.tokens`, serializable)).nonempty(),
|
|
2544
2659
|
expiresAt: makeUnixTimestampSchema(`${valueLabel}.expiresAt`),
|
|
2545
2660
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`)
|
|
2546
2661
|
}).check(function invariant_nameIsAssociatedWithDomainId(ctx) {
|
|
@@ -2582,32 +2697,32 @@ var makeRegisteredNameTokenSchema = (valueLabel = "Registered Name Token", seria
|
|
|
2582
2697
|
});
|
|
2583
2698
|
}
|
|
2584
2699
|
});
|
|
2585
|
-
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) =>
|
|
2586
|
-
responseCode:
|
|
2700
|
+
var makeNameTokensResponseOkSchema = (valueLabel = "Name Tokens Response OK", serializable) => import_v420.z.strictObject({
|
|
2701
|
+
responseCode: import_v420.z.literal(NameTokensResponseCodes.Ok),
|
|
2587
2702
|
registeredNameTokens: makeRegisteredNameTokenSchema(`${valueLabel}.nameTokens`, serializable)
|
|
2588
2703
|
});
|
|
2589
|
-
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") =>
|
|
2590
|
-
responseCode:
|
|
2591
|
-
errorCode:
|
|
2704
|
+
var makeNameTokensResponseErrorNameTokensNotIndexedSchema = (_valueLabel = "Name Tokens Response Error Name Not Indexed") => import_v420.z.strictObject({
|
|
2705
|
+
responseCode: import_v420.z.literal(NameTokensResponseCodes.Error),
|
|
2706
|
+
errorCode: import_v420.z.literal(NameTokensResponseErrorCodes.NameTokensNotIndexed),
|
|
2592
2707
|
error: ErrorResponseSchema
|
|
2593
2708
|
});
|
|
2594
|
-
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") =>
|
|
2595
|
-
responseCode:
|
|
2596
|
-
errorCode:
|
|
2709
|
+
var makeNameTokensResponseErrorEnsIndexerConfigUnsupported = (_valueLabel = "Name Tokens Response Error ENSIndexer Config Unsupported") => import_v420.z.strictObject({
|
|
2710
|
+
responseCode: import_v420.z.literal(NameTokensResponseCodes.Error),
|
|
2711
|
+
errorCode: import_v420.z.literal(NameTokensResponseErrorCodes.EnsIndexerConfigUnsupported),
|
|
2597
2712
|
error: ErrorResponseSchema
|
|
2598
2713
|
});
|
|
2599
|
-
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") =>
|
|
2600
|
-
responseCode:
|
|
2601
|
-
errorCode:
|
|
2714
|
+
var makeNameTokensResponseErrorNameIndexingStatusUnsupported = (_valueLabel = "Name Tokens Response Error Indexing Status Unsupported") => import_v420.z.strictObject({
|
|
2715
|
+
responseCode: import_v420.z.literal(NameTokensResponseCodes.Error),
|
|
2716
|
+
errorCode: import_v420.z.literal(NameTokensResponseErrorCodes.IndexingStatusUnsupported),
|
|
2602
2717
|
error: ErrorResponseSchema
|
|
2603
2718
|
});
|
|
2604
|
-
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") =>
|
|
2719
|
+
var makeNameTokensResponseErrorSchema = (valueLabel = "Name Tokens Response Error") => import_v420.z.discriminatedUnion("errorCode", [
|
|
2605
2720
|
makeNameTokensResponseErrorNameTokensNotIndexedSchema(valueLabel),
|
|
2606
2721
|
makeNameTokensResponseErrorEnsIndexerConfigUnsupported(valueLabel),
|
|
2607
2722
|
makeNameTokensResponseErrorNameIndexingStatusUnsupported(valueLabel)
|
|
2608
2723
|
]);
|
|
2609
2724
|
var makeNameTokensResponseSchema = (valueLabel = "Name Tokens Response", serializable) => {
|
|
2610
|
-
return
|
|
2725
|
+
return import_v420.z.discriminatedUnion("responseCode", [
|
|
2611
2726
|
makeNameTokensResponseOkSchema(valueLabel, serializable ?? false),
|
|
2612
2727
|
makeNameTokensResponseErrorSchema(valueLabel)
|
|
2613
2728
|
]);
|
|
@@ -2620,7 +2735,7 @@ function deserializedNameTokensResponse(maybeResponse) {
|
|
|
2620
2735
|
);
|
|
2621
2736
|
if (parsed.error) {
|
|
2622
2737
|
throw new Error(`Cannot deserialize NameTokensResponse:
|
|
2623
|
-
${(0,
|
|
2738
|
+
${(0, import_v421.prettifyError)(parsed.error)}
|
|
2624
2739
|
`);
|
|
2625
2740
|
}
|
|
2626
2741
|
return parsed.data;
|
|
@@ -2694,14 +2809,14 @@ function serializeNameTokensResponse(response) {
|
|
|
2694
2809
|
}
|
|
2695
2810
|
|
|
2696
2811
|
// src/ensapi/api/registrar-actions/deserialize.ts
|
|
2697
|
-
var
|
|
2812
|
+
var import_v425 = require("zod/v4");
|
|
2698
2813
|
|
|
2699
2814
|
// src/ensapi/api/registrar-actions/zod-schemas.ts
|
|
2700
2815
|
var import_ens7 = require("viem/ens");
|
|
2701
|
-
var
|
|
2816
|
+
var import_v424 = require("zod/v4");
|
|
2702
2817
|
|
|
2703
2818
|
// src/registrars/zod-schemas.ts
|
|
2704
|
-
var
|
|
2819
|
+
var import_v422 = require("zod/v4");
|
|
2705
2820
|
|
|
2706
2821
|
// src/registrars/encoded-referrer.ts
|
|
2707
2822
|
var import_viem15 = require("viem");
|
|
@@ -2776,11 +2891,11 @@ function serializeRegistrarAction(registrarAction) {
|
|
|
2776
2891
|
}
|
|
2777
2892
|
|
|
2778
2893
|
// src/registrars/zod-schemas.ts
|
|
2779
|
-
var makeSubregistrySchema = (valueLabel = "Subregistry") =>
|
|
2894
|
+
var makeSubregistrySchema = (valueLabel = "Subregistry") => import_v422.z.object({
|
|
2780
2895
|
subregistryId: makeAccountIdSchema(`${valueLabel} Subregistry ID`),
|
|
2781
2896
|
node: makeNodeSchema(`${valueLabel} Node`)
|
|
2782
2897
|
});
|
|
2783
|
-
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") =>
|
|
2898
|
+
var makeRegistrationLifecycleSchema = (valueLabel = "Registration Lifecycle") => import_v422.z.object({
|
|
2784
2899
|
subregistry: makeSubregistrySchema(`${valueLabel} Subregistry`),
|
|
2785
2900
|
node: makeNodeSchema(`${valueLabel} Node`),
|
|
2786
2901
|
expiresAt: makeUnixTimestampSchema(`${valueLabel} Expires at`)
|
|
@@ -2796,18 +2911,18 @@ function invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium(ctx) {
|
|
|
2796
2911
|
});
|
|
2797
2912
|
}
|
|
2798
2913
|
}
|
|
2799
|
-
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") =>
|
|
2914
|
+
var makeRegistrarActionPricingSchema = (valueLabel = "Registrar Action Pricing") => import_v422.z.union([
|
|
2800
2915
|
// pricing available
|
|
2801
|
-
|
|
2916
|
+
import_v422.z.object({
|
|
2802
2917
|
baseCost: makePriceEthSchema(`${valueLabel} Base Cost`),
|
|
2803
2918
|
premium: makePriceEthSchema(`${valueLabel} Premium`),
|
|
2804
2919
|
total: makePriceEthSchema(`${valueLabel} Total`)
|
|
2805
2920
|
}).check(invariant_registrarActionPricingTotalIsSumOfBaseCostAndPremium).transform((v) => v),
|
|
2806
2921
|
// pricing unknown
|
|
2807
|
-
|
|
2808
|
-
baseCost:
|
|
2809
|
-
premium:
|
|
2810
|
-
total:
|
|
2922
|
+
import_v422.z.object({
|
|
2923
|
+
baseCost: import_v422.z.null(),
|
|
2924
|
+
premium: import_v422.z.null(),
|
|
2925
|
+
total: import_v422.z.null()
|
|
2811
2926
|
}).transform((v) => v)
|
|
2812
2927
|
]);
|
|
2813
2928
|
function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
@@ -2830,9 +2945,9 @@ function invariant_registrarActionDecodedReferrerBasedOnRawReferrer(ctx) {
|
|
|
2830
2945
|
});
|
|
2831
2946
|
}
|
|
2832
2947
|
}
|
|
2833
|
-
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") =>
|
|
2948
|
+
var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral") => import_v422.z.union([
|
|
2834
2949
|
// referral available
|
|
2835
|
-
|
|
2950
|
+
import_v422.z.object({
|
|
2836
2951
|
encodedReferrer: makeHexStringSchema(
|
|
2837
2952
|
{ bytesCount: ENCODED_REFERRER_BYTE_LENGTH },
|
|
2838
2953
|
`${valueLabel} Encoded Referrer`
|
|
@@ -2840,9 +2955,9 @@ var makeRegistrarActionReferralSchema = (valueLabel = "Registrar Action Referral
|
|
|
2840
2955
|
decodedReferrer: makeLowercaseAddressSchema(`${valueLabel} Decoded Referrer`)
|
|
2841
2956
|
}).check(invariant_registrarActionDecodedReferrerBasedOnRawReferrer),
|
|
2842
2957
|
// referral not applicable
|
|
2843
|
-
|
|
2844
|
-
encodedReferrer:
|
|
2845
|
-
decodedReferrer:
|
|
2958
|
+
import_v422.z.object({
|
|
2959
|
+
encodedReferrer: import_v422.z.null(),
|
|
2960
|
+
decodedReferrer: import_v422.z.null()
|
|
2846
2961
|
})
|
|
2847
2962
|
]);
|
|
2848
2963
|
function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
@@ -2855,9 +2970,9 @@ function invariant_eventIdsInitialElementIsTheActionId(ctx) {
|
|
|
2855
2970
|
});
|
|
2856
2971
|
}
|
|
2857
2972
|
}
|
|
2858
|
-
var EventIdSchema =
|
|
2859
|
-
var EventIdsSchema =
|
|
2860
|
-
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") =>
|
|
2973
|
+
var EventIdSchema = import_v422.z.string().nonempty();
|
|
2974
|
+
var EventIdsSchema = import_v422.z.array(EventIdSchema).min(1).transform((v) => v);
|
|
2975
|
+
var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => import_v422.z.object({
|
|
2861
2976
|
id: EventIdSchema,
|
|
2862
2977
|
incrementalDuration: makeDurationSchema(`${valueLabel} Incremental Duration`),
|
|
2863
2978
|
registrant: makeLowercaseAddressSchema(`${valueLabel} Registrant`),
|
|
@@ -2871,38 +2986,38 @@ var makeBaseRegistrarActionSchema = (valueLabel = "Base Registrar Action") => im
|
|
|
2871
2986
|
eventIds: EventIdsSchema
|
|
2872
2987
|
}).check(invariant_eventIdsInitialElementIsTheActionId);
|
|
2873
2988
|
var makeRegistrarActionRegistrationSchema = (valueLabel = "Registration ") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2874
|
-
type:
|
|
2989
|
+
type: import_v422.z.literal(RegistrarActionTypes.Registration)
|
|
2875
2990
|
});
|
|
2876
2991
|
var makeRegistrarActionRenewalSchema = (valueLabel = "Renewal") => makeBaseRegistrarActionSchema(valueLabel).extend({
|
|
2877
|
-
type:
|
|
2992
|
+
type: import_v422.z.literal(RegistrarActionTypes.Renewal)
|
|
2878
2993
|
});
|
|
2879
|
-
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") =>
|
|
2994
|
+
var makeRegistrarActionSchema = (valueLabel = "Registrar Action") => import_v422.z.discriminatedUnion("type", [
|
|
2880
2995
|
makeRegistrarActionRegistrationSchema(`${valueLabel} Registration`),
|
|
2881
2996
|
makeRegistrarActionRenewalSchema(`${valueLabel} Renewal`)
|
|
2882
2997
|
]);
|
|
2883
2998
|
|
|
2884
2999
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
2885
|
-
var
|
|
3000
|
+
var import_v423 = require("zod/v4");
|
|
2886
3001
|
|
|
2887
3002
|
// src/ensapi/api/shared/pagination/request.ts
|
|
2888
3003
|
var RECORDS_PER_PAGE_DEFAULT = 10;
|
|
2889
3004
|
var RECORDS_PER_PAGE_MAX = 100;
|
|
2890
3005
|
|
|
2891
3006
|
// src/ensapi/api/shared/pagination/zod-schemas.ts
|
|
2892
|
-
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") =>
|
|
3007
|
+
var makeRequestPageParamsSchema = (valueLabel = "RequestPageParams") => import_v423.z.object({
|
|
2893
3008
|
page: makePositiveIntegerSchema(`${valueLabel}.page`),
|
|
2894
3009
|
recordsPerPage: makePositiveIntegerSchema(`${valueLabel}.recordsPerPage`).max(
|
|
2895
3010
|
RECORDS_PER_PAGE_MAX,
|
|
2896
3011
|
`${valueLabel}.recordsPerPage must not exceed ${RECORDS_PER_PAGE_MAX}`
|
|
2897
3012
|
)
|
|
2898
3013
|
});
|
|
2899
|
-
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") =>
|
|
2900
|
-
totalRecords:
|
|
2901
|
-
totalPages:
|
|
2902
|
-
hasNext:
|
|
2903
|
-
hasPrev:
|
|
2904
|
-
startIndex:
|
|
2905
|
-
endIndex:
|
|
3014
|
+
var makeResponsePageContextSchemaWithNoRecords = (valueLabel = "ResponsePageContextWithNoRecords") => import_v423.z.object({
|
|
3015
|
+
totalRecords: import_v423.z.literal(0),
|
|
3016
|
+
totalPages: import_v423.z.literal(1),
|
|
3017
|
+
hasNext: import_v423.z.literal(false),
|
|
3018
|
+
hasPrev: import_v423.z.literal(false),
|
|
3019
|
+
startIndex: import_v423.z.undefined(),
|
|
3020
|
+
endIndex: import_v423.z.undefined()
|
|
2906
3021
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape);
|
|
2907
3022
|
function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
2908
3023
|
const { hasNext, hasPrev, recordsPerPage, page, totalRecords, startIndex, endIndex } = ctx.value;
|
|
@@ -2937,15 +3052,15 @@ function invariant_responsePageWithRecordsIsCorrect(ctx) {
|
|
|
2937
3052
|
});
|
|
2938
3053
|
}
|
|
2939
3054
|
}
|
|
2940
|
-
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") =>
|
|
3055
|
+
var makeResponsePageContextSchemaWithRecords = (valueLabel = "ResponsePageContextWithRecords") => import_v423.z.object({
|
|
2941
3056
|
totalRecords: makePositiveIntegerSchema(`${valueLabel}.totalRecords`),
|
|
2942
3057
|
totalPages: makePositiveIntegerSchema(`${valueLabel}.totalPages`),
|
|
2943
|
-
hasNext:
|
|
2944
|
-
hasPrev:
|
|
3058
|
+
hasNext: import_v423.z.boolean(),
|
|
3059
|
+
hasPrev: import_v423.z.boolean(),
|
|
2945
3060
|
startIndex: makeNonNegativeIntegerSchema(`${valueLabel}.startIndex`),
|
|
2946
3061
|
endIndex: makeNonNegativeIntegerSchema(`${valueLabel}.endIndex`)
|
|
2947
3062
|
}).extend(makeRequestPageParamsSchema(valueLabel).shape).check(invariant_responsePageWithRecordsIsCorrect);
|
|
2948
|
-
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") =>
|
|
3063
|
+
var makeResponsePageContextSchema = (valueLabel = "ResponsePageContext") => import_v423.z.union([
|
|
2949
3064
|
makeResponsePageContextSchemaWithNoRecords(valueLabel),
|
|
2950
3065
|
makeResponsePageContextSchemaWithRecords(valueLabel)
|
|
2951
3066
|
]);
|
|
@@ -2975,21 +3090,21 @@ function invariant_registrationLifecycleNodeMatchesName(ctx) {
|
|
|
2975
3090
|
});
|
|
2976
3091
|
}
|
|
2977
3092
|
}
|
|
2978
|
-
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") =>
|
|
3093
|
+
var makeNamedRegistrarActionSchema = (valueLabel = "Named Registrar Action") => import_v424.z.object({
|
|
2979
3094
|
action: makeRegistrarActionSchema(valueLabel),
|
|
2980
3095
|
name: makeReinterpretedNameSchema(valueLabel)
|
|
2981
3096
|
}).check(invariant_registrationLifecycleNodeMatchesName);
|
|
2982
|
-
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") =>
|
|
2983
|
-
responseCode:
|
|
2984
|
-
registrarActions:
|
|
3097
|
+
var makeRegistrarActionsResponseOkSchema = (valueLabel = "Registrar Actions Response OK") => import_v424.z.object({
|
|
3098
|
+
responseCode: import_v424.z.literal(RegistrarActionsResponseCodes.Ok),
|
|
3099
|
+
registrarActions: import_v424.z.array(makeNamedRegistrarActionSchema(valueLabel)),
|
|
2985
3100
|
pageContext: makeResponsePageContextSchema(`${valueLabel}.pageContext`),
|
|
2986
3101
|
accurateAsOf: makeUnixTimestampSchema(`${valueLabel}.accurateAsOf`).optional()
|
|
2987
3102
|
});
|
|
2988
|
-
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") =>
|
|
2989
|
-
responseCode:
|
|
3103
|
+
var makeRegistrarActionsResponseErrorSchema = (_valueLabel = "Registrar Actions Response Error") => import_v424.z.strictObject({
|
|
3104
|
+
responseCode: import_v424.z.literal(RegistrarActionsResponseCodes.Error),
|
|
2990
3105
|
error: ErrorResponseSchema
|
|
2991
3106
|
});
|
|
2992
|
-
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") =>
|
|
3107
|
+
var makeRegistrarActionsResponseSchema = (valueLabel = "Registrar Actions Response") => import_v424.z.discriminatedUnion("responseCode", [
|
|
2993
3108
|
makeRegistrarActionsResponseOkSchema(valueLabel),
|
|
2994
3109
|
makeRegistrarActionsResponseErrorSchema(valueLabel)
|
|
2995
3110
|
]);
|
|
@@ -3000,7 +3115,7 @@ function deserializeRegistrarActionsResponse(maybeResponse) {
|
|
|
3000
3115
|
if (parsed.error) {
|
|
3001
3116
|
throw new Error(
|
|
3002
3117
|
`Cannot deserialize RegistrarActionsResponse:
|
|
3003
|
-
${(0,
|
|
3118
|
+
${(0, import_v425.prettifyError)(parsed.error)}
|
|
3004
3119
|
`
|
|
3005
3120
|
);
|
|
3006
3121
|
}
|
|
@@ -3147,12 +3262,12 @@ function serializeRegistrarActionsResponse(response) {
|
|
|
3147
3262
|
}
|
|
3148
3263
|
|
|
3149
3264
|
// src/ensapi/api/shared/errors/deserialize.ts
|
|
3150
|
-
var
|
|
3265
|
+
var import_v426 = require("zod/v4");
|
|
3151
3266
|
function deserializeErrorResponse(maybeErrorResponse) {
|
|
3152
3267
|
const parsed = ErrorResponseSchema.safeParse(maybeErrorResponse);
|
|
3153
3268
|
if (parsed.error) {
|
|
3154
3269
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3155
|
-
${(0,
|
|
3270
|
+
${(0, import_v426.prettifyError)(parsed.error)}
|
|
3156
3271
|
`);
|
|
3157
3272
|
}
|
|
3158
3273
|
return parsed.data;
|
|
@@ -3712,7 +3827,7 @@ function serializeEnsIndexerConfigResponse(response) {
|
|
|
3712
3827
|
}
|
|
3713
3828
|
|
|
3714
3829
|
// src/ensindexer/api/indexing-status/deserialize.ts
|
|
3715
|
-
var
|
|
3830
|
+
var import_v428 = require("zod/v4");
|
|
3716
3831
|
|
|
3717
3832
|
// src/ensindexer/api/indexing-status/response.ts
|
|
3718
3833
|
var EnsIndexerIndexingStatusResponseCodes = {
|
|
@@ -3727,23 +3842,23 @@ var EnsIndexerIndexingStatusResponseCodes = {
|
|
|
3727
3842
|
};
|
|
3728
3843
|
|
|
3729
3844
|
// src/ensindexer/api/indexing-status/zod-schemas.ts
|
|
3730
|
-
var
|
|
3731
|
-
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") =>
|
|
3732
|
-
responseCode:
|
|
3845
|
+
var import_v427 = require("zod/v4");
|
|
3846
|
+
var makeEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Indexing Status Response OK") => import_v427.z.strictObject({
|
|
3847
|
+
responseCode: import_v427.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3733
3848
|
realtimeProjection: makeRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3734
3849
|
});
|
|
3735
|
-
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") =>
|
|
3736
|
-
responseCode:
|
|
3850
|
+
var makeEnsIndexerIndexingStatusResponseErrorSchema = (_valueLabel = "Indexing Status Response Error") => import_v427.z.strictObject({
|
|
3851
|
+
responseCode: import_v427.z.literal(EnsIndexerIndexingStatusResponseCodes.Error)
|
|
3737
3852
|
});
|
|
3738
|
-
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") =>
|
|
3853
|
+
var makeEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
3739
3854
|
makeEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3740
3855
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3741
3856
|
]);
|
|
3742
|
-
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") =>
|
|
3743
|
-
responseCode:
|
|
3857
|
+
var makeSerializedEnsIndexerIndexingStatusResponseOkSchema = (valueLabel = "Serialized Indexing Status Response OK") => import_v427.z.strictObject({
|
|
3858
|
+
responseCode: import_v427.z.literal(EnsIndexerIndexingStatusResponseCodes.Ok),
|
|
3744
3859
|
realtimeProjection: makeSerializedRealtimeIndexingStatusProjectionSchema(valueLabel)
|
|
3745
3860
|
});
|
|
3746
|
-
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") =>
|
|
3861
|
+
var makeSerializedEnsIndexerIndexingStatusResponseSchema = (valueLabel = "Serialized Indexing Status Response") => import_v427.z.discriminatedUnion("responseCode", [
|
|
3747
3862
|
makeSerializedEnsIndexerIndexingStatusResponseOkSchema(valueLabel),
|
|
3748
3863
|
makeEnsIndexerIndexingStatusResponseErrorSchema(valueLabel)
|
|
3749
3864
|
]);
|
|
@@ -3765,7 +3880,7 @@ function deserializeEnsIndexerIndexingStatusResponse(maybeResponse) {
|
|
|
3765
3880
|
if (parsed.error) {
|
|
3766
3881
|
throw new Error(
|
|
3767
3882
|
`Cannot deserialize EnsIndexerIndexingStatusResponse:
|
|
3768
|
-
${(0,
|
|
3883
|
+
${(0, import_v428.prettifyError)(parsed.error)}
|
|
3769
3884
|
`
|
|
3770
3885
|
);
|
|
3771
3886
|
}
|
|
@@ -3786,13 +3901,13 @@ function serializeEnsIndexerIndexingStatusResponse(response) {
|
|
|
3786
3901
|
}
|
|
3787
3902
|
|
|
3788
3903
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
3789
|
-
var
|
|
3904
|
+
var import_v430 = require("zod/v4");
|
|
3790
3905
|
|
|
3791
3906
|
// src/ensindexer/api/shared/errors/zod-schemas.ts
|
|
3792
|
-
var
|
|
3793
|
-
var ErrorResponseSchema2 =
|
|
3794
|
-
message:
|
|
3795
|
-
details:
|
|
3907
|
+
var import_v429 = require("zod/v4");
|
|
3908
|
+
var ErrorResponseSchema2 = import_v429.z.object({
|
|
3909
|
+
message: import_v429.z.string(),
|
|
3910
|
+
details: import_v429.z.optional(import_v429.z.unknown())
|
|
3796
3911
|
});
|
|
3797
3912
|
|
|
3798
3913
|
// src/ensindexer/api/shared/errors/deserialize.ts
|
|
@@ -3800,7 +3915,7 @@ function deserializeErrorResponse2(maybeErrorResponse) {
|
|
|
3800
3915
|
const parsed = ErrorResponseSchema2.safeParse(maybeErrorResponse);
|
|
3801
3916
|
if (parsed.error) {
|
|
3802
3917
|
throw new Error(`Cannot deserialize ErrorResponse:
|
|
3803
|
-
${(0,
|
|
3918
|
+
${(0, import_v430.prettifyError)(parsed.error)}
|
|
3804
3919
|
`);
|
|
3805
3920
|
}
|
|
3806
3921
|
return parsed.data;
|
|
@@ -4077,14 +4192,14 @@ function isResolvedIdentity(identity) {
|
|
|
4077
4192
|
}
|
|
4078
4193
|
|
|
4079
4194
|
// src/indexing-status/deserialize/chain-indexing-status-snapshot.ts
|
|
4080
|
-
var
|
|
4195
|
+
var import_v431 = require("zod/v4");
|
|
4081
4196
|
function deserializeChainIndexingStatusSnapshot(maybeSnapshot, valueLabel) {
|
|
4082
4197
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4083
4198
|
const parsed = schema.safeParse(maybeSnapshot);
|
|
4084
4199
|
if (parsed.error) {
|
|
4085
4200
|
throw new Error(
|
|
4086
4201
|
`Cannot deserialize into ChainIndexingStatusSnapshot:
|
|
4087
|
-
${(0,
|
|
4202
|
+
${(0, import_v431.prettifyError)(parsed.error)}
|
|
4088
4203
|
`
|
|
4089
4204
|
);
|
|
4090
4205
|
}
|
|
@@ -4102,38 +4217,25 @@ function createRealtimeIndexingStatusProjection(snapshot, now) {
|
|
|
4102
4217
|
}
|
|
4103
4218
|
|
|
4104
4219
|
// src/indexing-status/validate/chain-indexing-status-snapshot.ts
|
|
4105
|
-
var
|
|
4220
|
+
var import_v432 = require("zod/v4");
|
|
4106
4221
|
function validateChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4107
4222
|
const schema = makeChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4108
4223
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4109
4224
|
if (parsed.error) {
|
|
4110
4225
|
throw new Error(`Invalid ChainIndexingStatusSnapshot:
|
|
4111
|
-
${(0,
|
|
4226
|
+
${(0, import_v432.prettifyError)(parsed.error)}
|
|
4112
4227
|
`);
|
|
4113
4228
|
}
|
|
4114
4229
|
return parsed.data;
|
|
4115
4230
|
}
|
|
4116
4231
|
|
|
4117
4232
|
// src/indexing-status/validate/cross-chain-indexing-status-snapshot.ts
|
|
4118
|
-
var
|
|
4233
|
+
var import_v433 = require("zod/v4");
|
|
4119
4234
|
function validateCrossChainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4120
4235
|
const schema = makeCrossChainIndexingStatusSnapshotSchema(valueLabel);
|
|
4121
4236
|
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4122
4237
|
if (parsed.error) {
|
|
4123
4238
|
throw new Error(`Invalid CrossChainIndexingStatusSnapshot:
|
|
4124
|
-
${(0, import_v432.prettifyError)(parsed.error)}
|
|
4125
|
-
`);
|
|
4126
|
-
}
|
|
4127
|
-
return parsed.data;
|
|
4128
|
-
}
|
|
4129
|
-
|
|
4130
|
-
// src/indexing-status/validate/omnichain-indexing-status-snapshot.ts
|
|
4131
|
-
var import_v433 = require("zod/v4");
|
|
4132
|
-
function validateOmnichainIndexingStatusSnapshot(unvalidatedSnapshot, valueLabel) {
|
|
4133
|
-
const schema = makeOmnichainIndexingStatusSnapshotSchema(valueLabel);
|
|
4134
|
-
const parsed = schema.safeParse(unvalidatedSnapshot);
|
|
4135
|
-
if (parsed.error) {
|
|
4136
|
-
throw new Error(`Invalid OmnichainIndexingStatusSnapshot:
|
|
4137
4239
|
${(0, import_v433.prettifyError)(parsed.error)}
|
|
4138
4240
|
`);
|
|
4139
4241
|
}
|
|
@@ -4376,16 +4478,6 @@ ${(0, import_v435.prettifyError)(parsed.error)}
|
|
|
4376
4478
|
}
|
|
4377
4479
|
return parsed.data;
|
|
4378
4480
|
}
|
|
4379
|
-
function deserializeBlockrange(maybeBlockrange, valueLabel) {
|
|
4380
|
-
const schema = makeBlockrangeSchema(valueLabel);
|
|
4381
|
-
const parsed = schema.safeParse(maybeBlockrange);
|
|
4382
|
-
if (parsed.error) {
|
|
4383
|
-
throw new Error(`Cannot deserialize Blockrange:
|
|
4384
|
-
${(0, import_v435.prettifyError)(parsed.error)}
|
|
4385
|
-
`);
|
|
4386
|
-
}
|
|
4387
|
-
return parsed.data;
|
|
4388
|
-
}
|
|
4389
4481
|
function deserializeBlockRef(maybeBlockRef, valueLabel) {
|
|
4390
4482
|
const schema = makeBlockRefSchema(valueLabel);
|
|
4391
4483
|
const parsed = schema.safeParse(maybeBlockRef);
|
|
@@ -4592,6 +4684,39 @@ var TtlCache = class {
|
|
|
4592
4684
|
}
|
|
4593
4685
|
};
|
|
4594
4686
|
|
|
4687
|
+
// src/shared/config/indexed-blockranges.ts
|
|
4688
|
+
var import_datasources12 = require("@ensnode/datasources");
|
|
4689
|
+
function buildIndexedBlockranges(namespace, pluginsRequiredDatasourceNames) {
|
|
4690
|
+
const indexedBlockranges = /* @__PURE__ */ new Map();
|
|
4691
|
+
for (const [pluginName, requiredDatasourceNames] of pluginsRequiredDatasourceNames) {
|
|
4692
|
+
for (const requiredDatasourceName of requiredDatasourceNames) {
|
|
4693
|
+
const requiredDatasource = (0, import_datasources12.maybeGetDatasource)(namespace, requiredDatasourceName);
|
|
4694
|
+
if (!requiredDatasource) {
|
|
4695
|
+
throw new Error(
|
|
4696
|
+
`Datasource ${requiredDatasourceName} required by plugin ${pluginName} is not defined in namespace ${namespace}.`
|
|
4697
|
+
);
|
|
4698
|
+
}
|
|
4699
|
+
const datasourceChainId = requiredDatasource.chain.id;
|
|
4700
|
+
const datasourceContracts = Object.values(requiredDatasource.contracts);
|
|
4701
|
+
for (const datasourceContract of datasourceContracts) {
|
|
4702
|
+
const currentChainIndexedBlockrange = indexedBlockranges.get(datasourceChainId);
|
|
4703
|
+
const contractIndexedBlockrange = buildBlockNumberRange(
|
|
4704
|
+
datasourceContract.startBlock,
|
|
4705
|
+
datasourceContract.endBlock
|
|
4706
|
+
);
|
|
4707
|
+
const indexedBlockrange = currentChainIndexedBlockrange ? mergeBlockNumberRanges(currentChainIndexedBlockrange, contractIndexedBlockrange) : contractIndexedBlockrange;
|
|
4708
|
+
if (indexedBlockrange.rangeType !== RangeTypeIds.LeftBounded && indexedBlockrange.rangeType !== RangeTypeIds.Bounded) {
|
|
4709
|
+
throw new Error(
|
|
4710
|
+
`Indexed blockrange for chain ${datasourceChainId} is expected to be left-bounded or bounded, but got ${indexedBlockrange.rangeType}.`
|
|
4711
|
+
);
|
|
4712
|
+
}
|
|
4713
|
+
indexedBlockranges.set(datasourceChainId, indexedBlockrange);
|
|
4714
|
+
}
|
|
4715
|
+
}
|
|
4716
|
+
}
|
|
4717
|
+
return indexedBlockranges;
|
|
4718
|
+
}
|
|
4719
|
+
|
|
4595
4720
|
// src/shared/interpretation/interpret-address.ts
|
|
4596
4721
|
var import_viem18 = require("viem");
|
|
4597
4722
|
var interpretAddress = (owner) => (0, import_viem18.isAddressEqual)(import_viem18.zeroAddress, owner) ? null : owner;
|
|
@@ -4708,10 +4833,10 @@ ${JSON.stringify(concrete)}`
|
|
|
4708
4833
|
}
|
|
4709
4834
|
|
|
4710
4835
|
// src/shared/root-registry.ts
|
|
4711
|
-
var
|
|
4712
|
-
var getENSv1Registry = (namespace) => getDatasourceContract(namespace,
|
|
4836
|
+
var import_datasources13 = require("@ensnode/datasources");
|
|
4837
|
+
var getENSv1Registry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSRoot, "ENSv1Registry");
|
|
4713
4838
|
var isENSv1Registry = (namespace, contract) => accountIdEqual(getENSv1Registry(namespace), contract);
|
|
4714
|
-
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace,
|
|
4839
|
+
var getENSv2RootRegistry = (namespace) => getDatasourceContract(namespace, import_datasources13.DatasourceNames.ENSv2Root, "RootRegistry");
|
|
4715
4840
|
var getENSv2RootRegistryId = (namespace) => makeRegistryId(getENSv2RootRegistry(namespace));
|
|
4716
4841
|
var isENSv2RootRegistry = (namespace, contract) => accountIdEqual(getENSv2RootRegistry(namespace), contract);
|
|
4717
4842
|
|