@scallop-io/sui-scallop-sdk 2.3.6 → 2.3.7

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.3.6",
3
+ "version": "2.3.7",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -451,10 +451,10 @@ export const getObligationAccount = async (
451
451
 
452
452
  const marketCollateral = market.collaterals[assetCoinName];
453
453
  const coinDecimal = query.utils.getCoinDecimal(assetCoinName);
454
- const coinPrice = coinPrices?.[assetCoinName];
454
+ const coinPrice = coinPrices?.[assetCoinName] ?? 0;
455
455
  const coinAmount = coinAmounts?.[assetCoinName] ?? 0;
456
456
 
457
- if (marketCollateral && coinPrice) {
457
+ if (marketCollateral) {
458
458
  const depositedAmount = BigNumber(collateral?.amount ?? 0);
459
459
  const depositedCoin = depositedAmount.shiftedBy(-1 * coinDecimal);
460
460
  const depositedValue = depositedCoin.multipliedBy(coinPrice);
@@ -520,10 +520,10 @@ export const getObligationAccount = async (
520
520
 
521
521
  const marketPool = market.pools[assetCoinName];
522
522
  const coinDecimal = query.utils.getCoinDecimal(assetCoinName);
523
- const coinPrice = coinPrices?.[assetCoinName];
523
+ const coinPrice = coinPrices?.[assetCoinName] ?? 0;
524
524
  const coinAmount = coinAmounts?.[assetCoinName] ?? 0;
525
525
 
526
- if (marketPool && coinPrice) {
526
+ if (marketPool) {
527
527
  const increasedRate = debt?.borrowIndex
528
528
  ? marketPool.borrowIndex / Number(debt.borrowIndex) - 1
529
529
  : 0;