@gearbox-protocol/sdk 15.0.0-next.1 → 15.0.0-next.3
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/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +1 -1
- package/dist/types/sdk/pools/types.d.ts +19 -0
- package/package.json +1 -1
|
@@ -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
|
*
|
|
@@ -121,6 +121,25 @@ export interface IPoolsService {
|
|
|
121
121
|
* @param tokenOut can be undefined if deposit is not resulting in a token out (e.g. for KYC underlying on demand)
|
|
122
122
|
*/
|
|
123
123
|
getDepositMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): DepositMetadata;
|
|
124
|
+
/**
|
|
125
|
+
* Returns a list of tokens that can be redeemed from a pool
|
|
126
|
+
* @param pool
|
|
127
|
+
*/
|
|
128
|
+
getWithdrawalTokensIn(pool: Address): Address[];
|
|
129
|
+
/**
|
|
130
|
+
* Returns a list of tokens that can be received after redeeming from a pool
|
|
131
|
+
* @param pool
|
|
132
|
+
* @param tokenIn token that will be redeemed from the pool
|
|
133
|
+
*/
|
|
134
|
+
getWithdrawalTokensOut(pool: Address, tokenIn: Address): Address[];
|
|
135
|
+
/**
|
|
136
|
+
* After user chooses tokenIn from {@link getWithdrawalTokensIn} and tokenOut from {@link getWithdrawalTokensOut},
|
|
137
|
+
* this method returns metadata that will be used to perform the withdrawal.
|
|
138
|
+
* @param pool
|
|
139
|
+
* @param tokenIn
|
|
140
|
+
* @param tokenOut
|
|
141
|
+
*/
|
|
142
|
+
getWithdrawalMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): WithdrawalMetadata;
|
|
124
143
|
/**
|
|
125
144
|
* Returns contract call parameters for adding liquidity to a pool
|
|
126
145
|
* Or undefined if no deposit action is required (e.g. for KYC underlying on demand)
|