@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/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/queries/portfolioQuery.ts +8 -4
package/package.json
CHANGED
|
@@ -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
|
|
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([
|