@gearbox-protocol/sdk 14.12.0-next.57 → 14.12.0-next.58
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.
- package/dist/cjs/abi/ILiquidationCompressorV313.js +43 -1
- package/dist/cjs/abi/IWithdrawalCompressorV313.js +71 -41
- package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +27 -43
- package/dist/cjs/sdk/accounts/liquidations/constants.js +1 -1
- package/dist/cjs/sdk/accounts/liquidations/helpers.js +4 -2
- package/dist/cjs/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +12 -0
- package/dist/cjs/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +10 -0
- package/dist/cjs/sdk/accounts/withdrawal-compressor/addresses.js +1 -1
- package/dist/esm/abi/ILiquidationCompressorV313.js +43 -1
- package/dist/esm/abi/IWithdrawalCompressorV313.js +71 -41
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +29 -45
- package/dist/esm/sdk/accounts/liquidations/constants.js +1 -1
- package/dist/esm/sdk/accounts/liquidations/helpers.js +4 -2
- package/dist/esm/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +12 -0
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +10 -0
- package/dist/esm/sdk/accounts/withdrawal-compressor/addresses.js +1 -1
- package/dist/types/abi/ILiquidationCompressorV313.d.ts +36 -1
- package/dist/types/abi/IWithdrawalCompressorV313.d.ts +62 -38
- package/dist/types/sdk/accounts/liquidations/helpers.d.ts +8 -1
- package/dist/types/sdk/accounts/liquidations/types.d.ts +27 -5
- package/dist/types/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts +3 -3
- package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.d.ts +62 -38
- package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +10 -0
- package/package.json +1 -1
|
@@ -99,6 +99,11 @@ interface LiquidatableAccount {
|
|
|
99
99
|
* liquidator's ownership instead of instantly receivable tokens.
|
|
100
100
|
**/
|
|
101
101
|
isDelayed: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* `true` when the credit manager's facade is paused. Liquidations of such
|
|
104
|
+
* accounts only succeed for emergency liquidators approved in the market.
|
|
105
|
+
**/
|
|
106
|
+
paused: boolean;
|
|
102
107
|
}
|
|
103
108
|
/**
|
|
104
109
|
* Chain-independent part of {@link GetLiquidationDetailsProps}.
|
|
@@ -213,10 +218,6 @@ type GetLiquidatorWithdrawalsProps<Multichain extends boolean = false> = GetLiqu
|
|
|
213
218
|
type LoadRWALiquidatorsProps<Multichain extends boolean = false> = WithMultichain<Multichain, MultichainNetworksProps>;
|
|
214
219
|
/**
|
|
215
220
|
* A single delayed-withdrawal position owned by the liquidator.
|
|
216
|
-
*
|
|
217
|
-
* The redeemer contract address is not included: it is not part of the
|
|
218
|
-
* on-chain withdrawal structs returned by the withdrawal compressor. It can
|
|
219
|
-
* be surfaced later if the compressor structs are extended.
|
|
220
221
|
**/
|
|
221
222
|
interface LiquidatorWithdrawal {
|
|
222
223
|
/**
|
|
@@ -241,6 +242,11 @@ interface LiquidatorWithdrawal {
|
|
|
241
242
|
* claimable. `undefined` means the withdrawal is claimable now.
|
|
242
243
|
**/
|
|
243
244
|
claimableAt?: bigint;
|
|
245
|
+
/**
|
|
246
|
+
* Redeemer contract the withdrawal is claimed from, owned by the liquidator.
|
|
247
|
+
* `undefined` on compressor versions below 313, which do not report it.
|
|
248
|
+
**/
|
|
249
|
+
redeemer?: Address;
|
|
244
250
|
}
|
|
245
251
|
/**
|
|
246
252
|
* ERC-20 approval the liquidator must grant before sending the liquidation
|
|
@@ -256,7 +262,9 @@ interface LiquidationApproval {
|
|
|
256
262
|
**/
|
|
257
263
|
spender: Address;
|
|
258
264
|
/**
|
|
259
|
-
* Token pulled from the liquidator
|
|
265
|
+
* Token pulled from the liquidator, as reported by the compressor for the
|
|
266
|
+
* liquidation path it selected: the credit manager underlying for standard
|
|
267
|
+
* liquidations, the unwrapped stablecoin (e.g. USDC) for RWA ones.
|
|
260
268
|
**/
|
|
261
269
|
token: Address;
|
|
262
270
|
/**
|
|
@@ -272,6 +280,14 @@ interface LiquidationApproval {
|
|
|
272
280
|
*
|
|
273
281
|
**/
|
|
274
282
|
interface LiquidationDetails extends LiquidatableAccount {
|
|
283
|
+
/**
|
|
284
|
+
* Exact amount the liquidator pays for the liquidation path the compressor
|
|
285
|
+
* selected, superseding the estimate of {@link LiquidatableAccount}. The
|
|
286
|
+
* token is {@link LiquidationApproval.token}, which for RWA markets is the
|
|
287
|
+
* unwrapped stablecoin rather than {@link LiquidatableAccount.totalValue}'s
|
|
288
|
+
* token; it falls back to the latter when nothing is pulled.
|
|
289
|
+
**/
|
|
290
|
+
repaymentAmount: Asset;
|
|
275
291
|
/**
|
|
276
292
|
* Assets the liquidator receives upon full liquidation: direct credit
|
|
277
293
|
* account balances plus outputs of delayed withdrawals (claimable and
|
|
@@ -285,6 +301,12 @@ interface LiquidationDetails extends LiquidatableAccount {
|
|
|
285
301
|
* particular wallet was rejected.
|
|
286
302
|
**/
|
|
287
303
|
isLiquidatorEligible: boolean;
|
|
304
|
+
/**
|
|
305
|
+
* `true` when the credit account is frozen by the RWA factory
|
|
306
|
+
* (`isFrozen`) and cannot move its RWA collateral. Always `false` for
|
|
307
|
+
* non-RWA liquidation paths.
|
|
308
|
+
**/
|
|
309
|
+
isCreditAccountFrozen: boolean;
|
|
288
310
|
/**
|
|
289
311
|
* Name of the KYC protocol the liquidator must be whitelisted in
|
|
290
312
|
* (e.g. `"securitize"`). `undefined` when the liquidation is not KYC-gated.
|
package/dist/types/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ declare const iCreditAccountAbi: readonly [{
|
|
|
18
18
|
}];
|
|
19
19
|
/**
|
|
20
20
|
* v313 ABI is a type-level superset of v310/v311 for the read methods used
|
|
21
|
-
* here. Fields missing in older versions (`maxWithdrawals`, `
|
|
22
|
-
* required in the inferred types but absent at runtime on
|
|
23
|
-
* normalization helpers must not assume their presence.
|
|
21
|
+
* here. Fields missing in older versions (`maxWithdrawals`, `redeemer`,
|
|
22
|
+
* `extraData`) are required in the inferred types but absent at runtime on
|
|
23
|
+
* v310/v311, so the normalization helpers must not assume their presence.
|
|
24
24
|
**/
|
|
25
25
|
type CommonAbi = typeof iWithdrawalCompressorV313Abi;
|
|
26
26
|
type OnchainCurrentWithdrawals = ContractFunctionReturnType<CommonAbi, "view", "getCurrentWithdrawals">;
|
|
@@ -67,6 +67,10 @@ declare const abi: readonly [{
|
|
|
67
67
|
readonly type: "bytes";
|
|
68
68
|
readonly internalType: "bytes";
|
|
69
69
|
}];
|
|
70
|
+
}, {
|
|
71
|
+
readonly name: "redeemer";
|
|
72
|
+
readonly type: "address";
|
|
73
|
+
readonly internalType: "address";
|
|
70
74
|
}, {
|
|
71
75
|
readonly name: "extraData";
|
|
72
76
|
readonly type: "bytes";
|
|
@@ -105,6 +109,10 @@ declare const abi: readonly [{
|
|
|
105
109
|
readonly name: "claimableAt";
|
|
106
110
|
readonly type: "uint256";
|
|
107
111
|
readonly internalType: "uint256";
|
|
112
|
+
}, {
|
|
113
|
+
readonly name: "redeemer";
|
|
114
|
+
readonly type: "address";
|
|
115
|
+
readonly internalType: "address";
|
|
108
116
|
}, {
|
|
109
117
|
readonly name: "extraData";
|
|
110
118
|
readonly type: "bytes";
|
|
@@ -116,9 +124,9 @@ declare const abi: readonly [{
|
|
|
116
124
|
readonly type: "function";
|
|
117
125
|
readonly name: "getExternalAccountCurrentWithdrawals";
|
|
118
126
|
readonly inputs: readonly [{
|
|
119
|
-
readonly name: "
|
|
120
|
-
readonly type: "address";
|
|
121
|
-
readonly internalType: "address";
|
|
127
|
+
readonly name: "withdrawalTokens";
|
|
128
|
+
readonly type: "address[]";
|
|
129
|
+
readonly internalType: "address[]";
|
|
122
130
|
}, {
|
|
123
131
|
readonly name: "account";
|
|
124
132
|
readonly type: "address";
|
|
@@ -170,6 +178,10 @@ declare const abi: readonly [{
|
|
|
170
178
|
readonly type: "bytes";
|
|
171
179
|
readonly internalType: "bytes";
|
|
172
180
|
}];
|
|
181
|
+
}, {
|
|
182
|
+
readonly name: "redeemer";
|
|
183
|
+
readonly type: "address";
|
|
184
|
+
readonly internalType: "address";
|
|
173
185
|
}, {
|
|
174
186
|
readonly name: "extraData";
|
|
175
187
|
readonly type: "bytes";
|
|
@@ -208,6 +220,10 @@ declare const abi: readonly [{
|
|
|
208
220
|
readonly name: "claimableAt";
|
|
209
221
|
readonly type: "uint256";
|
|
210
222
|
readonly internalType: "uint256";
|
|
223
|
+
}, {
|
|
224
|
+
readonly name: "redeemer";
|
|
225
|
+
readonly type: "address";
|
|
226
|
+
readonly internalType: "address";
|
|
211
227
|
}, {
|
|
212
228
|
readonly name: "extraData";
|
|
213
229
|
readonly type: "bytes";
|
|
@@ -219,9 +235,9 @@ declare const abi: readonly [{
|
|
|
219
235
|
readonly type: "function";
|
|
220
236
|
readonly name: "getExternalAccountCurrentWithdrawals";
|
|
221
237
|
readonly inputs: readonly [{
|
|
222
|
-
readonly name: "
|
|
223
|
-
readonly type: "address
|
|
224
|
-
readonly internalType: "address
|
|
238
|
+
readonly name: "withdrawalToken";
|
|
239
|
+
readonly type: "address";
|
|
240
|
+
readonly internalType: "address";
|
|
225
241
|
}, {
|
|
226
242
|
readonly name: "account";
|
|
227
243
|
readonly type: "address";
|
|
@@ -273,6 +289,10 @@ declare const abi: readonly [{
|
|
|
273
289
|
readonly type: "bytes";
|
|
274
290
|
readonly internalType: "bytes";
|
|
275
291
|
}];
|
|
292
|
+
}, {
|
|
293
|
+
readonly name: "redeemer";
|
|
294
|
+
readonly type: "address";
|
|
295
|
+
readonly internalType: "address";
|
|
276
296
|
}, {
|
|
277
297
|
readonly name: "extraData";
|
|
278
298
|
readonly type: "bytes";
|
|
@@ -311,6 +331,10 @@ declare const abi: readonly [{
|
|
|
311
331
|
readonly name: "claimableAt";
|
|
312
332
|
readonly type: "uint256";
|
|
313
333
|
readonly internalType: "uint256";
|
|
334
|
+
}, {
|
|
335
|
+
readonly name: "redeemer";
|
|
336
|
+
readonly type: "address";
|
|
337
|
+
readonly internalType: "address";
|
|
314
338
|
}, {
|
|
315
339
|
readonly name: "extraData";
|
|
316
340
|
readonly type: "bytes";
|
|
@@ -318,34 +342,6 @@ declare const abi: readonly [{
|
|
|
318
342
|
}];
|
|
319
343
|
}];
|
|
320
344
|
readonly stateMutability: "view";
|
|
321
|
-
}, {
|
|
322
|
-
readonly type: "function";
|
|
323
|
-
readonly name: "getWithdrawalStatus";
|
|
324
|
-
readonly inputs: readonly [{
|
|
325
|
-
readonly name: "redeemer";
|
|
326
|
-
readonly type: "address";
|
|
327
|
-
readonly internalType: "address";
|
|
328
|
-
}];
|
|
329
|
-
readonly outputs: readonly [{
|
|
330
|
-
readonly name: "";
|
|
331
|
-
readonly type: "uint8";
|
|
332
|
-
readonly internalType: "enum WithdrawalStatus";
|
|
333
|
-
}];
|
|
334
|
-
readonly stateMutability: "view";
|
|
335
|
-
}, {
|
|
336
|
-
readonly type: "function";
|
|
337
|
-
readonly name: "getWithdrawalStatus";
|
|
338
|
-
readonly inputs: readonly [{
|
|
339
|
-
readonly name: "redeemers";
|
|
340
|
-
readonly type: "address[]";
|
|
341
|
-
readonly internalType: "address[]";
|
|
342
|
-
}];
|
|
343
|
-
readonly outputs: readonly [{
|
|
344
|
-
readonly name: "";
|
|
345
|
-
readonly type: "uint8[]";
|
|
346
|
-
readonly internalType: "enum WithdrawalStatus[]";
|
|
347
|
-
}];
|
|
348
|
-
readonly stateMutability: "view";
|
|
349
345
|
}, {
|
|
350
346
|
readonly type: "function";
|
|
351
347
|
readonly name: "getWithdrawableAssets";
|
|
@@ -465,10 +461,6 @@ declare const abi: readonly [{
|
|
|
465
461
|
readonly name: "token";
|
|
466
462
|
readonly type: "address";
|
|
467
463
|
readonly internalType: "address";
|
|
468
|
-
}, {
|
|
469
|
-
readonly name: "withdrawalToken";
|
|
470
|
-
readonly type: "address";
|
|
471
|
-
readonly internalType: "address";
|
|
472
464
|
}, {
|
|
473
465
|
readonly name: "amount";
|
|
474
466
|
readonly type: "uint256";
|
|
@@ -534,6 +526,10 @@ declare const abi: readonly [{
|
|
|
534
526
|
readonly name: "token";
|
|
535
527
|
readonly type: "address";
|
|
536
528
|
readonly internalType: "address";
|
|
529
|
+
}, {
|
|
530
|
+
readonly name: "withdrawalToken";
|
|
531
|
+
readonly type: "address";
|
|
532
|
+
readonly internalType: "address";
|
|
537
533
|
}, {
|
|
538
534
|
readonly name: "amount";
|
|
539
535
|
readonly type: "uint256";
|
|
@@ -588,6 +584,34 @@ declare const abi: readonly [{
|
|
|
588
584
|
}];
|
|
589
585
|
}];
|
|
590
586
|
readonly stateMutability: "view";
|
|
587
|
+
}, {
|
|
588
|
+
readonly type: "function";
|
|
589
|
+
readonly name: "getWithdrawalStatus";
|
|
590
|
+
readonly inputs: readonly [{
|
|
591
|
+
readonly name: "redeemers";
|
|
592
|
+
readonly type: "address[]";
|
|
593
|
+
readonly internalType: "address[]";
|
|
594
|
+
}];
|
|
595
|
+
readonly outputs: readonly [{
|
|
596
|
+
readonly name: "";
|
|
597
|
+
readonly type: "uint8[]";
|
|
598
|
+
readonly internalType: "enum WithdrawalStatus[]";
|
|
599
|
+
}];
|
|
600
|
+
readonly stateMutability: "view";
|
|
601
|
+
}, {
|
|
602
|
+
readonly type: "function";
|
|
603
|
+
readonly name: "getWithdrawalStatus";
|
|
604
|
+
readonly inputs: readonly [{
|
|
605
|
+
readonly name: "redeemer";
|
|
606
|
+
readonly type: "address";
|
|
607
|
+
readonly internalType: "address";
|
|
608
|
+
}];
|
|
609
|
+
readonly outputs: readonly [{
|
|
610
|
+
readonly name: "";
|
|
611
|
+
readonly type: "uint8";
|
|
612
|
+
readonly internalType: "enum WithdrawalStatus";
|
|
613
|
+
}];
|
|
614
|
+
readonly stateMutability: "view";
|
|
591
615
|
}, {
|
|
592
616
|
readonly type: "function";
|
|
593
617
|
readonly name: "version";
|
|
@@ -188,6 +188,11 @@ interface ClaimableWithdrawal {
|
|
|
188
188
|
* Credit facade multicall (adapter calls) that executes the claim
|
|
189
189
|
**/
|
|
190
190
|
claimCalls: MultiCall[];
|
|
191
|
+
/**
|
|
192
|
+
* Redeemer contract the withdrawal is claimed from. `undefined` on
|
|
193
|
+
* compressor versions below 313, which do not report it
|
|
194
|
+
**/
|
|
195
|
+
redeemer?: Address;
|
|
191
196
|
/**
|
|
192
197
|
* Delayed intent decoded from the withdrawal's `extraData`, enriched with
|
|
193
198
|
* the credit manager of the credit account. `undefined` on compressor
|
|
@@ -217,6 +222,11 @@ interface PendingWithdrawal {
|
|
|
217
222
|
* Unix timestamp (in seconds) when the withdrawal becomes claimable
|
|
218
223
|
**/
|
|
219
224
|
claimableAt: bigint;
|
|
225
|
+
/**
|
|
226
|
+
* Redeemer contract the withdrawal will be claimed from. `undefined` on
|
|
227
|
+
* compressor versions below 313, which do not report it
|
|
228
|
+
**/
|
|
229
|
+
redeemer?: Address;
|
|
220
230
|
/**
|
|
221
231
|
* Delayed intent decoded from the withdrawal's `extraData`, enriched with
|
|
222
232
|
* the credit manager of the credit account. `undefined` on compressor
|