@gearbox-protocol/sdk 14.12.0-next.47 → 14.12.0-next.49

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 (53) hide show
  1. package/dist/cjs/abi/ILiquidationCompressorV313.js +103 -0
  2. package/dist/cjs/abi/compressors/liquidationCompressor.js +215 -0
  3. package/dist/cjs/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.js +104 -0
  4. package/dist/cjs/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.js +104 -0
  5. package/dist/cjs/dev/withdrawalAbi.js +104 -66
  6. package/dist/cjs/plugins/adapters/abi/adapters/iMidasGatewayAdapterV311.js +2 -306
  7. package/dist/cjs/plugins/adapters/abi/index.js +2 -0
  8. package/dist/cjs/plugins/adapters/abi/midas/iMidasGatewayV311.js +194 -0
  9. package/dist/cjs/plugins/adapters/abi/midas/index.js +22 -0
  10. package/dist/cjs/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.js +184 -24
  11. package/dist/cjs/plugins/adapters/contracts/MidasGatewayAdapterContract.js +2 -1
  12. package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +81 -58
  13. package/dist/cjs/sdk/accounts/liquidations/MultichainLiquidationsService.js +6 -0
  14. package/dist/cjs/sdk/accounts/liquidations/constants.js +29 -0
  15. package/dist/cjs/sdk/accounts/liquidations/helpers.js +49 -2
  16. package/dist/cjs/sdk/accounts/liquidations/index.js +2 -2
  17. package/dist/esm/abi/ILiquidationCompressorV313.js +79 -0
  18. package/dist/esm/abi/compressors/liquidationCompressor.js +191 -0
  19. package/dist/esm/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.js +80 -0
  20. package/dist/esm/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.js +80 -0
  21. package/dist/esm/dev/withdrawalAbi.js +104 -66
  22. package/dist/esm/plugins/adapters/abi/adapters/iMidasGatewayAdapterV311.js +1 -304
  23. package/dist/esm/plugins/adapters/abi/index.js +1 -0
  24. package/dist/esm/plugins/adapters/abi/midas/iMidasGatewayV311.js +170 -0
  25. package/dist/esm/plugins/adapters/abi/midas/index.js +1 -0
  26. package/dist/esm/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.js +184 -24
  27. package/dist/esm/plugins/adapters/contracts/MidasGatewayAdapterContract.js +2 -4
  28. package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +87 -61
  29. package/dist/esm/sdk/accounts/liquidations/MultichainLiquidationsService.js +6 -0
  30. package/dist/esm/sdk/accounts/liquidations/constants.js +5 -0
  31. package/dist/esm/sdk/accounts/liquidations/helpers.js +46 -2
  32. package/dist/esm/sdk/accounts/liquidations/index.js +1 -1
  33. package/dist/types/abi/ILiquidationCompressorV313.d.ts +107 -0
  34. package/dist/types/abi/compressors/liquidationCompressor.d.ts +262 -0
  35. package/dist/types/abi/compressors/subcompressors/liquidation/midasLiquidationSubcompressor.d.ts +111 -0
  36. package/dist/types/abi/compressors/subcompressors/liquidation/securitizeLiquidationSubcompressor.d.ts +111 -0
  37. package/dist/types/dev/withdrawalAbi.d.ts +81 -53
  38. package/dist/types/plugins/adapters/abi/adapters/iMidasGatewayAdapterV311.d.ts +0 -233
  39. package/dist/types/plugins/adapters/abi/index.d.ts +1 -0
  40. package/dist/types/plugins/adapters/abi/midas/iMidasGatewayV311.d.ts +261 -0
  41. package/dist/types/plugins/adapters/abi/midas/index.d.ts +1 -0
  42. package/dist/types/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.d.ts +24 -0
  43. package/dist/types/plugins/adapters/contracts/MidasGatewayAdapterContract.d.ts +28 -0
  44. package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +24 -0
  45. package/dist/types/rewards/rewards/merkl-api.d.ts +1 -1
  46. package/dist/types/sdk/MultichainSDK.d.ts +1 -1
  47. package/dist/types/sdk/accounts/liquidations/LiquidationsService.d.ts +6 -1
  48. package/dist/types/sdk/accounts/liquidations/MultichainLiquidationsService.d.ts +11 -6
  49. package/dist/types/sdk/accounts/liquidations/constants.d.ts +6 -0
  50. package/dist/types/sdk/accounts/liquidations/helpers.d.ts +73 -2
  51. package/dist/types/sdk/accounts/liquidations/index.d.ts +1 -1
  52. package/dist/types/sdk/accounts/liquidations/types.d.ts +142 -30
  53. package/package.json +9 -9
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var iMidasGatewayV311_exports = {};
20
+ __export(iMidasGatewayV311_exports, {
21
+ iMidasGatewayV311Abi: () => iMidasGatewayV311Abi
22
+ });
23
+ module.exports = __toCommonJS(iMidasGatewayV311_exports);
24
+ const iMidasGatewayV311Abi = [
25
+ {
26
+ type: "function",
27
+ name: "accessControl",
28
+ inputs: [],
29
+ outputs: [{ name: "", type: "address", internalType: "address" }],
30
+ stateMutability: "view"
31
+ },
32
+ {
33
+ type: "function",
34
+ name: "contractType",
35
+ inputs: [],
36
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
37
+ stateMutability: "view"
38
+ },
39
+ {
40
+ type: "function",
41
+ name: "depositInstant",
42
+ inputs: [
43
+ { name: "amountToken", type: "uint256", internalType: "uint256" },
44
+ { name: "minReceiveAmount", type: "uint256", internalType: "uint256" },
45
+ { name: "referrerId", type: "bytes32", internalType: "bytes32" }
46
+ ],
47
+ outputs: [],
48
+ stateMutability: "nonpayable"
49
+ },
50
+ {
51
+ type: "function",
52
+ name: "isEligibleAccountOwner",
53
+ inputs: [{ name: "account", type: "address", internalType: "address" }],
54
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
55
+ stateMutability: "view"
56
+ },
57
+ {
58
+ type: "function",
59
+ name: "mToken",
60
+ inputs: [],
61
+ outputs: [{ name: "", type: "address", internalType: "address" }],
62
+ stateMutability: "view"
63
+ },
64
+ {
65
+ type: "function",
66
+ name: "mode",
67
+ inputs: [],
68
+ outputs: [{ name: "", type: "uint8", internalType: "enum MidasMode" }],
69
+ stateMutability: "view"
70
+ },
71
+ {
72
+ type: "function",
73
+ name: "pendingAndClaimableTokenOutAmounts",
74
+ inputs: [{ name: "account", type: "address", internalType: "address" }],
75
+ outputs: [
76
+ { name: "pendingAmount", type: "uint256", internalType: "uint256" },
77
+ { name: "claimableAmount", type: "uint256", internalType: "uint256" }
78
+ ],
79
+ stateMutability: "view"
80
+ },
81
+ {
82
+ type: "function",
83
+ name: "pendingRedeemers",
84
+ inputs: [{ name: "account", type: "address", internalType: "address" }],
85
+ outputs: [
86
+ { name: "redeemers", type: "address[]", internalType: "address[]" }
87
+ ],
88
+ stateMutability: "view"
89
+ },
90
+ {
91
+ type: "function",
92
+ name: "phantomToken",
93
+ inputs: [],
94
+ outputs: [{ name: "", type: "address", internalType: "address" }],
95
+ stateMutability: "view"
96
+ },
97
+ {
98
+ type: "function",
99
+ name: "quoteToken",
100
+ inputs: [],
101
+ outputs: [{ name: "", type: "address", internalType: "address" }],
102
+ stateMutability: "view"
103
+ },
104
+ {
105
+ type: "function",
106
+ name: "redeemInstant",
107
+ inputs: [
108
+ { name: "amountMTokenIn", type: "uint256", internalType: "uint256" },
109
+ { name: "minReceiveAmount", type: "uint256", internalType: "uint256" }
110
+ ],
111
+ outputs: [],
112
+ stateMutability: "nonpayable"
113
+ },
114
+ {
115
+ type: "function",
116
+ name: "redemptionLogger",
117
+ inputs: [],
118
+ outputs: [{ name: "", type: "address", internalType: "address" }],
119
+ stateMutability: "view"
120
+ },
121
+ {
122
+ type: "function",
123
+ name: "requestRedeem",
124
+ inputs: [
125
+ { name: "amountMTokenIn", type: "uint256", internalType: "uint256" },
126
+ { name: "extraData", type: "bytes", internalType: "bytes" }
127
+ ],
128
+ outputs: [],
129
+ stateMutability: "nonpayable"
130
+ },
131
+ {
132
+ type: "function",
133
+ name: "transferMaster",
134
+ inputs: [],
135
+ outputs: [{ name: "", type: "address", internalType: "address" }],
136
+ stateMutability: "view"
137
+ },
138
+ {
139
+ type: "function",
140
+ name: "transferRedeemer",
141
+ inputs: [
142
+ { name: "redeemer", type: "address", internalType: "address" },
143
+ { name: "newAccount", type: "address", internalType: "address" }
144
+ ],
145
+ outputs: [],
146
+ stateMutability: "nonpayable"
147
+ },
148
+ {
149
+ type: "function",
150
+ name: "version",
151
+ inputs: [],
152
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
153
+ stateMutability: "view"
154
+ },
155
+ {
156
+ type: "function",
157
+ name: "withdraw",
158
+ inputs: [{ name: "amount", type: "uint256", internalType: "uint256" }],
159
+ outputs: [],
160
+ stateMutability: "nonpayable"
161
+ },
162
+ {
163
+ type: "function",
164
+ name: "withdrawFromRedeemer",
165
+ inputs: [
166
+ { name: "redeemer", type: "address", internalType: "address" },
167
+ { name: "amount", type: "uint256", internalType: "uint256" }
168
+ ],
169
+ outputs: [],
170
+ stateMutability: "nonpayable"
171
+ },
172
+ { type: "error", name: "AccessControlNotSetException", inputs: [] },
173
+ {
174
+ type: "error",
175
+ name: "ArbitraryCAAllowedInPermissionedModeException",
176
+ inputs: []
177
+ },
178
+ { type: "error", name: "CreditAccountNotEligibleException", inputs: [] },
179
+ { type: "error", name: "IncompatibleAccessControlsException", inputs: [] },
180
+ {
181
+ type: "error",
182
+ name: "IncompatibleIssuanceAndRedemptionVaultsException",
183
+ inputs: []
184
+ },
185
+ { type: "error", name: "InsufficientBalanceException", inputs: [] },
186
+ { type: "error", name: "MaxPendingRedeemersPerAccountException", inputs: [] },
187
+ { type: "error", name: "NewAccountNotGreenlistedException", inputs: [] },
188
+ { type: "error", name: "RedeemerNotOwnedByAccountException", inputs: [] },
189
+ { type: "error", name: "RedeemerTransferNotAllowedException", inputs: [] }
190
+ ];
191
+ // Annotate the CommonJS export names for ESM import in node:
192
+ 0 && (module.exports = {
193
+ iMidasGatewayV311Abi
194
+ });
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
+ var midas_exports = {};
17
+ module.exports = __toCommonJS(midas_exports);
18
+ __reExport(midas_exports, require("./iMidasGatewayV311.js"), module.exports);
19
+ // Annotate the CommonJS export names for ESM import in node:
20
+ 0 && (module.exports = {
21
+ ...require("./iMidasGatewayV311.js")
22
+ });
@@ -26,7 +26,11 @@ const iSecuritizeRedemptionGatewayV311Abi = [
26
26
  type: "function",
27
27
  name: "claim",
28
28
  inputs: [
29
- { name: "redeemers", type: "address[]", internalType: "address[]" }
29
+ {
30
+ name: "redeemers",
31
+ type: "address[]",
32
+ internalType: "address[]"
33
+ }
30
34
  ],
31
35
  outputs: [],
32
36
  stateMutability: "nonpayable"
@@ -35,57 +39,157 @@ const iSecuritizeRedemptionGatewayV311Abi = [
35
39
  type: "function",
36
40
  name: "contractType",
37
41
  inputs: [],
38
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
42
+ outputs: [
43
+ {
44
+ name: "",
45
+ type: "bytes32",
46
+ internalType: "bytes32"
47
+ }
48
+ ],
39
49
  stateMutability: "view"
40
50
  },
41
51
  {
42
52
  type: "function",
43
53
  name: "dsToken",
44
54
  inputs: [],
45
- outputs: [{ name: "", type: "address", internalType: "address" }],
55
+ outputs: [
56
+ {
57
+ name: "",
58
+ type: "address",
59
+ internalType: "address"
60
+ }
61
+ ],
46
62
  stateMutability: "view"
47
63
  },
48
64
  {
49
65
  type: "function",
50
66
  name: "getRedeemers",
51
- inputs: [{ name: "account", type: "address", internalType: "address" }],
52
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
67
+ inputs: [
68
+ {
69
+ name: "account",
70
+ type: "address",
71
+ internalType: "address"
72
+ }
73
+ ],
74
+ outputs: [
75
+ {
76
+ name: "",
77
+ type: "address[]",
78
+ internalType: "address[]"
79
+ }
80
+ ],
53
81
  stateMutability: "view"
54
82
  },
55
83
  {
56
84
  type: "function",
57
85
  name: "getRedemptionAmount",
58
- inputs: [{ name: "account", type: "address", internalType: "address" }],
59
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
86
+ inputs: [
87
+ {
88
+ name: "account",
89
+ type: "address",
90
+ internalType: "address"
91
+ }
92
+ ],
93
+ outputs: [
94
+ {
95
+ name: "",
96
+ type: "uint256",
97
+ internalType: "uint256"
98
+ }
99
+ ],
60
100
  stateMutability: "view"
61
101
  },
62
102
  {
63
103
  type: "function",
64
104
  name: "getUnclaimedRedeemers",
65
- inputs: [{ name: "account", type: "address", internalType: "address" }],
66
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
105
+ inputs: [
106
+ {
107
+ name: "account",
108
+ type: "address",
109
+ internalType: "address"
110
+ }
111
+ ],
112
+ outputs: [
113
+ {
114
+ name: "",
115
+ type: "address[]",
116
+ internalType: "address[]"
117
+ }
118
+ ],
119
+ stateMutability: "view"
120
+ },
121
+ {
122
+ type: "function",
123
+ name: "isEligibleAccountOwner",
124
+ inputs: [
125
+ {
126
+ name: "account",
127
+ type: "address",
128
+ internalType: "address"
129
+ }
130
+ ],
131
+ outputs: [
132
+ {
133
+ name: "",
134
+ type: "bool",
135
+ internalType: "bool"
136
+ }
137
+ ],
67
138
  stateMutability: "view"
68
139
  },
69
140
  {
70
141
  type: "function",
71
142
  name: "masterRedeemer",
72
143
  inputs: [],
73
- outputs: [{ name: "", type: "address", internalType: "address" }],
144
+ outputs: [
145
+ {
146
+ name: "",
147
+ type: "address",
148
+ internalType: "address"
149
+ }
150
+ ],
74
151
  stateMutability: "view"
75
152
  },
76
153
  {
77
154
  type: "function",
78
155
  name: "navProvider",
79
156
  inputs: [],
80
- outputs: [{ name: "", type: "address", internalType: "address" }],
157
+ outputs: [
158
+ {
159
+ name: "",
160
+ type: "address",
161
+ internalType: "address"
162
+ }
163
+ ],
164
+ stateMutability: "view"
165
+ },
166
+ {
167
+ type: "function",
168
+ name: "phantomToken",
169
+ inputs: [],
170
+ outputs: [
171
+ {
172
+ name: "",
173
+ type: "address",
174
+ internalType: "address"
175
+ }
176
+ ],
81
177
  stateMutability: "view"
82
178
  },
83
179
  {
84
180
  type: "function",
85
181
  name: "redeem",
86
182
  inputs: [
87
- { name: "dsTokenAmount", type: "uint256", internalType: "uint256" },
88
- { name: "extraData", type: "bytes", internalType: "bytes" }
183
+ {
184
+ name: "dsTokenAmount",
185
+ type: "uint256",
186
+ internalType: "uint256"
187
+ },
188
+ {
189
+ name: "extraData",
190
+ type: "bytes",
191
+ internalType: "bytes"
192
+ }
89
193
  ],
90
194
  outputs: [],
91
195
  stateMutability: "nonpayable"
@@ -94,43 +198,81 @@ const iSecuritizeRedemptionGatewayV311Abi = [
94
198
  type: "function",
95
199
  name: "redemptionAccount",
96
200
  inputs: [],
97
- outputs: [{ name: "", type: "address", internalType: "address" }],
201
+ outputs: [
202
+ {
203
+ name: "",
204
+ type: "address",
205
+ internalType: "address"
206
+ }
207
+ ],
98
208
  stateMutability: "view"
99
209
  },
100
210
  {
101
211
  type: "function",
102
212
  name: "redemptionLogger",
103
213
  inputs: [],
104
- outputs: [{ name: "", type: "address", internalType: "address" }],
214
+ outputs: [
215
+ {
216
+ name: "",
217
+ type: "address",
218
+ internalType: "address"
219
+ }
220
+ ],
105
221
  stateMutability: "view"
106
222
  },
107
223
  {
108
224
  type: "function",
109
225
  name: "securitizeWhitelister",
110
226
  inputs: [],
111
- outputs: [{ name: "", type: "address", internalType: "address" }],
227
+ outputs: [
228
+ {
229
+ name: "",
230
+ type: "address",
231
+ internalType: "address"
232
+ }
233
+ ],
112
234
  stateMutability: "view"
113
235
  },
114
236
  {
115
237
  type: "function",
116
238
  name: "stableCoinToken",
117
239
  inputs: [],
118
- outputs: [{ name: "", type: "address", internalType: "address" }],
240
+ outputs: [
241
+ {
242
+ name: "",
243
+ type: "address",
244
+ internalType: "address"
245
+ }
246
+ ],
119
247
  stateMutability: "view"
120
248
  },
121
249
  {
122
250
  type: "function",
123
251
  name: "transferMaster",
124
252
  inputs: [],
125
- outputs: [{ name: "", type: "address", internalType: "address" }],
253
+ outputs: [
254
+ {
255
+ name: "",
256
+ type: "address",
257
+ internalType: "address"
258
+ }
259
+ ],
126
260
  stateMutability: "view"
127
261
  },
128
262
  {
129
263
  type: "function",
130
264
  name: "transferRedeemer",
131
265
  inputs: [
132
- { name: "redeemer", type: "address", internalType: "address" },
133
- { name: "newAccount", type: "address", internalType: "address" }
266
+ {
267
+ name: "redeemer",
268
+ type: "address",
269
+ internalType: "address"
270
+ },
271
+ {
272
+ name: "newAccount",
273
+ type: "address",
274
+ internalType: "address"
275
+ }
134
276
  ],
135
277
  outputs: [],
136
278
  stateMutability: "nonpayable"
@@ -139,7 +281,13 @@ const iSecuritizeRedemptionGatewayV311Abi = [
139
281
  type: "function",
140
282
  name: "version",
141
283
  inputs: [],
142
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
284
+ outputs: [
285
+ {
286
+ name: "",
287
+ type: "uint256",
288
+ internalType: "uint256"
289
+ }
290
+ ],
143
291
  stateMutability: "view"
144
292
  },
145
293
  {
@@ -147,9 +295,21 @@ const iSecuritizeRedemptionGatewayV311Abi = [
147
295
  name: "MaxUnclaimedRedeemersPerAccountException",
148
296
  inputs: []
149
297
  },
150
- { type: "error", name: "NewAccountNotRegisteredException", inputs: [] },
151
- { type: "error", name: "RedeemerNotOwnedByAccountException", inputs: [] },
152
- { type: "error", name: "RedeemerTransferNotAllowedException", inputs: [] }
298
+ {
299
+ type: "error",
300
+ name: "NewAccountNotRegisteredException",
301
+ inputs: []
302
+ },
303
+ {
304
+ type: "error",
305
+ name: "RedeemerNotOwnedByAccountException",
306
+ inputs: []
307
+ },
308
+ {
309
+ type: "error",
310
+ name: "RedeemerTransferNotAllowedException",
311
+ inputs: []
312
+ }
153
313
  ];
154
314
  // Annotate the CommonJS export names for ESM import in node:
155
315
  0 && (module.exports = {
@@ -24,9 +24,10 @@ module.exports = __toCommonJS(MidasGatewayAdapterContract_exports);
24
24
  var import_viem = require("viem");
25
25
  var import_sdk = require("../../../sdk/index.js");
26
26
  var import_adapters = require("../abi/adapters/index.js");
27
+ var import_abi = require("../abi/index.js");
27
28
  var import_AbstractAdapter = require("./AbstractAdapter.js");
28
29
  const abi = import_adapters.iMidasGatewayAdapterV311Abi;
29
- const protocolAbi = import_adapters.iMidasGatewayV311Abi;
30
+ const protocolAbi = import_abi.iMidasGatewayV311Abi;
30
31
  class MidasGatewayAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
31
32
  #gateway;
32
33
  #mToken;