@gearbox-protocol/sdk 14.12.0-test.1 → 14.12.0-test.3
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/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.js +85 -1
- package/dist/cjs/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.js +85 -1
- package/dist/cjs/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +85 -1
- package/dist/cjs/abi/compressors/withdrawalCompressor.js +197 -1
- package/dist/cjs/abi/helpers/redemptionLogger.js +160 -0
- package/dist/cjs/abi/router/midasWorker.js +4 -4
- package/dist/cjs/dev/AccountOpener.js +2 -2
- package/dist/cjs/plugins/adapters/abi/actionAbi.js +13 -5
- package/dist/cjs/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js +23 -8
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +2 -1
- package/dist/cjs/preview/preview/buildDelayedPreview.js +38 -16
- package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +21 -0
- package/dist/cjs/sdk/accounts/liquidations/MultichainLiquidationsService.js +26 -0
- package/dist/cjs/sdk/accounts/liquidations/helpers.js +29 -2
- package/dist/cjs/sdk/accounts/withdrawal-compressor/intent-codec.js +4 -6
- package/dist/esm/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.js +85 -1
- package/dist/esm/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.js +85 -1
- package/dist/esm/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +85 -1
- package/dist/esm/abi/compressors/withdrawalCompressor.js +197 -1
- package/dist/esm/abi/helpers/redemptionLogger.js +136 -0
- package/dist/esm/abi/router/midasWorker.js +4 -4
- package/dist/esm/dev/AccountOpener.js +2 -2
- package/dist/esm/plugins/adapters/abi/actionAbi.js +13 -5
- package/dist/esm/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js +23 -8
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +2 -1
- package/dist/esm/preview/preview/buildDelayedPreview.js +41 -17
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +23 -1
- package/dist/esm/sdk/accounts/liquidations/MultichainLiquidationsService.js +26 -0
- package/dist/esm/sdk/accounts/liquidations/helpers.js +27 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/intent-codec.js +4 -6
- package/dist/types/abi/compressors/subcompressors/withdrawal/mellowWithdrawalSubcompressor.d.ts +121 -0
- package/dist/types/abi/compressors/subcompressors/withdrawal/midasWithdrawalSubcompressor.d.ts +121 -0
- package/dist/types/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.d.ts +121 -0
- package/dist/types/abi/compressors/withdrawalCompressor.d.ts +274 -0
- package/dist/types/abi/helpers/redemptionLogger.d.ts +167 -0
- package/dist/types/abi/router/midasWorker.d.ts +4 -4
- package/dist/types/permissionless/bindings/compressors/withdrawal-compressor.d.ts +274 -0
- package/dist/types/plugins/adapters/abi/actionAbi.d.ts +1 -1
- package/dist/types/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.d.ts +37 -7
- package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +37 -7
- package/dist/types/preview/preview/buildDelayedPreview.d.ts +8 -26
- package/dist/types/sdk/accounts/liquidations/LiquidationsService.d.ts +5 -1
- package/dist/types/sdk/accounts/liquidations/MultichainLiquidationsService.d.ts +5 -1
- package/dist/types/sdk/accounts/liquidations/helpers.d.ts +12 -0
- package/dist/types/sdk/accounts/liquidations/types.d.ts +55 -0
- package/dist/types/sdk/accounts/withdrawal-compressor/intent-codec.d.ts +1 -1
- package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +4 -9
- package/package.json +1 -1
|
@@ -29,6 +29,10 @@ declare const abi: readonly [{
|
|
|
29
29
|
readonly name: "";
|
|
30
30
|
readonly type: "bytes32";
|
|
31
31
|
readonly internalType: "bytes32";
|
|
32
|
+
}, {
|
|
33
|
+
readonly name: "";
|
|
34
|
+
readonly type: "uint256";
|
|
35
|
+
readonly internalType: "uint256";
|
|
32
36
|
}];
|
|
33
37
|
readonly outputs: readonly [{
|
|
34
38
|
readonly name: "";
|
|
@@ -145,6 +149,212 @@ declare const abi: readonly [{
|
|
|
145
149
|
}];
|
|
146
150
|
}];
|
|
147
151
|
readonly stateMutability: "view";
|
|
152
|
+
}, {
|
|
153
|
+
readonly type: "function";
|
|
154
|
+
readonly name: "getExternalAccountCurrentWithdrawals";
|
|
155
|
+
readonly inputs: readonly [{
|
|
156
|
+
readonly name: "withdrawalTokens";
|
|
157
|
+
readonly type: "address[]";
|
|
158
|
+
readonly internalType: "address[]";
|
|
159
|
+
}, {
|
|
160
|
+
readonly name: "account";
|
|
161
|
+
readonly type: "address";
|
|
162
|
+
readonly internalType: "address";
|
|
163
|
+
}];
|
|
164
|
+
readonly outputs: readonly [{
|
|
165
|
+
readonly name: "";
|
|
166
|
+
readonly type: "tuple[]";
|
|
167
|
+
readonly internalType: "struct ClaimableWithdrawal[]";
|
|
168
|
+
readonly components: readonly [{
|
|
169
|
+
readonly name: "token";
|
|
170
|
+
readonly type: "address";
|
|
171
|
+
readonly internalType: "address";
|
|
172
|
+
}, {
|
|
173
|
+
readonly name: "withdrawalPhantomToken";
|
|
174
|
+
readonly type: "address";
|
|
175
|
+
readonly internalType: "address";
|
|
176
|
+
}, {
|
|
177
|
+
readonly name: "withdrawalTokenSpent";
|
|
178
|
+
readonly type: "uint256";
|
|
179
|
+
readonly internalType: "uint256";
|
|
180
|
+
}, {
|
|
181
|
+
readonly name: "outputs";
|
|
182
|
+
readonly type: "tuple[]";
|
|
183
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
184
|
+
readonly components: readonly [{
|
|
185
|
+
readonly name: "token";
|
|
186
|
+
readonly type: "address";
|
|
187
|
+
readonly internalType: "address";
|
|
188
|
+
}, {
|
|
189
|
+
readonly name: "isDelayed";
|
|
190
|
+
readonly type: "bool";
|
|
191
|
+
readonly internalType: "bool";
|
|
192
|
+
}, {
|
|
193
|
+
readonly name: "amount";
|
|
194
|
+
readonly type: "uint256";
|
|
195
|
+
readonly internalType: "uint256";
|
|
196
|
+
}];
|
|
197
|
+
}, {
|
|
198
|
+
readonly name: "claimCalls";
|
|
199
|
+
readonly type: "tuple[]";
|
|
200
|
+
readonly internalType: "struct MultiCall[]";
|
|
201
|
+
readonly components: readonly [{
|
|
202
|
+
readonly name: "target";
|
|
203
|
+
readonly type: "address";
|
|
204
|
+
readonly internalType: "address";
|
|
205
|
+
}, {
|
|
206
|
+
readonly name: "callData";
|
|
207
|
+
readonly type: "bytes";
|
|
208
|
+
readonly internalType: "bytes";
|
|
209
|
+
}];
|
|
210
|
+
}, {
|
|
211
|
+
readonly name: "extraData";
|
|
212
|
+
readonly type: "bytes";
|
|
213
|
+
readonly internalType: "bytes";
|
|
214
|
+
}];
|
|
215
|
+
}, {
|
|
216
|
+
readonly name: "";
|
|
217
|
+
readonly type: "tuple[]";
|
|
218
|
+
readonly internalType: "struct PendingWithdrawal[]";
|
|
219
|
+
readonly components: readonly [{
|
|
220
|
+
readonly name: "token";
|
|
221
|
+
readonly type: "address";
|
|
222
|
+
readonly internalType: "address";
|
|
223
|
+
}, {
|
|
224
|
+
readonly name: "withdrawalPhantomToken";
|
|
225
|
+
readonly type: "address";
|
|
226
|
+
readonly internalType: "address";
|
|
227
|
+
}, {
|
|
228
|
+
readonly name: "expectedOutputs";
|
|
229
|
+
readonly type: "tuple[]";
|
|
230
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
231
|
+
readonly components: readonly [{
|
|
232
|
+
readonly name: "token";
|
|
233
|
+
readonly type: "address";
|
|
234
|
+
readonly internalType: "address";
|
|
235
|
+
}, {
|
|
236
|
+
readonly name: "isDelayed";
|
|
237
|
+
readonly type: "bool";
|
|
238
|
+
readonly internalType: "bool";
|
|
239
|
+
}, {
|
|
240
|
+
readonly name: "amount";
|
|
241
|
+
readonly type: "uint256";
|
|
242
|
+
readonly internalType: "uint256";
|
|
243
|
+
}];
|
|
244
|
+
}, {
|
|
245
|
+
readonly name: "claimableAt";
|
|
246
|
+
readonly type: "uint256";
|
|
247
|
+
readonly internalType: "uint256";
|
|
248
|
+
}, {
|
|
249
|
+
readonly name: "extraData";
|
|
250
|
+
readonly type: "bytes";
|
|
251
|
+
readonly internalType: "bytes";
|
|
252
|
+
}];
|
|
253
|
+
}];
|
|
254
|
+
readonly stateMutability: "view";
|
|
255
|
+
}, {
|
|
256
|
+
readonly type: "function";
|
|
257
|
+
readonly name: "getExternalAccountCurrentWithdrawals";
|
|
258
|
+
readonly inputs: readonly [{
|
|
259
|
+
readonly name: "withdrawalToken";
|
|
260
|
+
readonly type: "address";
|
|
261
|
+
readonly internalType: "address";
|
|
262
|
+
}, {
|
|
263
|
+
readonly name: "account";
|
|
264
|
+
readonly type: "address";
|
|
265
|
+
readonly internalType: "address";
|
|
266
|
+
}];
|
|
267
|
+
readonly outputs: readonly [{
|
|
268
|
+
readonly name: "";
|
|
269
|
+
readonly type: "tuple[]";
|
|
270
|
+
readonly internalType: "struct ClaimableWithdrawal[]";
|
|
271
|
+
readonly components: readonly [{
|
|
272
|
+
readonly name: "token";
|
|
273
|
+
readonly type: "address";
|
|
274
|
+
readonly internalType: "address";
|
|
275
|
+
}, {
|
|
276
|
+
readonly name: "withdrawalPhantomToken";
|
|
277
|
+
readonly type: "address";
|
|
278
|
+
readonly internalType: "address";
|
|
279
|
+
}, {
|
|
280
|
+
readonly name: "withdrawalTokenSpent";
|
|
281
|
+
readonly type: "uint256";
|
|
282
|
+
readonly internalType: "uint256";
|
|
283
|
+
}, {
|
|
284
|
+
readonly name: "outputs";
|
|
285
|
+
readonly type: "tuple[]";
|
|
286
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
287
|
+
readonly components: readonly [{
|
|
288
|
+
readonly name: "token";
|
|
289
|
+
readonly type: "address";
|
|
290
|
+
readonly internalType: "address";
|
|
291
|
+
}, {
|
|
292
|
+
readonly name: "isDelayed";
|
|
293
|
+
readonly type: "bool";
|
|
294
|
+
readonly internalType: "bool";
|
|
295
|
+
}, {
|
|
296
|
+
readonly name: "amount";
|
|
297
|
+
readonly type: "uint256";
|
|
298
|
+
readonly internalType: "uint256";
|
|
299
|
+
}];
|
|
300
|
+
}, {
|
|
301
|
+
readonly name: "claimCalls";
|
|
302
|
+
readonly type: "tuple[]";
|
|
303
|
+
readonly internalType: "struct MultiCall[]";
|
|
304
|
+
readonly components: readonly [{
|
|
305
|
+
readonly name: "target";
|
|
306
|
+
readonly type: "address";
|
|
307
|
+
readonly internalType: "address";
|
|
308
|
+
}, {
|
|
309
|
+
readonly name: "callData";
|
|
310
|
+
readonly type: "bytes";
|
|
311
|
+
readonly internalType: "bytes";
|
|
312
|
+
}];
|
|
313
|
+
}, {
|
|
314
|
+
readonly name: "extraData";
|
|
315
|
+
readonly type: "bytes";
|
|
316
|
+
readonly internalType: "bytes";
|
|
317
|
+
}];
|
|
318
|
+
}, {
|
|
319
|
+
readonly name: "";
|
|
320
|
+
readonly type: "tuple[]";
|
|
321
|
+
readonly internalType: "struct PendingWithdrawal[]";
|
|
322
|
+
readonly components: readonly [{
|
|
323
|
+
readonly name: "token";
|
|
324
|
+
readonly type: "address";
|
|
325
|
+
readonly internalType: "address";
|
|
326
|
+
}, {
|
|
327
|
+
readonly name: "withdrawalPhantomToken";
|
|
328
|
+
readonly type: "address";
|
|
329
|
+
readonly internalType: "address";
|
|
330
|
+
}, {
|
|
331
|
+
readonly name: "expectedOutputs";
|
|
332
|
+
readonly type: "tuple[]";
|
|
333
|
+
readonly internalType: "struct WithdrawalOutput[]";
|
|
334
|
+
readonly components: readonly [{
|
|
335
|
+
readonly name: "token";
|
|
336
|
+
readonly type: "address";
|
|
337
|
+
readonly internalType: "address";
|
|
338
|
+
}, {
|
|
339
|
+
readonly name: "isDelayed";
|
|
340
|
+
readonly type: "bool";
|
|
341
|
+
readonly internalType: "bool";
|
|
342
|
+
}, {
|
|
343
|
+
readonly name: "amount";
|
|
344
|
+
readonly type: "uint256";
|
|
345
|
+
readonly internalType: "uint256";
|
|
346
|
+
}];
|
|
347
|
+
}, {
|
|
348
|
+
readonly name: "claimableAt";
|
|
349
|
+
readonly type: "uint256";
|
|
350
|
+
readonly internalType: "uint256";
|
|
351
|
+
}, {
|
|
352
|
+
readonly name: "extraData";
|
|
353
|
+
readonly type: "bytes";
|
|
354
|
+
readonly internalType: "bytes";
|
|
355
|
+
}];
|
|
356
|
+
}];
|
|
357
|
+
readonly stateMutability: "view";
|
|
148
358
|
}, {
|
|
149
359
|
readonly type: "function";
|
|
150
360
|
readonly name: "getWithdrawableAssets";
|
|
@@ -387,6 +597,34 @@ declare const abi: readonly [{
|
|
|
387
597
|
}];
|
|
388
598
|
}];
|
|
389
599
|
readonly stateMutability: "view";
|
|
600
|
+
}, {
|
|
601
|
+
readonly type: "function";
|
|
602
|
+
readonly name: "getWithdrawalStatus";
|
|
603
|
+
readonly inputs: readonly [{
|
|
604
|
+
readonly name: "redeemers";
|
|
605
|
+
readonly type: "address[]";
|
|
606
|
+
readonly internalType: "address[]";
|
|
607
|
+
}];
|
|
608
|
+
readonly outputs: readonly [{
|
|
609
|
+
readonly name: "";
|
|
610
|
+
readonly type: "uint8[]";
|
|
611
|
+
readonly internalType: "enum WithdrawalStatus[]";
|
|
612
|
+
}];
|
|
613
|
+
readonly stateMutability: "view";
|
|
614
|
+
}, {
|
|
615
|
+
readonly type: "function";
|
|
616
|
+
readonly name: "getWithdrawalStatus";
|
|
617
|
+
readonly inputs: readonly [{
|
|
618
|
+
readonly name: "redeemer";
|
|
619
|
+
readonly type: "address";
|
|
620
|
+
readonly internalType: "address";
|
|
621
|
+
}];
|
|
622
|
+
readonly outputs: readonly [{
|
|
623
|
+
readonly name: "";
|
|
624
|
+
readonly type: "uint8";
|
|
625
|
+
readonly internalType: "enum WithdrawalStatus";
|
|
626
|
+
}];
|
|
627
|
+
readonly stateMutability: "view";
|
|
390
628
|
}, {
|
|
391
629
|
readonly type: "function";
|
|
392
630
|
readonly name: "owner";
|
|
@@ -427,6 +665,24 @@ declare const abi: readonly [{
|
|
|
427
665
|
}];
|
|
428
666
|
readonly outputs: readonly [];
|
|
429
667
|
readonly stateMutability: "nonpayable";
|
|
668
|
+
}, {
|
|
669
|
+
readonly type: "function";
|
|
670
|
+
readonly name: "setWithdrawableVersionToSpecificCompressorVersion";
|
|
671
|
+
readonly inputs: readonly [{
|
|
672
|
+
readonly name: "withdrawableType";
|
|
673
|
+
readonly type: "bytes32";
|
|
674
|
+
readonly internalType: "bytes32";
|
|
675
|
+
}, {
|
|
676
|
+
readonly name: "withdrawableVersion";
|
|
677
|
+
readonly type: "uint256";
|
|
678
|
+
readonly internalType: "uint256";
|
|
679
|
+
}, {
|
|
680
|
+
readonly name: "compressorVersion";
|
|
681
|
+
readonly type: "uint256";
|
|
682
|
+
readonly internalType: "uint256";
|
|
683
|
+
}];
|
|
684
|
+
readonly outputs: readonly [];
|
|
685
|
+
readonly stateMutability: "nonpayable";
|
|
430
686
|
}, {
|
|
431
687
|
readonly type: "function";
|
|
432
688
|
readonly name: "transferOwnership";
|
|
@@ -461,6 +717,24 @@ declare const abi: readonly [{
|
|
|
461
717
|
readonly internalType: "bytes32";
|
|
462
718
|
}];
|
|
463
719
|
readonly stateMutability: "view";
|
|
720
|
+
}, {
|
|
721
|
+
readonly type: "function";
|
|
722
|
+
readonly name: "withdrawableTypeToSpecificCompressorVersion";
|
|
723
|
+
readonly inputs: readonly [{
|
|
724
|
+
readonly name: "";
|
|
725
|
+
readonly type: "bytes32";
|
|
726
|
+
readonly internalType: "bytes32";
|
|
727
|
+
}, {
|
|
728
|
+
readonly name: "";
|
|
729
|
+
readonly type: "uint256";
|
|
730
|
+
readonly internalType: "uint256";
|
|
731
|
+
}];
|
|
732
|
+
readonly outputs: readonly [{
|
|
733
|
+
readonly name: "";
|
|
734
|
+
readonly type: "uint256";
|
|
735
|
+
readonly internalType: "uint256";
|
|
736
|
+
}];
|
|
737
|
+
readonly stateMutability: "view";
|
|
464
738
|
}, {
|
|
465
739
|
readonly type: "event";
|
|
466
740
|
readonly name: "OwnershipTransferred";
|
|
@@ -6,7 +6,7 @@ import { AdapterType, type VersionedAbi } from "../types.js";
|
|
|
6
6
|
* These ABIs correspond to the constructor parameters used in each adapter's getDeployParams method
|
|
7
7
|
* Based on the actual encodeAbiParameters calls in the adapter implementations
|
|
8
8
|
*/
|
|
9
|
-
export declare const adapterActionSignatures: PartialRecord<AdapterType, Record<number, string>>;
|
|
9
|
+
export declare const adapterActionSignatures: PartialRecord<AdapterType, Record<number, string | string[]>>;
|
|
10
10
|
/**
|
|
11
11
|
* Mapping of adapter types to their parsed ABIs
|
|
12
12
|
*/
|
package/dist/types/plugins/adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
export declare const iSecuritizeRedemptionGatewayAdapterV311Abi: readonly [{
|
|
2
|
+
readonly type: "function";
|
|
3
|
+
readonly name: "acl";
|
|
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
|
+
}, {
|
|
2
12
|
readonly type: "function";
|
|
3
13
|
readonly name: "claim";
|
|
4
14
|
readonly inputs: readonly [{
|
|
@@ -36,11 +46,11 @@ export declare const iSecuritizeRedemptionGatewayAdapterV311Abi: readonly [{
|
|
|
36
46
|
readonly type: "function";
|
|
37
47
|
readonly name: "depositPhantomToken";
|
|
38
48
|
readonly inputs: readonly [{
|
|
39
|
-
readonly name: "
|
|
49
|
+
readonly name: "";
|
|
40
50
|
readonly type: "address";
|
|
41
51
|
readonly internalType: "address";
|
|
42
52
|
}, {
|
|
43
|
-
readonly name: "
|
|
53
|
+
readonly name: "";
|
|
44
54
|
readonly type: "uint256";
|
|
45
55
|
readonly internalType: "uint256";
|
|
46
56
|
}];
|
|
@@ -49,7 +59,7 @@ export declare const iSecuritizeRedemptionGatewayAdapterV311Abi: readonly [{
|
|
|
49
59
|
readonly type: "bool";
|
|
50
60
|
readonly internalType: "bool";
|
|
51
61
|
}];
|
|
52
|
-
readonly stateMutability: "
|
|
62
|
+
readonly stateMutability: "view";
|
|
53
63
|
}, {
|
|
54
64
|
readonly type: "function";
|
|
55
65
|
readonly name: "dsToken";
|
|
@@ -196,20 +206,32 @@ export declare const iSecuritizeRedemptionGatewayAdapterV311Abi: readonly [{
|
|
|
196
206
|
readonly type: "function";
|
|
197
207
|
readonly name: "withdrawPhantomToken";
|
|
198
208
|
readonly inputs: readonly [{
|
|
199
|
-
readonly name: "
|
|
209
|
+
readonly name: "";
|
|
200
210
|
readonly type: "address";
|
|
201
211
|
readonly internalType: "address";
|
|
202
212
|
}, {
|
|
203
|
-
readonly name: "
|
|
213
|
+
readonly name: "";
|
|
204
214
|
readonly type: "uint256";
|
|
205
215
|
readonly internalType: "uint256";
|
|
206
216
|
}];
|
|
207
217
|
readonly outputs: readonly [{
|
|
208
|
-
readonly name: "
|
|
218
|
+
readonly name: "";
|
|
209
219
|
readonly type: "bool";
|
|
210
220
|
readonly internalType: "bool";
|
|
211
221
|
}];
|
|
212
|
-
readonly stateMutability: "
|
|
222
|
+
readonly stateMutability: "view";
|
|
223
|
+
}, {
|
|
224
|
+
readonly type: "error";
|
|
225
|
+
readonly name: "AddressIsNotContractException";
|
|
226
|
+
readonly inputs: readonly [{
|
|
227
|
+
readonly name: "";
|
|
228
|
+
readonly type: "address";
|
|
229
|
+
readonly internalType: "address";
|
|
230
|
+
}];
|
|
231
|
+
}, {
|
|
232
|
+
readonly type: "error";
|
|
233
|
+
readonly name: "CallerNotCreditFacadeException";
|
|
234
|
+
readonly inputs: readonly [];
|
|
213
235
|
}, {
|
|
214
236
|
readonly type: "error";
|
|
215
237
|
readonly name: "IncorrectStakedPhantomTokenException";
|
|
@@ -218,4 +240,12 @@ export declare const iSecuritizeRedemptionGatewayAdapterV311Abi: readonly [{
|
|
|
218
240
|
readonly type: "error";
|
|
219
241
|
readonly name: "InvalidRedemptionGatewayException";
|
|
220
242
|
readonly inputs: readonly [];
|
|
243
|
+
}, {
|
|
244
|
+
readonly type: "error";
|
|
245
|
+
readonly name: "NotImplementedException";
|
|
246
|
+
readonly inputs: readonly [];
|
|
247
|
+
}, {
|
|
248
|
+
readonly type: "error";
|
|
249
|
+
readonly name: "ZeroAddressException";
|
|
250
|
+
readonly inputs: readonly [];
|
|
221
251
|
}];
|
package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts
CHANGED
|
@@ -4,6 +4,16 @@ import type { DelayedWithdrawalClaim, DelayedWithdrawalRequest } from "../types.
|
|
|
4
4
|
import type { ConcreteAdapterContractOptions } from "./AbstractAdapter.js";
|
|
5
5
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
6
6
|
declare const abi: readonly [{
|
|
7
|
+
readonly type: "function";
|
|
8
|
+
readonly name: "acl";
|
|
9
|
+
readonly inputs: readonly [];
|
|
10
|
+
readonly outputs: readonly [{
|
|
11
|
+
readonly name: "";
|
|
12
|
+
readonly type: "address";
|
|
13
|
+
readonly internalType: "address";
|
|
14
|
+
}];
|
|
15
|
+
readonly stateMutability: "view";
|
|
16
|
+
}, {
|
|
7
17
|
readonly type: "function";
|
|
8
18
|
readonly name: "claim";
|
|
9
19
|
readonly inputs: readonly [{
|
|
@@ -41,11 +51,11 @@ declare const abi: readonly [{
|
|
|
41
51
|
readonly type: "function";
|
|
42
52
|
readonly name: "depositPhantomToken";
|
|
43
53
|
readonly inputs: readonly [{
|
|
44
|
-
readonly name: "
|
|
54
|
+
readonly name: "";
|
|
45
55
|
readonly type: "address";
|
|
46
56
|
readonly internalType: "address";
|
|
47
57
|
}, {
|
|
48
|
-
readonly name: "
|
|
58
|
+
readonly name: "";
|
|
49
59
|
readonly type: "uint256";
|
|
50
60
|
readonly internalType: "uint256";
|
|
51
61
|
}];
|
|
@@ -54,7 +64,7 @@ declare const abi: readonly [{
|
|
|
54
64
|
readonly type: "bool";
|
|
55
65
|
readonly internalType: "bool";
|
|
56
66
|
}];
|
|
57
|
-
readonly stateMutability: "
|
|
67
|
+
readonly stateMutability: "view";
|
|
58
68
|
}, {
|
|
59
69
|
readonly type: "function";
|
|
60
70
|
readonly name: "dsToken";
|
|
@@ -201,20 +211,32 @@ declare const abi: readonly [{
|
|
|
201
211
|
readonly type: "function";
|
|
202
212
|
readonly name: "withdrawPhantomToken";
|
|
203
213
|
readonly inputs: readonly [{
|
|
204
|
-
readonly name: "
|
|
214
|
+
readonly name: "";
|
|
205
215
|
readonly type: "address";
|
|
206
216
|
readonly internalType: "address";
|
|
207
217
|
}, {
|
|
208
|
-
readonly name: "
|
|
218
|
+
readonly name: "";
|
|
209
219
|
readonly type: "uint256";
|
|
210
220
|
readonly internalType: "uint256";
|
|
211
221
|
}];
|
|
212
222
|
readonly outputs: readonly [{
|
|
213
|
-
readonly name: "
|
|
223
|
+
readonly name: "";
|
|
214
224
|
readonly type: "bool";
|
|
215
225
|
readonly internalType: "bool";
|
|
216
226
|
}];
|
|
217
|
-
readonly stateMutability: "
|
|
227
|
+
readonly stateMutability: "view";
|
|
228
|
+
}, {
|
|
229
|
+
readonly type: "error";
|
|
230
|
+
readonly name: "AddressIsNotContractException";
|
|
231
|
+
readonly inputs: readonly [{
|
|
232
|
+
readonly name: "";
|
|
233
|
+
readonly type: "address";
|
|
234
|
+
readonly internalType: "address";
|
|
235
|
+
}];
|
|
236
|
+
}, {
|
|
237
|
+
readonly type: "error";
|
|
238
|
+
readonly name: "CallerNotCreditFacadeException";
|
|
239
|
+
readonly inputs: readonly [];
|
|
218
240
|
}, {
|
|
219
241
|
readonly type: "error";
|
|
220
242
|
readonly name: "IncorrectStakedPhantomTokenException";
|
|
@@ -223,6 +245,14 @@ declare const abi: readonly [{
|
|
|
223
245
|
readonly type: "error";
|
|
224
246
|
readonly name: "InvalidRedemptionGatewayException";
|
|
225
247
|
readonly inputs: readonly [];
|
|
248
|
+
}, {
|
|
249
|
+
readonly type: "error";
|
|
250
|
+
readonly name: "NotImplementedException";
|
|
251
|
+
readonly inputs: readonly [];
|
|
252
|
+
}, {
|
|
253
|
+
readonly type: "error";
|
|
254
|
+
readonly name: "ZeroAddressException";
|
|
255
|
+
readonly inputs: readonly [];
|
|
226
256
|
}];
|
|
227
257
|
type abi = typeof abi;
|
|
228
258
|
declare const protocolAbi: readonly [{
|
|
@@ -8,34 +8,16 @@ import { type InstantOperationPreview } from "./types.js";
|
|
|
8
8
|
export type ConvertFn = (token: Address, to: Address, amount: bigint) => bigint;
|
|
9
9
|
/**
|
|
10
10
|
* Builds the best-effort preview of the account state after the detected
|
|
11
|
-
* delayed withdrawal is claimed and its intent (if any) is resumed
|
|
11
|
+
* delayed withdrawal is claimed and its intent (if any) is resumed:
|
|
12
|
+
* the claim itself followed by the intent-specific tail
|
|
12
13
|
*
|
|
13
|
-
* Pure function:
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* `ERROR_UNPRICEABLE_TOKEN` error on the preview.
|
|
14
|
+
* Pure function: the input states are never mutated and no network access is performed.
|
|
15
|
+
* Swaps are estimated with the injected conversion; tokens it cannot price contribute
|
|
16
|
+
* nothing and set a non-fatal `ERROR_UNPRICEABLE_TOKEN` error on the
|
|
17
|
+
* preview.
|
|
18
18
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* Intent-specific resume:
|
|
23
|
-
* - `CLOSE_ACCOUNT`: everything is swapped into the underlying, the debt is
|
|
24
|
-
* fully repaid and the rest is withdrawn to the user as `receivedToken`
|
|
25
|
-
* (the unwrapped underlying for RWA markets, converting 1:1 with the
|
|
26
|
-
* underlying; the underlying itself otherwise).
|
|
27
|
-
* - `DECREASE_LEVERAGE`: the claimed amount is swapped into the underlying
|
|
28
|
-
* and used to decrease the debt.
|
|
29
|
-
* - `WITHDRAW_COLLATERAL`: the recorded amount of the recorded token is
|
|
30
|
-
* withdrawn to the user, the rest of the claimed amount decreases the debt.
|
|
31
|
-
* - other intents and `intent: undefined`: claim-only, the post-claim swap
|
|
32
|
-
* target is not recoverable from the intent.
|
|
33
|
-
*
|
|
34
|
-
* The changes (`debtChange`, `quotasChange`, `assetsChange`) are reported
|
|
35
|
-
* relative to the account state before the whole transaction, not the
|
|
36
|
-
* post-instant-part state: to the user the delayed preview answers "where will
|
|
37
|
-
* the account end up compared to now", so the transient phantom token
|
|
38
|
-
* (minted by the instant part, burned by the claim) nets out to nothing.
|
|
19
|
+
* The changes (e.g. `debtChange`) are reported relative to the account
|
|
20
|
+
* state before the whole transaction.
|
|
39
21
|
*
|
|
40
22
|
* @param afterInstant - Account state after the instant part of the
|
|
41
23
|
* transaction.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SDKConstruct } from "../../base/index.js";
|
|
2
|
-
import type { GetLiquidatableAccountsProps, GetLiquidationDetailsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails } from "./types.js";
|
|
2
|
+
import type { GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidatorWithdrawalsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails, LiquidatorWithdrawal } from "./types.js";
|
|
3
3
|
/**
|
|
4
4
|
* Per-chain implementation of {@link ILiquidationsService}.
|
|
5
5
|
*
|
|
@@ -17,4 +17,8 @@ export declare class LiquidationsService extends SDKConstruct implements ILiquid
|
|
|
17
17
|
* {@inheritDoc ILiquidationsService.getLiquidationDetails}
|
|
18
18
|
**/
|
|
19
19
|
getLiquidationDetails(props: GetLiquidationDetailsProps): Promise<LiquidationDetails>;
|
|
20
|
+
/**
|
|
21
|
+
* {@inheritDoc ILiquidationsService.getLiquidatorWithdrawals}
|
|
22
|
+
**/
|
|
23
|
+
getLiquidatorWithdrawals(props: GetLiquidatorWithdrawalsProps): Promise<LiquidatorWithdrawal[]>;
|
|
20
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { MultichainSDK } from "../../MultichainSDK.js";
|
|
2
2
|
import type { PluginsMap } from "../../plugins/index.js";
|
|
3
|
-
import type { GetLiquidatableAccountsProps, GetLiquidationDetailsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails } from "./types.js";
|
|
3
|
+
import type { GetLiquidatableAccountsProps, GetLiquidationDetailsProps, GetLiquidatorWithdrawalsProps, ILiquidationsService, LiquidatableAccount, LiquidationDetails, LiquidatorWithdrawal } from "./types.js";
|
|
4
4
|
/**
|
|
5
5
|
* Cross-chain implementation of {@link ILiquidationsService}.
|
|
6
6
|
*
|
|
@@ -20,4 +20,8 @@ export declare class MultichainLiquidationsService<const Plugins extends Plugins
|
|
|
20
20
|
* {@inheritDoc ILiquidationsService.getLiquidationDetails}
|
|
21
21
|
**/
|
|
22
22
|
getLiquidationDetails(props: GetLiquidationDetailsProps): Promise<LiquidationDetails>;
|
|
23
|
+
/**
|
|
24
|
+
* {@inheritDoc ILiquidationsService.getLiquidatorWithdrawals}
|
|
25
|
+
**/
|
|
26
|
+
getLiquidatorWithdrawals(props: GetLiquidatorWithdrawalsProps): Promise<LiquidatorWithdrawal[]>;
|
|
23
27
|
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
2
|
import type { CreditAccountData } from "../../base/index.js";
|
|
3
|
+
import type { NetworkType } from "../../chain/index.js";
|
|
4
|
+
import type { CurrentWithdrawals } from "../withdrawal-compressor/index.js";
|
|
5
|
+
import type { LiquidatorWithdrawal } from "./types.js";
|
|
3
6
|
/**
|
|
4
7
|
* Token balances at or below this threshold are treated as dust and ignored,
|
|
5
8
|
* consistent with the rest of the SDK (see `filterDust`).
|
|
@@ -32,3 +35,12 @@ export declare function calcEstimatedProfit(totalValue: bigint, liquidationDisco
|
|
|
32
35
|
* must return `0n` when the price is unavailable
|
|
33
36
|
**/
|
|
34
37
|
export declare function pickMainAsset(ca: CreditAccountData, convert: (token: Address, balance: bigint) => bigint): Address | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Flattens delayed withdrawals of a liquidator into per-output rows:
|
|
40
|
+
* claimable outputs have no `claimableAt` (claimable now), pending outputs
|
|
41
|
+
* carry the estimated claim timestamp.
|
|
42
|
+
*
|
|
43
|
+
* @param current - Claimable and pending withdrawals from the withdrawal compressor
|
|
44
|
+
* @param network - Network the withdrawals live on
|
|
45
|
+
**/
|
|
46
|
+
export declare function toLiquidatorWithdrawals(current: CurrentWithdrawals, network: NetworkType): LiquidatorWithdrawal[];
|
|
@@ -135,6 +135,53 @@ export interface DelayedReceivedAsset {
|
|
|
135
135
|
* A single asset the liquidator receives when fully liquidating an account.
|
|
136
136
|
**/
|
|
137
137
|
export type ReceivedAsset = InstantReceivedAsset | DelayedReceivedAsset;
|
|
138
|
+
/**
|
|
139
|
+
* Props for {@link ILiquidationsService.getLiquidatorWithdrawals}.
|
|
140
|
+
**/
|
|
141
|
+
export interface GetLiquidatorWithdrawalsProps {
|
|
142
|
+
/**
|
|
143
|
+
* Networks to query. On {@link MultichainLiquidationsService} selects which
|
|
144
|
+
* chains to query; a single-chain service returns an empty list when its
|
|
145
|
+
* own network is excluded.
|
|
146
|
+
**/
|
|
147
|
+
networks?: NetworkType[];
|
|
148
|
+
/**
|
|
149
|
+
* Liquidator wallet that owns the redemption receipts (redeemer contracts
|
|
150
|
+
* received as a result of liquidations).
|
|
151
|
+
**/
|
|
152
|
+
liquidator: Address;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* A single delayed-withdrawal position owned by the liquidator.
|
|
156
|
+
*
|
|
157
|
+
* The redeemer contract address is not included: it is not part of the
|
|
158
|
+
* on-chain withdrawal structs returned by the withdrawal compressor. It can
|
|
159
|
+
* be surfaced later if the compressor structs are extended.
|
|
160
|
+
**/
|
|
161
|
+
export interface LiquidatorWithdrawal {
|
|
162
|
+
/**
|
|
163
|
+
* Network the withdrawal lives on.
|
|
164
|
+
**/
|
|
165
|
+
network: NetworkType;
|
|
166
|
+
/**
|
|
167
|
+
* Source asset spent by the delayed withdrawal (e.g. ACRED).
|
|
168
|
+
**/
|
|
169
|
+
sourceToken: Address;
|
|
170
|
+
/**
|
|
171
|
+
* Receivable asset (e.g. USDC).
|
|
172
|
+
**/
|
|
173
|
+
token: Address;
|
|
174
|
+
/**
|
|
175
|
+
* Amount of `token` receivable: exact for claimable withdrawals, estimated
|
|
176
|
+
* for pending ones.
|
|
177
|
+
**/
|
|
178
|
+
amount: bigint;
|
|
179
|
+
/**
|
|
180
|
+
* Estimated unix timestamp (in seconds) when a pending withdrawal becomes
|
|
181
|
+
* claimable. `undefined` means the withdrawal is claimable now.
|
|
182
|
+
**/
|
|
183
|
+
claimableAt?: bigint;
|
|
184
|
+
}
|
|
138
185
|
/**
|
|
139
186
|
* Detailed information about a liquidatable credit account, extending the
|
|
140
187
|
* list row with the full breakdown of assets the liquidator receives.
|
|
@@ -169,4 +216,12 @@ export interface ILiquidationsService {
|
|
|
169
216
|
* @throws When the account is not found or its collateral computation fails.
|
|
170
217
|
**/
|
|
171
218
|
getLiquidationDetails(props: GetLiquidationDetailsProps): Promise<LiquidationDetails>;
|
|
219
|
+
/**
|
|
220
|
+
* Returns the status of delayed-withdrawal positions (redemption receipts)
|
|
221
|
+
* owned by a liquidator wallet: what is receivable, how much, and when it
|
|
222
|
+
* becomes claimable.
|
|
223
|
+
*
|
|
224
|
+
* @param props - See {@link GetLiquidatorWithdrawalsProps}
|
|
225
|
+
**/
|
|
226
|
+
getLiquidatorWithdrawals(props: GetLiquidatorWithdrawalsProps): Promise<LiquidatorWithdrawal[]>;
|
|
172
227
|
}
|
|
@@ -4,7 +4,7 @@ import type { DelayedIntent } from "./types.js";
|
|
|
4
4
|
* Current version of the delayed intent encoding schema.
|
|
5
5
|
* Bump when the layout of any intent type changes.
|
|
6
6
|
**/
|
|
7
|
-
export declare const DELAYED_INTENT_VERSION =
|
|
7
|
+
export declare const DELAYED_INTENT_VERSION = 1;
|
|
8
8
|
/**
|
|
9
9
|
* Stable uint8 discriminants for intent types.
|
|
10
10
|
* Starts at 1 so that all-zero data cannot decode as a valid intent.
|