@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "0.44.10",
3
+ "version": "0.44.12",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -44,7 +44,7 @@
44
44
  "@noble/hashes": "^1.3.2",
45
45
  "@pythnetwork/price-service-client": "^1.8.2",
46
46
  "@pythnetwork/pyth-sui-js": "^1.2.4",
47
- "@scallop-io/sui-kit": "^0.44.0",
47
+ "@scallop-io/sui-kit": "^0.44.2",
48
48
  "@scure/bip39": "^1.2.1",
49
49
  "axios": "^1.6.0",
50
50
  "bignumber.js": "^9.1.2",
@@ -253,12 +253,12 @@ export class ScallopClient {
253
253
  txBlock.setSender(sender);
254
254
 
255
255
  const obligations = await this.query.getObligations(sender);
256
- const tarketObligationId = obligationId || obligations[0].id;
257
- if (tarketObligationId) {
256
+ const specificObligationId = obligationId || obligations?.[0]?.id;
257
+ if (specificObligationId) {
258
258
  await txBlock.addCollateralQuick(
259
259
  amount,
260
260
  collateralCoinName,
261
- tarketObligationId
261
+ specificObligationId
262
262
  );
263
263
  } else {
264
264
  const [obligation, obligationKey, hotPotato] = txBlock.openObligation();
@@ -704,6 +704,8 @@ export const getObligations = async (
704
704
  ) {
705
705
  hasNextPage = true;
706
706
  nextCursor = paginatedKeyObjectsResponse.nextCursor;
707
+ } else {
708
+ hasNextPage = false;
707
709
  }
708
710
  } while (hasNextPage);
709
711
 
@@ -820,6 +822,8 @@ export const getCoinAmounts = async (
820
822
  ) {
821
823
  hasNextPage = true;
822
824
  nextCursor = paginatedCoinObjectsResponse.nextCursor;
825
+ } else {
826
+ hasNextPage = false;
823
827
  }
824
828
  } while (hasNextPage);
825
829
 
@@ -884,6 +888,8 @@ export const getCoinAmount = async (
884
888
  ) {
885
889
  hasNextPage = true;
886
890
  nextCursor = paginatedCoinObjectsResponse.nextCursor;
891
+ } else {
892
+ hasNextPage = false;
887
893
  }
888
894
  } while (hasNextPage);
889
895
 
@@ -952,6 +958,8 @@ export const getMarketCoinAmounts = async (
952
958
  ) {
953
959
  hasNextPage = true;
954
960
  nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
961
+ } else {
962
+ hasNextPage = false;
955
963
  }
956
964
  } while (hasNextPage);
957
965
 
@@ -1018,6 +1026,8 @@ export const getMarketCoinAmount = async (
1018
1026
  ) {
1019
1027
  hasNextPage = true;
1020
1028
  nextCursor = paginatedMarketCoinObjectsResponse.nextCursor;
1029
+ } else {
1030
+ hasNextPage = false;
1021
1031
  }
1022
1032
  } while (hasNextPage);
1023
1033
 
@@ -283,6 +283,8 @@ export const getStakeAccounts = async (
283
283
  ) {
284
284
  hasNextPage = true;
285
285
  nextCursor = paginatedStakeObjectsResponse.nextCursor;
286
+ } else {
287
+ hasNextPage = false;
286
288
  }
287
289
  } while (hasNextPage);
288
290