@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
@@ -48,34 +48,29 @@ const midasGatewayAbi = [
48
48
  internalType: "address"
49
49
  },
50
50
  {
51
- name: "_isAccessControlled",
52
- type: "bool",
53
- internalType: "bool"
51
+ name: "_mode",
52
+ type: "uint8",
53
+ internalType: "enum MidasMode"
54
54
  },
55
55
  {
56
56
  name: "_allowedMarketConfigurator",
57
57
  type: "address",
58
58
  internalType: "address"
59
59
  },
60
- {
61
- name: "_checkBorrowerGreenlist",
62
- type: "bool",
63
- internalType: "bool"
64
- },
65
60
  {
66
61
  name: "_expectedRedemptionDuration",
67
62
  type: "uint256",
68
63
  internalType: "uint256"
69
64
  },
70
- {
71
- name: "_redemptionLogger",
72
- type: "address",
73
- internalType: "address"
74
- },
75
65
  {
76
66
  name: "_withDelayedWithdrawals",
77
67
  type: "bool",
78
68
  internalType: "bool"
69
+ },
70
+ {
71
+ name: "_addressProvider",
72
+ type: "address",
73
+ internalType: "address"
79
74
  }
80
75
  ],
81
76
  stateMutability: "nonpayable"
@@ -106,19 +101,6 @@ const midasGatewayAbi = [
106
101
  ],
107
102
  stateMutability: "view"
108
103
  },
109
- {
110
- type: "function",
111
- name: "checkBorrowerGreenlist",
112
- inputs: [],
113
- outputs: [
114
- {
115
- name: "",
116
- type: "bool",
117
- internalType: "bool"
118
- }
119
- ],
120
- stateMutability: "view"
121
- },
122
104
  {
123
105
  type: "function",
124
106
  name: "contractType",
@@ -168,6 +150,25 @@ const midasGatewayAbi = [
168
150
  ],
169
151
  stateMutability: "view"
170
152
  },
153
+ {
154
+ type: "function",
155
+ name: "isEligibleAccountOwner",
156
+ inputs: [
157
+ {
158
+ name: "account",
159
+ type: "address",
160
+ internalType: "address"
161
+ }
162
+ ],
163
+ outputs: [
164
+ {
165
+ name: "",
166
+ type: "bool",
167
+ internalType: "bool"
168
+ }
169
+ ],
170
+ stateMutability: "view"
171
+ },
171
172
  {
172
173
  type: "function",
173
174
  name: "mToken",
@@ -220,6 +221,19 @@ const midasGatewayAbi = [
220
221
  ],
221
222
  stateMutability: "view"
222
223
  },
