@gearbox-protocol/sdk 15.0.0-next.1 → 15.0.0-next.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.
|
@@ -456,7 +456,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
456
456
|
/**
|
|
457
457
|
* {@inheritDoc ICreditAccountsService.calcMinSeizedAmount}
|
|
458
458
|
*/
|
|
459
|
-
|
|
459
|
+
calcMinSeizedAmount(props) {
|
|
460
460
|
const { account, token, repaidAmount } = props;
|
|
461
461
|
const market = this.sdk.marketRegister.findByCreditManager(
|
|
462
462
|
account.creditManager
|
|
@@ -465,7 +465,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
465
465
|
account.creditManager
|
|
466
466
|
);
|
|
467
467
|
const fee = suite.isExpired ? suite.creditManager.liquidationDiscountExpired : suite.creditManager.liquidationDiscount;
|
|
468
|
-
const tokenAmount =
|
|
468
|
+
const tokenAmount = market.priceOracle.convert(
|
|
469
469
|
market.underlying,
|
|
470
470
|
token,
|
|
471
471
|
repaidAmount
|
|
@@ -451,7 +451,7 @@ class CreditAccountsServiceV310 extends SDKConstruct {
|
|
|
451
451
|
/**
|
|
452
452
|
* {@inheritDoc ICreditAccountsService.calcMinSeizedAmount}
|
|
453
453
|
*/
|
|
454
|
-
|
|
454
|
+
calcMinSeizedAmount(props) {
|
|
455
455
|
const { account, token, repaidAmount } = props;
|
|
456
456
|
const market = this.sdk.marketRegister.findByCreditManager(
|
|
457
457
|
account.creditManager
|
|
@@ -460,7 +460,7 @@ class CreditAccountsServiceV310 extends SDKConstruct {
|
|
|
460
460
|
account.creditManager
|
|
461
461
|
);
|
|
462
462
|
const fee = suite.isExpired ? suite.creditManager.liquidationDiscountExpired : suite.creditManager.liquidationDiscount;
|
|
463
|
-
const tokenAmount =
|
|
463
|
+
const tokenAmount = market.priceOracle.convert(
|
|
464
464
|
market.underlying,
|
|
465
465
|
token,
|
|
466
466
|
repaidAmount
|
|
@@ -67,7 +67,7 @@ export declare class CreditAccountsServiceV310 extends SDKConstruct implements I
|
|
|
67
67
|
/**
|
|
68
68
|
* {@inheritDoc ICreditAccountsService.calcMinSeizedAmount}
|
|
69
69
|
*/
|
|
70
|
-
calcMinSeizedAmount(props: PartiallyLiquidateProps):
|
|
70
|
+
calcMinSeizedAmount(props: PartiallyLiquidateProps): bigint;
|
|
71
71
|
/**
|
|
72
72
|
* {@inheritDoc ICreditAccountsService.partiallyLiquidate}
|
|
73
73
|
*/
|
|
@@ -723,7 +723,7 @@ export interface ICreditAccountsService extends Construct {
|
|
|
723
723
|
* @param props - {@link CalcMinSeizedAmountProps}
|
|
724
724
|
* @returns Minimum amount of collateral token to seize
|
|
725
725
|
*/
|
|
726
|
-
calcMinSeizedAmount(props: CalcMinSeizedAmountProps):
|
|
726
|
+
calcMinSeizedAmount(props: CalcMinSeizedAmountProps): bigint;
|
|
727
727
|
/**
|
|
728
728
|
* Generates transaction to partially liquidate credit account;
|
|
729
729
|
*
|