@gearbox-protocol/sdk 10.5.0 → 10.6.0

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.
Files changed (31) hide show
  1. package/dist/cjs/abi/310/generated.js +239 -25
  2. package/dist/cjs/dev/RevolverTransport.js +3 -0
  3. package/dist/cjs/sdk/market/MarketSuite.js +4 -0
  4. package/dist/cjs/sdk/market/credit/CreditFacadeV300Contract.js +4 -1
  5. package/dist/cjs/sdk/market/credit/CreditFacadeV310Contract.js +2 -2
  6. package/dist/cjs/sdk/market/loss-policy/AliasLossPolicyV310Contract.js +40 -0
  7. package/dist/cjs/sdk/market/loss-policy/LossPolicyContract.js +40 -0
  8. package/dist/cjs/sdk/market/loss-policy/createLossPolicy.js +48 -0
  9. package/dist/cjs/sdk/market/loss-policy/index.js +28 -0
  10. package/dist/cjs/sdk/market/loss-policy/types.js +16 -0
  11. package/dist/esm/abi/310/generated.js +238 -25
  12. package/dist/esm/dev/RevolverTransport.js +4 -0
  13. package/dist/esm/sdk/market/MarketSuite.js +6 -0
  14. package/dist/esm/sdk/market/credit/CreditFacadeV300Contract.js +4 -1
  15. package/dist/esm/sdk/market/credit/CreditFacadeV310Contract.js +2 -2
  16. package/dist/esm/sdk/market/loss-policy/AliasLossPolicyV310Contract.js +16 -0
  17. package/dist/esm/sdk/market/loss-policy/LossPolicyContract.js +16 -0
  18. package/dist/esm/sdk/market/loss-policy/createLossPolicy.js +24 -0
  19. package/dist/esm/sdk/market/loss-policy/index.js +4 -0
  20. package/dist/esm/sdk/market/loss-policy/types.js +0 -0
  21. package/dist/types/abi/310/generated.d.ts +292 -22
  22. package/dist/types/sdk/market/MarketSuite.d.ts +2 -0
  23. package/dist/types/sdk/market/credit/CreditFacadeV300Contract.d.ts +2 -2
  24. package/dist/types/sdk/market/credit/CreditFacadeV310Contract.d.ts +2 -2
  25. package/dist/types/sdk/market/loss-policy/AliasLossPolicyV310Contract.d.ts +277 -0
  26. package/dist/types/sdk/market/loss-policy/LossPolicyContract.d.ts +133 -0
  27. package/dist/types/sdk/market/loss-policy/createLossPolicy.d.ts +16 -0
  28. package/dist/types/sdk/market/loss-policy/index.d.ts +4 -0
  29. package/dist/types/sdk/market/loss-policy/types.d.ts +5 -0
  30. package/dist/types/sdk/types/state-human.d.ts +1 -0
  31. package/package.json +1 -1
