@scallop-io/sui-scallop-sdk 1.4.11 → 1.4.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": "1.4.11",
3
+ "version": "1.4.12",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -25,6 +25,7 @@ import type {
25
25
  SupportBorrowIncentiveCoins,
26
26
  ObligationBorrowIcentiveReward,
27
27
  SupportBorrowIncentiveRewardCoins,
28
+ SupportAssetCoins,
28
29
  } from '../types';
29
30
 
30
31
  /**
@@ -349,15 +350,18 @@ export const getObligationAccount = async (
349
350
  coinPrices?: CoinPrices,
350
351
  coinAmounts?: CoinAmounts
351
352
  ) => {
352
- const collateralAssetCoinNames: SupportCollateralCoins[] = [
353
+ const coinNames: SupportAssetCoins[] = Array.from(
354
+ new Set([...SUPPORT_POOLS, ...SUPPORT_COLLATERALS])
355
+ );
356
+ const collateralAssetCoinNames = [
353
357
  ...SUPPORT_COLLATERALS,
354
- ];
358
+ ] as SupportCollateralCoins[];
359
+
355
360
  market = market ?? (await query.queryMarket({ indexer }));
356
361
  coinPrices =
357
362
  coinPrices ?? (await query.getAllCoinPrices({ marketPools: market.pools }));
358
363
  coinAmounts =
359
- coinAmounts ||
360
- (await query.getCoinAmounts(collateralAssetCoinNames, ownerAddress));
364
+ coinAmounts || (await query.getCoinAmounts(coinNames, ownerAddress));
361
365
 
362
366
  const [obligationQuery, borrowIncentivePools, borrowIncentiveAccounts] =
363
367
  await Promise.all([