@defisaver/sdk 1.3.16 → 1.3.17-aave-v4-dev

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 (51) hide show
  1. package/esm/src/Strategy.d.ts +1 -0
  2. package/esm/src/Strategy.js +3 -0
  3. package/esm/src/actions/aavev4/AaveV4BorrowAction.d.ts +17 -0
  4. package/esm/src/actions/aavev4/AaveV4BorrowAction.js +26 -0
  5. package/esm/src/actions/aavev4/AaveV4CollateralSwitchAction.d.ts +16 -0
  6. package/esm/src/actions/aavev4/AaveV4CollateralSwitchAction.js +24 -0
  7. package/esm/src/actions/aavev4/AaveV4PaybackAction.d.ts +23 -0
  8. package/esm/src/actions/aavev4/AaveV4PaybackAction.js +46 -0
  9. package/esm/src/actions/aavev4/AaveV4StoreRatioAction.d.ts +14 -0
  10. package/esm/src/actions/aavev4/AaveV4StoreRatioAction.js +20 -0
  11. package/esm/src/actions/aavev4/AaveV4SupplyAction.d.ts +25 -0
  12. package/esm/src/actions/aavev4/AaveV4SupplyAction.js +49 -0
  13. package/esm/src/actions/aavev4/AaveV4WithdrawAction.d.ts +17 -0
  14. package/esm/src/actions/aavev4/AaveV4WithdrawAction.js +26 -0
  15. package/esm/src/actions/aavev4/index.d.ts +6 -0
  16. package/esm/src/actions/aavev4/index.js +6 -0
  17. package/esm/src/actions/checkers/AaveV4RatioCheckAction.d.ts +16 -0
  18. package/esm/src/actions/checkers/AaveV4RatioCheckAction.js +24 -0
  19. package/esm/src/actions/checkers/index.d.ts +1 -0
  20. package/esm/src/actions/checkers/index.js +1 -0
  21. package/esm/src/actions/index.d.ts +2 -1
  22. package/esm/src/actions/index.js +2 -1
  23. package/esm/src/addresses.d.ts +35 -0
  24. package/esm/src/addresses.js +10 -0
  25. package/esm/src/index.d.ts +140 -0
  26. package/esm/src/triggers/AaveV4QuotePriceRangeTrigger.d.ts +10 -0
  27. package/esm/src/triggers/AaveV4QuotePriceRangeTrigger.js +12 -0
  28. package/esm/src/triggers/AaveV4QuotePriceTrigger.d.ts +10 -0
  29. package/esm/src/triggers/AaveV4QuotePriceTrigger.js +12 -0
  30. package/esm/src/triggers/AaveV4RatioTrigger.d.ts +10 -0
  31. package/esm/src/triggers/AaveV4RatioTrigger.js +12 -0
  32. package/esm/src/triggers/index.d.ts +3 -0
  33. package/esm/src/triggers/index.js +3 -0
  34. package/package.json +1 -1
  35. package/src/Strategy.ts +4 -0
  36. package/src/actions/aavev4/AaveV4BorrowAction.ts +39 -0
  37. package/src/actions/aavev4/AaveV4CollateralSwitchAction.ts +36 -0
  38. package/src/actions/aavev4/AaveV4PaybackAction.ts +51 -0
  39. package/src/actions/aavev4/AaveV4StoreRatioAction.ts +30 -0
  40. package/src/actions/aavev4/AaveV4SupplyAction.ts +55 -0
  41. package/src/actions/aavev4/AaveV4WithdrawAction.ts +39 -0
  42. package/src/actions/aavev4/index.ts +6 -0
  43. package/src/actions/checkers/AaveV4RatioCheckAction.ts +36 -0
  44. package/src/actions/checkers/index.ts +2 -1
  45. package/src/actions/index.ts +2 -0
  46. package/src/addresses.ts +15 -2
  47. package/src/triggers/AaveV4QuotePriceRangeTrigger.ts +25 -0
  48. package/src/triggers/AaveV4QuotePriceTrigger.ts +25 -0
  49. package/src/triggers/AaveV4RatioTrigger.ts +24 -0
  50. package/src/triggers/index.ts +4 -1
  51. package/umd/index.js +964 -581