@@ -0,0 +1,277 @@
1
+ import { BaseContract, type BaseParams } from "../../base/index.js";
2
+ import type { GearboxSDK } from "../../GearboxSDK.js";
3
+ declare const abi: readonly [{
4
+ readonly type: "function";
5
+ readonly name: "accessMode";
6
+ readonly inputs: readonly [];
7
+ readonly outputs: readonly [{
8
+ readonly name: "";
9
+ readonly type: "uint8";
10
+ readonly internalType: "enum ILossPolicy.AccessMode";
11
+ }];
12
+ readonly stateMutability: "view";
13
+ }, {
14
+ readonly type: "function";
15
+ readonly name: "acl";
16
+ readonly inputs: readonly [];
17
+ readonly outputs: readonly [{
18
+ readonly name: "";
19
+ readonly type: "address";
20
+ readonly internalType: "address";
21
+ }];
22
+ readonly stateMutability: "view";
23
+ }, {
24
+ readonly type: "function";
25
+ readonly name: "checksEnabled";
26
+ readonly inputs: readonly [];
27
+ readonly outputs: readonly [{
28
+ readonly name: "";
29
+ readonly type: "bool";
30
+ readonly internalType: "bool";
31
+ }];
32
+ readonly stateMutability: "view";
33
+ }, {
34
+ readonly type: "function";
35
+ readonly name: "contractType";
36
+ readonly inputs: readonly [];
37
+ readonly outputs: readonly [{
38
+ readonly name: "";
39
+ readonly type: "bytes32";
40
+ readonly internalType: "bytes32";
41
+ }];
42
+ readonly stateMutability: "view";
43
+ }, {
44
+ readonly type: "function";
45
+ readonly name: "getAliasPriceFeedParams";
46
+ readonly inputs: readonly [{
47
+ readonly name: "token";
48
+ readonly type: "address";
49
+ readonly internalType: "address";
50
+ }];
51
+ readonly outputs: readonly [{
52
+ readonly name: "";
53
+ readonly type: "tuple";
54
+ readonly internalType: "struct PriceFeedParams";
55
+ readonly components: readonly [{
56
+ readonly name: "priceFeed";
57
+ readonly type: "address";
58
+ readonly internalType: "address";
59
+ }, {
60
+ readonly name: "stalenessPeriod";
61
+ readonly type: "uint32";
62
+ readonly internalType: "uint32";
63
+ }, {
64
+ readonly name: "skipCheck";
65
+ readonly type: "bool";
66
+ readonly internalType: "bool";
67
+ }, {
68
+ readonly name: "tokenDecimals";
69
+ readonly type: "uint8";
70
+ readonly internalType: "uint8";
71
+ }];
72
+ }];
73
+ readonly stateMutability: "view";
74
+ }, {
75
+ readonly type: "function";
76
+ readonly name: "getRequiredAliasPriceFeeds";
77
+ readonly inputs: readonly [{
78
+ readonly name: "creditAccount";
79
+ readonly type: "address";
80
+ readonly internalType: "address";
81
+ }];
82
+ readonly outputs: readonly [{
83
+ readonly name: "";
84
+ readonly type: "address[]";
85
+ readonly internalType: "address[]";
86
+ }];
87
+ readonly stateMutability: "view";
88
+ }, {
89
+ readonly type: "function";
90
+ readonly name: "getTokensWithAlias";
91
+ readonly inputs: readonly [];
92
+ readonly outputs: readonly [{
93
+ readonly name: "";
94
+ readonly type: "address[]";
95
+ readonly internalType: "address[]";
96
+ }];
97
+ readonly stateMutability: "view";
98
+ }, {
99
+ readonly type: "function";
100
+ readonly name: "isLiquidatableWithLoss";
101
+ readonly inputs: readonly [{
102
+ readonly name: "creditAccount";
103
+ readonly type: "address";
104
+ readonly internalType: "address";
105
+ }, {
106
+ readonly name: "caller";
107
+ readonly type: "address";
108
+ readonly internalType: "address";
109
+ }, {
110
+ readonly name: "params";
111
+ readonly type: "tuple";
112
+ readonly internalType: "struct ILossPolicy.Params";
113
+ readonly components: readonly [{
114
+ readonly name: "totalDebtUSD";
115
+ readonly type: "uint256";
116
+ readonly internalType: "uint256";
117
+ }, {
118
+ readonly name: "twvUSD";
119
+ readonly type: "uint256";
120
+ readonly internalType: "uint256";
121
+ }, {
122
+ readonly name: "extraData";
123
+ readonly type: "bytes";
124
+ readonly internalType: "bytes";
125
+ }];
126
+ }];
127
+ readonly outputs: readonly [{
128
+ readonly name: "";
129
+ readonly type: "bool";
130
+ readonly internalType: "bool";
131
+ }];
132
+ readonly stateMutability: "nonpayable";
133
+ }, {
134
+ readonly type: "function";
135
+ readonly name: "pool";
136
+ readonly inputs: readonly [];
137
+ readonly outputs: readonly [{
138
+ readonly name: "";
139
+ readonly type: "address";
140
+ readonly internalType: "address";
141
+ }];
142
+ readonly stateMutability: "view";
143
+ }, {
144
+ readonly type: "function";
145
+ readonly name: "priceFeedStore";
146
+ readonly inputs: readonly [];
147
+ readonly outputs: readonly [{
148
+ readonly name: "";
149
+ readonly type: "address";
150
+ readonly internalType: "address";
151
+ }];
152
+ readonly stateMutability: "view";
153
+ }, {
154
+ readonly type: "function";
155
+ readonly name: "serialize";
156
+ readonly inputs: readonly [];
157
+ readonly outputs: readonly [{
158
+ readonly name: "serializedData";
159
+ readonly type: "bytes";
160
+ readonly internalType: "bytes";
161
+ }];
162
+ readonly stateMutability: "view";
163
+ }, {
164
+ readonly type: "function";
165
+ readonly name: "setAccessMode";
166
+ readonly inputs: readonly [{
167
+ readonly name: "mode";
168
+ readonly type: "uint8";
169
+ readonly internalType: "enum ILossPolicy.AccessMode";
170
+ }];
171
+ readonly outputs: readonly [];
172
+ readonly stateMutability: "nonpayable";
173
+ }, {
174
+ readonly type: "function";
175
+ readonly name: "setAliasPriceFeed";
176
+ readonly inputs: readonly [{
177
+ readonly name: "token";
178
+ readonly type: "address";
179
+ readonly internalType: "address";
180
+ }, {
181
+ readonly name: "priceFeed";
182
+ readonly type: "address";
183
+ readonly internalType: "address";
184
+ }];
185
+ readonly outputs: readonly [];
186
+ readonly stateMutability: "nonpayable";
187
+ }, {
188
+ readonly type: "function";
189
+ readonly name: "setChecksEnabled";
190
+ readonly inputs: readonly [{
191
+ readonly name: "enabled";
192
+ readonly type: "bool";
193
+ readonly internalType: "bool";
194
+ }];
195
+ readonly outputs: readonly [];
196
+ readonly stateMutability: "nonpayable";
197
+ }, {
198
+ readonly type: "function";
199
+ readonly name: "underlying";
200
+ readonly inputs: readonly [];
201
+ readonly outputs: readonly [{
202
+ readonly name: "";
203
+ readonly type: "address";
204
+ readonly internalType: "address";
205
+ }];
206
+ readonly stateMutability: "view";
207
+ }, {
208
+ readonly type: "function";
209
+ readonly name: "version";
210
+ readonly inputs: readonly [];
211
+ readonly outputs: readonly [{
212
+ readonly name: "";
213
+ readonly type: "uint256";
214
+ readonly internalType: "uint256";
215
+ }];
216
+ readonly stateMutability: "view";
217
+ }, {
218
+ readonly type: "event";
219
+ readonly name: "SetAccessMode";
220
+ readonly inputs: readonly [{
221
+ readonly name: "mode";
222
+ readonly type: "uint8";
223
+ readonly indexed: false;
224
+ readonly internalType: "enum ILossPolicy.AccessMode";
225
+ }];
226
+ readonly anonymous: false;
227
+ }, {
228
+ readonly type: "event";
229
+ readonly name: "SetAliasPriceFeed";
230
+ readonly inputs: readonly [{
231
+ readonly name: "token";
232
+ readonly type: "address";
233
+ readonly indexed: true;
234
+ readonly internalType: "address";
235
+ }, {
236
+ readonly name: "priceFeed";
237
+ readonly type: "address";
238
+ readonly indexed: true;
239
+ readonly internalType: "address";
240
+ }, {
241
+ readonly name: "stalenessPeriod";
242
+ readonly type: "uint32";
243
+ readonly indexed: false;
244
+ readonly internalType: "uint32";
245
+ }, {
246
+ readonly name: "skipCheck";
247
+ readonly type: "bool";
248
+ readonly indexed: false;
249
+ readonly internalType: "bool";
250
+ }];
251
+ readonly anonymous: false;
252
+ }, {
253
+ readonly type: "event";
254
+ readonly name: "SetChecksEnabled";
255
+ readonly inputs: readonly [{
256
+ readonly name: "enabled";
257
+ readonly type: "bool";
258
+ readonly indexed: false;
259
+ readonly internalType: "bool";
260
+ }];
261
+ readonly anonymous: false;
262
+ }, {
263
+ readonly type: "event";
264
+ readonly name: "UnsetAliasPriceFeed";
265
+ readonly inputs: readonly [{
266
+ readonly name: "token";
267
+ readonly type: "address";
268
+ readonly indexed: true;
269
+ readonly internalType: "address";
270
+ }];
271
+ readonly anonymous: false;
272
+ }];
273
+ type abi = typeof abi;
274
+ export declare class AliasLossPolicyV310Contract extends BaseContract<abi> {
275
+ constructor(sdk: GearboxSDK, params: BaseParams);
276
+ }
277
+ export {};
@@ -0,0 +1,133 @@
1
+ import { BaseContract, type BaseParams } from "../../base/index.js";
2
+ import type { GearboxSDK } from "../../GearboxSDK.js";
3
+ declare const abi: readonly [{
4
+ readonly type: "function";
5
+ readonly name: "accessMode";
6
+ readonly inputs: readonly [];
7
+ readonly outputs: readonly [{
8
+ readonly name: "";
9
+ readonly type: "uint8";
10
+ readonly internalType: "enum ILossPolicy.AccessMode";
11
+ }];
12
+ readonly stateMutability: "view";
13
+ }, {
14
+ readonly type: "function";
15
+ readonly name: "checksEnabled";
16
+ readonly inputs: readonly [];
17
+ readonly outputs: readonly [{
18
+ readonly name: "";
19
+ readonly type: "bool";
20
+ readonly internalType: "bool";
21
+ }];
22
+ readonly stateMutability: "view";
23
+ }, {
24
+ readonly type: "function";
25
+ readonly name: "contractType";
26
+ readonly inputs: readonly [];
27
+ readonly outputs: readonly [{
28
+ readonly name: "";
29
+ readonly type: "bytes32";
30
+ readonly internalType: "bytes32";
31
+ }];
32
+ readonly stateMutability: "view";
33
+ }, {
34
+ readonly type: "function";
35
+ readonly name: "isLiquidatableWithLoss";
36
+ readonly inputs: readonly [{
37
+ readonly name: "creditAccount";
38
+ readonly type: "address";
39
+ readonly internalType: "address";
40
+ }, {
41
+ readonly name: "caller";
42
+ readonly type: "address";
43
+ readonly internalType: "address";
44
+ }, {
45
+ readonly name: "params";
46
+ readonly type: "tuple";
47
+ readonly internalType: "struct ILossPolicy.Params";
48
+ readonly components: readonly [{
49
+ readonly name: "totalDebtUSD";
50
+ readonly type: "uint256";
51
+ readonly internalType: "uint256";
52
+ }, {
53
+ readonly name: "twvUSD";
54
+ readonly type: "uint256";
55
+ readonly internalType: "uint256";
56
+ }, {
57
+ readonly name: "extraData";
58
+ readonly type: "bytes";
59
+ readonly internalType: "bytes";
60
+ }];
61
+ }];
62
+ readonly outputs: readonly [{
63
+ readonly name: "";
64
+ readonly type: "bool";
65
+ readonly internalType: "bool";
66
+ }];
67
+ readonly stateMutability: "nonpayable";
68
+ }, {
69
+ readonly type: "function";
70
+ readonly name: "serialize";
71
+ readonly inputs: readonly [];
72
+ readonly outputs: readonly [{
73
+ readonly name: "serializedData";
74
+ readonly type: "bytes";
75
+ readonly internalType: "bytes";
76
+ }];
77
+ readonly stateMutability: "view";
78
+ }, {
79
+ readonly type: "function";
80
+ readonly name: "setAccessMode";
81
+ readonly inputs: readonly [{
82
+ readonly name: "mode";
83
+ readonly type: "uint8";
84
+ readonly internalType: "enum ILossPolicy.AccessMode";
85
+ }];
86
+ readonly outputs: readonly [];
87
+ readonly stateMutability: "nonpayable";
88
+ }, {
89
+ readonly type: "function";
90
+ readonly name: "setChecksEnabled";
91
+ readonly inputs: readonly [{
92
+ readonly name: "enabled";
93
+ readonly type: "bool";
94
+ readonly internalType: "bool";
95
+ }];
96
+ readonly outputs: readonly [];
97
+ readonly stateMutability: "nonpayable";
98
+ }, {
99
+ readonly type: "function";
100
+ readonly name: "version";
101
+ readonly inputs: readonly [];
102
+ readonly outputs: readonly [{
103
+ readonly name: "";
104
+ readonly type: "uint256";
105
+ readonly internalType: "uint256";
106
+ }];
107
+ readonly stateMutability: "view";
108
+ }, {
109
+ readonly type: "event";
110
+ readonly name: "SetAccessMode";
111
+ readonly inputs: readonly [{
112
+ readonly name: "mode";
113
+ readonly type: "uint8";
114
+ readonly indexed: false;
115
+ readonly internalType: "enum ILossPolicy.AccessMode";
116
+ }];
117
+ readonly anonymous: false;
118
+ }, {
119
+ readonly type: "event";
120
+ readonly name: "SetChecksEnabled";
121
+ readonly inputs: readonly [{
122
+ readonly name: "enabled";
123
+ readonly type: "bool";
124
+ readonly indexed: false;
125
+ readonly internalType: "bool";
126
+ }];
127
+ readonly anonymous: false;
128
+ }];
129
+ type abi = typeof abi;
130
+ export declare class LossPolicyContract extends BaseContract<abi> {
131
+ constructor(sdk: GearboxSDK, params: BaseParams);
132
+ }
133
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { BaseState } from "../../base/index.js";
2
+ import type { GearboxSDK } from "../../GearboxSDK.js";
3
+ import type { ILossPolicyContract } from "./types.js";
4
+ /**
5
+ * Used get or create oracle contract instances
6
+ * In 3.0 we can have same oracle for different pools
7
+ * But also due to how compressor works for v3.0, each maketpriceOracle data will have different tokens (for the same oracle)
8
+ *
9
+ * So this method bridges multiple compressor data pieces and single oracle contract isntance
10
+ *
11
+ * @param sdk
12
+ * @param data
13
+ * @param underlying
14
+ * @returns
15
+ */
16
+ export declare function createLossPolicy(sdk: GearboxSDK, { baseParams }: BaseState): ILossPolicyContract;
@@ -0,0 +1,4 @@
1
+ export * from "./AliasLossPolicyV310Contract.js";
2
+ export * from "./createLossPolicy.js";
3
+ export * from "./LossPolicyContract.js";
4
+ export * from "./types.js";
@@ -0,0 +1,5 @@
1
+ import type { IBaseContract } from "../../base/index.js";
2
+ import type { BaseContractStateHuman } from "../../types/index.js";
3
+ export interface ILossPolicyContract extends IBaseContract {
4
+ stateHuman(raw?: boolean): BaseContractStateHuman;
5
+ }
@@ -176,6 +176,7 @@ export interface MarketStateHuman {
176
176
  pool: PoolSuiteStateHuman;
177
177
  creditManagers: CreditSuiteStateHuman[];
178
178
  priceOracle: PriceOracleStateHuman;
179
+ lossPolicy: BaseContractStateHuman;
179
180
  pausableAdmins: string[];
180
181
  unpausableAdmins: string[];
181
182
  emergencyLiquidators: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "10.5.0",
3
+ "version": "10.6.0",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",