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