@gearbox-protocol/sdk 18.1.0 → 18.2.0-next.2

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 (46) hide show
  1. package/dist/cjs/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.js +179 -0
  2. package/dist/cjs/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.js +534 -0
  3. package/dist/cjs/abi/router/treehouseWorker.js +885 -0
  4. package/dist/cjs/onchain/market/adapters/abi/actionAbi.js +1 -0
  5. package/dist/cjs/onchain/market/adapters/abi/conctructorAbi.js +3 -0
  6. package/dist/cjs/onchain/market/adapters/types.js +3 -0
  7. package/dist/cjs/permissionless/api/GearboxPermissionless.js +12 -5
  8. package/dist/cjs/permissionless/api/analytics/PermissionlessAnalytics.js +50 -0
  9. package/dist/cjs/permissionless/api/analytics/index.js +4 -0
  10. package/dist/cjs/permissionless/api/analytics/schemas.js +27 -0
  11. package/dist/cjs/permissionless/api/analytics/types.js +1 -0
  12. package/dist/cjs/permissionless/api/index.js +3 -0
  13. package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +69 -0
  14. package/dist/cjs/permissionless/api/oracles/schemas.js +36 -0
  15. package/dist/cjs/permissionless/index.js +2 -0
  16. package/dist/esm/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.js +178 -0
  17. package/dist/esm/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.js +533 -0
  18. package/dist/esm/abi/router/treehouseWorker.js +884 -0
  19. package/dist/esm/onchain/market/adapters/abi/actionAbi.js +1 -0
  20. package/dist/esm/onchain/market/adapters/abi/conctructorAbi.js +3 -0
  21. package/dist/esm/onchain/market/adapters/types.js +3 -0
  22. package/dist/esm/permissionless/api/GearboxPermissionless.js +12 -5
  23. package/dist/esm/permissionless/api/analytics/PermissionlessAnalytics.js +49 -0
  24. package/dist/esm/permissionless/api/analytics/index.js +2 -0
  25. package/dist/esm/permissionless/api/analytics/schemas.js +25 -0
  26. package/dist/esm/permissionless/api/analytics/types.js +1 -0
  27. package/dist/esm/permissionless/api/index.js +3 -1
  28. package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +70 -1
  29. package/dist/esm/permissionless/api/oracles/schemas.js +33 -1
  30. package/dist/esm/permissionless/index.js +2 -1
  31. package/dist/types/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.d.ts +148 -0
  32. package/dist/types/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.d.ts +440 -0
  33. package/dist/types/abi/router/treehouseWorker.d.ts +728 -0
  34. package/dist/types/onchain/market/adapters/types.d.ts +4 -1
  35. package/dist/types/permissionless/api/GearboxPermissionless.d.ts +11 -5
  36. package/dist/types/permissionless/api/analytics/PermissionlessAnalytics.d.ts +38 -0
  37. package/dist/types/permissionless/api/analytics/index.d.ts +3 -0
  38. package/dist/types/permissionless/api/analytics/schemas.d.ts +32 -0
  39. package/dist/types/permissionless/api/analytics/types.d.ts +38 -0
  40. package/dist/types/permissionless/api/index.d.ts +5 -2
  41. package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +55 -1
  42. package/dist/types/permissionless/api/oracles/index.d.ts +2 -2
  43. package/dist/types/permissionless/api/oracles/schemas.d.ts +55 -0
  44. package/dist/types/permissionless/api/oracles/types.d.ts +92 -0
  45. package/dist/types/permissionless/index.d.ts +4 -2
  46. package/package.json +1 -1
