@gearbox-protocol/sdk 10.2.0 → 10.2.2
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.
|
@@ -242,6 +242,13 @@ const mellow4626WorkerAbi = [
|
|
|
242
242
|
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
243
243
|
stateMutability: "view"
|
|
244
244
|
},
|
|
245
|
+
{
|
|
246
|
+
type: "function",
|
|
247
|
+
name: "isWithdrawableVault",
|
|
248
|
+
inputs: [{ name: "", type: "address", internalType: "address" }],
|
|
249
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
250
|
+
stateMutability: "view"
|
|
251
|
+
},
|
|
245
252
|
{
|
|
246
253
|
type: "function",
|
|
247
254
|
name: "migrate",
|
|
@@ -418,6 +425,16 @@ const mellow4626WorkerAbi = [
|
|
|
418
425
|
],
|
|
419
426
|
stateMutability: "view"
|
|
420
427
|
},
|
|
428
|
+
{
|
|
429
|
+
type: "function",
|
|
430
|
+
name: "setWithdrawableVault",
|
|
431
|
+
inputs: [
|
|
432
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
433
|
+
{ name: "status", type: "bool", internalType: "bool" }
|
|
434
|
+
],
|
|
435
|
+
outputs: [],
|
|
436
|
+
stateMutability: "nonpayable"
|
|
437
|
+
},
|
|
421
438
|
{
|
|
422
439
|
type: "function",
|
|
423
440
|
name: "trimSpecialVertex",
|
|
@@ -26,8 +26,7 @@ async function calcLiquidatableLTs(sdk, ca, factor = 9990n, logger) {
|
|
|
26
26
|
const cm = sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
27
27
|
const market = sdk.marketRegister.findByCreditManager(ca.creditManager);
|
|
28
28
|
const weightedBalances = ca.tokens.filter(({ token, balance }) => {
|
|
29
|
-
|
|
30
|
-
return balance > minBalance;
|
|
29
|
+
return !(0, import_sdk.isDust)({ sdk, token, balance, creditManager: ca.creditManager });
|
|
31
30
|
}).map((t) => {
|
|
32
31
|
const { token, balance } = t;
|
|
33
32
|
const balanceU = market.priceOracle.convert(
|
|
@@ -219,6 +219,13 @@ const mellow4626WorkerAbi = [
|
|
|
219
219
|
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
220
220
|
stateMutability: "view"
|
|
221
221
|
},
|
|
222
|
+
{
|
|
223
|
+
type: "function",
|
|
224
|
+
name: "isWithdrawableVault",
|
|
225
|
+
inputs: [{ name: "", type: "address", internalType: "address" }],
|
|
226
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
227
|
+
stateMutability: "view"
|
|
228
|
+
},
|
|
222
229
|
{
|
|
223
230
|
type: "function",
|
|
224
231
|
name: "migrate",
|
|
@@ -395,6 +402,16 @@ const mellow4626WorkerAbi = [
|
|
|
395
402
|
],
|
|
396
403
|
stateMutability: "view"
|
|
397
404
|
},
|
|
405
|
+
{
|
|
406
|
+
type: "function",
|
|
407
|
+
name: "setWithdrawableVault",
|
|
408
|
+
inputs: [
|
|
409
|
+
{ name: "vault", type: "address", internalType: "address" },
|
|
410
|
+
{ name: "status", type: "bool", internalType: "bool" }
|
|
411
|
+
],
|
|
412
|
+
outputs: [],
|
|
413
|
+
stateMutability: "nonpayable"
|
|
414
|
+
},
|
|
398
415
|
{
|
|
399
416
|
type: "function",
|
|
400
417
|
name: "trimSpecialVertex",
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { PERCENTAGE_FACTOR, WAD } from "../sdk/index.js";
|
|
1
|
+
import { isDust, PERCENTAGE_FACTOR, WAD } from "../sdk/index.js";
|
|
2
2
|
async function calcLiquidatableLTs(sdk, ca, factor = 9990n, logger) {
|
|
3
3
|
const cm = sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
4
4
|
const market = sdk.marketRegister.findByCreditManager(ca.creditManager);
|
|
5
5
|
const weightedBalances = ca.tokens.filter(({ token, balance }) => {
|
|
6
|
-
|
|
7
|
-
return balance > minBalance;
|
|
6
|
+
return !isDust({ sdk, token, balance, creditManager: ca.creditManager });
|
|
8
7
|
}).map((t) => {
|
|
9
8
|
const { token, balance } = t;
|
|
10
9
|
const balanceU = market.priceOracle.convert(
|
|
@@ -309,6 +309,20 @@ export declare const mellow4626WorkerAbi: readonly [{
|
|
|
309
309
|
readonly internalType: "bool";
|
|
310
310
|
}];
|
|
311
311
|
readonly stateMutability: "view";
|
|
312
|
+
}, {
|
|
313
|
+
readonly type: "function";
|
|
314
|
+
readonly name: "isWithdrawableVault";
|
|
315
|
+
readonly inputs: readonly [{
|
|
316
|
+
readonly name: "";
|
|
317
|
+
readonly type: "address";
|
|
318
|
+
readonly internalType: "address";
|
|
319
|
+
}];
|
|
320
|
+
readonly outputs: readonly [{
|
|
321
|
+
readonly name: "";
|
|
322
|
+
readonly type: "bool";
|
|
323
|
+
readonly internalType: "bool";
|
|
324
|
+
}];
|
|
325
|
+
readonly stateMutability: "view";
|
|
312
326
|
}, {
|
|
313
327
|
readonly type: "function";
|
|
314
328
|
readonly name: "migrate";
|
|
@@ -543,6 +557,20 @@ export declare const mellow4626WorkerAbi: readonly [{
|
|
|
543
557
|
readonly internalType: "contract IGearboxRouter";
|
|
544
558
|
}];
|
|
545
559
|
readonly stateMutability: "view";
|
|
560
|
+
}, {
|
|
561
|
+
readonly type: "function";
|
|
562
|
+
readonly name: "setWithdrawableVault";
|
|
563
|
+
readonly inputs: readonly [{
|
|
564
|
+
readonly name: "vault";
|
|
565
|
+
readonly type: "address";
|
|
566
|
+
readonly internalType: "address";
|
|
567
|
+
}, {
|
|
568
|
+
readonly name: "status";
|
|
569
|
+
readonly type: "bool";
|
|
570
|
+
readonly internalType: "bool";
|
|
571
|
+
}];
|
|
572
|
+
readonly outputs: readonly [];
|
|
573
|
+
readonly stateMutability: "nonpayable";
|
|
546
574
|
}, {
|
|
547
575
|
readonly type: "function";
|
|
548
576
|
readonly name: "trimSpecialVertex";
|