@ensnode/ensnode-sdk 1.6.0 → 1.7.0
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 +19 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +19 -8
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1213,18 +1213,29 @@ function mergeBlockNumberRanges(...ranges) {
|
|
|
1213
1213
|
}
|
|
1214
1214
|
let minStartBlock;
|
|
1215
1215
|
let maxEndBlock;
|
|
1216
|
+
let hasUnboundedStart = false;
|
|
1217
|
+
let hasUnboundedEnd = false;
|
|
1216
1218
|
for (const range of ranges) {
|
|
1217
|
-
if (range.startBlock
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1219
|
+
if (range.startBlock === void 0) {
|
|
1220
|
+
hasUnboundedStart = true;
|
|
1221
|
+
} else if (minStartBlock === void 0 || range.startBlock < minStartBlock) {
|
|
1222
|
+
minStartBlock = range.startBlock;
|
|
1221
1223
|
}
|
|
1222
|
-
if (range.endBlock
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1224
|
+
if (range.endBlock === void 0) {
|
|
1225
|
+
hasUnboundedEnd = true;
|
|
1226
|
+
} else if (maxEndBlock === void 0 || range.endBlock > maxEndBlock) {
|
|
1227
|
+
maxEndBlock = range.endBlock;
|
|
1228
|
+
}
|
|
1229
|
+
if (hasUnboundedStart && hasUnboundedEnd) {
|
|
1230
|
+
return buildBlockNumberRange(void 0, void 0);
|
|
1226
1231
|
}
|
|
1227
1232
|
}
|
|
1233
|
+
if (hasUnboundedStart) {
|
|
1234
|
+
minStartBlock = void 0;
|
|
1235
|
+
}
|
|
1236
|
+
if (hasUnboundedEnd) {
|
|
1237
|
+
maxEndBlock = void 0;
|
|
1238
|
+
}
|
|
1228
1239
|
return buildBlockNumberRange(minStartBlock, maxEndBlock);
|
|
1229
1240
|
}
|
|
1230
1241
|
function buildBlockRefRange(startBlock, endBlock) {
|