@aurigami/sdk 1.7.3 → 1.7.5

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/sdk.esm.js CHANGED
@@ -1382,6 +1382,14 @@ function _getBlocksTimestamp() {
1382
1382
  while (1) {
1383
1383
  switch (_context4.prev = _context4.next) {
1384
1384
  case 0:
1385
+ if (!(blockNumbers.length == 0)) {
1386
+ _context4.next = 2;
1387
+ break;
1388
+ }
1389
+
1390
+ return _context4.abrupt("return", []);
1391
+
1392
+ case 2:
1385
1393
  CHUNK_SIZE = 100; // graphql query limit
1386
1394
 
1387
1395
  promises = [];
@@ -1395,10 +1403,10 @@ function _getBlocksTimestamp() {
1395
1403
  } // merge all the json objects
1396
1404
 
1397
1405
 
1398
- _context4.next = 6;
1406
+ _context4.next = 8;
1399
1407
  return Promise.all(promises);
1400
1408
 
1401
- case 6:
1409
+ case 8:
1402
1410
  results = _context4.sent.reduce(function (acc, cur) {
1403
1411
  return _extends({}, acc, cur);
1404
1412
  });
@@ -1410,10 +1418,10 @@ function _getBlocksTimestamp() {
1410
1418
  devLog("These blocks are missing from Aurora GraphQL endpoint: " + missingBlocks.join(', '));
1411
1419
  }
1412
1420
 
1413
- _context4.next = 11;
1421
+ _context4.next = 13;
1414
1422
  return getBlocksTimestampViaRPC(provider, missingBlocks);
1415
1423
 
1416
- case 11:
1424
+ case 13:
1417
1425
  missingBlocksTimestamps = _context4.sent;
1418
1426
  missingBlocksTimestamps.forEach(function (timestamp, index) {
1419
1427
  results["b" + missingBlocks[index]] = {
@@ -1424,7 +1432,7 @@ function _getBlocksTimestamp() {
1424
1432
  return Math.trunc(new Date(results["b" + blockNumber].timestamp).getTime() / 1000);
1425
1433
  }));
1426
1434
 
1427
- case 14:
1435
+ case 16:
1428
1436
  case "end":
1429
1437
  return _context4.stop();
1430
1438
  }