@t2000/sdk 0.18.7 → 0.18.8

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.cjs CHANGED
@@ -3874,7 +3874,6 @@ To access invested funds: t2000 invest sell ${params.amount} ${asset}`,
3874
3874
  assetPrices[asset] = 0;
3875
3875
  }
3876
3876
  }
3877
- const toUsd = (asset, amount) => asset in INVESTMENT_ASSETS ? amount * (assetPrices[asset] ?? 0) : amount;
3878
3877
  let chainTotal = bal.available + bal.gasReserve.usdEquiv;
3879
3878
  for (const asset of Object.keys(INVESTMENT_ASSETS)) {
3880
3879
  if (asset === "SUI") continue;
@@ -3883,15 +3882,14 @@ To access invested funds: t2000 invest sell ${params.amount} ${asset}`,
3883
3882
  try {
3884
3883
  const positions = await this.positions();
3885
3884
  for (const pos of positions.positions) {
3886
- const usdValue = toUsd(pos.asset, pos.amount);
3887
3885
  if (pos.type === "save") {
3888
- chainTotal += usdValue;
3886
+ chainTotal += pos.amount;
3889
3887
  if (!earningAssets.has(pos.asset)) {
3890
- bal.savings += usdValue;
3888
+ bal.savings += pos.amount;
3891
3889
  }
3892
3890
  } else if (pos.type === "borrow") {
3893
- chainTotal -= usdValue;
3894
- bal.debt += usdValue;
3891
+ chainTotal -= pos.amount;
3892
+ bal.debt += pos.amount;
3895
3893
  }
3896
3894
  }
3897
3895
  } catch {