@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.
@@ -51,7 +51,7 @@ function getConfig(env, indexerUrl) {
51
51
  REF_FI_CONTRACT_ID: 'v2.ref-finance.near',
52
52
  REF_TOKEN_ID: 'token.v2.ref-finance.near',
53
53
  indexerUrl: indexerUrl || 'https://indexer.ref.finance',
54
- explorerUrl: 'https://testnet.nearblocks.io',
54
+ explorerUrl: 'https://nearblocks.io',
55
55
  REF_DCL_SWAP_CONTRACT_ID: 'dclv2.ref-labs.near'
56
56
  };
57
57
  case 'testnet':
@@ -4750,24 +4750,30 @@ var fetchAllPools = /*#__PURE__*/function () {
4750
4750
  });
4751
4751
  case 3:
4752
4752
  _pools = _context7.sent;
4753
+ if (!(_pools.code !== 0 || !_pools.simplePools)) {
4754
+ _context7.next = 6;
4755
+ break;
4756
+ }
4757
+ throw Error();
4758
+ case 6:
4753
4759
  return _context7.abrupt("return", _pools);
4754
- case 7:
4755
- _context7.prev = 7;
4756
- _context7.t0 = _context7["catch"](0);
4757
4760
  case 9:
4761
+ _context7.prev = 9;
4762
+ _context7.t0 = _context7["catch"](0);
4763
+ case 11:
4758
4764
  if (perPage) {
4759
4765
  DEFAULT_PAGE_LIMIT = Math.min(perPage, 500);
4760
4766
  }
4761
- _context7.next = 12;
4767
+ _context7.next = 14;
4762
4768
  return getTotalPools();
4763
- case 12:
4769
+ case 14:
4764
4770
  totalPools = _context7.sent;
4765
4771
  pages = Math.ceil(totalPools / DEFAULT_PAGE_LIMIT);
4766
- _context7.next = 16;
4772
+ _context7.next = 18;
4767
4773
  return Promise.all([].concat(Array(pages)).fill(0).map(function (_, i) {
4768
4774
  return getRefPools(i + 1);
4769
4775
  }));
4770
- case 16:
4776
+ case 18:
4771
4777
  pools = _context7.sent.flat();
4772
4778
  return _context7.abrupt("return", {
4773
4779
  simplePools: pools.filter(function (p) {
@@ -4780,12 +4786,12 @@ var fetchAllPools = /*#__PURE__*/function () {
4780
4786
  return p.pool_kind && p.pool_kind === 'RATED_SWAP';
4781
4787
  })
4782
4788
  });
4783
- case 18:
4789
+ case 20:
4784
4790
  case "end":
4785
4791
  return _context7.stop();
4786
4792
  }
4787
4793
  }
4788
- }, _callee7, null, [[0, 7]]);
4794
+ }, _callee7, null, [[0, 9]]);
4789
4795
  }));
4790
4796
  return function fetchAllPools(_x8) {
4791
4797
  return _ref9.apply(this, arguments);
@@ -5200,7 +5206,7 @@ var useTokenBalances = function useTokenBalances(tokens, AccountId) {
5200
5206
  }(), [tokens]);
5201
5207
  useEffect(function () {
5202
5208
  // Initializes token balances
5203
- // Called in 1 minute intervals
5209
+ // Called in 15 seconds intervals
5204
5210
  var initTokenBalances = /*#__PURE__*/function () {
5205
5211
  var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
5206
5212
  var validTokens, ids;
@@ -5234,7 +5240,7 @@ var useTokenBalances = function useTokenBalances(tokens, AccountId) {
5234
5240
  };
5235
5241
  }();
5236
5242
  initTokenBalances();
5237
- var interval = setInterval(initTokenBalances, 60000);
5243
+ var interval = setInterval(initTokenBalances, 15000);
5238
5244
  return function () {
5239
5245
  return clearInterval(interval);
5240
5246
  };
@@ -6465,7 +6471,7 @@ var Notification = function Notification(_ref15) {
6465
6471
  style: {
6466
6472
  color: primary
6467
6473
  }
6468
- }, (state === null || state === undefined) && React.createElement("p", null, "Waiting for confirmation"), state === 'fail' && !!tx && React.createElement("a", {
6474
+ }, (state === null || state === undefined) && React.createElement("p", null, "Waiting for confirmation"), state === 'success' && tx && React.createElement("a", {
6469
6475
  className: "text-primary font-semibold",
6470
6476
  href: config.explorerUrl + "/txns/" + tx,
6471
6477
  target: "_blank",