@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,261 @@
1
+ export declare const iMidasGatewayV311Abi: readonly [{
2
+ readonly type: "function";
3
+ readonly name: "accessControl";
4
+ readonly inputs: readonly [];
5
+ readonly outputs: readonly [{
6
+ readonly name: "";
7
+ readonly type: "address";
8
+ readonly internalType: "address";
9
+ }];
10
+ readonly stateMutability: "view";
11
+ }, {
12
+ readonly type: "function";
13
+ readonly name: "contractType";
14
+ readonly inputs: readonly [];
15
+ readonly outputs: readonly [{
16
+ readonly name: "";
17
+ readonly type: "bytes32";
18
+ readonly internalType: "bytes32";
19
+ }];
20
+ readonly stateMutability: "view";
21
+ }, {
22
+ readonly type: "function";
23
+ readonly name: "depositInstant";
24
+ readonly inputs: readonly [{
25
+ readonly name: "amountToken";
26
+ readonly type: "uint256";
27
+ readonly internalType: "uint256";
28
+ }, {
29
+ readonly name: "minReceiveAmount";
30
+ readonly type: "uint256";
31
+ readonly internalType: "uint256";
32
+ }, {
33
+ readonly name: "referrerId";
34
+ readonly type: "bytes32";
35
+ readonly internalType: "bytes32";
36
+ }];
37
+ readonly outputs: readonly [];
38
+ readonly stateMutability: "nonpayable";
39
+ }, {
40
+ readonly type: "function";
41
+ readonly name: "isEligibleAccountOwner";
42
+ readonly inputs: readonly [{
43
+ readonly name: "account";
44
+ readonly type: "address";
45
+ readonly internalType: "address";
46
+ }];
47
+ readonly outputs: readonly [{
48
+ readonly name: "";
49
+ readonly type: "bool";
50
+ readonly internalType: "bool";
51
+ }];
52
+ readonly stateMutability: "view";
53
+ }, {
54
+ readonly type: "function";
55
+ readonly name: "mToken";
56
+ readonly inputs: readonly [];
57
+ readonly outputs: readonly [{
58
+ readonly name: "";
59
+ readonly type: "address";
60
+ readonly internalType: "address";
61
+ }];
62
+ readonly stateMutability: "view";
63
+ }, {
64
+ readonly type: "function";
65
+ readonly name: "mode";
66
+ readonly inputs: readonly [];
67
+ readonly outputs: readonly [{
68
+ readonly name: "";
69
+ readonly type: "uint8";
70
+ readonly internalType: "enum MidasMode";
71
+ }];
72
+ readonly stateMutability: "view";
73
+ }, {
74
+ readonly type: "function";
75
+ readonly name: "pendingAndClaimableTokenOutAmounts";
76
+ readonly inputs: readonly [{
77
+ readonly name: "account";
78
+ readonly type: "address";
79
+ readonly internalType: "address";
80
+ }];
81
+ readonly outputs: readonly [{
82
+ readonly name: "pendingAmount";
83
+ readonly type: "uint256";
84
+ readonly internalType: "uint256";
85
+ }, {
86
+ readonly name: "claimableAmount";
87
+ readonly type: "uint256";
88
+ readonly internalType: "uint256";
89
+ }];
90
+ readonly stateMutability: "view";
91
+ }, {
92
+ readonly type: "function";
93
+ readonly name: "pendingRedeemers";
94
+ readonly inputs: readonly [{
95
+ readonly name: "account";
96
+ readonly type: "address";
97
+ readonly internalType: "address";
98
+ }];
99
+ readonly outputs: readonly [{
100
+ readonly name: "redeemers";
101
+ readonly type: "address[]";
102
+ readonly internalType: "address[]";
103
+ }];
104
+ readonly stateMutability: "view";
105
+ }, {
106
+ readonly type: "function";
107
+ readonly name: "phantomToken";
108
+ readonly inputs: readonly [];
109
+ readonly outputs: readonly [{
110
+ readonly name: "";
111
+ readonly type: "address";
112
+ readonly internalType: "address";
113
+ }];
114
+ readonly stateMutability: "view";
115
+ }, {
116
+ readonly type: "function";
117
+ readonly name: "quoteToken";
118
+ readonly inputs: readonly [];
119
+ readonly outputs: readonly [{
120
+ readonly name: "";
121
+ readonly type: "address";
122
+ readonly internalType: "address";
123
+ }];
124
+ readonly stateMutability: "view";
125
+ }, {
126
+ readonly type: "function";
127
+ readonly name: "redeemInstant";
128
+ readonly inputs: readonly [{
129
+ readonly name: "amountMTokenIn";
130
+ readonly type: "uint256";
131
+ readonly internalType: "uint256";
132
+ }, {
133
+ readonly name: "minReceiveAmount";
134
+ readonly type: "uint256";
135
+ readonly internalType: "uint256";
136
+ }];
137
+ readonly outputs: readonly [];
138
+ readonly stateMutability: "nonpayable";
139
+ }, {
140
+ readonly type: "function";
141
+ readonly name: "redemptionLogger";
142
+ readonly inputs: readonly [];
143
+ readonly outputs: readonly [{
144
+ readonly name: "";
145
+ readonly type: "address";
146
+ readonly internalType: "address";
147
+ }];
148
+ readonly stateMutability: "view";
149
+ }, {
150
+ readonly type: "function";
151
+ readonly name: "requestRedeem";
152
+ readonly inputs: readonly [{
153
+ readonly name: "amountMTokenIn";
154
+ readonly type: "uint256";
155
+ readonly internalType: "uint256";
156
+ }, {
157
+ readonly name: "extraData";
158
+ readonly type: "bytes";
159
+ readonly internalType: "bytes";
160
+ }];
161
+ readonly outputs: readonly [];
162
+ readonly stateMutability: "nonpayable";
163
+ }, {
164
+ readonly type: "function";
165
+ readonly name: "transferMaster";
166
+ readonly inputs: readonly [];
167
+ readonly outputs: readonly [{
168
+ readonly name: "";
169
+ readonly type: "address";
170
+ readonly internalType: "address";
171
+ }];
172
+ readonly stateMutability: "view";
173
+ }, {
174
+ readonly type: "function";
175
+ readonly name: "transferRedeemer";
176
+ readonly inputs: readonly [{
177
+ readonly name: "redeemer";
178
+ readonly type: "address";
179
+ readonly internalType: "address";
180
+ }, {
181
+ readonly name: "newAccount";
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: "version";
190
+ readonly inputs: readonly [];
191
+ readonly outputs: readonly [{
192
+ readonly name: "";
193
+ readonly type: "uint256";
194
+ readonly internalType: "uint256";
195
+ }];
196
+ readonly stateMutability: "view";
197
+ }, {
198
+ readonly type: "function";
199
+ readonly name: "withdraw";
200
+ readonly inputs: readonly [{
201
+ readonly name: "amount";
202
+ readonly type: "uint256";
203
+ readonly internalType: "uint256";
204
+ }];
205
+ readonly outputs: readonly [];
206
+ readonly stateMutability: "nonpayable";
207
+ }, {
208
+ readonly type: "function";
209
+ readonly name: "withdrawFromRedeemer";
210
+ readonly inputs: readonly [{
211
+ readonly name: "redeemer";
212
+ readonly type: "address";
213
+ readonly internalType: "address";
214
+ }, {
215
+ readonly name: "amount";
216
+ readonly type: "uint256";
217
+ readonly internalType: "uint256";
218
+ }];
219
+ readonly outputs: readonly [];
220
+ readonly stateMutability: "nonpayable";
221
+ }, {
222
+ readonly type: "error";
223
+ readonly name: "AccessControlNotSetException";
224
+ readonly inputs: readonly [];
225
+ }, {
226
+ readonly type: "error";
227
+ readonly name: "ArbitraryCAAllowedInPermissionedModeException";
228
+ readonly inputs: readonly [];
229
+ }, {
230
+ readonly type: "error";
231
+ readonly name: "CreditAccountNotEligibleException";
232
+ readonly inputs: readonly [];
233
+ }, {
234
+ readonly type: "error";
235
+ readonly name: "IncompatibleAccessControlsException";
236
+ readonly inputs: readonly [];
237
+ }, {
238
+ readonly type: "error";
239
+ readonly name: "IncompatibleIssuanceAndRedemptionVaultsException";
240
+ readonly inputs: readonly [];
241
+ }, {
242
+ readonly type: "error";
243
+ readonly name: "InsufficientBalanceException";
244
+ readonly inputs: readonly [];
245
+ }, {
246
+ readonly type: "error";
247
+ readonly name: "MaxPendingRedeemersPerAccountException";
248
+ readonly inputs: readonly [];
249
+ }, {
250
+ readonly type: "error";
251
+ readonly name: "NewAccountNotGreenlistedException";
252
+ readonly inputs: readonly [];
253
+ }, {
254
+ readonly type: "error";
255
+ readonly name: "RedeemerNotOwnedByAccountException";
256
+ readonly inputs: readonly [];
257
+ }, {
258
+ readonly type: "error";
259
+ readonly name: "RedeemerTransferNotAllowedException";
260
+ readonly inputs: readonly [];
261
+ }];
@@ -0,0 +1 @@
1
+ export * from "./iMidasGatewayV311.js";
@@ -70,6 +70,20 @@ export declare const iSecuritizeRedemptionGatewayV311Abi: readonly [{
70
70
  readonly internalType: "address[]";
71
71
  }];
72
72
  readonly stateMutability: "view";
73
+ }, {
74
+ readonly type: "function";
75
+ readonly name: "isEligibleAccountOwner";
76
+ readonly inputs: readonly [{
77
+ readonly name: "account";
78
+ readonly type: "address";
79
+ readonly internalType: "address";
80
+ }];
81
+ readonly outputs: readonly [{
82
+ readonly name: "";
83
+ readonly type: "bool";
84
+ readonly internalType: "bool";
85
+ }];
86
+ readonly stateMutability: "view";
73
87
  }, {
74
88
  readonly type: "function";
75
89
  readonly name: "masterRedeemer";
@@ -90,6 +104,16 @@ export declare const iSecuritizeRedemptionGatewayV311Abi: readonly [{
90
104
  readonly internalType: "address";
91
105
  }];
92
106
  readonly stateMutability: "view";
107
+ }, {
108
+ readonly type: "function";
109
+ readonly name: "phantomToken";
110
+ readonly inputs: readonly [];
111
+ readonly outputs: readonly [{
112
+ readonly name: "";
113
+ readonly type: "address";
114
+ readonly internalType: "address";
115
+ }];
116
+ readonly stateMutability: "view";
93
117
  }, {
94
118
  readonly type: "function";
95
119
  readonly name: "redeem";
@@ -377,6 +377,20 @@ declare const protocolAbi: readonly [{
377
377
  }];
378
378
  readonly outputs: readonly [];
379
379
  readonly stateMutability: "nonpayable";
380
+ }, {
381
+ readonly type: "function";
382
+ readonly name: "isEligibleAccountOwner";
383
+ readonly inputs: readonly [{
384
+ readonly name: "account";
385
+ readonly type: "address";
386
+ readonly internalType: "address";
387
+ }];
388
+ readonly outputs: readonly [{
389
+ readonly name: "";
390
+ readonly type: "bool";
391
+ readonly internalType: "bool";
392
+ }];
393
+ readonly stateMutability: "view";
380
394
  }, {
381
395
  readonly type: "function";
382
396
  readonly name: "mToken";
@@ -387,6 +401,16 @@ declare const protocolAbi: readonly [{
387
401
  readonly internalType: "address";
388
402
  }];
389
403
  readonly stateMutability: "view";
404
+ }, {
405
+ readonly type: "function";
406
+ readonly name: "mode";
407
+ readonly inputs: readonly [];
408
+ readonly outputs: readonly [{
409
+ readonly name: "";
410
+ readonly type: "uint8";
411
+ readonly internalType: "enum MidasMode";
412
+ }];
413
+ readonly stateMutability: "view";
390
414
  }, {
391
415
  readonly type: "function";
392
416
  readonly name: "pendingAndClaimableTokenOutAmounts";
@@ -539,6 +563,10 @@ declare const protocolAbi: readonly [{
539
563
  readonly type: "error";
540
564
  readonly name: "AccessControlNotSetException";
541
565
  readonly inputs: readonly [];
566
+ }, {
567
+ readonly type: "error";
568
+ readonly name: "ArbitraryCAAllowedInPermissionedModeException";
569
+ readonly inputs: readonly [];
542
570
  }, {
543
571
  readonly type: "error";
544
572
  readonly name: "CreditAccountNotEligibleException";
@@ -327,6 +327,20 @@ declare const protocolAbi: readonly [{
327
327
  readonly internalType: "address[]";
328
328
  }];
329
329
  readonly stateMutability: "view";
330
+ }, {
331
+ readonly type: "function";
332
+ readonly name: "isEligibleAccountOwner";
333
+ readonly inputs: readonly [{
334
+ readonly name: "account";
335
+ readonly type: "address";
336
+ readonly internalType: "address";
337
+ }];
338
+ readonly outputs: readonly [{
339
+ readonly name: "";
340
+ readonly type: "bool";
341
+ readonly internalType: "bool";
342
+ }];
343
+ readonly stateMutability: "view";
330
344
  }, {
331
345
  readonly type: "function";
332
346
  readonly name: "masterRedeemer";
@@ -347,6 +361,16 @@ declare const protocolAbi: readonly [{
347
361
  readonly internalType: "address";
348
362
  }];
349
363
  readonly stateMutability: "view";
364
+ }, {
365
+ readonly type: "function";
366
+ readonly name: "phantomToken";
367
+ readonly inputs: readonly [];
368
+ readonly outputs: readonly [{
369
+ readonly name: "";
370
+ readonly type: "address";
371
+ readonly internalType: "address";
372
+ }];
373
+ readonly stateMutability: "view";
350
374
  }, {
351
375
  readonly type: "function";
352
376
  readonly name: "redeem";
@@ -40,7 +40,7 @@ export declare class MerkleXYZApi {
40
40
  static defaultDomain: string;
41
41
  static angleDomain: string;
42
42
  static apiKeyHeader: string;
43
- static fetchWithFallback: <T>(getUrl: (domain: string) => string, apiKey?: string) => Promise<import("axios").AxiosResponse<T, any, {}>>;
43
+ static fetchWithFallback: <T>(getUrl: (domain: string) => string, apiKey?: string) => Promise<import("axios").AxiosResponse<T, any, {}, any>>;
44
44
  static getUserRewardsUrl: (options: UserOptions) => (domain: string) => string;
45
45
  }
46
46
  export {};
@@ -107,7 +107,7 @@ export declare class MultichainSDK<const Plugins extends PluginsMap = {}> {
107
107
  * Namespace for liquidatable credit accounts discovery across all
108
108
  * configured chains.
109
109
  */
110
- readonly liquidations: ILiquidationsService;
110
+ readonly liquidations: ILiquidationsService<true>;
111
111
  constructor(options: MultichainSDKOptions<Plugins>);
112
112
  /**
113
113
  * Attach all configured chains in parallel.
@@ -1,5 +1,6 @@
1
1
  import { SDKConstruct } from "../../base/index.js";
2
- import type { GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidatorWithdrawalsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails, LiquidatorWithdrawal } from "./types.js";
2
+ import type { RawTx } from "../../types/index.js";
3
+ import type { BuildLiquidationTxProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidatorWithdrawalsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails, LiquidatorWithdrawal } from "./types.js";
3
4
  /**
4
5
  * Per-chain implementation of {@link ILiquidationsService}.
5
6
  *
@@ -17,6 +18,10 @@ export declare class LiquidationsService extends SDKConstruct implements ILiquid
17
18
  * {@inheritDoc ILiquidationsService.getLiquidationDetails}
18
19
  **/
19
20
  getLiquidationDetails(props: GetLiquidationDetailsProps): Promise<LiquidationDetails>;
21
+ /**
22
+ * {@inheritDoc ILiquidationsService.buildLiquidationTx}
23
+ **/
24
+ buildLiquidationTx(props: BuildLiquidationTxProps): Promise<RawTx>;
20
25
  /**
21
26
  * {@inheritDoc ILiquidationsService.getLiquidatorWithdrawals}
22
27
  **/
@@ -1,27 +1,32 @@
1
1
  import type { MultichainSDK } from "../../MultichainSDK.js";
2
2
  import type { PluginsMap } from "../../plugins/index.js";
3
- import type { GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidatorWithdrawalsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails, LiquidatorWithdrawal } from "./types.js";
3
+ import type { RawTx } from "../../types/index.js";
4
+ import type { BuildLiquidationTxProps, GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidatorWithdrawalsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails, LiquidatorWithdrawal } from "./types.js";
4
5
  /**
5
6
  * Cross-chain implementation of {@link ILiquidationsService}.
6
7
  *
7
8
  * Aggregates liquidatable accounts over all chains configured in
8
9
  * {@link MultichainSDK} (optionally restricted via
9
- * {@link GetLiquidatableAccountsProps.networks}). A failed chain is logged as
10
+ * {@link MultichainNetworksProps.networks}). A failed chain is logged as
10
11
  * a warning and skipped, so one dead RPC does not empty the whole list.
11
12
  **/
12
- export declare class MultichainLiquidationsService<const Plugins extends PluginsMap = {}> implements ILiquidationsService {
13
+ export declare class MultichainLiquidationsService<const Plugins extends PluginsMap = {}> implements ILiquidationsService<true> {
13
14
  #private;
14
15
  constructor(sdk: MultichainSDK<Plugins>);
15
16
  /**
16
17
  * {@inheritDoc ILiquidationsService.getLiquidatableAccounts}
17
18
  **/
18
- getLiquidatableAccounts(props?: GetLiquidatableAccountsProps): Promise<LiquidatableAccount[]>;
19
+ getLiquidatableAccounts(props?: GetLiquidatableAccountsProps<true>): Promise<LiquidatableAccount[]>;
19
20
  /**
20
21
  * {@inheritDoc ILiquidationsService.getLiquidationDetails}
21
22
  **/
22
- getLiquidationDetails(props: GetLiquidationDetailsProps): Promise<LiquidationDetails>;
23
+ getLiquidationDetails(props: GetLiquidationDetailsProps<true>): Promise<LiquidationDetails>;
24
+ /**
25
+ * {@inheritDoc ILiquidationsService.buildLiquidationTx}
26
+ **/
27
+ buildLiquidationTx(props: BuildLiquidationTxProps<true>): Promise<RawTx>;
23
28
  /**
24
29
  * {@inheritDoc ILiquidationsService.getLiquidatorWithdrawals}
25
30
  **/
26
- getLiquidatorWithdrawals(props: GetLiquidatorWithdrawalsProps): Promise<LiquidatorWithdrawal[]>;
31
+ getLiquidatorWithdrawals(props: GetLiquidatorWithdrawalsProps<true>): Promise<LiquidatorWithdrawal[]>;
27
32
  }
@@ -0,0 +1,6 @@
1
+ import type { Address } from "viem";
2
+ /**
3
+ * TODO: the contract is not deployed yet, replace with the real address
4
+ * (per-network lookup if it ends up being deployed on several chains).
5
+ **/
6
+ export declare const LIQUIDATION_COMPRESSOR_V313_ADDRESS: Address;
@@ -1,8 +1,22 @@
1
- import type { Address } from "viem";
1
+ import type { Address, ContractFunctionReturnType } from "viem";
2
+ import type { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
2
3
  import type { CreditAccountData } from "../../base/index.js";
3
4
  import type { NetworkType } from "../../chain/index.js";
5
+ import type { RawTx } from "../../types/index.js";
4
6
  import type { CurrentWithdrawals } from "../withdrawal-compressor/index.js";
5
- import type { LiquidatorWithdrawal } from "./types.js";
7
+ import type { LiquidationApproval, LiquidatorWithdrawal, ReceivedAsset } from "./types.js";
8
+ /**
9
+ * Raw `LiquidationData` returned by `LiquidationCompressor.getLiquidationData`.
10
+ **/
11
+ export type OnchainLiquidationData = ContractFunctionReturnType<typeof iLiquidationCompressorV313Abi, "nonpayable", "getLiquidationData">;
12
+ /**
13
+ * Single element of {@link OnchainLiquidationData.expectedOutputs}.
14
+ **/
15
+ export type OnchainLiquidationOutput = OnchainLiquidationData["expectedOutputs"][number];
16
+ /**
17
+ * Single call built by the liquidation compressor.
18
+ **/
19
+ export type OnchainLiquidationCall = OnchainLiquidationData["liquidationCall"];
6
20
  /**
7
21
  * Token balances at or below this threshold are treated as dust and ignored,
8
22
  * consistent with the rest of the SDK (see `filterDust`).
@@ -44,3 +58,60 @@ export declare function pickMainAsset(ca: CreditAccountData, convert: (token: Ad
44
58
  * @param network - Network the withdrawals live on
45
59
  **/
46
60
  export declare function toLiquidatorWithdrawals(current: CurrentWithdrawals, network: NetworkType): LiquidatorWithdrawal[];
61
+ /**
62
+ * Normalizes the liquidation compressor outputs into assets the liquidator
63
+ * receives. Zero `redeemerAddress` and `claimableAt` (used by the contracts
64
+ * for "not applicable") become `undefined`.
65
+ *
66
+ * @param outputs - `expectedOutputs` of the compressor's liquidation data
67
+ **/
68
+ export declare function toReceivedAssets(outputs: readonly OnchainLiquidationOutput[]): ReceivedAsset[];
69
+ /**
70
+ * Props for {@link toLiquidationApproval}.
71
+ **/
72
+ export interface ToLiquidationApprovalProps {
73
+ /**
74
+ * Target of the compressor's `liquidationCall`.
75
+ **/
76
+ target: Address;
77
+ /**
78
+ * Credit facade of the liquidated account's credit manager.
79
+ **/
80
+ creditFacade: Address;
81
+ /**
82
+ * Credit manager of the liquidated account.
83
+ **/
84
+ creditManager: Address;
85
+ /**
86
+ * Token the liquidation transaction pulls from the liquidator.
87
+ **/
88
+ token: Address;
89
+ /**
90
+ * Amount of `token` the liquidation transaction pulls.
91
+ **/
92
+ amount: bigint;
93
+ }
94
+ /**
95
+ * Resolves the approval the liquidator must grant for the liquidation call.
96
+ *
97
+ * A call targeting the credit facade is paid by `msg.sender` but transferred by
98
+ * the credit manager, so the latter is the spender. Any other target is a
99
+ * dedicated liquidator contract (Midas / Securitize) that pulls the token to
100
+ * itself and re-approves the credit manager, so it is the spender itself.
101
+ *
102
+ * @param props - See {@link ToLiquidationApprovalProps}
103
+ * @returns The approval, or `undefined` when the call pulls nothing
104
+ **/
105
+ export declare function toLiquidationApproval(props: ToLiquidationApprovalProps): LiquidationApproval | undefined;
106
+ /**
107
+ * Converts the compressor's liquidation call into a raw transaction.
108
+ *
109
+ * The calldata is passed through as-is: depending on the liquidated assets,
110
+ * the target is either the credit facade or a dedicated liquidator contract
111
+ * (with its own function signature), so it cannot be re-encoded from a single
112
+ * known ABI.
113
+ *
114
+ * @param call - `liquidationCall` of the compressor's liquidation data
115
+ * @param description - Optional human-readable description
116
+ **/
117
+ export declare function liquidationCallToRawTx(call: OnchainLiquidationCall, description?: string): RawTx;
@@ -1,4 +1,4 @@
1
- export * from "./helpers.js";
1
+ export * from "./constants.js";
2
2
  export * from "./LiquidationsService.js";
3
3
  export * from "./MultichainLiquidationsService.js";
4
4
  export * from "./types.js";