@gearbox-protocol/sdk 3.0.0-next.97 → 3.0.0-next.99

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.
@@ -59,6 +59,8 @@ export declare class CreditManagerData {
59
59
  export declare class ChartsCreditManagerData {
60
60
  readonly address: string;
61
61
  readonly underlyingToken: string;
62
+ readonly configurator: string;
63
+ readonly creditFacade: string;
62
64
  readonly pool: string;
63
65
  readonly version: number;
64
66
  readonly name: string;
@@ -229,6 +229,8 @@ exports.CreditManagerData = CreditManagerData;
229
229
  class ChartsCreditManagerData {
230
230
  address;
231
231
  underlyingToken;
232
+ configurator;
233
+ creditFacade;
232
234
  pool;
233
235
  version;
234
236
  name;
@@ -269,6 +271,8 @@ class ChartsCreditManagerData {
269
271
  constructor(payload) {
270
272
  this.address = (payload.addr || "").toLowerCase();
271
273
  this.underlyingToken = (payload.underlyingToken || "").toLowerCase();
274
+ this.configurator = (payload.configurator || "").toLowerCase();
275
+ this.creditFacade = (payload.creditFacade || "").toLowerCase();
272
276
  this.pool = (payload.poolAddress || "").toLowerCase();
273
277
  this.version = payload.version || 2;
274
278
  this.name = payload.name || "";
@@ -1,4 +1,4 @@
1
- import { CreditSessionFilteredPayload, CreditSessionPayload, CreditSessionsAggregatedStatsPayload, UserCreditSessionsAggregatedStatsPayload } from "../payload/creditSession";
1
+ import { CreditSessionFilteredPayload, CreditSessionPayload, CreditSessionsAggregatedStatsPayload, SecondaryStatus, UserCreditSessionsAggregatedStatsPayload } from "../payload/creditSession";
2
2
  import { AssetWithView } from "./assets";
3
3
  export type CreditSessionStatus = "active" | "closed" | "repaid" | "liquidated" | "liquidateExpired" | "liquidatePaused";
4
4
  export declare const CREDIT_SESSION_STATUS_BY_ID: Record<number, CreditSessionStatus>;
@@ -27,10 +27,16 @@ export declare class CreditSession {
27
27
  readonly apy: number;
28
28
  readonly currentBlock: number;
29
29
  readonly currentTimestamp: number;
30
+ readonly baseBorrowAPY7DAverage: number;
31
+ readonly baseBorrowAPY_RAY: bigint;
32
+ readonly baseToken: string;
33
+ readonly pool: string;
30
34
  readonly entryPrice: number;
31
35
  readonly closePrice: number;
32
36
  readonly quoteToken: string;
33
37
  readonly tradingToken: string;
38
+ readonly sinceTimestamp: number;
39
+ readonly closedAtTimestamp: number;
34
40
  readonly borrowAPY_RAY: bigint;
35
41
  readonly borrowAPY7DAverage: number;
36
42
  readonly totalValueUSD: number;
@@ -45,6 +51,7 @@ export declare class CreditSession {
45
51
  readonly balances: Array<AssetWithView>;
46
52
  readonly forbiddenTokens: Record<string, true>;
47
53
  readonly disabledTokens: Record<string, true>;
54
+ readonly teritaryStatus: SecondaryStatus;
48
55
  constructor(payload: CreditSessionPayload);
49
56
  }
50
57
  export declare class CreditSessionFiltered {
@@ -58,6 +65,8 @@ export declare class CreditSessionFiltered {
58
65
  readonly sinceDate: string;
59
66
  readonly closedAt: number;
60
67
  readonly closedAtDate: string;
68
+ readonly sinceTimestamp: number;
69
+ readonly closedAtTimestamp: number;
61
70
  readonly healthFactor: number;
62
71
  readonly leverage: number;
63
72
  readonly debt: bigint;
@@ -68,6 +77,7 @@ export declare class CreditSessionFiltered {
68
77
  readonly profitInUnderlying: number;
69
78
  readonly tfIndex: number;
70
79
  readonly balances: Array<AssetWithView>;
80
+ readonly teritaryStatus: SecondaryStatus;
71
81
  constructor(payload: CreditSessionFilteredPayload);
72
82
  }
73
83
  export type CreditSessionSortFields = "type" | "tvl" | "hf" | "debt" | "pnl" | "leverage" | "tfIndex";
@@ -39,12 +39,16 @@ class CreditSession {
39
39
  apy;
40
40
  currentBlock;
41
41
  currentTimestamp;
42
+ baseBorrowAPY7DAverage;
43
+ baseBorrowAPY_RAY;
44
+ baseToken;
45
+ pool;
42
46
  entryPrice;
43
47
  closePrice;
44
48
  quoteToken;
45
49
  tradingToken;
46
- // sinceTimestamp: number;
47
- // closedAtTimestamp: number;
50
+ sinceTimestamp;
51
+ closedAtTimestamp;
48
52
  borrowAPY_RAY;
49
53
  borrowAPY7DAverage;
50
54
  totalValueUSD;
@@ -59,8 +63,10 @@ class CreditSession {
59
63
  balances = [];
60
64
  forbiddenTokens = {};
61
65
  disabledTokens = {};
66
+ teritaryStatus;
62
67
  constructor(payload) {
63
68
  this.id = (payload.id || "").toLowerCase();
69
+ this.teritaryStatus = payload.teritaryStatus || { secStatus: [] };
64
70
  this.status = exports.CREDIT_SESSION_STATUS_BY_ID[payload.status || 0];
65
71
  this.borrower = (payload.borrower || "").toLowerCase();
66
72
  this.creditManager = (payload.creditManager || "").toLowerCase();
@@ -75,10 +81,16 @@ class CreditSession {
75
81
  this.closedAt = payload.closedAt || 0;
76
82
  this.sinceDate = (0, moment_1.default)((payload.sinceTimestamp || 0) * 1000).format("Do MMM YYYY");
77
83
  this.closedAtDate = (0, moment_1.default)((payload.closedAtTimestamp || 0) * 1000).format("Do MMM YYYY");
84
+ this.sinceTimestamp = payload.sinceTimestamp || 0;
85
+ this.closedAtTimestamp = payload.closedAtTimestamp || 0;
78
86
  this.profitInUSD = payload.profitInUSD || 0;
79
87
  this.profitInUnderlying = payload.profitInUnderlying || 0;
80
88
  this.collateralInUSD = payload.collateralInUSD || 0;
81
89
  this.collateralInUnderlying = payload.collateralInUnderlying || 0;
90
+ this.baseBorrowAPY7DAverage = payload.baseBorrowAPY7DAverage || 0;
91
+ this.baseBorrowAPY_RAY = (0, sdk_gov_1.toBigInt)(payload.baseBorrowAPY_RAY || 0);
92
+ this.baseToken = (payload.tradingToken || "").toLowerCase();
93
+ this.pool = (payload.tradingToken || "").toLowerCase();
82
94
  this.entryPrice = payload.entryPrice || 0;
83
95
  this.closePrice = payload.closePrice || 0;
84
96
  this.tradingToken = (payload.tradingToken || "").toLowerCase();
@@ -133,6 +145,8 @@ class CreditSessionFiltered {
133
145
  sinceDate;
134
146
  closedAt;
135
147
  closedAtDate;
148
+ sinceTimestamp;
149
+ closedAtTimestamp;
136
150
  healthFactor;
137
151
  leverage;
138
152
  debt;
@@ -143,17 +157,21 @@ class CreditSessionFiltered {
143
157
  profitInUnderlying;
144
158
  tfIndex;
145
159
  balances;
160
+ teritaryStatus;
146
161
  constructor(payload) {
147
162
  this.id = (payload.id || "").toLowerCase();
148
163
  this.borrower = (payload.borrower || "").toLowerCase();
149
164
  this.account = (payload.account || "").toLowerCase();
150
165
  this.creditManager = (payload.creditManager || "").toLowerCase();
151
166
  this.underlyingToken = (payload.underlyingToken || "").toLowerCase();
167
+ this.teritaryStatus = payload.teritaryStatus || { secStatus: [] };
152
168
  this.status = exports.CREDIT_SESSION_STATUS_BY_ID[payload.status || 0];
153
169
  this.since = payload.since || 0;
154
170
  this.closedAt = payload.closedAt || 0;
155
171
  this.sinceDate = (0, moment_1.default)((payload.since || 0) * 1000).format("Do MMM YYYY");
156
172
  this.closedAtDate = (0, moment_1.default)((payload.closedAt || 0) * 1000).format("Do MMM YYYY");
173
+ this.sinceTimestamp = payload.sinceTimestamp || 0;
174
+ this.closedAtTimestamp = payload.closedAtTimestamp || 0;
157
175
  this.healthFactor = Number((0, sdk_gov_1.toBigInt)(payload.healthFactor || 0));
158
176
  this.leverage = payload.leverage || 0;
159
177
  this.debt = (0, sdk_gov_1.toBigInt)(payload.debt || 0);
@@ -14,6 +14,8 @@ export type CreditManagerDataPayload = ExcludeArrayProps<CreditManagerDataStruct
14
14
  export interface ChartsCreditManagerPayload {
15
15
  addr: string;
16
16
  underlyingToken: string;
17
+ configurator: string;
18
+ creditFacade: string;
17
19
  isWeth: boolean;
18
20
  poolAddress: string;
19
21
  name: string;
@@ -12,6 +12,9 @@ interface CreditSessionReward {
12
12
  pool: string;
13
13
  symbol: string;
14
14
  }
15
+ export interface SecondaryStatus {
16
+ secStatus: Array<[block: number, status: number]>;
17
+ }
15
18
  export interface CreditSessionPayload {
16
19
  id: string;
17
20
  status: number;
@@ -52,6 +55,11 @@ export interface CreditSessionPayload {
52
55
  currentTimestamp: number;
53
56
  cvxUnclaimedRewards: Record<string, CreditSessionReward>;
54
57
  balances: Record<string, CreditSessionBalancePayload>;
58
+ baseBorrowAPY7DAverage: number;
59
+ baseBorrowAPY_RAY: string;
60
+ baseToken: string;
61
+ pool: string;
62
+ teritaryStatus: null | SecondaryStatus;
55
63
  }
56
64
  export interface CreditSessionFilteredPayload {
57
65
  balances: Record<string, CreditSessionBalancePayload>;
@@ -72,6 +80,9 @@ export interface CreditSessionFilteredPayload {
72
80
  pnl: number;
73
81
  pnlUSD: number;
74
82
  tfIndex: number;
83
+ closedAtTimestamp: number;
84
+ sinceTimestamp: number;
85
+ teritaryStatus: null | SecondaryStatus;
75
86
  }
76
87
  export interface CreditSessionsAggregatedStatsPayload {
77
88
  healthFactor: BigNumberish;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-next.97",
3
+ "version": "3.0.0-next.99",
4
4
  "description": "Gearbox SDK",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",