@gearbox-protocol/sdk 13.0.0-next.28 → 13.0.0-next.29
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.
|
@@ -600,7 +600,8 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
600
600
|
async changeDebt({
|
|
601
601
|
creditAccount,
|
|
602
602
|
amount,
|
|
603
|
-
collateral
|
|
603
|
+
collateral,
|
|
604
|
+
wrapAsset
|
|
604
605
|
}) {
|
|
605
606
|
if (amount === 0n) {
|
|
606
607
|
throw new Error("debt increase or decrease must be non-zero");
|
|
@@ -624,8 +625,8 @@ class AbstractCreditAccountService extends import_base.SDKConstruct {
|
|
|
624
625
|
],
|
|
625
626
|
{}
|
|
626
627
|
) : [];
|
|
627
|
-
const unwrapCalls =
|
|
628
|
-
|
|
628
|
+
const unwrapCalls = wrapAsset && isDecrease ? await this.getKYCWrapCalls(
|
|
629
|
+
wrapAsset[0].balance,
|
|
629
630
|
creditAccount.creditManager
|
|
630
631
|
) || [] : [];
|
|
631
632
|
if (addCollateralCalls.length > 0 && unwrapCalls.length === 0 && collateral && collateral?.[0].token !== creditAccount.underlying) {
|
|
@@ -590,7 +590,8 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
590
590
|
async changeDebt({
|
|
591
591
|
creditAccount,
|
|
592
592
|
amount,
|
|
593
|
-
collateral
|
|
593
|
+
collateral,
|
|
594
|
+
wrapAsset
|
|
594
595
|
}) {
|
|
595
596
|
if (amount === 0n) {
|
|
596
597
|
throw new Error("debt increase or decrease must be non-zero");
|
|
@@ -614,8 +615,8 @@ class AbstractCreditAccountService extends SDKConstruct {
|
|
|
614
615
|
],
|
|
615
616
|
{}
|
|
616
617
|
) : [];
|
|
617
|
-
const unwrapCalls =
|
|
618
|
-
|
|
618
|
+
const unwrapCalls = wrapAsset && isDecrease ? await this.getKYCWrapCalls(
|
|
619
|
+
wrapAsset[0].balance,
|
|
619
620
|
creditAccount.creditManager
|
|
620
621
|
) || [] : [];
|
|
621
622
|
if (addCollateralCalls.length > 0 && unwrapCalls.length === 0 && collateral && collateral?.[0].token !== creditAccount.underlying) {
|
|
@@ -136,7 +136,7 @@ export declare abstract class AbstractCreditAccountService extends SDKConstruct
|
|
|
136
136
|
positive value for debt increase.
|
|
137
137
|
* @returns All necessary data to execute the transaction (call, credit facade)
|
|
138
138
|
*/
|
|
139
|
-
changeDebt({ creditAccount, amount, collateral, }: ChangeDeptProps): Promise<CreditAccountOperationResult>;
|
|
139
|
+
changeDebt({ creditAccount, amount, collateral, wrapAsset, }: ChangeDeptProps): Promise<CreditAccountOperationResult>;
|
|
140
140
|
/**
|
|
141
141
|
* Executes swap specified by given calls, update quotas of affected tokens
|
|
142
142
|
- Swap is executed in the following order: price update -> execute swap path -> update quotas
|