@ref-finance/ref-sdk 1.3.12 → 1.4.1

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.
@@ -58,7 +58,7 @@ function getConfig(env, indexerUrl) {
58
58
  REF_FI_CONTRACT_ID: 'v2.ref-finance.near',
59
59
  REF_TOKEN_ID: 'token.v2.ref-finance.near',
60
60
  indexerUrl: indexerUrl || 'https://indexer.ref.finance',
61
- explorerUrl: 'https://testnet.nearblocks.io',
61
+ explorerUrl: 'https://nearblocks.io',
62
62
  REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near'
63
63
  };
64
64
  case 'testnet':
@@ -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);
@@ -5206,7 +5212,7 @@ var useTokenBalances = function useTokenBalances(tokens, AccountId) {
5206
5212
  }(), [tokens]);
5207
5213
  React.useEffect(function () {
5208
5214
  // Initializes token balances
5209
- // Called in 1 minute intervals
5215
+ // Called in 15 seconds intervals
5210
5216
  var initTokenBalances = /*#__PURE__*/function () {
5211
5217
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
5212
5218
  var validTokens, ids;
@@ -5240,7 +5246,7 @@ var useTokenBalances = function useTokenBalances(tokens, AccountId) {
5240
5246
  };
5241
5247
  }();
5242
5248
  initTokenBalances();
5243
- var interval = setInterval(initTokenBalances, 60000);
5249
+ var interval = setInterval(initTokenBalances, 15000);
5244
5250
  return function () {
5245
5251
  return clearInterval(interval);
5246
5252
  };
@@ -6441,7 +6447,7 @@ var Notification = function Notification(_ref15) {
6441
6447
  style: {
6442
6448
  color: primary
6443
6449
  }
6444
- }, (state === null || state === undefined) && React__default.createElement("p", null, "Waiting for confirmation"), state === 'fail' && !!tx && React__default.createElement("a", {
6450
+ }, (state === null || state === undefined) && React__default.createElement("p", null, "Waiting for confirmation"), state === 'success' && tx && React__default.createElement("a", {
6445
6451
  className: "text-primary font-semibold",
6446
6452
  href: exports.config.explorerUrl + "/txns/" + tx,
6447
6453
  target: "_blank",