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