@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.
@@ -456,7 +456,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
456
456
  /**
457
457
  * {@inheritDoc ICreditAccountsService.calcMinSeizedAmount}
458
458
  */
459
- async calcMinSeizedAmount(props) {
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 = await market.priceOracle.updateAndConvert(
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
- async calcMinSeizedAmount(props) {
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 = await market.priceOracle.updateAndConvert(
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): Promise<bigint>;
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): Promise<bigint>;
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)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "15.0.0-next.1",
3
+ "version": "15.0.0-next.3",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",