@scallop-io/sui-scallop-sdk 2.0.3 → 2.0.4
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.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/queries/portfolioQuery.ts +14 -0
package/package.json
CHANGED
|
@@ -908,6 +908,20 @@ export const getUserPortfolio = async (
|
|
|
908
908
|
obligationAccount.totalAvailableCollateralValue,
|
|
909
909
|
totalUnhealthyCollateralInUsd:
|
|
910
910
|
obligationAccount.totalUnhealthyCollateralValue,
|
|
911
|
+
collaterals: Object.values(obligationAccount.collaterals)
|
|
912
|
+
.filter(
|
|
913
|
+
(collateral): collateral is NonNullable<typeof collateral> =>
|
|
914
|
+
!!collateral && collateral.depositedCoin > 0
|
|
915
|
+
)
|
|
916
|
+
.map((collateral) => ({
|
|
917
|
+
coinName: collateral.coinName,
|
|
918
|
+
symbol: collateral.symbol,
|
|
919
|
+
coinDecimals: collateral.coinDecimal,
|
|
920
|
+
coinType: collateral.coinType,
|
|
921
|
+
coinPrice: collateral.coinPrice,
|
|
922
|
+
depositedCoin: collateral.depositedCoin,
|
|
923
|
+
depositedValueInUsd: collateral.depositedValue,
|
|
924
|
+
})),
|
|
911
925
|
borrowedPools: Object.values(obligationAccount.debts)
|
|
912
926
|
.filter(
|
|
913
927
|
(debt): debt is NonNullable<typeof debt> =>
|