@defisaver/sdk 1.3.28-audit-dev → 1.3.29

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 (36) hide show
  1. package/esm/src/Action.js +23 -5
  2. package/esm/src/actions/etherfi/EtherFiStakeFromLidoAction.d.ts +20 -0
  3. package/esm/src/actions/etherfi/EtherFiStakeFromLidoAction.js +41 -0
  4. package/esm/src/actions/etherfi/index.d.ts +1 -0
  5. package/esm/src/actions/etherfi/index.js +1 -0
  6. package/esm/src/actions/index.d.ts +2 -1
  7. package/esm/src/actions/index.js +2 -1
  8. package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.d.ts +18 -0
  9. package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.js +28 -0
  10. package/esm/src/actions/midnight/MidnightPaybackDirectAction.d.ts +16 -0
  11. package/esm/src/actions/midnight/MidnightPaybackDirectAction.js +24 -0
  12. package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.d.ts +18 -0
  13. package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.js +28 -0
  14. package/esm/src/actions/midnight/MidnightSupplyCollateralAction.d.ts +17 -0
  15. package/esm/src/actions/midnight/MidnightSupplyCollateralAction.js +26 -0
  16. package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.d.ts +17 -0
  17. package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.js +26 -0
  18. package/esm/src/actions/midnight/index.d.ts +5 -0
  19. package/esm/src/actions/midnight/index.js +5 -0
  20. package/esm/src/addresses.d.ts +42 -0
  21. package/esm/src/addresses.js +22 -15
  22. package/esm/src/index.d.ts +168 -0
  23. package/package.json +4 -30
  24. package/src/Action.ts +21 -5
  25. package/src/actions/etherfi/EtherFiStakeFromLidoAction.ts +38 -0
  26. package/src/actions/etherfi/index.ts +2 -1
  27. package/src/actions/index.ts +2 -0
  28. package/src/actions/midnight/MidnightBorrowFromOrdersAction.ts +44 -0
  29. package/src/actions/midnight/MidnightPaybackDirectAction.ts +36 -0
  30. package/src/actions/midnight/MidnightPaybackFromOrdersAction.ts +44 -0
  31. package/src/actions/midnight/MidnightSupplyCollateralAction.ts +39 -0
  32. package/src/actions/midnight/MidnightWithdrawCollateralAction.ts +39 -0
  33. package/src/actions/midnight/index.ts +5 -0
  34. package/src/addresses.ts +23 -15
  35. package/test/actions/etherFi/EtherFiStakeFromLidoAction.js +40 -0
  36. package/umd/index.js +942 -676
