@gearbox-protocol/sdk 3.0.0-next.88 → 3.0.0-next.89

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.
@@ -17,6 +17,7 @@ export declare class CreditManagerData {
17
17
  readonly forbiddenTokenMask: bigint;
18
18
  readonly maxEnabledTokensLength: number;
19
19
  readonly name: string;
20
+ readonly tier: number;
20
21
  readonly baseBorrowRate: number;
21
22
  readonly minDebt: bigint;
22
23
  readonly maxDebt: bigint;
@@ -53,6 +54,7 @@ export declare class CreditManagerData {
53
54
  encodeWithdrawCollateralV3(token: string, amount: bigint, to: string): MultiCall;
54
55
  static withdrawAllAndUnwrap_Convex(address: string, claim: boolean): MultiCall;
55
56
  encodeOnDemandPriceUpdateV3(token: string, reserve: boolean, data: string): MultiCall;
57
+ static getPoolTier(name: string): number;
56
58
  }
57
59
  export declare class ChartsCreditManagerData {
58
60
  readonly address: string;
@@ -19,6 +19,7 @@ class CreditManagerData {
19
19
  forbiddenTokenMask; // V2 only: mask which forbids some particular tokens
20
20
  maxEnabledTokensLength;
21
21
  name;
22
+ tier;
22
23
  baseBorrowRate;
23
24
  minDebt;
24
25
  maxDebt;
@@ -42,6 +43,7 @@ class CreditManagerData {
42
43
  this.type = pool_1.PoolData.getPoolType(payload.name || "");
43
44
  this.name = payload.name;
44
45
  this.pool = payload.pool.toLowerCase();
46
+ this.tier = CreditManagerData.getPoolTier(payload.name);
45
47
  this.creditFacade = payload.creditFacade.toLowerCase();
46
48
  this.creditConfigurator = payload.creditConfigurator.toLowerCase();
47
49
  this.degenNFT = payload.degenNFT.toLowerCase();
@@ -212,6 +214,16 @@ class CreditManagerData {
212
214
  callData: types_1.ICreditFacadeV3Multicall__factory.createInterface().encodeFunctionData("onDemandPriceUpdate", [token, reserve, data]),
213
215
  };
214
216
  }
217
+ static getPoolTier(name) {
218
+ const DEFAULT_TIER = 99;
219
+ const l = name.split(" ") || [];
220
+ const [word, number] = l.slice(-2);
221
+ if (word.toLowerCase() === "tier") {
222
+ const n = Number(number || DEFAULT_TIER);
223
+ return Number.isNaN(n) ? DEFAULT_TIER : n;
224
+ }
225
+ return DEFAULT_TIER;
226
+ }
215
227
  }
216
228
  exports.CreditManagerData = CreditManagerData;
217
229
  class ChartsCreditManagerData {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-next.88",
3
+ "version": "3.0.0-next.89",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",