224
+ {
225
+ type: "function",
226
+ name: "mode",
227
+ inputs: [],
228
+ outputs: [
229
+ {
230
+ name: "",
231
+ type: "uint8",
232
+ internalType: "enum MidasMode"
233
+ }
234
+ ],
235
+ stateMutability: "view"
236
+ },
223
237
  {
224
238
  type: "function",
225
239
  name: "pendingAndClaimableTokenOutAmounts",
@@ -418,6 +432,11 @@ const midasGatewayAbi = [
418
432
  name: "AccessControlNotSetException",
419
433
  inputs: []
420
434
  },
435
+ {
436
+ type: "error",
437
+ name: "ArbitraryCAAllowedInPermissionedModeException",
438
+ inputs: []
439
+ },
421
440
  {
422
441
  type: "error",
423
442
  name: "CreditAccountNotEligibleException",
@@ -491,7 +510,7 @@ const midasRedeemerAbi = [
491
510
  },
492
511
  {
493
512
  type: "function",
494
- name: "alreadyRedeemed",
513
+ name: "alreadyRequested",
495
514
  inputs: [],
496
515
  outputs: [
497
516
  {
@@ -515,19 +534,6 @@ const midasRedeemerAbi = [
515
534
  ],
516
535
  stateMutability: "view"
517
536
  },
518
- {
519
- type: "function",
520
- name: "clearCancelledRequest",
521
- inputs: [
522
- {
523
- name: "amount",
524
- type: "uint256",
525
- internalType: "uint256"
526
- }
527
- ],
528
- outputs: [],
529
- stateMutability: "nonpayable"
530
- },
531
537
  {
532
538
  type: "function",
533
539
  name: "gateway",
@@ -541,19 +547,6 @@ const midasRedeemerAbi = [
541
547
  ],
542
548
  stateMutability: "view"
543
549
  },
544
- {
545
- type: "function",
546
- name: "isManuallyCleared",
547
- inputs: [],
548
- outputs: [
549
- {
550
- name: "",
551
- type: "bool",
552
- internalType: "bool"
553
- }
554
- ],
555
- stateMutability: "view"
556
- },
557
550
  {
558
551
  type: "function",
559
552
  name: "mToken",
@@ -686,12 +679,7 @@ const midasRedeemerAbi = [
686
679
  },
687
680
  {
688
681
  type: "error",
689
- name: "AlreadyRedeemedException",
690
- inputs: []
691
- },
692
- {
693
- type: "error",
694
- name: "AmountIsLessThanRequiredException",
682
+ name: "AlreadyRequestedException",
695
683
  inputs: []
696
684
  },
697
685
  {
@@ -703,11 +691,6 @@ const midasRedeemerAbi = [
703
691
  type: "error",
704
692
  name: "InsufficientBalanceException",
705
693
  inputs: []
706
- },
707
- {
708
- type: "error",
709
- name: "RequestNotCancelledOrManuallyClearedException",
710
- inputs: []
711
694
  }
712
695
  ];
713
696
  const midasRedemptionVaultPhantomTokenAbi = [
@@ -1054,6 +1037,19 @@ const iMidasDataFeedAbi = [
1054
1037
  }
1055
1038
  ];
1056
1039
  const iMidasRedemptionVaultAbi = [
1040
+ {
1041
+ type: "function",
1042
+ name: "accessControl",
1043
+ inputs: [],
1044
+ outputs: [
1045
+ {
1046
+ name: "",
1047
+ type: "address",
1048
+ internalType: "address"
1049
+ }
1050
+ ],
1051
+ stateMutability: "view"
1052
+ },
1057
1053
  {
1058
1054
  type: "function",
1059
1055
  name: "currentRequestId",
@@ -1164,7 +1160,7 @@ const iMidasRedemptionVaultAbi = [
1164
1160
  {
1165
1161
  name: "status",
1166
1162
  type: "uint8",
1167
- internalType: "uint8"
1163
+ internalType: "enum RedemptionStatus"
1168
1164
  },
1169
1165
  {
1170
1166
  name: "amountMTokenIn",
@@ -1225,7 +1221,7 @@ const securitizeRedemptionGatewayAbi = [
1225
1221
  internalType: "address"
1226
1222
  },
1227
1223
  {
1228
- name: "_redemptionLogger",
1224
+ name: "_addressProvider",
1229
1225
  type: "address",
1230
1226
  internalType: "address"
1231
1227
  }
@@ -1328,6 +1324,25 @@ const securitizeRedemptionGatewayAbi = [
1328
1324
  ],
1329
1325
  stateMutability: "view"
1330
1326
  },
1327
+ {
1328
+ type: "function",
1329
+ name: "isEligibleAccountOwner",
1330
+ inputs: [
1331
+ {
1332
+ name: "account",
1333
+ type: "address",
1334
+ internalType: "address"
1335
+ }
1336
+ ],
1337
+ outputs: [
1338
+ {
1339
+ name: "",
1340
+ type: "bool",
1341
+ internalType: "bool"
1342
+ }
1343
+ ],
1344
+ stateMutability: "view"
1345
+ },
1331
1346
  {
1332
1347
  type: "function",
1333
1348
  name: "masterRedeemer",
@@ -1354,6 +1369,19 @@ const securitizeRedemptionGatewayAbi = [
1354
1369
  ],
1355
1370
  stateMutability: "view"
1356
1371
  },
1372
+ {
1373
+ type: "function",
1374
+ name: "phantomToken",
1375
+ inputs: [],
1376
+ outputs: [
1377
+ {
1378
+ name: "",
1379
+ type: "address",
1380
+ internalType: "address"
1381
+ }
1382
+ ],
1383
+ stateMutability: "view"
1384
+ },
1357
1385
  {
1358
1386
  type: "function",
1359
1387
  name: "redeem",
@@ -1510,6 +1538,16 @@ const securitizeRedemptionPhantomTokenAbi = [
1510
1538
  name: "_redemptionGateway",
1511
1539
  type: "address",
1512
1540
  internalType: "address"
1541
+ },
1542
+ {
1543
+ name: "_dsToken",
1544
+ type: "address",
1545
+ internalType: "address"
1546
+ },
1547
+ {
1548
+ name: "_stableCoinToken",
1549
+ type: "address",
1550
+ internalType: "address"
1513
1551
  }
1514
1552
  ],
1515
1553
  stateMutability: "nonpayable"
@@ -18,8 +18,7 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var iMidasGatewayAdapterV311_exports = {};
20
20
  __export(iMidasGatewayAdapterV311_exports, {
21
- iMidasGatewayAdapterV311Abi: () => iMidasGatewayAdapterV311Abi,
22
- iMidasGatewayV311Abi: () => iMidasGatewayV311Abi
21
+ iMidasGatewayAdapterV311Abi: () => iMidasGatewayAdapterV311Abi
23
22
  });
24
23
  module.exports = __toCommonJS(iMidasGatewayAdapterV311_exports);
25
24
  const iMidasGatewayAdapterV311Abi = [
@@ -466,310 +465,7 @@ const iMidasGatewayAdapterV311Abi = [
466
465
  inputs: []
467
466
  }
468
467
  ];
469
- const iMidasGatewayV311Abi = [
470
- {
471
- type: "function",
472
- name: "accessControl",
473
- inputs: [],
474
- outputs: [
475
- {
476
- name: "",
477
- type: "address",
478
- internalType: "address"
479
- }
480
- ],
481
- stateMutability: "view"
482
- },
483
- {
484
- type: "function",
485
- name: "contractType",
486
- inputs: [],
487
- outputs: [
488
- {
489
- name: "",
490
- type: "bytes32",
491
- internalType: "bytes32"
492
- }
493
- ],
494
- stateMutability: "view"
495
- },
496
- {
497
- type: "function",
498
- name: "depositInstant",
499
- inputs: [
500
- {
501
- name: "amountToken",
502
- type: "uint256",
503
- internalType: "uint256"
504
- },
505
- {
506
- name: "minReceiveAmount",
507
- type: "uint256",
508
- internalType: "uint256"
509
- },
510
- {
511
- name: "referrerId",
512
- type: "bytes32",
513
- internalType: "bytes32"
514
- }
515
- ],
516
- outputs: [],
517
- stateMutability: "nonpayable"
518
- },
519
- {
520
- type: "function",
521
- name: "mToken",
522
- inputs: [],
523
- outputs: [
524
- {
525
- name: "",
526
- type: "address",
527
- internalType: "address"
528
- }
529
- ],
530
- stateMutability: "view"
531
- },
532
- {
533
- type: "function",
534
- name: "pendingAndClaimableTokenOutAmounts",
535
- inputs: [
536
- {
537
- name: "account",
538
- type: "address",
539
- internalType: "address"
540
- }
541
- ],
542
- outputs: [
543
- {
544
- name: "pendingAmount",
545
- type: "uint256",
546
- internalType: "uint256"
547
- },
548
- {
549
- name: "claimableAmount",
550
- type: "uint256",
551
- internalType: "uint256"
552
- }
553
- ],
554
- stateMutability: "view"
555
- },
556
- {
557
- type: "function",
558
- name: "pendingRedeemers",
559
- inputs: [
560
- {
561
- name: "account",
562
- type: "address",
563
- internalType: "address"
564
- }
565
- ],
566
- outputs: [
567
- {
568
- name: "redeemers",
569
- type: "address[]",
570
- internalType: "address[]"
571
- }
572
- ],
573
- stateMutability: "view"
574
- },
575
- {
576
- type: "function",
577
- name: "phantomToken",
578
- inputs: [],
579
- outputs: [
580
- {
581
- name: "",
582
- type: "address",
583
- internalType: "address"
584
- }
585
- ],
586
- stateMutability: "view"
587
- },
588
- {
589
- type: "function",
590
- name: "quoteToken",
591
- inputs: [],
592
- outputs: [
593
- {
594
- name: "",
595
- type: "address",
596
- internalType: "address"
597
- }
598
- ],
599
- stateMutability: "view"
600
- },
601
- {
602
- type: "function",
603
- name: "redeemInstant",
604
- inputs: [
605
- {
606
- name: "amountMTokenIn",
607
- type: "uint256",
608
- internalType: "uint256"
609
- },
610
- {
611
- name: "minReceiveAmount",
612
- type: "uint256",
613
- internalType: "uint256"
614
- }
615
- ],
616
- outputs: [],
617
- stateMutability: "nonpayable"
618
- },
619
- {
620
- type: "function",
621
- name: "redemptionLogger",
622
- inputs: [],
623
- outputs: [
624
- {
625
- name: "",
626
- type: "address",
627
- internalType: "address"
628
- }
629
- ],
630
- stateMutability: "view"
631
- },
632
- {
633
- type: "function",
634
- name: "requestRedeem",
635
- inputs: [
636
- {
637
- name: "amountMTokenIn",
638
- type: "uint256",
639
- internalType: "uint256"
640
- },
641
- {
642
- name: "extraData",
643
- type: "bytes",
644
- internalType: "bytes"
645
- }
646
- ],
647
- outputs: [],
648
- stateMutability: "nonpayable"
649
- },
650
- {
651
- type: "function",
652
- name: "transferMaster",
653
- inputs: [],
654
- outputs: [
655
- {
656
- name: "",
657
- type: "address",
658
- internalType: "address"
659
- }
660
- ],
661
- stateMutability: "view"
662
- },
663
- {
664
- type: "function",
665
- name: "transferRedeemer",
666
- inputs: [
667
- {
668
- name: "redeemer",
669
- type: "address",
670
- internalType: "address"
671
- },
672
- {
673
- name: "newAccount",
674
- type: "address",
675
- internalType: "address"
676
- }
677
- ],
678
- outputs: [],
679
- stateMutability: "nonpayable"
680
- },
681
- {
682
- type: "function",
683
- name: "version",
684
- inputs: [],
685
- outputs: [
686
- {
687
- name: "",
688
- type: "uint256",
689
- internalType: "uint256"
690
- }
691
- ],
692
- stateMutability: "view"
693
- },
694
- {
695
- type: "function",
696
- name: "withdraw",
697
- inputs: [
698
- {
699
- name: "amount",
700
- type: "uint256",
701
- internalType: "uint256"
702
- }
703
- ],
704
- outputs: [],
705
- stateMutability: "nonpayable"
706
- },
707
- {
708
- type: "function",
709
- name: "withdrawFromRedeemer",
710
- inputs: [
711
- {
712
- name: "redeemer",
713
- type: "address",
714
- internalType: "address"
715
- },
716
- {
717
- name: "amount",
718
- type: "uint256",
719
- internalType: "uint256"
720
- }
721
- ],
722
- outputs: [],
723
- stateMutability: "nonpayable"
724
- },
725
- {
726
- type: "error",
727
- name: "AccessControlNotSetException",
728
- inputs: []
729
- },
730
- {
731
- type: "error",
732
- name: "CreditAccountNotEligibleException",
733
- inputs: []
734
- },
735
- {
736
- type: "error",
737
- name: "IncompatibleAccessControlsException",
738
- inputs: []
739
- },
740
- {
741
- type: "error",
742
- name: "IncompatibleIssuanceAndRedemptionVaultsException",
743
- inputs: []
744
- },
745
- {
746
- type: "error",
747
- name: "InsufficientBalanceException",
748
- inputs: []
749
- },
750
- {
751
- type: "error",
752
- name: "MaxPendingRedeemersPerAccountException",
753
- inputs: []
754
- },
755
- {
756
- type: "error",
757
- name: "NewAccountNotGreenlistedException",
758
- inputs: []
759
- },
760
- {
761
- type: "error",
762
- name: "RedeemerNotOwnedByAccountException",
763
- inputs: []
764
- },
765
- {
766
- type: "error",
767
- name: "RedeemerTransferNotAllowedException",
768
- inputs: []
769
- }
770
- ];
771
468
  // Annotate the CommonJS export names for ESM import in node:
772
469
  0 && (module.exports = {
773
- iMidasGatewayAdapterV311Abi,
774
- iMidasGatewayV311Abi
470
+ iMidasGatewayAdapterV311Abi
775
471
  });
@@ -18,6 +18,7 @@ module.exports = __toCommonJS(abi_exports);
18
18
  __reExport(abi_exports, require("./actionAbi.js"), module.exports);
19
19
  __reExport(abi_exports, require("./adapters/index.js"), module.exports);
20
20
  __reExport(abi_exports, require("./conctructorAbi.js"), module.exports);
21
+ __reExport(abi_exports, require("./midas/index.js"), module.exports);
21
22
  __reExport(abi_exports, require("./securitize/index.js"), module.exports);
22
23
  __reExport(abi_exports, require("./targetContractAbi.js"), module.exports);
23
24
  __reExport(abi_exports, require("./utils.js"), module.exports);
@@ -26,6 +27,7 @@ __reExport(abi_exports, require("./utils.js"), module.exports);
26
27
  ...require("./actionAbi.js"),
27
28
  ...require("./adapters/index.js"),
28
29
  ...require("./conctructorAbi.js"),
30
+ ...require("./midas/index.js"),
29
31
  ...require("./securitize/index.js"),
30
32
  ...require("./targetContractAbi.js"),
31
33
  ...require("./utils.js")