@gearbox-protocol/sdk 3.0.0-next.227 → 3.0.0-next.229

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.
@@ -148,6 +148,6 @@ export declare class CreditAccountData {
148
148
  * Calculates the time remaining until liquidation for a credit account.
149
149
  * @returns The time remaining until liquidation in milliseconds.
150
150
  */
151
- static getTimeToLiquidation({ healthFactor, totalBorrowRate_debt, }: TimeToLiquidationProps): bigint;
151
+ static getTimeToLiquidation({ healthFactor, totalBorrowRate_debt, }: TimeToLiquidationProps): bigint | null;
152
152
  }
153
153
  export {};
@@ -405,7 +405,7 @@ class CreditAccountData {
405
405
  */
406
406
  static getTimeToLiquidation({ healthFactor, totalBorrowRate_debt, }) {
407
407
  if (healthFactor <= sdk_gov_1.PERCENTAGE_FACTOR || totalBorrowRate_debt === 0n)
408
- return 0n;
408
+ return null;
409
409
  // (HF - 1) / (br_D / year) or (HF - 1) * (year / br_D)
410
410
  const HF_1 = BigInt(healthFactor) - sdk_gov_1.PERCENTAGE_FACTOR;
411
411
  const brPerYear = (BigInt(sdk_gov_1.SECONDS_PER_YEAR) * sdk_gov_1.PERCENTAGE_FACTOR * sdk_gov_1.PERCENTAGE_DECIMALS) /
@@ -15,6 +15,7 @@ export declare class CreditManagerData {
15
15
  readonly version: number;
16
16
  readonly isPaused: boolean;
17
17
  readonly forbiddenTokenMask: bigint;
18
+ readonly isBorrowingForbidden: boolean;
18
19
  readonly maxEnabledTokensLength: number;
19
20
  readonly name: string;
20
21
  readonly tier: number;
@@ -17,6 +17,7 @@ class CreditManagerData {
17
17
  version;
18
18
  isPaused;
19
19
  forbiddenTokenMask; // V2 only: mask which forbids some particular tokens
20
+ isBorrowingForbidden;
20
21
  maxEnabledTokensLength;
21
22
  name;
22
23
  tier;
@@ -55,6 +56,7 @@ class CreditManagerData {
55
56
  this.isPaused = payload.isPaused;
56
57
  this.forbiddenTokenMask = payload.forbiddenTokenMask;
57
58
  this.maxEnabledTokensLength = Number(payload.maxEnabledTokensLength);
59
+ this.isBorrowingForbidden = payload.isBorrowingForbidden;
58
60
  this.baseBorrowRate = Number((payload.baseBorrowRate *
59
61
  (BigInt(payload.feeInterest) + sdk_gov_1.PERCENTAGE_FACTOR) *
60
62
  sdk_gov_1.PERCENTAGE_DECIMALS) /
@@ -47,6 +47,7 @@ export interface CreditManagerDataPayload {
47
47
  liquidationDiscountExpired: number;
48
48
  quotas: PoolDataPayload["quotas"];
49
49
  lirm: PoolDataPayload["lirm"];
50
+ isBorrowingForbidden: boolean;
50
51
  }
51
52
  export interface ChartsCreditManagerPayload {
52
53
  addr: Address;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-next.227",
3
+ "version": "3.0.0-next.229",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",