@@ -288,6 +288,11 @@ declare const actionAddressesAllChains: {
288
288
  SFApproveTokens: string;
289
289
  SummerfiUnsub: string;
290
290
  SummerfiUnsubV2: string;
291
+ AaveV4Supply: string;
292
+ AaveV4Withdraw: string;
293
+ AaveV4Borrow: string;
294
+ AaveV4Payback: string;
295
+ AaveV4CollateralSwitch: string;
291
296
  AaveV3DelegateCredit?: undefined;
292
297
  AaveV3RatioTrigger?: undefined;
293
298
  GasFeeTakerL2?: undefined;
@@ -574,6 +579,11 @@ declare const actionAddressesAllChains: {
574
579
  UmbrellaClaimRewards?: undefined;
575
580
  UmbrellaStake?: undefined;
576
581
  UmbrellaUnstake?: undefined;
582
+ AaveV4Supply?: undefined;
583
+ AaveV4Withdraw?: undefined;
584
+ AaveV4Borrow?: undefined;
585
+ AaveV4Payback?: undefined;
586
+ AaveV4CollateralSwitch?: undefined;
577
587
  MorphoBlueView?: undefined;
578
588
  } | {
579
589
  DFSSell: string;
@@ -855,6 +865,11 @@ declare const actionAddressesAllChains: {
855
865
  UmbrellaClaimRewards?: undefined;
856
866
  UmbrellaStake?: undefined;
857
867
  UmbrellaUnstake?: undefined;
868
+ AaveV4Supply?: undefined;
869
+ AaveV4Withdraw?: undefined;
870
+ AaveV4Borrow?: undefined;
871
+ AaveV4Payback?: undefined;
872
+ AaveV4CollateralSwitch?: undefined;
858
873
  AaveV3DelegateCredit?: undefined;
859
874
  AaveV3RatioTrigger?: undefined;
860
875
  } | {
@@ -1136,6 +1151,11 @@ declare const actionAddressesAllChains: {
1136
1151
  UmbrellaClaimRewards?: undefined;
1137
1152
  UmbrellaStake?: undefined;
1138
1153
  UmbrellaUnstake?: undefined;
1154
+ AaveV4Supply?: undefined;
1155
+ AaveV4Withdraw?: undefined;
1156
+ AaveV4Borrow?: undefined;
1157
+ AaveV4Payback?: undefined;
1158
+ AaveV4CollateralSwitch?: undefined;
1139
1159
  AaveV3DelegateCredit?: undefined;
1140
1160
  AaveV3RatioTrigger?: undefined;
1141
1161
  AaveV3RatioCheck?: undefined;
@@ -1417,6 +1437,11 @@ declare const actionAddressesAllChains: {
1417
1437
  SFApproveTokens?: undefined;
1418
1438
  SummerfiUnsub?: undefined;
1419
1439
  SummerfiUnsubV2?: undefined;
1440
+ AaveV4Supply?: undefined;
1441
+ AaveV4Withdraw?: undefined;
1442
+ AaveV4Borrow?: undefined;
1443
+ AaveV4Payback?: undefined;
1444
+ AaveV4CollateralSwitch?: undefined;
1420
1445
  AaveV3RatioTrigger?: undefined;
1421
1446
  GasFeeTakerL2?: undefined;
1422
1447
  AaveV3RatioCheck?: undefined;
@@ -1699,6 +1724,11 @@ declare const actionAddressesAllChains: {
1699
1724
  SFApproveTokens?: undefined;
1700
1725
  SummerfiUnsub?: undefined;
1701
1726
  SummerfiUnsubV2?: undefined;
1727
+ AaveV4Supply?: undefined;
1728
+ AaveV4Withdraw?: undefined;
1729
+ AaveV4Borrow?: undefined;
1730
+ AaveV4Payback?: undefined;
1731
+ AaveV4CollateralSwitch?: undefined;
1702
1732
  AaveV3RatioTrigger?: undefined;
1703
1733
  GasFeeTakerL2?: undefined;
1704
1734
  AaveV3RatioCheck?: undefined;
@@ -1982,6 +2012,11 @@ declare const actionAddresses: (chainId?: null) => {
1982
2012
  SFApproveTokens: string;
1983
2013
  SummerfiUnsub: string;
1984
2014
  SummerfiUnsubV2: string;
2015
+ AaveV4Supply: string;
2016
+ AaveV4Withdraw: string;
2017
+ AaveV4Borrow: string;
2018
+ AaveV4Payback: string;
2019
+ AaveV4CollateralSwitch: string;
1985
2020
  AaveV3DelegateCredit?: undefined;
1986
2021
  AaveV3RatioTrigger?: undefined;
1987
2022
  GasFeeTakerL2?: undefined;
@@ -2268,6 +2303,11 @@ declare const actionAddresses: (chainId?: null) => {
2268
2303
  UmbrellaClaimRewards?: undefined;
2269
2304
  UmbrellaStake?: undefined;
2270
2305
  UmbrellaUnstake?: undefined;
2306
+ AaveV4Supply?: undefined;
2307
+ AaveV4Withdraw?: undefined;
2308
+ AaveV4Borrow?: undefined;
2309
+ AaveV4Payback?: undefined;
2310
+ AaveV4CollateralSwitch?: undefined;
2271
2311
  MorphoBlueView?: undefined;
2272
2312
  } | {
2273
2313
  DFSSell: string;
@@ -2549,6 +2589,11 @@ declare const actionAddresses: (chainId?: null) => {
2549
2589
  UmbrellaClaimRewards?: undefined;
2550
2590
  UmbrellaStake?: undefined;
2551
2591
  UmbrellaUnstake?: undefined;
2592
+ AaveV4Supply?: undefined;
2593
+ AaveV4Withdraw?: undefined;
2594
+ AaveV4Borrow?: undefined;
2595
+ AaveV4Payback?: undefined;
2596
+ AaveV4CollateralSwitch?: undefined;
2552
2597
  AaveV3DelegateCredit?: undefined;
2553
2598
  AaveV3RatioTrigger?: undefined;
2554
2599
  } | {
@@ -2830,6 +2875,11 @@ declare const actionAddresses: (chainId?: null) => {
2830
2875
  UmbrellaClaimRewards?: undefined;
2831
2876
  UmbrellaStake?: undefined;
2832
2877
  UmbrellaUnstake?: undefined;
2878
+ AaveV4Supply?: undefined;
2879
+ AaveV4Withdraw?: undefined;
2880
+ AaveV4Borrow?: undefined;
2881
+ AaveV4Payback?: undefined;
2882
+ AaveV4CollateralSwitch?: undefined;
2833
2883
  AaveV3DelegateCredit?: undefined;
2834
2884
  AaveV3RatioTrigger?: undefined;
2835
2885
  AaveV3RatioCheck?: undefined;
@@ -3111,6 +3161,11 @@ declare const actionAddresses: (chainId?: null) => {
3111
3161
  SFApproveTokens?: undefined;
3112
3162
  SummerfiUnsub?: undefined;
3113
3163
  SummerfiUnsubV2?: undefined;
3164
+ AaveV4Supply?: undefined;
3165
+ AaveV4Withdraw?: undefined;
3166
+ AaveV4Borrow?: undefined;
3167
+ AaveV4Payback?: undefined;
3168
+ AaveV4CollateralSwitch?: undefined;
3114
3169
  AaveV3RatioTrigger?: undefined;
3115
3170
  GasFeeTakerL2?: undefined;
3116
3171
  AaveV3RatioCheck?: undefined;
@@ -3393,6 +3448,11 @@ declare const actionAddresses: (chainId?: null) => {
3393
3448
  SFApproveTokens?: undefined;
3394
3449
  SummerfiUnsub?: undefined;
3395
3450
  SummerfiUnsubV2?: undefined;
3451
+ AaveV4Supply?: undefined;
3452
+ AaveV4Withdraw?: undefined;
3453
+ AaveV4Borrow?: undefined;
3454
+ AaveV4Payback?: undefined;
3455
+ AaveV4CollateralSwitch?: undefined;
3396
3456
  AaveV3RatioTrigger?: undefined;
3397
3457
  GasFeeTakerL2?: undefined;
3398
3458
  AaveV3RatioCheck?: undefined;
@@ -3405,6 +3465,7 @@ declare const otherAddressesAllChains: {
3405
3465
  DFSRegistry: string;
3406
3466
  DFSProxyRegistry: string;
3407
3467
  ProxyRegistry: string;
3468
+ SFProxyEntryPoint: string;
3408
3469
  McdCdpManager: string;
3409
3470
  BCdpManager: string;
3410
3471
  AaveDefaultMarket: string;
@@ -3426,6 +3487,7 @@ declare const otherAddressesAllChains: {
3426
3487
  RecipeExecutorForTxSaver: string;
3427
3488
  DFSRegistry: string;
3428
3489
  ProxyRegistry: string;
3490
+ SFProxyEntryPoint: string;
3429
3491
  DSGuardFactory: string;
3430
3492
  AdminVault: string;
3431
3493
  DefisaverLogger: string;
@@ -3448,6 +3510,7 @@ declare const otherAddressesAllChains: {
3448
3510
  RecipeExecutorForTxSaver: string;
3449
3511
  DFSRegistry: string;
3450
3512
  ProxyRegistry: string;
3513
+ SFProxyEntryPoint: string;
3451
3514
  DSGuardFactory: string;
3452
3515
  AdminVault: string;
3453
3516
  DefisaverLogger: string;
@@ -3475,6 +3538,7 @@ declare const otherAddressesAllChains: {
3475
3538
  RecipeExecutorForTxSaver?: undefined;
3476
3539
  DFSProxyRegistry?: undefined;
3477
3540
  ProxyRegistry?: undefined;
3541
+ SFProxyEntryPoint?: undefined;
3478
3542
  McdCdpManager?: undefined;
3479
3543
  BCdpManager?: undefined;
3480
3544
  AaveDefaultMarket?: undefined;
@@ -3496,6 +3560,7 @@ declare const otherAddressesAllChains: {
3496
3560
  RecipeExecutorForTxSaver?: undefined;
3497
3561
  DFSProxyRegistry?: undefined;
3498
3562
  ProxyRegistry?: undefined;
3563
+ SFProxyEntryPoint?: undefined;
3499
3564
  McdCdpManager?: undefined;
3500
3565
  BCdpManager?: undefined;
3501
3566
  AaveDefaultMarket?: undefined;
@@ -3517,6 +3582,7 @@ declare const otherAddresses: (chainId?: null) => {
3517
3582
  DFSRegistry: string;
3518
3583
  DFSProxyRegistry: string;
3519
3584
  ProxyRegistry: string;
3585
+ SFProxyEntryPoint: string;
3520
3586
  McdCdpManager: string;
3521
3587
  BCdpManager: string;
3522
3588
  AaveDefaultMarket: string;
@@ -3538,6 +3604,7 @@ declare const otherAddresses: (chainId?: null) => {
3538
3604
  RecipeExecutorForTxSaver: string;
3539
3605
  DFSRegistry: string;
3540
3606
  ProxyRegistry: string;
3607
+ SFProxyEntryPoint: string;
3541
3608
  DSGuardFactory: string;
3542
3609
  AdminVault: string;
3543
3610
  DefisaverLogger: string;
@@ -3560,6 +3627,7 @@ declare const otherAddresses: (chainId?: null) => {
3560
3627
  RecipeExecutorForTxSaver: string;
3561
3628
  DFSRegistry: string;
3562
3629
  ProxyRegistry: string;
3630
+ SFProxyEntryPoint: string;
3563
3631
  DSGuardFactory: string;
3564
3632
  AdminVault: string;
3565
3633
  DefisaverLogger: string;
@@ -3587,6 +3655,7 @@ declare const otherAddresses: (chainId?: null) => {
3587
3655
  RecipeExecutorForTxSaver?: undefined;
3588
3656
  DFSProxyRegistry?: undefined;
3589
3657
  ProxyRegistry?: undefined;
3658
+ SFProxyEntryPoint?: undefined;
3590
3659
  McdCdpManager?: undefined;
3591
3660
  BCdpManager?: undefined;
3592
3661
  AaveDefaultMarket?: undefined;
@@ -3608,6 +3677,7 @@ declare const otherAddresses: (chainId?: null) => {
3608
3677
  RecipeExecutorForTxSaver?: undefined;
3609
3678
  DFSProxyRegistry?: undefined;
3610
3679
  ProxyRegistry?: undefined;
3680
+ SFProxyEntryPoint?: undefined;
3611
3681
  McdCdpManager?: undefined;
3612
3682
  BCdpManager?: undefined;
3613
3683
  AaveDefaultMarket?: undefined;
@@ -3913,6 +3983,11 @@ declare const _default: {
3913
3983
  SFApproveTokens: string;
3914
3984
  SummerfiUnsub: string;
3915
3985
  SummerfiUnsubV2: string;
3986
+ AaveV4Supply: string;
3987
+ AaveV4Withdraw: string;
3988
+ AaveV4Borrow: string;
3989
+ AaveV4Payback: string;
3990
+ AaveV4CollateralSwitch: string;
3916
3991
  AaveV3DelegateCredit?: undefined;
3917
3992
  AaveV3RatioTrigger?: undefined;
3918
3993
  GasFeeTakerL2?: undefined;
@@ -4199,6 +4274,11 @@ declare const _default: {
4199
4274
  UmbrellaClaimRewards?: undefined;
4200
4275
  UmbrellaStake?: undefined;
4201
4276
  UmbrellaUnstake?: undefined;
4277
+ AaveV4Supply?: undefined;
4278
+ AaveV4Withdraw?: undefined;
4279
+ AaveV4Borrow?: undefined;
4280
+ AaveV4Payback?: undefined;
4281
+ AaveV4CollateralSwitch?: undefined;
4202
4282
  MorphoBlueView?: undefined;
4203
4283
  } | {
4204
4284
  DFSSell: string;
@@ -4480,6 +4560,11 @@ declare const _default: {
4480
4560
  UmbrellaClaimRewards?: undefined;
4481
4561
  UmbrellaStake?: undefined;
4482
4562
  UmbrellaUnstake?: undefined;
4563
+ AaveV4Supply?: undefined;
4564
+ AaveV4Withdraw?: undefined;
4565
+ AaveV4Borrow?: undefined;
4566
+ AaveV4Payback?: undefined;
4567
+ AaveV4CollateralSwitch?: undefined;
4483
4568
  AaveV3DelegateCredit?: undefined;
4484
4569
  AaveV3RatioTrigger?: undefined;
4485
4570
  } | {
@@ -4761,6 +4846,11 @@ declare const _default: {
4761
4846
  UmbrellaClaimRewards?: undefined;
4762
4847
  UmbrellaStake?: undefined;
4763
4848
  UmbrellaUnstake?: undefined;
4849
+ AaveV4Supply?: undefined;
4850
+ AaveV4Withdraw?: undefined;
4851
+ AaveV4Borrow?: undefined;
4852
+ AaveV4Payback?: undefined;
4853
+ AaveV4CollateralSwitch?: undefined;
4764
4854
  AaveV3DelegateCredit?: undefined;
4765
4855
  AaveV3RatioTrigger?: undefined;
4766
4856
  AaveV3RatioCheck?: undefined;
@@ -5042,6 +5132,11 @@ declare const _default: {
5042
5132
  SFApproveTokens?: undefined;
5043
5133
  SummerfiUnsub?: undefined;
5044
5134
  SummerfiUnsubV2?: undefined;
5135
+ AaveV4Supply?: undefined;
5136
+ AaveV4Withdraw?: undefined;
5137
+ AaveV4Borrow?: undefined;
5138
+ AaveV4Payback?: undefined;
5139
+ AaveV4CollateralSwitch?: undefined;
5045
5140
  AaveV3RatioTrigger?: undefined;
5046
5141
  GasFeeTakerL2?: undefined;
5047
5142
  AaveV3RatioCheck?: undefined;
@@ -5324,6 +5419,11 @@ declare const _default: {
5324
5419
  SFApproveTokens?: undefined;
5325
5420
  SummerfiUnsub?: undefined;
5326
5421
  SummerfiUnsubV2?: undefined;
5422
+ AaveV4Supply?: undefined;
5423
+ AaveV4Withdraw?: undefined;
5424
+ AaveV4Borrow?: undefined;
5425
+ AaveV4Payback?: undefined;
5426
+ AaveV4CollateralSwitch?: undefined;
5327
5427
  AaveV3RatioTrigger?: undefined;
5328
5428
  GasFeeTakerL2?: undefined;
5329
5429
  AaveV3RatioCheck?: undefined;
@@ -5607,6 +5707,11 @@ declare const _default: {
5607
5707
  SFApproveTokens: string;
5608
5708
  SummerfiUnsub: string;
5609
5709
  SummerfiUnsubV2: string;
5710
+ AaveV4Supply: string;
5711
+ AaveV4Withdraw: string;
5712
+ AaveV4Borrow: string;
5713
+ AaveV4Payback: string;
5714
+ AaveV4CollateralSwitch: string;
5610
5715
  AaveV3DelegateCredit?: undefined;
5611
5716
  AaveV3RatioTrigger?: undefined;
5612
5717
  GasFeeTakerL2?: undefined;
@@ -5893,6 +5998,11 @@ declare const _default: {
5893
5998
  UmbrellaClaimRewards?: undefined;
5894
5999
  UmbrellaStake?: undefined;
5895
6000
  UmbrellaUnstake?: undefined;
6001
+ AaveV4Supply?: undefined;
6002
+ AaveV4Withdraw?: undefined;
6003
+ AaveV4Borrow?: undefined;
6004
+ AaveV4Payback?: undefined;
6005
+ AaveV4CollateralSwitch?: undefined;
5896
6006
  MorphoBlueView?: undefined;
5897
6007
  } | {
5898
6008
  DFSSell: string;
@@ -6174,6 +6284,11 @@ declare const _default: {
6174
6284
  UmbrellaClaimRewards?: undefined;
6175
6285
  UmbrellaStake?: undefined;
6176
6286
  UmbrellaUnstake?: undefined;
6287
+ AaveV4Supply?: undefined;
6288
+ AaveV4Withdraw?: undefined;
6289
+ AaveV4Borrow?: undefined;
6290
+ AaveV4Payback?: undefined;
6291
+ AaveV4CollateralSwitch?: undefined;
6177
6292
  AaveV3DelegateCredit?: undefined;
6178
6293
  AaveV3RatioTrigger?: undefined;
6179
6294
  } | {
@@ -6455,6 +6570,11 @@ declare const _default: {
6455
6570
  UmbrellaClaimRewards?: undefined;
6456
6571
  UmbrellaStake?: undefined;
6457
6572
  UmbrellaUnstake?: undefined;
6573
+ AaveV4Supply?: undefined;
6574
+ AaveV4Withdraw?: undefined;
6575
+ AaveV4Borrow?: undefined;
6576
+ AaveV4Payback?: undefined;
6577
+ AaveV4CollateralSwitch?: undefined;
6458
6578
  AaveV3DelegateCredit?: undefined;
6459
6579
  AaveV3RatioTrigger?: undefined;
6460
6580
  AaveV3RatioCheck?: undefined;
@@ -6736,6 +6856,11 @@ declare const _default: {
6736
6856
  SFApproveTokens?: undefined;
6737
6857
  SummerfiUnsub?: undefined;
6738
6858
  SummerfiUnsubV2?: undefined;
6859
+ AaveV4Supply?: undefined;
6860
+ AaveV4Withdraw?: undefined;
6861
+ AaveV4Borrow?: undefined;
6862
+ AaveV4Payback?: undefined;
6863
+ AaveV4CollateralSwitch?: undefined;
6739
6864
  AaveV3RatioTrigger?: undefined;
6740
6865
  GasFeeTakerL2?: undefined;
6741
6866
  AaveV3RatioCheck?: undefined;
@@ -7018,6 +7143,11 @@ declare const _default: {
7018
7143
  SFApproveTokens?: undefined;
7019
7144
  SummerfiUnsub?: undefined;
7020
7145
  SummerfiUnsubV2?: undefined;
7146
+ AaveV4Supply?: undefined;
7147
+ AaveV4Withdraw?: undefined;
7148
+ AaveV4Borrow?: undefined;
7149
+ AaveV4Payback?: undefined;
7150
+ AaveV4CollateralSwitch?: undefined;
7021
7151
  AaveV3RatioTrigger?: undefined;
7022
7152
  GasFeeTakerL2?: undefined;
7023
7153
  AaveV3RatioCheck?: undefined;
@@ -7030,6 +7160,7 @@ declare const _default: {
7030
7160
  DFSRegistry: string;
7031
7161
  DFSProxyRegistry: string;
7032
7162
  ProxyRegistry: string;
7163
+ SFProxyEntryPoint: string;
7033
7164
  McdCdpManager: string;
7034
7165
  BCdpManager: string;
7035
7166
  AaveDefaultMarket: string;
@@ -7051,6 +7182,7 @@ declare const _default: {
7051
7182
  RecipeExecutorForTxSaver: string;
7052
7183
  DFSRegistry: string;
7053
7184
  ProxyRegistry: string;
7185
+ SFProxyEntryPoint: string;
7054
7186
  DSGuardFactory: string;
7055
7187
  AdminVault: string;
7056
7188
  DefisaverLogger: string;
@@ -7073,6 +7205,7 @@ declare const _default: {
7073
7205
  RecipeExecutorForTxSaver: string;
7074
7206
  DFSRegistry: string;
7075
7207
  ProxyRegistry: string;
7208
+ SFProxyEntryPoint: string;
7076
7209
  DSGuardFactory: string;
7077
7210
  AdminVault: string;
7078
7211
  DefisaverLogger: string;
@@ -7100,6 +7233,7 @@ declare const _default: {
7100
7233
  RecipeExecutorForTxSaver?: undefined;
7101
7234
  DFSProxyRegistry?: undefined;
7102
7235
  ProxyRegistry?: undefined;
7236
+ SFProxyEntryPoint?: undefined;
7103
7237
  McdCdpManager?: undefined;
7104
7238
  BCdpManager?: undefined;
7105
7239
  AaveDefaultMarket?: undefined;
@@ -7121,6 +7255,7 @@ declare const _default: {
7121
7255
  RecipeExecutorForTxSaver?: undefined;
7122
7256
  DFSProxyRegistry?: undefined;
7123
7257
  ProxyRegistry?: undefined;
7258
+ SFProxyEntryPoint?: undefined;
7124
7259
  McdCdpManager?: undefined;
7125
7260
  BCdpManager?: undefined;
7126
7261
  AaveDefaultMarket?: undefined;
@@ -7142,6 +7277,7 @@ declare const _default: {
7142
7277
  DFSRegistry: string;
7143
7278
  DFSProxyRegistry: string;
7144
7279
  ProxyRegistry: string;
7280
+ SFProxyEntryPoint: string;
7145
7281
  McdCdpManager: string;
7146
7282
  BCdpManager: string;
7147
7283
  AaveDefaultMarket: string;
@@ -7163,6 +7299,7 @@ declare const _default: {
7163
7299
  RecipeExecutorForTxSaver: string;
7164
7300
  DFSRegistry: string;
7165
7301
  ProxyRegistry: string;
7302
+ SFProxyEntryPoint: string;
7166
7303
  DSGuardFactory: string;
7167
7304
  AdminVault: string;
7168
7305
  DefisaverLogger: string;
@@ -7185,6 +7322,7 @@ declare const _default: {
7185
7322
  RecipeExecutorForTxSaver: string;
7186
7323
  DFSRegistry: string;
7187
7324
  ProxyRegistry: string;
7325
+ SFProxyEntryPoint: string;
7188
7326
  DSGuardFactory: string;
7189
7327
  AdminVault: string;
7190
7328
  DefisaverLogger: string;
@@ -7212,6 +7350,7 @@ declare const _default: {
7212
7350
  RecipeExecutorForTxSaver?: undefined;
7213
7351
  DFSProxyRegistry?: undefined;
7214
7352
  ProxyRegistry?: undefined;
7353
+ SFProxyEntryPoint?: undefined;
7215
7354
  McdCdpManager?: undefined;
7216
7355
  BCdpManager?: undefined;
7217
7356
  AaveDefaultMarket?: undefined;
@@ -7233,6 +7372,7 @@ declare const _default: {
7233
7372
  RecipeExecutorForTxSaver?: undefined;
7234
7373
  DFSProxyRegistry?: undefined;
7235
7374
  ProxyRegistry?: undefined;
7375
+ SFProxyEntryPoint?: undefined;
7236
7376
  McdCdpManager?: undefined;
7237
7377
  BCdpManager?: undefined;
7238
7378
  AaveDefaultMarket?: undefined;
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256 } from '../types';
3
+ /**
4
+ * AaveV4QuotePriceRangeTrigger - Verifies if current token price ratio for aaveV4 spoke is within a subbed price range.
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export declare class AaveV4QuotePriceRangeTrigger extends Action {
9
+ constructor(spoke: EthAddress, baseTokenId: uint256, quoteTokenId: uint256, lowerPrice: uint256, upperPrice: uint256);
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ * AaveV4QuotePriceRangeTrigger - Verifies if current token price ratio for aaveV4 spoke is within a subbed price range.
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export class AaveV4QuotePriceRangeTrigger extends Action {
9
+ constructor(spoke, baseTokenId, quoteTokenId, lowerPrice, upperPrice) {
10
+ super('AaveV4QuotePriceRangeTrigger', getAddr('Empty'), [['address', 'uint256', 'uint256', 'uint256', 'uint256']], [[spoke, baseTokenId, quoteTokenId, lowerPrice, upperPrice]]);
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256, uint8 } from '../types';
3
+ /**
4
+ * AaveV4QuotePriceTrigger - Verifies if current token price ratio for aaveV4 spoke is over/under a subbed price ratio.
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export declare class AaveV4QuotePriceTrigger extends Action {
9
+ constructor(spoke: EthAddress, baseTokenId: uint256, quoteTokenId: uint256, price: uint256, state: uint8);
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ * AaveV4QuotePriceTrigger - Verifies if current token price ratio for aaveV4 spoke is over/under a subbed price ratio.
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export class AaveV4QuotePriceTrigger extends Action {
9
+ constructor(spoke, baseTokenId, quoteTokenId, price, state) {
10
+ super('AaveV4QuotePriceTrigger', getAddr('Empty'), [['address', 'uint256', 'uint256', 'uint256', 'uint8']], [[spoke, baseTokenId, quoteTokenId, price, state]]);
11
+ }
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Action } from '../Action';
2
+ import { EthAddress, uint256, uint8 } from '../types';
3
+ /**
4
+ * AaveV4RatioTrigger - Triggers when the user's ratio is over/under a subbed ratio.
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export declare class AaveV4RatioTrigger extends Action {
9
+ constructor(user: EthAddress, spoke: EthAddress, ratio: uint256, state: uint8);
10
+ }
@@ -0,0 +1,12 @@
1
+ import { Action } from '../Action';
2
+ import { getAddr } from '../addresses';
3
+ /**
4
+ * AaveV4RatioTrigger - Triggers when the user's ratio is over/under a subbed ratio.
5
+ *
6
+ * @category Triggers
7
+ */
8
+ export class AaveV4RatioTrigger extends Action {
9
+ constructor(user, spoke, ratio, state) {
10
+ super('AaveV4RatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[user, spoke, ratio, state]]);
11
+ }
12
+ }
@@ -31,3 +31,6 @@ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
31
31
  export * from './AaveV3QuotePriceRangeTrigger';
32
32
  export * from './SparkQuotePriceRangeTrigger';
33
33
  export * from './MorphoBluePriceRangeTrigger';
34
+ export * from './AaveV4QuotePriceTrigger';
35
+ export * from './AaveV4QuotePriceRangeTrigger';
36
+ export * from './AaveV4RatioTrigger';
@@ -31,3 +31,6 @@ export * from './LiquityV2AdjustRateDebtInFrontTrigger';
31
31
  export * from './AaveV3QuotePriceRangeTrigger';
32
32
  export * from './SparkQuotePriceRangeTrigger';
33
33
  export * from './MorphoBluePriceRangeTrigger';
34
+ export * from './AaveV4QuotePriceTrigger';
35
+ export * from './AaveV4QuotePriceRangeTrigger';
36
+ export * from './AaveV4RatioTrigger';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "1.3.16",
3
+ "version": "1.3.17-aave-v4-dev",
4
4
  "description": "",
5
5
  "main": "./umd/index.js",
6
6
  "module": "./esm/src/index.js",
package/src/Strategy.ts CHANGED
@@ -36,6 +36,10 @@ export class Strategy {
36
36
  this.actions.push(newAction);
37
37
  }
38
38
 
39
+ addActions(newActions: Array<Action>) {
40
+ this.actions.push(...newActions);
41
+ }
42
+
39
43
  print() {
40
44
  console.log(`Name: ${this.name}`);
41
45
  console.log(`Slots: ${this.subSlots}`);
@@ -0,0 +1,39 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * AaveV4BorrowAction
7
+ *
8
+ * @category AaveV4
9
+ */
10
+ export class AaveV4BorrowAction extends Action {
11
+ /**
12
+ * @param spoke Address of the spoke.
13
+ * @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
14
+ * @param to Address that will receive the borrowed tokens.
15
+ * @param reserveId Reserve id.
16
+ * @param amount Amount of tokens to borrow.
17
+ */
18
+ constructor(
19
+ spoke: EthAddress,
20
+ onBehalf: EthAddress,
21
+ to: EthAddress,
22
+ reserveId: uint256,
23
+ amount: uint256,
24
+ ) {
25
+ super(
26
+ 'AaveV4Borrow',
27
+ getAddr('AaveV4Borrow'),
28
+ ['address', 'address', 'address', 'uint256', 'uint256'],
29
+ [spoke, onBehalf, to, reserveId, amount],
30
+ );
31
+ this.mappableArgs = [
32
+ this.args[0],
33
+ this.args[1],
34
+ this.args[2],
35
+ this.args[3],
36
+ this.args[4],
37
+ ];
38
+ }
39
+ }
@@ -0,0 +1,36 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * AaveV4CollateralSwitchAction
7
+ *
8
+ * @category AaveV4
9
+ */
10
+ export class AaveV4CollateralSwitchAction extends Action {
11
+ /**
12
+ * @param spoke Address of the spoke.
13
+ * @param onBehalf Address to switch collateral on behalf of. Defaults to the user's wallet if not provided.
14
+ * @param reserveId Reserve id.
15
+ * @param useAsCollateral Whether to use the tokens as collateral.
16
+ */
17
+ constructor(
18
+ spoke: EthAddress,
19
+ onBehalf: EthAddress,
20
+ reserveId: uint256,
21
+ useAsCollateral: boolean,
22
+ ) {
23
+ super(
24
+ 'AaveV4CollateralSwitch',
25
+ getAddr('AaveV4CollateralSwitch'),
26
+ ['address', 'address', 'uint256', 'bool'],
27
+ [spoke, onBehalf, reserveId, useAsCollateral],
28
+ );
29
+ this.mappableArgs = [
30
+ this.args[0],
31
+ this.args[1],
32
+ this.args[2],
33
+ this.args[3],
34
+ ];
35
+ }
36
+ }
@@ -0,0 +1,51 @@
1
+ import { getAssetInfoByAddress } from '@defisaver/tokens';
2
+ import { Action } from '../../Action';
3
+ import { getAddr } from '../../addresses';
4
+ import { EthAddress, uint256 } from '../../types';
5
+
6
+ /**
7
+ * AaveV4PaybackAction
8
+ *
9
+ * @category AaveV4
10
+ */
11
+ export class AaveV4PaybackAction extends Action {
12
+ tokenForApproval: EthAddress;
13
+
14
+ /**
15
+ * @param spoke Address of the spoke.
16
+ * @param onBehalf Address to payback tokens on behalf of. Defaults to the user's wallet if not provided.
17
+ * @param from Address from which to pull the payback tokens.
18
+ * @param reserveId Reserve id.
19
+ * @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
20
+ * @param tokenAddress Address of the token to approve. Optional, as it is only used for token approval, not part of encoding.
21
+ */
22
+ constructor(
23
+ spoke: EthAddress,
24
+ onBehalf: EthAddress,
25
+ from: EthAddress,
26
+ reserveId: uint256,
27
+ amount: uint256,
28
+ tokenAddress: EthAddress = getAddr('Empty'),
29
+ ) {
30
+ super(
31
+ 'AaveV4Payback',
32
+ getAddr('AaveV4Payback'),
33
+ ['address', 'address', 'address', 'uint256', 'uint256'],
34
+ [spoke, onBehalf, from, reserveId, amount],
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
+ this.tokenForApproval = tokenAddress;
44
+ }
45
+
46
+ async getAssetsToApprove() {
47
+ const asset = getAssetInfoByAddress(this.tokenForApproval);
48
+ if (asset.symbol !== 'ETH') return [{ asset: this.tokenForApproval, owner: this.args[2] }];
49
+ return [];
50
+ }
51
+ }