@@ -0,0 +1,179 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/abi/compressors/subcompressors/liquidation/treehouseLiquidationSubcompressor.ts
3
+ const treehouseLiquidationSubcompressorAbi = [
4
+ {
5
+ type: "function",
6
+ name: "contractType",
7
+ inputs: [],
8
+ outputs: [{
9
+ name: "",
10
+ type: "bytes32",
11
+ internalType: "bytes32"
12
+ }],
13
+ stateMutability: "view"
14
+ },
15
+ {
16
+ type: "function",
17
+ name: "getLiquidationData",
18
+ inputs: [
19
+ {
20
+ name: "liquidator",
21
+ type: "address",
22
+ internalType: "address"
23
+ },
24
+ {
25
+ name: "creditAccount",
26
+ type: "address",
27
+ internalType: "address"
28
+ },
29
+ {
30
+ name: "phantomToken",
31
+ type: "address",
32
+ internalType: "address"
33
+ },
34
+ {
35
+ name: "priceUpdates",
36
+ type: "tuple[]",
37
+ internalType: "struct PriceUpdate[]",
38
+ components: [{
39
+ name: "priceFeed",
40
+ type: "address",
41
+ internalType: "address"
42
+ }, {
43
+ name: "data",
44
+ type: "bytes",
45
+ internalType: "bytes"
46
+ }]
47
+ }
48
+ ],
49
+ outputs: [{
50
+ name: "data",
51
+ type: "tuple",
52
+ internalType: "struct LiquidationData",
53
+ components: [
54
+ {
55
+ name: "requiredToken",
56
+ type: "address",
57
+ internalType: "address"
58
+ },
59
+ {
60
+ name: "requiredAmount",
61
+ type: "uint256",
62
+ internalType: "uint256"
63
+ },
64
+ {
65
+ name: "expectedOutputs",
66
+ type: "tuple[]",
67
+ internalType: "struct LiquidationOutput[]",
68
+ components: [
69
+ {
70
+ name: "token",
71
+ type: "address",
72
+ internalType: "address"
73
+ },
74
+ {
75
+ name: "amount",
76
+ type: "uint256",
77
+ internalType: "uint256"
78
+ },
79
+ {
80
+ name: "delayed",
81
+ type: "bool",
82
+ internalType: "bool"
83
+ },
84
+ {
85
+ name: "redeemerAddress",
86
+ type: "address",
87
+ internalType: "address"
88
+ },
89
+ {
90
+ name: "claimableAt",
91
+ type: "uint256",
92
+ internalType: "uint256"
93
+ }
94
+ ]
95
+ },
96
+ {
97
+ name: "liquidationCall",
98
+ type: "tuple",
99
+ internalType: "struct MultiCall",
100
+ components: [{
101
+ name: "target",
102
+ type: "address",
103
+ internalType: "address"
104
+ }, {
105
+ name: "callData",
106
+ type: "bytes",
107
+ internalType: "bytes"
108
+ }]
109
+ },
110
+ {
111
+ name: "isLiquidatorEligible",
112
+ type: "bool",
113
+ internalType: "bool"
114
+ },
115
+ {
116
+ name: "isCreditAccountFrozen",
117
+ type: "bool",
118
+ internalType: "bool"
119
+ },
120
+ {
121
+ name: "kycProtocol",
122
+ type: "string",
123
+ internalType: "string"
124
+ },
125
+ {
126
+ name: "kycToken",
127
+ type: "address",
128
+ internalType: "address"
129
+ }
130
+ ]
131
+ }],
132
+ stateMutability: "nonpayable"
133
+ },
134
+ {
135
+ type: "function",
136
+ name: "getRWALiquidatorInfo",
137
+ inputs: [{
138
+ name: "token",
139
+ type: "address",
140
+ internalType: "address"
141
+ }],
142
+ outputs: [{
143
+ name: "info",
144
+ type: "tuple",
145
+ internalType: "struct RWALiquidatorInfo",
146
+ components: [
147
+ {
148
+ name: "gateway",
149
+ type: "address",
150
+ internalType: "address"
151
+ },
152
+ {
153
+ name: "liquidatorAddress",
154
+ type: "address",
155
+ internalType: "address"
156
+ },
157
+ {
158
+ name: "contractType",
159
+ type: "bytes32",
160
+ internalType: "bytes32"
161
+ }
162
+ ]
163
+ }],
164
+ stateMutability: "view"
165
+ },
166
+ {
167
+ type: "function",
168
+ name: "version",
169
+ inputs: [],
170
+ outputs: [{
171
+ name: "",
172
+ type: "uint256",
173
+ internalType: "uint256"
174
+ }],
175
+ stateMutability: "view"
176
+ }
177
+ ];
178
+ //#endregion
179
+ exports.treehouseLiquidationSubcompressorAbi = treehouseLiquidationSubcompressorAbi;
@@ -0,0 +1,534 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/abi/compressors/subcompressors/withdrawal/treehouseWithdrawalSubcompressor.ts
3
+ const treehouseWithdrawalSubcompressorAbi = [
4
+ {
5
+ type: "function",
6
+ name: "contractType",
7
+ inputs: [],
8
+ outputs: [{
9
+ name: "",
10
+ type: "bytes32",
11
+ internalType: "bytes32"
12
+ }],
13
+ stateMutability: "view"
14
+ },
15
+ {
16
+ type: "function",
17
+ name: "getCurrentWithdrawals",
18
+ inputs: [{
19
+ name: "creditAccount",
20
+ type: "address",
21
+ internalType: "address"
22
+ }, {
23
+ name: "token",
24
+ type: "address",
25
+ internalType: "address"
26
+ }],
27
+ outputs: [{
28
+ name: "",
29
+ type: "tuple[]",
30
+ internalType: "struct ClaimableWithdrawal[]",
31
+ components: [
32
+ {
33
+ name: "token",
34
+ type: "address",
35
+ internalType: "address"
36
+ },
37
+ {
38
+ name: "withdrawalPhantomToken",
39
+ type: "address",
40
+ internalType: "address"
41
+ },
42
+ {
43
+ name: "withdrawalTokenSpent",
44
+ type: "uint256",
45
+ internalType: "uint256"
46
+ },
47
+ {
48
+ name: "outputs",
49
+ type: "tuple[]",
50
+ internalType: "struct WithdrawalOutput[]",
51
+ components: [
52
+ {
53
+ name: "token",
54
+ type: "address",
55
+ internalType: "address"
56
+ },
57
+ {
58
+ name: "isDelayed",
59
+ type: "bool",
60
+ internalType: "bool"
61
+ },
62
+ {
63
+ name: "amount",
64
+ type: "uint256",
65
+ internalType: "uint256"
66
+ }
67
+ ]
68
+ },
69
+ {
70
+ name: "claimCalls",
71
+ type: "tuple[]",
72
+ internalType: "struct MultiCall[]",
73
+ components: [{
74
+ name: "target",
75
+ type: "address",
76
+ internalType: "address"
77
+ }, {
78
+ name: "callData",
79
+ type: "bytes",
80
+ internalType: "bytes"
81
+ }]
82
+ },
83
+ {
84
+ name: "redeemer",
85
+ type: "address",
86
+ internalType: "address"
87
+ },
88
+ {
89
+ name: "extraData",
90
+ type: "bytes",
91
+ internalType: "bytes"
92
+ }
93
+ ]
94
+ }, {
95
+ name: "",
96
+ type: "tuple[]",
97
+ internalType: "struct PendingWithdrawal[]",
98
+ components: [
99
+ {
100
+ name: "token",
101
+ type: "address",
102
+ internalType: "address"
103
+ },
104
+ {
105
+ name: "withdrawalPhantomToken",
106
+ type: "address",
107
+ internalType: "address"
108
+ },
109
+ {
110
+ name: "expectedOutputs",
111
+ type: "tuple[]",
112
+ internalType: "struct WithdrawalOutput[]",
113
+ components: [
114
+ {
115
+ name: "token",
116
+ type: "address",
117
+ internalType: "address"
118
+ },
119
+ {
120
+ name: "isDelayed",
121
+ type: "bool",
122
+ internalType: "bool"
123
+ },
124
+ {
125
+ name: "amount",
126
+ type: "uint256",
127
+ internalType: "uint256"
128
+ }
129
+ ]
130
+ },
131
+ {
132
+ name: "claimableAt",
133
+ type: "uint256",
134
+ internalType: "uint256"
135
+ },
136
+ {
137
+ name: "redeemer",
138
+ type: "address",
139
+ internalType: "address"
140
+ },
141
+ {
142
+ name: "extraData",
143
+ type: "bytes",
144
+ internalType: "bytes"
145
+ }
146
+ ]
147
+ }],
148
+ stateMutability: "view"
149
+ },
150
+ {
151
+ type: "function",
152
+ name: "getExternalAccountCurrentWithdrawals",
153
+ inputs: [{
154
+ name: "account",
155
+ type: "address",
156
+ internalType: "address"
157
+ }, {
158
+ name: "token",
159
+ type: "address",
160
+ internalType: "address"
161
+ }],
162
+ outputs: [{
163
+ name: "",
164
+ type: "tuple[]",
165
+ internalType: "struct ClaimableWithdrawal[]",
166
+ components: [
167
+ {
168
+ name: "token",
169
+ type: "address",
170
+ internalType: "address"
171
+ },
172
+ {
173
+ name: "withdrawalPhantomToken",
174
+ type: "address",
175
+ internalType: "address"
176
+ },
177
+ {
178
+ name: "withdrawalTokenSpent",
179
+ type: "uint256",
180
+ internalType: "uint256"
181
+ },
182
+ {
183
+ name: "outputs",
184
+ type: "tuple[]",
185
+ internalType: "struct WithdrawalOutput[]",
186
+ components: [
187
+ {
188
+ name: "token",
189
+ type: "address",
190
+ internalType: "address"
191
+ },
192
+ {
193
+ name: "isDelayed",
194
+ type: "bool",
195
+ internalType: "bool"
196
+ },
197
+ {
198
+ name: "amount",
199
+ type: "uint256",
200
+ internalType: "uint256"
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ name: "claimCalls",
206
+ type: "tuple[]",
207
+ internalType: "struct MultiCall[]",
208
+ components: [{
209
+ name: "target",
210
+ type: "address",
211
+ internalType: "address"
212
+ }, {
213
+ name: "callData",
214
+ type: "bytes",
215
+ internalType: "bytes"
216
+ }]
217
+ },
218
+ {
219
+ name: "redeemer",
220
+ type: "address",
221
+ internalType: "address"
222
+ },
223
+ {
224
+ name: "extraData",
225
+ type: "bytes",
226
+ internalType: "bytes"
227
+ }
228
+ ]
229
+ }, {
230
+ name: "",
231
+ type: "tuple[]",
232
+ internalType: "struct PendingWithdrawal[]",
233
+ components: [
234
+ {
235
+ name: "token",
236
+ type: "address",
237
+ internalType: "address"
238
+ },
239
+ {
240
+ name: "withdrawalPhantomToken",
241
+ type: "address",
242
+ internalType: "address"
243
+ },
244
+ {
245
+ name: "expectedOutputs",
246
+ type: "tuple[]",
247
+ internalType: "struct WithdrawalOutput[]",
248
+ components: [
249
+ {
250
+ name: "token",
251
+ type: "address",
252
+ internalType: "address"
253
+ },
254
+ {
255
+ name: "isDelayed",
256
+ type: "bool",
257
+ internalType: "bool"
258
+ },
259
+ {
260
+ name: "amount",
261
+ type: "uint256",
262
+ internalType: "uint256"
263
+ }
264
+ ]
265
+ },
266
+ {
267
+ name: "claimableAt",
268
+ type: "uint256",
269
+ internalType: "uint256"
270
+ },
271
+ {
272
+ name: "redeemer",
273
+ type: "address",
274
+ internalType: "address"
275
+ },
276
+ {
277
+ name: "extraData",
278
+ type: "bytes",
279
+ internalType: "bytes"
280
+ }
281
+ ]
282
+ }],
283
+ stateMutability: "view"
284
+ },
285
+ {
286
+ type: "function",
287
+ name: "getWithdrawableAssets",
288
+ inputs: [{
289
+ name: "",
290
+ type: "address",
291
+ internalType: "address"
292
+ }, {
293
+ name: "token",
294
+ type: "address",
295
+ internalType: "address"
296
+ }],
297
+ outputs: [{
298
+ name: "",
299
+ type: "tuple[]",
300
+ internalType: "struct WithdrawableAsset[]",
301
+ components: [
302
+ {
303
+ name: "token",
304
+ type: "address",
305
+ internalType: "address"
306
+ },
307
+ {
308
+ name: "withdrawalPhantomToken",
309
+ type: "address",
310
+ internalType: "address"
311
+ },
312
+ {
313
+ name: "underlying",
314
+ type: "address",
315
+ internalType: "address"
316
+ },
317
+ {
318
+ name: "withdrawalLength",
319
+ type: "uint256",
320
+ internalType: "uint256"
321
+ },
322
+ {
323
+ name: "maxWithdrawals",
324
+ type: "uint256",
325
+ internalType: "uint256"
326
+ }
327
+ ]
328
+ }],
329
+ stateMutability: "view"
330
+ },
331
+ {
332
+ type: "function",
333
+ name: "getWithdrawalRequestResult",
334
+ inputs: [
335
+ {
336
+ name: "creditAccount",
337
+ type: "address",
338
+ internalType: "address"
339
+ },
340
+ {
341
+ name: "token",
342
+ type: "address",
343
+ internalType: "address"
344
+ },
345
+ {
346
+ name: "withdrawalToken",
347
+ type: "address",
348
+ internalType: "address"
349
+ },
350
+ {
351
+ name: "amount",
352
+ type: "uint256",
353
+ internalType: "uint256"
354
+ },
355
+ {
356
+ name: "extraData",
357
+ type: "bytes",
358
+ internalType: "bytes"
359
+ }
360
+ ],
361
+ outputs: [{
362
+ name: "requestableWithdrawal",
363
+ type: "tuple",
364
+ internalType: "struct RequestableWithdrawal",
365
+ components: [
366
+ {
367
+ name: "token",
368
+ type: "address",
369
+ internalType: "address"
370
+ },
371
+ {
372
+ name: "amountIn",
373
+ type: "uint256",
374
+ internalType: "uint256"
375
+ },
376
+ {
377
+ name: "outputs",
378
+ type: "tuple[]",
379
+ internalType: "struct WithdrawalOutput[]",
380
+ components: [
381
+ {
382
+ name: "token",
383
+ type: "address",
384
+ internalType: "address"
385
+ },
386
+ {
387
+ name: "isDelayed",
388
+ type: "bool",
389
+ internalType: "bool"
390
+ },
391
+ {
392
+ name: "amount",
393
+ type: "uint256",
394
+ internalType: "uint256"
395
+ }
396
+ ]
397
+ },
398
+ {
399
+ name: "requestCalls",
400
+ type: "tuple[]",
401
+ internalType: "struct MultiCall[]",
402
+ components: [{
403
+ name: "target",
404
+ type: "address",
405
+ internalType: "address"
406
+ }, {
407
+ name: "callData",
408
+ type: "bytes",
409
+ internalType: "bytes"
410
+ }]
411
+ },
412
+ {
413
+ name: "claimableAt",
414
+ type: "uint256",
415
+ internalType: "uint256"
416
+ }
417
+ ]
418
+ }],
419
+ stateMutability: "view"
420
+ },
421
+ {
422
+ type: "function",
423
+ name: "getWithdrawalRequestResult",
424
+ inputs: [
425
+ {
426
+ name: "creditAccount",
427
+ type: "address",
428
+ internalType: "address"
429
+ },
430
+ {
431
+ name: "token",
432
+ type: "address",
433
+ internalType: "address"
434
+ },
435
+ {
436
+ name: "withdrawalToken",
437
+ type: "address",
438
+ internalType: "address"
439
+ },
440
+ {
441
+ name: "amount",
442
+ type: "uint256",
443
+ internalType: "uint256"
444
+ }
445
+ ],
446
+ outputs: [{
447
+ name: "requestableWithdrawal",
448
+ type: "tuple",
449
+ internalType: "struct RequestableWithdrawal",
450
+ components: [
451
+ {
452
+ name: "token",
453
+ type: "address",
454
+ internalType: "address"
455
+ },
456
+ {
457
+ name: "amountIn",
458
+ type: "uint256",
459
+ internalType: "uint256"
460
+ },
461
+ {
462
+ name: "outputs",
463
+ type: "tuple[]",
464
+ internalType: "struct WithdrawalOutput[]",
465
+ components: [
466
+ {
467
+ name: "token",
468
+ type: "address",
469
+ internalType: "address"
470
+ },
471
+ {
472
+ name: "isDelayed",
473
+ type: "bool",
474
+ internalType: "bool"
475
+ },
476
+ {
477
+ name: "amount",
478
+ type: "uint256",
479
+ internalType: "uint256"
480
+ }
481
+ ]
482
+ },
483
+ {
484
+ name: "requestCalls",
485
+ type: "tuple[]",
486
+ internalType: "struct MultiCall[]",
487
+ components: [{
488
+ name: "target",
489
+ type: "address",
490
+ internalType: "address"
491
+ }, {
492
+ name: "callData",
493
+ type: "bytes",
494
+ internalType: "bytes"
495
+ }]
496
+ },
497
+ {
498
+ name: "claimableAt",
499
+ type: "uint256",
500
+ internalType: "uint256"
501
+ }
502
+ ]
503
+ }],
504
+ stateMutability: "view"
505
+ },
506
+ {
507
+ type: "function",
508
+ name: "getWithdrawalStatus",
509
+ inputs: [{
510
+ name: "redeemer",
511
+ type: "address",
512
+ internalType: "address"
513
+ }],
514
+ outputs: [{
515
+ name: "",
516
+ type: "uint8",
517
+ internalType: "enum WithdrawalStatus"
518
+ }],
519
+ stateMutability: "view"
520
+ },
521
+ {
522
+ type: "function",
523
+ name: "version",
524
+ inputs: [],
525
+ outputs: [{
526
+ name: "",
527
+ type: "uint256",
528
+ internalType: "uint256"
529
+ }],
530
+ stateMutability: "view"
531
+ }
532
+ ];
533
+ //#endregion
534
+ exports.treehouseWithdrawalSubcompressorAbi = treehouseWithdrawalSubcompressorAbi;