@@ -267,6 +267,7 @@ declare const actionAddressesAllChains: {
267
267
  MerklClaim: string;
268
268
  RenzoStake: string;
269
269
  EtherFiStake: string;
270
+ EtherFiStakeFromLido: string;
270
271
  EtherFiWrap: string;
271
272
  EtherFiUnwrap: string;
272
273
  KingClaim: string;
@@ -304,6 +305,12 @@ declare const actionAddressesAllChains: {
304
305
  GasFeeTakerL2?: undefined;
305
306
  AaveV3RatioCheck?: undefined;
306
307
  MorphoBlueView?: undefined;
308
+ MidnightPaybackDirect?: undefined;
309
+ MidnightBorrowFromOrders?: undefined;
310
+ MidnightPaybackFromOrders?: undefined;
311
+ MidnightSupplyCollateral?: undefined;
312
+ MidnightWithdrawCollateral?: undefined;
313
+ MidnightView?: undefined;
307
314
  } | {
308
315
  DFSSell: string;
309
316
  DFSSellNoFee: string;
@@ -566,6 +573,7 @@ declare const actionAddressesAllChains: {
566
573
  EulerV2View?: undefined;
567
574
  RenzoStake?: undefined;
568
575
  EtherFiStake?: undefined;
576
+ EtherFiStakeFromLido?: undefined;
569
577
  EtherFiWrap?: undefined;
570
578
  EtherFiUnwrap?: undefined;
571
579
  KingClaim?: undefined;
@@ -597,6 +605,12 @@ declare const actionAddressesAllChains: {
597
605
  AaveV4DelegateBorrowWithSig?: undefined;
598
606
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
599
607
  MorphoBlueView?: undefined;
608
+ MidnightPaybackDirect?: undefined;
609
+ MidnightBorrowFromOrders?: undefined;
610
+ MidnightPaybackFromOrders?: undefined;
611
+ MidnightSupplyCollateral?: undefined;
612
+ MidnightWithdrawCollateral?: undefined;
613
+ MidnightView?: undefined;
600
614
  } | {
601
615
  DFSSell: string;
602
616
  DFSSellNoFee: string;
@@ -871,6 +885,7 @@ declare const actionAddressesAllChains: {
871
885
  EulerV2View?: undefined;
872
886
  RenzoStake?: undefined;
873
887
  EtherFiStake?: undefined;
888
+ EtherFiStakeFromLido?: undefined;
874
889
  EtherFiWrap?: undefined;
875
890
  EtherFiUnwrap?: undefined;
876
891
  KingClaim?: undefined;
@@ -890,6 +905,12 @@ declare const actionAddressesAllChains: {
890
905
  AaveV4DelegateBorrowWithSig?: undefined;
891
906
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
892
907
  AaveV3RatioTrigger?: undefined;
908
+ MidnightPaybackDirect?: undefined;
909
+ MidnightBorrowFromOrders?: undefined;
910
+ MidnightPaybackFromOrders?: undefined;
911
+ MidnightSupplyCollateral?: undefined;
912
+ MidnightWithdrawCollateral?: undefined;
913
+ MidnightView?: undefined;
893
914
  } | {
894
915
  DFSSell: string;
895
916
  DFSSellNoFee: string;
@@ -963,6 +984,12 @@ declare const actionAddressesAllChains: {
963
984
  SFApproveTokens: string;
964
985
  SummerfiUnsub: string;
965
986
  SummerfiUnsubV2: string;
987
+ MidnightPaybackDirect: string;
988
+ MidnightBorrowFromOrders: string;
989
+ MidnightPaybackFromOrders: string;
990
+ MidnightSupplyCollateral: string;
991
+ MidnightWithdrawCollateral: string;
992
+ MidnightView: string;
966
993
  AutomationV2Unsub?: undefined;
967
994
  SendTokenAndUnwrap?: undefined;
968
995
  SDaiWrap?: undefined;
@@ -1163,6 +1190,7 @@ declare const actionAddressesAllChains: {
1163
1190
  EulerV2View?: undefined;
1164
1191
  RenzoStake?: undefined;
1165
1192
  EtherFiStake?: undefined;
1193
+ EtherFiStakeFromLido?: undefined;
1166
1194
  EtherFiWrap?: undefined;
1167
1195
  EtherFiUnwrap?: undefined;
1168
1196
  KingClaim?: undefined;
@@ -1439,6 +1467,7 @@ declare const actionAddressesAllChains: {
1439
1467
  EulerV2View?: undefined;
1440
1468
  RenzoStake?: undefined;
1441
1469
  EtherFiStake?: undefined;
1470
+ EtherFiStakeFromLido?: undefined;
1442
1471
  EtherFiWrap?: undefined;
1443
1472
  EtherFiUnwrap?: undefined;
1444
1473
  KingClaim?: undefined;
@@ -1476,6 +1505,12 @@ declare const actionAddressesAllChains: {
1476
1505
  GasFeeTakerL2?: undefined;
1477
1506
  AaveV3RatioCheck?: undefined;
1478
1507
  MorphoBlueView?: undefined;
1508
+ MidnightPaybackDirect?: undefined;
1509
+ MidnightBorrowFromOrders?: undefined;
1510
+ MidnightPaybackFromOrders?: undefined;
1511
+ MidnightSupplyCollateral?: undefined;
1512
+ MidnightWithdrawCollateral?: undefined;
1513
+ MidnightView?: undefined;
1479
1514
  } | {
1480
1515
  DFSSell: string;
1481
1516
  DFSSellNoFee: string;
@@ -1745,6 +1780,7 @@ declare const actionAddressesAllChains: {
1745
1780
  EulerV2View?: undefined;
1746
1781
  RenzoStake?: undefined;
1747
1782
  EtherFiStake?: undefined;
1783
+ EtherFiStakeFromLido?: undefined;
1748
1784
  EtherFiWrap?: undefined;
1749
1785
  EtherFiUnwrap?: undefined;
1750
1786
  KingClaim?: undefined;
@@ -1769,6 +1805,12 @@ declare const actionAddressesAllChains: {
1769
1805
  GasFeeTakerL2?: undefined;
1770
1806
  AaveV3RatioCheck?: undefined;
1771
1807
  MorphoBlueView?: undefined;
1808
+ MidnightPaybackDirect?: undefined;
1809
+ MidnightBorrowFromOrders?: undefined;
1810
+ MidnightPaybackFromOrders?: undefined;
1811
+ MidnightSupplyCollateral?: undefined;
1812
+ MidnightWithdrawCollateral?: undefined;
1813
+ MidnightView?: undefined;
1772
1814
  };
1773
1815
  };
1774
1816
  declare const actionAddresses: (chainId?: null) => {
@@ -2027,6 +2069,7 @@ declare const actionAddresses: (chainId?: null) => {
2027
2069
  MerklClaim: string;
2028
2070
  RenzoStake: string;
2029
2071
  EtherFiStake: string;
2072
+ EtherFiStakeFromLido: string;
2030
2073
  EtherFiWrap: string;
2031
2074
  EtherFiUnwrap: string;
2032
2075
  KingClaim: string;
@@ -2064,6 +2107,12 @@ declare const actionAddresses: (chainId?: null) => {
2064
2107
  GasFeeTakerL2?: undefined;
2065
2108
  AaveV3RatioCheck?: undefined;
2066
2109
  MorphoBlueView?: undefined;
2110
+ MidnightPaybackDirect?: undefined;
2111
+ MidnightBorrowFromOrders?: undefined;
2112
+ MidnightPaybackFromOrders?: undefined;
2113
+ MidnightSupplyCollateral?: undefined;
2114
+ MidnightWithdrawCollateral?: undefined;
2115
+ MidnightView?: undefined;
2067
2116
  } | {
2068
2117
  DFSSell: string;
2069
2118
  DFSSellNoFee: string;
@@ -2326,6 +2375,7 @@ declare const actionAddresses: (chainId?: null) => {
2326
2375
  EulerV2View?: undefined;
2327
2376
  RenzoStake?: undefined;
2328
2377
  EtherFiStake?: undefined;
2378
+ EtherFiStakeFromLido?: undefined;
2329
2379
  EtherFiWrap?: undefined;
2330
2380
  EtherFiUnwrap?: undefined;
2331
2381
  KingClaim?: undefined;
@@ -2357,6 +2407,12 @@ declare const actionAddresses: (chainId?: null) => {
2357
2407
  AaveV4DelegateBorrowWithSig?: undefined;
2358
2408
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
2359
2409
  MorphoBlueView?: undefined;
2410
+ MidnightPaybackDirect?: undefined;
2411
+ MidnightBorrowFromOrders?: undefined;
2412
+ MidnightPaybackFromOrders?: undefined;
2413
+ MidnightSupplyCollateral?: undefined;
2414
+ MidnightWithdrawCollateral?: undefined;
2415
+ MidnightView?: undefined;
2360
2416
  } | {
2361
2417
  DFSSell: string;
2362
2418
  DFSSellNoFee: string;
@@ -2631,6 +2687,7 @@ declare const actionAddresses: (chainId?: null) => {
2631
2687
  EulerV2View?: undefined;
2632
2688
  RenzoStake?: undefined;
2633
2689
  EtherFiStake?: undefined;
2690
+ EtherFiStakeFromLido?: undefined;
2634
2691
  EtherFiWrap?: undefined;
2635
2692
  EtherFiUnwrap?: undefined;
2636
2693
  KingClaim?: undefined;
@@ -2650,6 +2707,12 @@ declare const actionAddresses: (chainId?: null) => {
2650
2707
  AaveV4DelegateBorrowWithSig?: undefined;
2651
2708
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
2652
2709
  AaveV3RatioTrigger?: undefined;
2710
+ MidnightPaybackDirect?: undefined;
2711
+ MidnightBorrowFromOrders?: undefined;
2712
+ MidnightPaybackFromOrders?: undefined;
2713
+ MidnightSupplyCollateral?: undefined;
2714
+ MidnightWithdrawCollateral?: undefined;
2715
+ MidnightView?: undefined;
2653
2716
  } | {
2654
2717
  DFSSell: string;
2655
2718
  DFSSellNoFee: string;
@@ -2723,6 +2786,12 @@ declare const actionAddresses: (chainId?: null) => {
2723
2786
  SFApproveTokens: string;
2724
2787
  SummerfiUnsub: string;
2725
2788
  SummerfiUnsubV2: string;
2789
+ MidnightPaybackDirect: string;
2790
+ MidnightBorrowFromOrders: string;
2791
+ MidnightPaybackFromOrders: string;
2792
+ MidnightSupplyCollateral: string;
2793
+ MidnightWithdrawCollateral: string;
2794
+ MidnightView: string;
2726
2795
  AutomationV2Unsub?: undefined;
2727
2796
  SendTokenAndUnwrap?: undefined;
2728
2797
  SDaiWrap?: undefined;
@@ -2923,6 +2992,7 @@ declare const actionAddresses: (chainId?: null) => {
2923
2992
  EulerV2View?: undefined;
2924
2993
  RenzoStake?: undefined;
2925
2994
  EtherFiStake?: undefined;
2995
+ EtherFiStakeFromLido?: undefined;
2926
2996
  EtherFiWrap?: undefined;
2927
2997
  EtherFiUnwrap?: undefined;
2928
2998
  KingClaim?: undefined;
@@ -3199,6 +3269,7 @@ declare const actionAddresses: (chainId?: null) => {
3199
3269
  EulerV2View?: undefined;
3200
3270
  RenzoStake?: undefined;
3201
3271
  EtherFiStake?: undefined;
3272
+ EtherFiStakeFromLido?: undefined;
3202
3273
  EtherFiWrap?: undefined;
3203
3274
  EtherFiUnwrap?: undefined;
3204
3275
  KingClaim?: undefined;
@@ -3236,6 +3307,12 @@ declare const actionAddresses: (chainId?: null) => {
3236
3307
  GasFeeTakerL2?: undefined;
3237
3308
  AaveV3RatioCheck?: undefined;
3238
3309
  MorphoBlueView?: undefined;
3310
+ MidnightPaybackDirect?: undefined;
3311
+ MidnightBorrowFromOrders?: undefined;
3312
+ MidnightPaybackFromOrders?: undefined;
3313
+ MidnightSupplyCollateral?: undefined;
3314
+ MidnightWithdrawCollateral?: undefined;
3315
+ MidnightView?: undefined;
3239
3316
  } | {
3240
3317
  DFSSell: string;
3241
3318
  DFSSellNoFee: string;
@@ -3505,6 +3582,7 @@ declare const actionAddresses: (chainId?: null) => {
3505
3582
  EulerV2View?: undefined;
3506
3583
  RenzoStake?: undefined;
3507
3584
  EtherFiStake?: undefined;
3585
+ EtherFiStakeFromLido?: undefined;
3508
3586
  EtherFiWrap?: undefined;
3509
3587
  EtherFiUnwrap?: undefined;
3510
3588
  KingClaim?: undefined;
@@ -3529,6 +3607,12 @@ declare const actionAddresses: (chainId?: null) => {
3529
3607
  GasFeeTakerL2?: undefined;
3530
3608
  AaveV3RatioCheck?: undefined;
3531
3609
  MorphoBlueView?: undefined;
3610
+ MidnightPaybackDirect?: undefined;
3611
+ MidnightBorrowFromOrders?: undefined;
3612
+ MidnightPaybackFromOrders?: undefined;
3613
+ MidnightSupplyCollateral?: undefined;
3614
+ MidnightWithdrawCollateral?: undefined;
3615
+ MidnightView?: undefined;
3532
3616
  };
3533
3617
  declare const otherAddressesAllChains: {
3534
3618
  [x: number]: {
@@ -4024,6 +4108,7 @@ declare const _default: {
4024
4108
  MerklClaim: string;
4025
4109
  RenzoStake: string;
4026
4110
  EtherFiStake: string;
4111
+ EtherFiStakeFromLido: string;
4027
4112
  EtherFiWrap: string;
4028
4113
  EtherFiUnwrap: string;
4029
4114
  KingClaim: string;
@@ -4061,6 +4146,12 @@ declare const _default: {
4061
4146
  GasFeeTakerL2?: undefined;
4062
4147
  AaveV3RatioCheck?: undefined;
4063
4148
  MorphoBlueView?: undefined;
4149
+ MidnightPaybackDirect?: undefined;
4150
+ MidnightBorrowFromOrders?: undefined;
4151
+ MidnightPaybackFromOrders?: undefined;
4152
+ MidnightSupplyCollateral?: undefined;
4153
+ MidnightWithdrawCollateral?: undefined;
4154
+ MidnightView?: undefined;
4064
4155
  } | {
4065
4156
  DFSSell: string;
4066
4157
  DFSSellNoFee: string;
@@ -4323,6 +4414,7 @@ declare const _default: {
4323
4414
  EulerV2View?: undefined;
4324
4415
  RenzoStake?: undefined;
4325
4416
  EtherFiStake?: undefined;
4417
+ EtherFiStakeFromLido?: undefined;
4326
4418
  EtherFiWrap?: undefined;
4327
4419
  EtherFiUnwrap?: undefined;
4328
4420
  KingClaim?: undefined;
@@ -4354,6 +4446,12 @@ declare const _default: {
4354
4446
  AaveV4DelegateBorrowWithSig?: undefined;
4355
4447
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
4356
4448
  MorphoBlueView?: undefined;
4449
+ MidnightPaybackDirect?: undefined;
4450
+ MidnightBorrowFromOrders?: undefined;
4451
+ MidnightPaybackFromOrders?: undefined;
4452
+ MidnightSupplyCollateral?: undefined;
4453
+ MidnightWithdrawCollateral?: undefined;
4454
+ MidnightView?: undefined;
4357
4455
  } | {
4358
4456
  DFSSell: string;
4359
4457
  DFSSellNoFee: string;
@@ -4628,6 +4726,7 @@ declare const _default: {
4628
4726
  EulerV2View?: undefined;
4629
4727
  RenzoStake?: undefined;
4630
4728
  EtherFiStake?: undefined;
4729
+ EtherFiStakeFromLido?: undefined;
4631
4730
  EtherFiWrap?: undefined;
4632
4731
  EtherFiUnwrap?: undefined;
4633
4732
  KingClaim?: undefined;
@@ -4647,6 +4746,12 @@ declare const _default: {
4647
4746
  AaveV4DelegateBorrowWithSig?: undefined;
4648
4747
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
4649
4748
  AaveV3RatioTrigger?: undefined;
4749
+ MidnightPaybackDirect?: undefined;
4750
+ MidnightBorrowFromOrders?: undefined;
4751
+ MidnightPaybackFromOrders?: undefined;
4752
+ MidnightSupplyCollateral?: undefined;
4753
+ MidnightWithdrawCollateral?: undefined;
4754
+ MidnightView?: undefined;
4650
4755
  } | {
4651
4756
  DFSSell: string;
4652
4757
  DFSSellNoFee: string;
@@ -4720,6 +4825,12 @@ declare const _default: {
4720
4825
  SFApproveTokens: string;
4721
4826
  SummerfiUnsub: string;
4722
4827
  SummerfiUnsubV2: string;
4828
+ MidnightPaybackDirect: string;
4829
+ MidnightBorrowFromOrders: string;
4830
+ MidnightPaybackFromOrders: string;
4831
+ MidnightSupplyCollateral: string;
4832
+ MidnightWithdrawCollateral: string;
4833
+ MidnightView: string;
4723
4834
  AutomationV2Unsub?: undefined;
4724
4835
  SendTokenAndUnwrap?: undefined;
4725
4836
  SDaiWrap?: undefined;
@@ -4920,6 +5031,7 @@ declare const _default: {
4920
5031
  EulerV2View?: undefined;
4921
5032
  RenzoStake?: undefined;
4922
5033
  EtherFiStake?: undefined;
5034
+ EtherFiStakeFromLido?: undefined;
4923
5035
  EtherFiWrap?: undefined;
4924
5036
  EtherFiUnwrap?: undefined;
4925
5037
  KingClaim?: undefined;
@@ -5196,6 +5308,7 @@ declare const _default: {
5196
5308
  EulerV2View?: undefined;
5197
5309
  RenzoStake?: undefined;
5198
5310
  EtherFiStake?: undefined;
5311
+ EtherFiStakeFromLido?: undefined;
5199
5312
  EtherFiWrap?: undefined;
5200
5313
  EtherFiUnwrap?: undefined;
5201
5314
  KingClaim?: undefined;
@@ -5233,6 +5346,12 @@ declare const _default: {
5233
5346
  GasFeeTakerL2?: undefined;
5234
5347
  AaveV3RatioCheck?: undefined;
5235
5348
  MorphoBlueView?: undefined;
5349
+ MidnightPaybackDirect?: undefined;
5350
+ MidnightBorrowFromOrders?: undefined;
5351
+ MidnightPaybackFromOrders?: undefined;
5352
+ MidnightSupplyCollateral?: undefined;
5353
+ MidnightWithdrawCollateral?: undefined;
5354
+ MidnightView?: undefined;
5236
5355
  } | {
5237
5356
  DFSSell: string;
5238
5357
  DFSSellNoFee: string;
@@ -5502,6 +5621,7 @@ declare const _default: {
5502
5621
  EulerV2View?: undefined;
5503
5622
  RenzoStake?: undefined;
5504
5623
  EtherFiStake?: undefined;
5624
+ EtherFiStakeFromLido?: undefined;
5505
5625
  EtherFiWrap?: undefined;
5506
5626
  EtherFiUnwrap?: undefined;
5507
5627
  KingClaim?: undefined;
@@ -5526,6 +5646,12 @@ declare const _default: {
5526
5646
  GasFeeTakerL2?: undefined;
5527
5647
  AaveV3RatioCheck?: undefined;
5528
5648
  MorphoBlueView?: undefined;
5649
+ MidnightPaybackDirect?: undefined;
5650
+ MidnightBorrowFromOrders?: undefined;
5651
+ MidnightPaybackFromOrders?: undefined;
5652
+ MidnightSupplyCollateral?: undefined;
5653
+ MidnightWithdrawCollateral?: undefined;
5654
+ MidnightView?: undefined;
5529
5655
  };
5530
5656
  actionAddressesAllChains: {
5531
5657
  [x: number]: {
@@ -5784,6 +5910,7 @@ declare const _default: {
5784
5910
  MerklClaim: string;
5785
5911
  RenzoStake: string;
5786
5912
  EtherFiStake: string;
5913
+ EtherFiStakeFromLido: string;
5787
5914
  EtherFiWrap: string;
5788
5915
  EtherFiUnwrap: string;
5789
5916
  KingClaim: string;
@@ -5821,6 +5948,12 @@ declare const _default: {
5821
5948
  GasFeeTakerL2?: undefined;
5822
5949
  AaveV3RatioCheck?: undefined;
5823
5950
  MorphoBlueView?: undefined;
5951
+ MidnightPaybackDirect?: undefined;
5952
+ MidnightBorrowFromOrders?: undefined;
5953
+ MidnightPaybackFromOrders?: undefined;
5954
+ MidnightSupplyCollateral?: undefined;
5955
+ MidnightWithdrawCollateral?: undefined;
5956
+ MidnightView?: undefined;
5824
5957
  } | {
5825
5958
  DFSSell: string;
5826
5959
  DFSSellNoFee: string;
@@ -6083,6 +6216,7 @@ declare const _default: {
6083
6216
  EulerV2View?: undefined;
6084
6217
  RenzoStake?: undefined;
6085
6218
  EtherFiStake?: undefined;
6219
+ EtherFiStakeFromLido?: undefined;
6086
6220
  EtherFiWrap?: undefined;
6087
6221
  EtherFiUnwrap?: undefined;
6088
6222
  KingClaim?: undefined;
@@ -6114,6 +6248,12 @@ declare const _default: {
6114
6248
  AaveV4DelegateBorrowWithSig?: undefined;
6115
6249
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
6116
6250
  MorphoBlueView?: undefined;
6251
+ MidnightPaybackDirect?: undefined;
6252
+ MidnightBorrowFromOrders?: undefined;
6253
+ MidnightPaybackFromOrders?: undefined;
6254
+ MidnightSupplyCollateral?: undefined;
6255
+ MidnightWithdrawCollateral?: undefined;
6256
+ MidnightView?: undefined;
6117
6257
  } | {
6118
6258
  DFSSell: string;
6119
6259
  DFSSellNoFee: string;
@@ -6388,6 +6528,7 @@ declare const _default: {
6388
6528
  EulerV2View?: undefined;
6389
6529
  RenzoStake?: undefined;
6390
6530
  EtherFiStake?: undefined;
6531
+ EtherFiStakeFromLido?: undefined;
6391
6532
  EtherFiWrap?: undefined;
6392
6533
  EtherFiUnwrap?: undefined;
6393
6534
  KingClaim?: undefined;
@@ -6407,6 +6548,12 @@ declare const _default: {
6407
6548
  AaveV4DelegateBorrowWithSig?: undefined;
6408
6549
  AaveV4DelegateSetUsingAsCollateralWithSig?: undefined;
6409
6550
  AaveV3RatioTrigger?: undefined;
6551
+ MidnightPaybackDirect?: undefined;
6552
+ MidnightBorrowFromOrders?: undefined;
6553
+ MidnightPaybackFromOrders?: undefined;
6554
+ MidnightSupplyCollateral?: undefined;
6555
+ MidnightWithdrawCollateral?: undefined;
6556
+ MidnightView?: undefined;
6410
6557
  } | {
6411
6558
  DFSSell: string;
6412
6559
  DFSSellNoFee: string;
@@ -6480,6 +6627,12 @@ declare const _default: {
6480
6627
  SFApproveTokens: string;
6481
6628
  SummerfiUnsub: string;
6482
6629
  SummerfiUnsubV2: string;
6630
+ MidnightPaybackDirect: string;
6631
+ MidnightBorrowFromOrders: string;
6632
+ MidnightPaybackFromOrders: string;
6633
+ MidnightSupplyCollateral: string;
6634
+ MidnightWithdrawCollateral: string;
6635
+ MidnightView: string;
6483
6636
  AutomationV2Unsub?: undefined;
6484
6637
  SendTokenAndUnwrap?: undefined;
6485
6638
  SDaiWrap?: undefined;
@@ -6680,6 +6833,7 @@ declare const _default: {
6680
6833
  EulerV2View?: undefined;
6681
6834
  RenzoStake?: undefined;
6682
6835
  EtherFiStake?: undefined;
6836
+ EtherFiStakeFromLido?: undefined;
6683
6837
  EtherFiWrap?: undefined;
6684
6838
  EtherFiUnwrap?: undefined;
6685
6839
  KingClaim?: undefined;
@@ -6956,6 +7110,7 @@ declare const _default: {
6956
7110
  EulerV2View?: undefined;
6957
7111
  RenzoStake?: undefined;
6958
7112
  EtherFiStake?: undefined;
7113
+ EtherFiStakeFromLido?: undefined;
6959
7114
  EtherFiWrap?: undefined;
6960
7115
  EtherFiUnwrap?: undefined;
6961
7116
  KingClaim?: undefined;
@@ -6993,6 +7148,12 @@ declare const _default: {
6993
7148
  GasFeeTakerL2?: undefined;
6994
7149
  AaveV3RatioCheck?: undefined;
6995
7150
  MorphoBlueView?: undefined;
7151
+ MidnightPaybackDirect?: undefined;
7152
+ MidnightBorrowFromOrders?: undefined;
7153
+ MidnightPaybackFromOrders?: undefined;
7154
+ MidnightSupplyCollateral?: undefined;
7155
+ MidnightWithdrawCollateral?: undefined;
7156
+ MidnightView?: undefined;
6996
7157
  } | {
6997
7158
  DFSSell: string;
6998
7159
  DFSSellNoFee: string;
@@ -7262,6 +7423,7 @@ declare const _default: {
7262
7423
  EulerV2View?: undefined;
7263
7424
  RenzoStake?: undefined;
7264
7425
  EtherFiStake?: undefined;
7426
+ EtherFiStakeFromLido?: undefined;
7265
7427
  EtherFiWrap?: undefined;
7266
7428
  EtherFiUnwrap?: undefined;
7267
7429
  KingClaim?: undefined;
@@ -7286,6 +7448,12 @@ declare const _default: {
7286
7448
  GasFeeTakerL2?: undefined;
7287
7449
  AaveV3RatioCheck?: undefined;
7288
7450
  MorphoBlueView?: undefined;
7451
+ MidnightPaybackDirect?: undefined;
7452
+ MidnightBorrowFromOrders?: undefined;
7453
+ MidnightPaybackFromOrders?: undefined;
7454
+ MidnightSupplyCollateral?: undefined;
7455
+ MidnightWithdrawCollateral?: undefined;
7456
+ MidnightView?: undefined;
7289
7457
  };
7290
7458
  };
7291
7459
  otherAddresses: (chainId?: null) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.3.28-audit-dev",
3
+ "version": "1.3.29",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
@@ -21,39 +21,13 @@
21
21
  "author": "DeFi Saver",
22
22
  "repository": "https://github.com/DecenterApps/defisaver-sdk",
23
23
  "license": "ISC",
24
- "overrides": {
25
- "tar": "^7.5.21",
26
- "ws": "^8.18.3",
27
- "form-data": "^4.0.4",
28
- "tough-cookie": "^4.1.3",
29
- "qs": "^6.14.0",
30
- "serialize-javascript": "^7.1.0",
31
- "eslint": {
32
- "minimatch": "^3.1.5"
33
- },
34
- "@eslint/eslintrc": {
35
- "minimatch": "^3.1.5"
36
- },
37
- "@humanwhocodes/config-array": {
38
- "minimatch": "^3.1.5"
39
- },
40
- "eslint-plugin-import": {
41
- "minimatch": "^3.1.5"
42
- },
43
- "eslint-plugin-jsx-a11y": {
44
- "minimatch": "^3.1.5"
45
- },
46
- "eslint-plugin-react": {
47
- "minimatch": "^3.1.5"
48
- }
49
- },
50
24
  "dependencies": {
51
25
  "@defisaver/eslint-config": "^1.0.0",
52
26
  "@defisaver/tokens": "^1.7.9",
53
27
  "@ethersproject/address": "^5.0.10",
54
28
  "@ethersproject/solidity": "^5.0.9",
55
29
  "@types/web3-eth-abi": "^1.2.2",
56
- "axios": "^1.19.0",
30
+ "axios": "^0.21.1",
57
31
  "decimal.js": "^10.2.1",
58
32
  "web3": "^1.10.1",
59
33
  "web3-eth-abi": "^1.8.0",
@@ -72,8 +46,8 @@
72
46
  "chai": "^4.2.0",
73
47
  "dotenv": "^10.0.0",
74
48
  "eslint": "^8.57.0",
75
- "jsdoc-to-markdown": "^9.1.3",
76
- "mocha": "^11.8.0",
49
+ "jsdoc-to-markdown": "^6.0.1",
50
+ "mocha": "^8.4.0",
77
51
  "ts-node": "^10.9.1",
78
52
  "typedoc": "^0.23.20",
79
53
  "typedoc-plugin-markdown": "^3.13.6",
package/src/Action.ts CHANGED
@@ -101,14 +101,30 @@ export class Action {
101
101
 
102
102
  _parseParamType(paramType:string | ParamTypes, arg:Args) {
103
103
  if (typeof (paramType) === 'string') {
104
- if (paramType.startsWith('(')) {
105
- let _paramType = paramType.replace('(', '');
106
- _paramType = _paramType.replace(')', '');
107
- return _paramType.split(',');
108
- }
109
104
  if (paramType.endsWith('[]')) {
110
105
  return Array.from(Array(arg.length).fill(paramType.replace('[]', '')));
111
106
  }
107
+ if (paramType.startsWith('(') || paramType.startsWith('tuple(')) {
108
+ const tupleStart = paramType.indexOf('(');
109
+ const tupleEnd = paramType.lastIndexOf(')');
110
+ const tupleContents = paramType.slice(tupleStart + 1, tupleEnd);
111
+ const tupleTypes = [];
112
+ let currentType = '';
113
+ let nestingDepth = 0;
114
+
115
+ for (const character of tupleContents) {
116
+ if (character === ',' && nestingDepth === 0) {
117
+ tupleTypes.push(currentType);
118
+ currentType = '';
119
+ } else {
120
+ currentType += character;
121
+ if (character === '(') nestingDepth += 1;
122
+ if (character === ')') nestingDepth -= 1;
123
+ }
124
+ }
125
+ tupleTypes.push(currentType);
126
+ return tupleTypes;
127
+ }
112
128
  }
113
129
  return paramType;
114
130
  }
@@ -0,0 +1,38 @@
1
+ import { getAssetInfo } from '@defisaver/tokens';
2
+ import { Action } from '../../Action';
3
+ import { getAddr } from '../../addresses';
4
+ import { EthAddress, uint256 } from '../../types';
5
+ import { requireAddress } from '../../utils/general';
6
+
7
+ /**
8
+ * EtherFiStakeFromLidoAction - Converts wstETH to weETH through Ether.fi's Lido staking route
9
+ *
10
+ * @category EtherFi
11
+ */
12
+ export class EtherFiStakeFromLidoAction extends Action {
13
+ /**
14
+ * @param amount - amount of wstETH to pull
15
+ * @param minAmountOut - minimum amount of weETH to receive
16
+ * @param from - address from which to pull wstETH
17
+ * @param to - address where received weETH will be sent
18
+ */
19
+ constructor(amount:uint256, minAmountOut:uint256, from:EthAddress, to:EthAddress) {
20
+ requireAddress(to);
21
+ super(
22
+ 'EtherFiStakeFromLido',
23
+ getAddr('EtherFiStakeFromLido'),
24
+ ['uint256', 'uint256', 'address', 'address'],
25
+ [amount, minAmountOut, from, to],
26
+ );
27
+ this.mappableArgs = [
28
+ this.args[0],
29
+ this.args[1],
30
+ this.args[2],
31
+ this.args[3],
32
+ ];
33
+ }
34
+
35
+ async getAssetsToApprove() {
36
+ return [{ asset: getAssetInfo('WSTETH').address, owner: this.args[2] }];
37
+ }
38
+ }
@@ -1,3 +1,4 @@
1
1
  export * from './EtherFiStakeAction';
2
+ export * from './EtherFiStakeFromLidoAction';
2
3
  export * from './EtherFiWrapAction';
3
- export * from './EtherFiUnwrapAction';
4
+ export * from './EtherFiUnwrapAction';
@@ -40,6 +40,7 @@ import * as fluid from './fluid';
40
40
  import * as pendle from './pendle';
41
41
  import * as umbrella from './umbrella';
42
42
  import * as aaveV4 from './aavev4';
43
+ import * as midnight from './midnight';
43
44
 
44
45
  export {
45
46
  aave,
@@ -84,4 +85,5 @@ export {
84
85
  pendle,
85
86
  umbrella,
86
87
  aaveV4,
88
+ midnight,
87
89
  };
@@ -0,0 +1,44 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, bytes32, uint256 } from '../../types';
4
+
5
+ const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
6
+
7
+ /**
8
+ * MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
9
+ *
10
+ * @category MidnightBorrowFromOrders
11
+ */
12
+ export class MidnightBorrowFromOrdersAction extends Action {
13
+ /**
14
+ * @param marketId Market id.
15
+ * @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
16
+ * @param to Address to send the borrowed tokens to.
17
+ * @param amount Amount of tokens to borrow.
18
+ * @param maxUnits Maximum number of units to take from the orders (slippage protection).
19
+ * @param offerFills Array of offer fills to borrow from.
20
+ */
21
+ constructor(
22
+ marketId: bytes32,
23
+ onBehalf: EthAddress,
24
+ to: EthAddress,
25
+ amount: uint256,
26
+ maxUnits: uint256,
27
+ offerFills: Array<any>,
28
+ ) {
29
+ super(
30
+ 'MidnightBorrowFromOrders',
31
+ getAddr('MidnightBorrowFromOrders'),
32
+ ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType],
33
+ [marketId, onBehalf, to, amount, maxUnits, offerFills],
34
+ );
35
+
36
+ this.mappableArgs = [
37
+ this.args[0],
38
+ this.args[1],
39
+ this.args[2],
40
+ this.args[3],
41
+ this.args[4],
42
+ ];
43
+ }
44
+ }