@gearbox-protocol/sdk 3.0.0 → 3.0.1
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.
|
@@ -209,14 +209,16 @@ class CreditAccountsService extends import_base.SDKConstruct {
|
|
|
209
209
|
* @param account
|
|
210
210
|
* @param to Address to transfer underlying left after liquidation
|
|
211
211
|
* @param slippage
|
|
212
|
+
* @param force TODO: legacy v3 option to remove
|
|
212
213
|
* @returns
|
|
213
214
|
*/
|
|
214
|
-
async fullyLiquidate(account, to, slippage = 50n) {
|
|
215
|
+
async fullyLiquidate(account, to, slippage = 50n, force = false) {
|
|
215
216
|
const cm = this.sdk.marketRegister.findCreditManager(account.creditManager);
|
|
216
217
|
const routerCloseResult = await this.sdk.router.findBestClosePath({
|
|
217
218
|
creditAccount: account,
|
|
218
219
|
creditManager: cm.creditManager,
|
|
219
|
-
slippage
|
|
220
|
+
slippage,
|
|
221
|
+
force
|
|
220
222
|
});
|
|
221
223
|
const priceUpdates = await this.getPriceUpdatesForFacade(
|
|
222
224
|
account.creditManager,
|
|
@@ -213,14 +213,16 @@ class CreditAccountsService extends SDKConstruct {
|
|
|
213
213
|
* @param account
|
|
214
214
|
* @param to Address to transfer underlying left after liquidation
|
|
215
215
|
* @param slippage
|
|
216
|
+
* @param force TODO: legacy v3 option to remove
|
|
216
217
|
* @returns
|
|
217
218
|
*/
|
|
218
|
-
async fullyLiquidate(account, to, slippage = 50n) {
|
|
219
|
+
async fullyLiquidate(account, to, slippage = 50n, force = false) {
|
|
219
220
|
const cm = this.sdk.marketRegister.findCreditManager(account.creditManager);
|
|
220
221
|
const routerCloseResult = await this.sdk.router.findBestClosePath({
|
|
221
222
|
creditAccount: account,
|
|
222
223
|
creditManager: cm.creditManager,
|
|
223
|
-
slippage
|
|
224
|
+
slippage,
|
|
225
|
+
force
|
|
224
226
|
});
|
|
225
227
|
const priceUpdates = await this.getPriceUpdatesForFacade(
|
|
226
228
|
account.creditManager,
|
|
@@ -73,9 +73,10 @@ export declare class CreditAccountsService extends SDKConstruct {
|
|
|
73
73
|
* @param account
|
|
74
74
|
* @param to Address to transfer underlying left after liquidation
|
|
75
75
|
* @param slippage
|
|
76
|
+
* @param force TODO: legacy v3 option to remove
|
|
76
77
|
* @returns
|
|
77
78
|
*/
|
|
78
|
-
fullyLiquidate(account: RouterCASlice, to: Address, slippage?: bigint): Promise<CloseCreditAccountResult>;
|
|
79
|
+
fullyLiquidate(account: RouterCASlice, to: Address, slippage?: bigint, force?: boolean): Promise<CloseCreditAccountResult>;
|
|
79
80
|
/**
|
|
80
81
|
* Closes credit account or closes credit account and keeps it open with zero debt.
|
|
81
82
|
- Ca is closed in the following order: price update -> close path to swap all tokens into underlying ->
|
|
@@ -185,6 +185,10 @@ export interface FindBestClosePathProps {
|
|
|
185
185
|
* Balances {@link ClosePathBalances} to close account with, if not provided, all assets will be swapped according to inner logic.
|
|
186
186
|
*/
|
|
187
187
|
balances?: ClosePathBalances;
|
|
188
|
+
/**
|
|
189
|
+
* TODO: legacy v3 option to pass to contract
|
|
190
|
+
*/
|
|
191
|
+
force?: boolean;
|
|
188
192
|
}
|
|
189
193
|
export interface ClosePathBalances {
|
|
190
194
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gearbox-protocol/sdk",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "Gearbox SDK",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/cjs/sdk/index.js",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
"date-fns": "^4.1.0",
|
|
72
72
|
"decimal.js-light": "^2.5.1",
|
|
73
73
|
"viem": ">=2.23.15 <3.0.0",
|
|
74
|
-
"zod": "^3.24.
|
|
74
|
+
"zod": "^3.24.3"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@commitlint/cli": "^19.8.0",
|