@scallop-io/sui-scallop-sdk 0.44.10 → 0.44.12

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.js CHANGED
@@ -1612,6 +1612,8 @@ var getObligations = async (query, ownerAddress) => {
1612
1612
  if (paginatedKeyObjectsResponse.hasNextPage && paginatedKeyObjectsResponse.nextCursor) {
1613
1613
  hasNextPage = true;
1614
1614
  nextCursor = paginatedKeyObjectsResponse.nextCursor;
1615
+ } else {
1616
+ hasNextPage = false;
1615
1617
  }
1616
1618
  } while (hasNextPage);
1617
1619
  const keyObjectIds = keyObjectsResponse.map((ref) => ref?.data?.objectId).filter((id) => id !== void 0);
@@ -1676,6 +1678,8 @@ var getCoinAmounts = async (query, assetCoinNames, ownerAddress) => {
1676
1678
  if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
1677
1679
  hasNextPage = true;
1678
1680
  nextCursor = paginatedCoinObjectsResponse.nextCursor;
1681
+ } else {
1682
+ hasNextPage = false;
1679
1683
  }
1680
1684
  } while (hasNextPage);
1681
1685
  const coinAmounts = {};
@@ -1715,6 +1719,8 @@ var getCoinAmount = async (query, assetCoinName, ownerAddress) => {
1715
1719
  if (paginatedCoinObjectsResponse.hasNextPage && paginatedCoinObjectsResponse.nextCursor) {
1716
1720
  hasNextPage = true;
1717
1721
  nextCursor = paginatedCoinObjectsResponse.nextCursor;
1722
+ } else {
1723
+ hasNextPage = false;
1718
1724
  }
1719
1725
  } while (hasNextPage);
1720
1726
  let coinAmount = 0;
@@ -1758,6 +1764,8 @@ var getMarketCoinAmounts = async (query, marketCoinNames, ownerAddress) => {
1758
1764
  if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
1759
1765
  hasNextPage = true;
1760
1766
  nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
1767
+ } else {
1768
+ hasNextPage = false;
1761
1769
  }
1762
1770
  } while (hasNextPage);
1763
1771
  const marketCoinAmounts = {};
@@ -1799,6 +1807,8 @@ var getMarketCoinAmount = async (query, marketCoinName, ownerAddress) => {
1799
1807
  if (paginatedMarketCoinObjectsResponse.hasNextPage && paginatedMarketCoinObjectsResponse.nextCursor) {
1800
1808
  hasNextPage = true;
1801
1809
  nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
1810
+ } else {
1811
+ hasNextPage = false;
1802
1812
  }
1803
1813
  } while (hasNextPage);
1804
1814
  let marketCoinAmount = 0;
@@ -1990,6 +2000,8 @@ var getStakeAccounts = async (query, ownerAddress) => {
1990
2000
  if (paginatedStakeObjectsResponse.hasNextPage && paginatedStakeObjectsResponse.nextCursor) {
1991
2001
  hasNextPage = true;
1992
2002
  nextCursor = paginatedStakeObjectsResponse.nextCursor;
2003
+ } else {
2004
+ hasNextPage = false;
1993
2005
  }
1994
2006
  } while (hasNextPage);
1995
2007
  const stakeAccounts = {
@@ -4658,12 +4670,12 @@ var ScallopClient = class {
4658
4670
  const sender = walletAddress || this.walletAddress;
4659
4671
  txBlock.setSender(sender);
4660
4672
  const obligations = await this.query.getObligations(sender);
4661
- const tarketObligationId = obligationId || obligations[0].id;
4662
- if (tarketObligationId) {
4673
+ const specificObligationId = obligationId || obligations?.[0]?.id;
4674
+ if (specificObligationId) {
4663
4675
  await txBlock.addCollateralQuick(
4664
4676
  amount,
4665
4677
  collateralCoinName,
4666
- tarketObligationId
4678
+ specificObligationId
4667
4679
  );
4668
4680
  } else {
4669
4681
  const [obligation, obligationKey, hotPotato] = txBlock.openObligation();