@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -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> =>