@scallop-io/sui-scallop-sdk 0.44.9 → 0.44.11

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.mjs CHANGED
@@ -1548,6 +1548,8 @@ var getObligations = async (query, ownerAddress) => {
1548
1548
  if (paginatedKeyObjectsResponse.hasNextPage && paginatedKeyObjectsResponse.nextCursor) {
1549
1549
  hasNextPage = true;
1550
1550
  nextCursor = paginatedKeyObjectsResponse.nextCursor;
1551
+ } else {
1552
+ hasNextPage = false;
1551
1553
  }
1552
1554
  } while (hasNextPage);
1553
1555
  const keyObjectIds = keyObjectsResponse.map((ref) => ref?.data?.objectId).filter((id) => id !== void 0);
@@ -1612,6 +1614,8 @@ var getCoinAmounts = async (query, assetCoinNames, ownerAddress) => {
1612
1614
  if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
1613
1615
  hasNextPage = true;
1614
1616
  nextCursor = paginatedCoinObjectsResponse.nextCursor;
1617
+ } else {
1618
+ hasNextPage = false;
1615
1619
  }
1616
1620
  } while (hasNextPage);
1617
1621
  const coinAmounts = {};
@@ -1651,6 +1655,8 @@ var getCoinAmount = async (query, assetCoinName, ownerAddress) => {
1651
1655
  if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
1652
1656
  hasNextPage = true;
1653
1657
  nextCursor = paginatedCoinObjectsResponse.nextCursor;
1658
+ } else {
1659
+ hasNextPage = false;
1654
1660
  }
1655
1661
  } while (hasNextPage);
1656
1662
  let coinAmount = 0;
@@ -1694,6 +1700,8 @@ var getMarketCoinAmounts = async (query, marketCoinNames, ownerAddress) => {
1694
1700
  if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
1695
1701
  hasNextPage = true;
1696
1702
  nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
1703
+ } else {
1704
+ hasNextPage = false;
1697
1705
  }
1698
1706
  } while (hasNextPage);
1699
1707
  const marketCoinAmounts = {};
@@ -1735,6 +1743,8 @@ var getMarketCoinAmount = async (query, marketCoinName, ownerAddress) => {
1735
1743
  if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
1736
1744
  hasNextPage = true;
1737
1745
  nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
1746
+ } else {
1747
+ hasNextPage = false;
1738
1748
  }
1739
1749
  } while (hasNextPage);
1740
1750
  let marketCoinAmount = 0;
@@ -1926,6 +1936,8 @@ var getStakeAccounts = async (query, ownerAddress) => {
1926
1936
  if (paginatedStakeObjectsResponse.hasNextPage && paginatedStakeObjectsResponse.nextCursor) {
1927
1937
  hasNextPage = true;
1928
1938
  nextCursor = paginatedStakeObjectsResponse.nextCursor;
1939
+ } else {
1940
+ hasNextPage = false;
1929
1941
  }
1930
1942
  } while (hasNextPage);
1931
1943
  const stakeAccounts = {
@@ -2676,12 +2688,16 @@ var getTotalValueLocked = async (query, indexer = false) => {
2676
2688
  let supplyValue = BigNumber3(0);
2677
2689
  let borrowValue = BigNumber3(0);
2678
2690
  if (indexer) {
2679
- const tvl2 = await query.indexer.getTotalValueLocked();
2680
- return {
2681
- supplyValue: tvl2.supplyValue,
2682
- borrowValue: tvl2.borrowValue,
2683
- totalValue: tvl2.totalValue
2691
+ const tvlIndexer = await query.indexer.getTotalValueLocked();
2692
+ const tvl2 = {
2693
+ supplyValue: tvlIndexer.supplyValue,
2694
+ supplyValueChangeRatio: tvlIndexer.supplyValueChangeRatio,
2695
+ borrowValue: tvlIndexer.borrowValue,
2696
+ borrowValueChangeRatio: tvlIndexer.borrowValueChangeRatio,
2697
+ totalValue: tvlIndexer.totalValue,
2698
+ totalValueChangeRatio: tvlIndexer.totalValueChangeRatio
2684
2699
  };
2700
+ return tvl2;
2685
2701
  }
2686
2702
  for (const pool of Object.values(market.pools)) {
2687
2703
  supplyValue = supplyValue.plus(