@t2000/sdk 0.18.18 → 0.18.19
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 +14 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +14 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -57310,6 +57310,13 @@ To access invested funds: t2000 invest sell ${params.amount} ${asset}`,
|
|
|
57310
57310
|
finalAmount = built.effectiveAmount;
|
|
57311
57311
|
return built.tx;
|
|
57312
57312
|
});
|
|
57313
|
+
if (target.asset !== "USDC") {
|
|
57314
|
+
try {
|
|
57315
|
+
const postBal = await queryBalance(this.client, this._address);
|
|
57316
|
+
await this._convertWalletStablesToUsdc(postBal);
|
|
57317
|
+
} catch {
|
|
57318
|
+
}
|
|
57319
|
+
}
|
|
57313
57320
|
this.emitBalanceChange("USDC", finalAmount, "withdraw", gasResult.digest);
|
|
57314
57321
|
return {
|
|
57315
57322
|
success: true,
|
|
@@ -57419,11 +57426,15 @@ To access invested funds: t2000 invest sell ${params.amount} ${asset}`,
|
|
|
57419
57426
|
totalUsdcReceived += built.effectiveAmount;
|
|
57420
57427
|
lastTx = built.tx;
|
|
57421
57428
|
}
|
|
57422
|
-
if (hasNonUsdc && swapAdapter) {
|
|
57423
|
-
await this._convertWalletStablesToUsdc(await queryBalance(this.client, this._address));
|
|
57424
|
-
}
|
|
57425
57429
|
return lastTx;
|
|
57426
57430
|
});
|
|
57431
|
+
if (hasNonUsdc) {
|
|
57432
|
+
try {
|
|
57433
|
+
const postBal = await queryBalance(this.client, this._address);
|
|
57434
|
+
await this._convertWalletStablesToUsdc(postBal);
|
|
57435
|
+
} catch {
|
|
57436
|
+
}
|
|
57437
|
+
}
|
|
57427
57438
|
if (totalUsdcReceived <= 0) {
|
|
57428
57439
|
throw new T2000Error("NO_COLLATERAL", "No savings to withdraw across any protocol");
|
|
57429
57440
|
}
|