@ref-finance/ref-sdk 1.3.12 → 1.4.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.
@@ -4756,24 +4756,30 @@ var fetchAllPools = /*#__PURE__*/function () {
4756
4756
  });
4757
4757
  case 3:
4758
4758
  _pools = _context7.sent;
4759
+ if (!(_pools.code !== 0 || !_pools.simplePools)) {
4760
+ _context7.next = 6;
4761
+ break;
4762
+ }
4763
+ throw Error();
4764
+ case 6:
4759
4765
  return _context7.abrupt("return", _pools);
4760
- case 7:
4761
- _context7.prev = 7;
4762
- _context7.t0 = _context7["catch"](0);
4763
4766
  case 9:
4767
+ _context7.prev = 9;
4768
+ _context7.t0 = _context7["catch"](0);
4769
+ case 11:
4764
4770
  if (perPage) {
4765
4771
  DEFAULT_PAGE_LIMIT = Math.min(perPage, 500);
4766
4772
  }
4767
- _context7.next = 12;
4773
+ _context7.next = 14;
4768
4774
  return getTotalPools();
4769
- case 12:
4775
+ case 14:
4770
4776
  totalPools = _context7.sent;
4771
4777
  pages = Math.ceil(totalPools / DEFAULT_PAGE_LIMIT);
4772
- _context7.next = 16;
4778
+ _context7.next = 18;
4773
4779
  return Promise.all([].concat(Array(pages)).fill(0).map(function (_, i) {
4774
4780
  return getRefPools(i + 1);
4775
4781
  }));
4776
- case 16:
4782
+ case 18:
4777
4783
  pools = _context7.sent.flat();
4778
4784
  return _context7.abrupt("return", {
4779
4785
  simplePools: pools.filter(function (p) {
@@ -4786,12 +4792,12 @@ var fetchAllPools = /*#__PURE__*/function () {
4786
4792
  return p.pool_kind && p.pool_kind === 'RATED_SWAP';
4787
4793
  })
4788
4794
  });
4789
- case 18:
4795
+ case 20:
4790
4796
  case "end":
4791
4797
  return _context7.stop();
4792
4798
  }
4793
4799
  }
4794
- }, _callee7, null, [[0, 7]]);
4800
+ }, _callee7, null, [[0, 9]]);
4795
4801
  }));
4796
4802
  return function fetchAllPools(_x8) {
4797
4803
  return _ref9.apply(this, arguments);