@defisaver/sdk 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/ACTIONS.md CHANGED
@@ -10,9 +10,6 @@
10
10
  <dt><a href="#AaveCollateralSwitchAction">AaveCollateralSwitchAction</a></dt>
11
11
  <dd><p>AaveCollateralSwitchAction - Aave enable/disable token usage as collateral</p>
12
12
  </dd>
13
- <dt><a href="#AaveMigrateLendAction">AaveMigrateLendAction</a></dt>
14
- <dd><p>AaveMigrateLendAction - Migrates Lend to Aave</p>
15
- </dd>
16
13
  <dt><a href="#AavePaybackAction">AavePaybackAction</a></dt>
17
14
  <dd><p>AavePaybackAction - Payback borrowed tokens from Aave</p>
18
15
  </dd>
@@ -32,6 +29,8 @@
32
29
  <dt><a href="#ChangeProxyOwnerAction">ChangeProxyOwnerAction</a></dt>
33
30
  <dd><p>ChangeProxyOwnerAction - Changes EOA which owns the proxy that is being called</p>
34
31
  </dd>
32
+ <dt><a href="#GasFeeAction">GasFeeAction</a></dt>
33
+ <dd></dd>
35
34
  <dt><a href="#PullTokenAction">PullTokenAction</a></dt>
36
35
  <dd><p>Transfers specified token from a specified address to DSProxy (recipe)</p>
37
36
  </dd>
@@ -41,18 +40,30 @@
41
40
  <dt><a href="#SendTokenAction">SendTokenAction</a></dt>
42
41
  <dd><p>Transfers specified token from recipe (DsProxy) to specified address</p>
43
42
  </dd>
43
+ <dt><a href="#SendTokenAndUnwrapAction">SendTokenAndUnwrapAction</a></dt>
44
+ <dd><p>Transfers specified token from recipe (DsProxy) to specified address unwraps if Weth address</p>
45
+ </dd>
44
46
  <dt><a href="#SubInputsAction">SubInputsAction</a></dt>
45
47
  <dd><p>Subs 2 inputs/return values</p>
46
48
  </dd>
47
49
  <dt><a href="#SumInputsAction">SumInputsAction</a></dt>
48
50
  <dd><p>Sums up 2 inputs/return values</p>
49
51
  </dd>
52
+ <dt><a href="#ToggleSubAction">ToggleSubAction</a></dt>
53
+ <dd><p>Sets the state of the sub to active or deactivated</p>
54
+ </dd>
50
55
  <dt><a href="#UnwrapEthAction">UnwrapEthAction</a></dt>
51
56
  <dd><p>Unwraps a specified amount of WETH from the proxy</p>
52
57
  </dd>
58
+ <dt><a href="#UpdateSubAction">UpdateSubAction</a></dt>
59
+ <dd><p>Action for updating sub data</p>
60
+ </dd>
53
61
  <dt><a href="#WrapEthAction">WrapEthAction</a></dt>
54
62
  <dd><p>Wraps a specified amount of ETH from the wallet to WETH on the recipe</p>
55
63
  </dd>
64
+ <dt><a href="#MakerRatioCheckAction">MakerRatioCheckAction</a></dt>
65
+ <dd><p>MakerRatioCheckAction - Checks mcd ratio at end of all actions</p>
66
+ </dd>
56
67
  <dt><a href="#CompoundBorrowAction">CompoundBorrowAction</a></dt>
57
68
  <dd><p>CompoundBorrowAction - Borrow tokens from Compound</p>
58
69
  </dd>
@@ -71,6 +82,26 @@
71
82
  <dt><a href="#CompoundWithdrawAction">CompoundWithdrawAction</a></dt>
72
83
  <dd><p>CompoundWithdrawAction - Withdraw token from an Compound position</p>
73
84
  </dd>
85
+ <dt><a href="#CurveClaimFeesAction">CurveClaimFeesAction</a></dt>
86
+ <dd></dd>
87
+ <dt><a href="#CurveDepositAction">CurveDepositAction</a></dt>
88
+ <dd></dd>
89
+ <dt><a href="#CurveGaugeDepositAction">CurveGaugeDepositAction</a></dt>
90
+ <dd></dd>
91
+ <dt><a href="#CurveGaugeWithdrawAction">CurveGaugeWithdrawAction</a></dt>
92
+ <dd></dd>
93
+ <dt><a href="#CurveMintCrvAction">CurveMintCrvAction</a></dt>
94
+ <dd></dd>
95
+ <dt><a href="#CurveStethPoolDepositAction">CurveStethPoolDepositAction</a></dt>
96
+ <dd><p>CurveStethPoolDepositAction - Deposits tokens into curve steth pool</p>
97
+ </dd>
98
+ <dt><a href="#CurveStethPoolWithdrawAction">CurveStethPoolWithdrawAction</a></dt>
99
+ <dd><p>CurveStethPoolWithdrawAction - Withdraws tokens from curve steth pool</p>
100
+ </dd>
101
+ <dt><a href="#CurveSwapAction">CurveSwapAction</a></dt>
102
+ <dd></dd>
103
+ <dt><a href="#CurveWithdrawAction">CurveWithdrawAction</a></dt>
104
+ <dd></dd>
74
105
  <dt><a href="#DyDxWithdrawAction">DyDxWithdrawAction</a></dt>
75
106
  <dd><p>DyDxWithdrawAction - Withdraw token from an DyDx position</p>
76
107
  </dd>
@@ -92,9 +123,27 @@
92
123
  <dt><a href="#DyDxFlashLoanPaybackAction">DyDxFlashLoanPaybackAction</a></dt>
93
124
  <dd><p>Pays back a flashloan from DyDx</p>
94
125
  </dd>
126
+ <dt><a href="#MakerFlashLoanAction">MakerFlashLoanAction</a></dt>
127
+ <dd><p>Gets a flashloan from Maker</p>
128
+ </dd>
129
+ <dt><a href="#MakerFlashLoanPaybackAction">MakerFlashLoanPaybackAction</a></dt>
130
+ <dd><p>Pays back a flashloan from Maker</p>
131
+ </dd>
132
+ <dt><a href="#GUniDeposit">GUniDeposit</a></dt>
133
+ <dd><p>Action that adds liquidity to G-UNI pool of interest (mints G-UNI LP tokens)</p>
134
+ </dd>
135
+ <dt><a href="#GUniWithdraw">GUniWithdraw</a></dt>
136
+ <dd><p>Action that removes liquidity from a G-UNI pool and burns G-UNI LP tokens</p>
137
+ </dd>
95
138
  <dt><a href="#LidoStakeAction">LidoStakeAction</a></dt>
96
139
  <dd><p>LidoStakeAction - Receives WETH, transforms it to ETH then sends it to Lido staking contract receiving stETH in return</p>
97
140
  </dd>
141
+ <dt><a href="#LidoUnwrapAction">LidoUnwrapAction</a></dt>
142
+ <dd><p>LidoUnwrapAction - Unwraps WStEth into StEth</p>
143
+ </dd>
144
+ <dt><a href="#LidoWrapAction">LidoWrapAction</a></dt>
145
+ <dd><p>LidoWrapAction - Turns WETH or StEth into WStEth</p>
146
+ </dd>
98
147
  <dt><a href="#LiquityBorrowAction">LiquityBorrowAction</a></dt>
99
148
  <dd><p>LiquityBorrowAction - Borrows LUSD from the trove</p>
100
149
  </dd>
@@ -140,6 +189,9 @@
140
189
  <dt><a href="#LiquityWithdrawAction">LiquityWithdrawAction</a></dt>
141
190
  <dd><p>LiquityWithdrawAction - Withdraws collateral from the trove</p>
142
191
  </dd>
192
+ <dt><a href="#MakerClaimAction">MakerClaimAction</a></dt>
193
+ <dd><p>MakerClaimAction - Claim bonus tokens in CropJoin types</p>
194
+ </dd>
143
195
  <dt><a href="#MakerGenerateAction">MakerGenerateAction</a></dt>
144
196
  <dd><p>MakerGenerateAction - Generated Dai from a Vault</p>
145
197
  </dd>
@@ -155,6 +207,9 @@
155
207
  <dt><a href="#MakerPaybackAction">MakerPaybackAction</a></dt>
156
208
  <dd><p>MakerPaybackAction - Payback dai to a Vault</p>
157
209
  </dd>
210
+ <dt><a href="#MakerRatioAction">MakerRatioAction</a></dt>
211
+ <dd><p>MakerRatioAction</p>
212
+ </dd>
158
213
  <dt><a href="#MakerSupplyAction">MakerSupplyAction</a></dt>
159
214
  <dd><p>MakerSupplyAction - Supply token to a Vault</p>
160
215
  </dd>
@@ -258,18 +313,6 @@ AaveClaimStkAaveAction - Claims stkAave from incentives controller
258
313
  ## AaveCollateralSwitchAction
259
314
  AaveCollateralSwitchAction - Aave enable/disable token usage as collateral
260
315
 
261
- **Kind**: global class
262
- <a name="AaveMigrateLendAction"></a>
263
-
264
- ## AaveClaimStkAaveAction
265
- AaveClaimStkAaveAction - Claims stkAave from incentives controller
266
-
267
- **Kind**: global class
268
- <a name="AaveCollateralSwitchAction"></a>
269
-
270
- ## AaveCollateralSwitchAction
271
- AaveCollateralSwitchAction - Aave enable/disable token usage as collateral
272
-
273
316
  **Kind**: global class
274
317
  <a name="AavePaybackAction"></a>
275
318
 
@@ -386,6 +429,20 @@ ChangeProxyOwnerAction - Changes EOA which owns the proxy that is being called
386
429
 
387
430
  - newOwner <code>Address</code> - Address of new owner
388
431
 
432
+ <a name="GasFeeAction"></a>
433
+
434
+ ## GasFeeAction
435
+ **Kind**: global class
436
+ <a name="new_GasFeeAction_new"></a>
437
+
438
+ ### new GasFeeAction(gasStart, feeToken, availableAmount, dfsFeeDivider)
439
+ **Params**
440
+
441
+ - gasStart <code>string</code> - Always 0 will be inject value
442
+ - feeToken <code>string</code> - Address of the token we are taken the fee in
443
+ - availableAmount - Amount we have available to pay the gas fee
444
+ - dfsFeeDivider <code> = 2000</code> - Additional fee for DFS, default is 5bps
445
+
389
446
  <a name="PullTokenAction"></a>
390
447
 
391
448
  ## PullTokenAction
@@ -432,6 +489,21 @@ Transfers specified token from recipe (DsProxy) to specified address
432
489
  - to <code>string</code> - Transfer recipient
433
490
  - amount <code>string</code> - Transfer amount (-1 for whole Recipe (DsProxy) balance)
434
491
 
492
+ <a name="SendTokenAndUnwrapAction"></a>
493
+
494
+ ## SendTokenAndUnwrapAction
495
+ Transfers specified token from recipe (DsProxy) to specified address unwraps if Weth address
496
+
497
+ **Kind**: global class
498
+ <a name="new_SendTokenAndUnwrapAction_new"></a>
499
+
500
+ ### new SendTokenAndUnwrapAction(token, to, amount)
501
+ **Params**
502
+
503
+ - token <code>string</code> - Token address
504
+ - to <code>string</code> - Transfer recipient
505
+ - amount <code>string</code> - Transfer amount (-1 for whole Recipe (DsProxy) balance)
506
+
435
507
  <a name="SubInputsAction"></a>
436
508
 
437
509
  ## SubInputsAction
@@ -444,6 +516,20 @@ Subs 2 inputs/return values
444
516
  Sums up 2 inputs/return values
445
517
 
446
518
  **Kind**: global class
519
+ <a name="ToggleSubAction"></a>
520
+
521
+ ## ToggleSubAction
522
+ Sets the state of the sub to active or deactivated
523
+
524
+ **Kind**: global class
525
+ <a name="new_ToggleSubAction_new"></a>
526
+
527
+ ### new ToggleSubAction(subId, active)
528
+ **Params**
529
+
530
+ - subId - Id of the subscription in the SubStorage contract
531
+ - active - Set to true to activate action, to false to deactivate
532
+
447
533
  <a name="UnwrapEthAction"></a>
448
534
 
449
535
  ## UnwrapEthAction
@@ -458,6 +544,20 @@ Unwraps a specified amount of WETH from the proxy
458
544
  - amount <code>string</code> - Token address
459
545
  - to <code>string</code> - Transfer recipient
460
546
 
547
+ <a name="UpdateSubAction"></a>
548
+
549
+ ## UpdateSubAction
550
+ Action for updating sub data
551
+
552
+ **Kind**: global class
553
+ <a name="new_UpdateSubAction_new"></a>
554
+
555
+ ### new UpdateSubAction(subId, sub)
556
+ **Params**
557
+
558
+ - subId - id of the subscription in the SubStorage contract
559
+ - sub - object that contains new sub information
560
+
461
561
  <a name="WrapEthAction"></a>
462
562
 
463
563
  ## WrapEthAction
@@ -471,6 +571,23 @@ Wraps a specified amount of ETH from the wallet to WETH on the recipe
471
571
 
472
572
  - amount <code>string</code> - Transfer amount
473
573
 
574
+ <a name="MakerRatioCheckAction"></a>
575
+
576
+ ## MakerRatioCheckAction
577
+ MakerRatioCheckAction - Checks mcd ratio at end of all actions
578
+
579
+ **Kind**: global class
580
+ <a name="new_MakerRatioCheckAction_new"></a>
581
+
582
+ ### new MakerRatioCheckAction(ratioState, checkTarget, targetRatio, vaultId, startRatioIndex)
583
+ **Params**
584
+
585
+ - ratioState <code>uint8</code> - If it should lower/higher
586
+ - checkTarget
587
+ - targetRatio <code>string</code> - The ratio user want to be at
588
+ - vaultId <code>string</code> - Id of the vault
589
+ - startRatioIndex <code>uint256</code> - Index in returnValues where ratio before actions is stored
590
+
474
591
  <a name="CompoundBorrowAction"></a>
475
592
 
476
593
  ## CompoundBorrowAction
@@ -522,7 +639,7 @@ CompoundPaybackAction - Payback borrowed tokens from Compound
522
639
  - cTokenAddr <code>EthAddress</code>
523
640
  - amount <code>string</code> - Wei amount in underlying asset decimals (not cAsset) - ie. 18 dec for cETH, not 8
524
641
  - from <code>EthAddress</code>
525
- - onBehalf <code>Array.&lt;EthAddress&gt;</code>
642
+ - onBehalf <code>EthAddress</code> - Defaults to DsProxy address if 0x0
526
643
 
527
644
  <a name="CompoundSupplyAction"></a>
528
645
 
@@ -555,6 +672,148 @@ CompoundWithdrawAction - Withdraw token from an Compound position
555
672
  - amount <code>string</code> - Wei amount in underlying asset decimals (not cAsset) - ie. 18 dec for cETH, not 8
556
673
  - to <code>EthAddress</code>
557
674
 
675
+ <a name="CurveClaimFeesAction"></a>
676
+
677
+ ## CurveClaimFeesAction
678
+ **Kind**: global class
679
+ <a name="new_CurveClaimFeesAction_new"></a>
680
+
681
+ ### new CurveClaimFeesAction(claimFor, receiver)
682
+ **Params**
683
+
684
+ - claimFor <code>EthAddress</code>
685
+ - receiver <code>EthAddress</code>
686
+
687
+ <a name="CurveDepositAction"></a>
688
+
689
+ ## CurveDepositAction
690
+ **Kind**: global class
691
+ <a name="new_CurveDepositAction_new"></a>
692
+
693
+ ### new CurveDepositAction(sender, receiver, depositTarget, lpToken, sig, minMintAmount, amounts, tokens, useUnderlying)
694
+ **Params**
695
+
696
+ - sender <code>EthAddress</code>
697
+ - receiver <code>EthAddress</code>
698
+ - depositTarget <code>EthAddress</code>
699
+ - lpToken <code>EthAddress</code>
700
+ - sig <code>bytes4</code>
701
+ - minMintAmount <code>string</code>
702
+ - amounts <code>Array.&lt;string&gt;</code>
703
+ - tokens <code>Array.&lt;EthAddress&gt;</code>
704
+ - useUnderlying <code>boolean</code>
705
+
706
+ <a name="CurveGaugeDepositAction"></a>
707
+
708
+ ## CurveGaugeDepositAction
709
+ **Kind**: global class
710
+ <a name="new_CurveGaugeDepositAction_new"></a>
711
+
712
+ ### new CurveGaugeDepositAction(gaugeAddr, lpToken, sender, onBehalfOf, amount)
713
+ **Params**
714
+
715
+ - gaugeAddr <code>EthAddress</code>
716
+ - lpToken <code>EthAddress</code>
717
+ - sender <code>EthAddress</code>
718
+ - onBehalfOf <code>EthAddress</code>
719
+ - amount <code>string</code>
720
+
721
+ <a name="CurveGaugeWithdrawAction"></a>
722
+
723
+ ## CurveGaugeWithdrawAction
724
+ **Kind**: global class
725
+ <a name="new_CurveGaugeWithdrawAction_new"></a>
726
+
727
+ ### new CurveGaugeWithdrawAction(gaugeAddr, lpToken, receiver, amount)
728
+ **Params**
729
+
730
+ - gaugeAddr <code>EthAddress</code>
731
+ - lpToken <code>EthAddress</code>
732
+ - receiver <code>EthAddress</code>
733
+ - amount <code>string</code>
734
+
735
+ <a name="CurveMintCrvAction"></a>
736
+
737
+ ## CurveMintCrvAction
738
+ **Kind**: global class
739
+ <a name="new_CurveMintCrvAction_new"></a>
740
+
741
+ ### new CurveMintCrvAction(gaugeAddrs, receiver)
742
+ **Params**
743
+
744
+ - gaugeAddrs <code>Array.&lt;EthAddress&gt;</code>
745
+ - receiver <code>EthAddress</code>
746
+
747
+ <a name="CurveStethPoolDepositAction"></a>
748
+
749
+ ## CurveStethPoolDepositAction
750
+ CurveStethPoolDepositAction - Deposits tokens into curve steth pool
751
+
752
+ **Kind**: global class
753
+ <a name="new_CurveStethPoolDepositAction_new"></a>
754
+
755
+ ### new CurveStethPoolDepositAction(from, to, amounts, minMintAmount)
756
+ **Params**
757
+
758
+ - from <code>address</code>
759
+ - to <code>address</code>
760
+ - amounts <code>Array.&lt;string&gt;</code>
761
+ - minMintAmount <code>string</code>
762
+
763
+ <a name="CurveStethPoolWithdrawAction"></a>
764
+
765
+ ## CurveStethPoolWithdrawAction
766
+ CurveStethPoolWithdrawAction - Withdraws tokens from curve steth pool
767
+
768
+ **Kind**: global class
769
+ <a name="new_CurveStethPoolWithdrawAction_new"></a>
770
+
771
+ ### new CurveStethPoolWithdrawAction(from, to, amounts, maxBurnAmount, returnValue)
772
+ **Params**
773
+
774
+ - from <code>address</code>
775
+ - to <code>address</code>
776
+ - amounts <code>Array.&lt;string&gt;</code>
777
+ - maxBurnAmount <code>string</code>
778
+ - returnValue <code>string</code>
779
+
780
+ <a name="CurveSwapAction"></a>
781
+
782
+ ## CurveSwapAction
783
+ **Kind**: global class
784
+ <a name="new_CurveSwapAction_new"></a>
785
+
786
+ ### new CurveSwapAction(sender, receiver, pool, tokenA, tokenB, amount, expected)
787
+ **Params**
788
+
789
+ - sender <code>EthAddress</code>
790
+ - receiver <code>EthAddress</code>
791
+ - pool <code>EthAddress</code>
792
+ - tokenA <code>EthAddress</code>
793
+ - tokenB <code>EthAddress</code>
794
+ - amount <code>string</code>
795
+ - expected <code>string</code>
796
+
797
+ <a name="CurveWithdrawAction"></a>
798
+
799
+ ## CurveWithdrawAction
800
+ **Kind**: global class
801
+ <a name="new_CurveWithdrawAction_new"></a>
802
+
803
+ ### new CurveWithdrawAction(sender, receiver, depositTarget, lpToken, sig, burnAmount, minAmounts, tokens, withdrawExact, useUnderlying)
804
+ **Params**
805
+
806
+ - sender <code>EthAddress</code>
807
+ - receiver <code>EthAddress</code>
808
+ - depositTarget <code>EthAddress</code>
809
+ - lpToken <code>EthAddress</code>
810
+ - sig <code>bytes4</code>
811
+ - burnAmount <code>string</code>
812
+ - minAmounts <code>Array.&lt;string&gt;</code>
813
+ - tokens <code>Array.&lt;EthAddress&gt;</code>
814
+ - withdrawExact <code>boolean</code>
815
+ - useUnderlying <code>boolean</code>
816
+
558
817
  <a name="DyDxWithdrawAction"></a>
559
818
 
560
819
  ## DyDxWithdrawAction
@@ -662,6 +921,46 @@ Pays back a flashloan from DyDx
662
921
  - loanAmount <code>string</code>
663
922
  - tokenAddr <code>EthAddress</code>
664
923
 
924
+ <a name="MakerFlashLoanAction"></a>
925
+
926
+ ## MakerFlashLoanAction
927
+ Gets a flashloan from Maker
928
+
929
+ **Kind**: global class
930
+ <a name="new_MakerFlashLoanAction_new"></a>
931
+
932
+ ### new MakerFlashLoanAction(amount, flParamGetterAddr, flParamGetterData)
933
+ **Params**
934
+
935
+ - amount <code>string</code>
936
+ - flParamGetterAddr <code>EthAddress</code>
937
+ - flParamGetterData <code>bytes</code>
938
+
939
+ <a name="MakerFlashLoanPaybackAction"></a>
940
+
941
+ ## MakerFlashLoanPaybackAction
942
+ Pays back a flashloan from Maker
943
+
944
+ **Kind**: global class
945
+ <a name="new_MakerFlashLoanPaybackAction_new"></a>
946
+
947
+ ### new MakerFlashLoanPaybackAction(loanAmount)
948
+ **Params**
949
+
950
+ - loanAmount <code>string</code>
951
+
952
+ <a name="GUniDeposit"></a>
953
+
954
+ ## GUniDeposit
955
+ Action that adds liquidity to G-UNI pool of interest (mints G-UNI LP tokens)
956
+
957
+ **Kind**: global class
958
+ <a name="GUniWithdraw"></a>
959
+
960
+ ## GUniWithdraw
961
+ Action that removes liquidity from a G-UNI pool and burns G-UNI LP tokens
962
+
963
+ **Kind**: global class
665
964
  <a name="LidoStakeAction"></a>
666
965
 
667
966
  ## LidoStakeAction
@@ -677,6 +976,37 @@ LidoStakeAction - Receives WETH, transforms it to ETH then sends it to Lido stak
677
976
  - from <code>EthAddress</code> - WETH will be taken from this address
678
977
  - to <code>EthAddress</code> - stETH will be sent to this address
679
978
 
979
+ <a name="LidoUnwrapAction"></a>
980
+
981
+ ## LidoUnwrapAction
982
+ LidoUnwrapAction - Unwraps WStEth into StEth
983
+
984
+ **Kind**: global class
985
+ <a name="new_LidoUnwrapAction_new"></a>
986
+
987
+ ### new LidoUnwrapAction(amount, from, to)
988
+ **Params**
989
+
990
+ - amount <code>string</code> - amount of WStEth to pull and Unwrap
991
+ - from <code>EthAddress</code> - WstEth will be taken from this address
992
+ - to <code>EthAddress</code> - stETH will be sent to this address
993
+
994
+ <a name="LidoWrapAction"></a>
995
+
996
+ ## LidoWrapAction
997
+ LidoWrapAction - Turns WETH or StEth into WStEth
998
+
999
+ **Kind**: global class
1000
+ <a name="new_LidoWrapAction_new"></a>
1001
+
1002
+ ### new LidoWrapAction(amount, from, to, useEth)
1003
+ **Params**
1004
+
1005
+ - amount <code>string</code> - amount to pull and stake
1006
+ - from <code>EthAddress</code> - tokens will be taken from this address
1007
+ - to <code>EthAddress</code> - WStEth will be sent to this address
1008
+ - useEth <code>boolean</code> - true for using WETH, false for using stEth
1009
+
680
1010
  <a name="LiquityBorrowAction"></a>
681
1011
 
682
1012
  ## LiquityBorrowAction
@@ -899,6 +1229,21 @@ LiquityWithdrawAction - Withdraws collateral from the trove
899
1229
  - collAmount - Amount of WETH tokens to withdraw
900
1230
  - to - Address that will receive the withdrawn tokens
901
1231
 
1232
+ <a name="MakerClaimAction"></a>
1233
+
1234
+ ## MakerClaimAction
1235
+ MakerClaimAction - Claim bonus tokens in CropJoin types
1236
+
1237
+ **Kind**: global class
1238
+ <a name="new_MakerClaimAction_new"></a>
1239
+
1240
+ ### new MakerClaimAction(vaultId, joinAddr, to)
1241
+ **Params**
1242
+
1243
+ - vaultId <code>VaultId</code>
1244
+ - joinAddr <code>EthAddress</code>
1245
+ - to <code>EthAddress</code> - Tokens will be sent to this address
1246
+
902
1247
  <a name="MakerGenerateAction"></a>
903
1248
 
904
1249
  ## MakerGenerateAction
@@ -976,6 +1321,19 @@ MakerPaybackAction - Payback dai to a Vault
976
1321
  - from <code>EthAddress</code> - DAI will be sent from this address
977
1322
  - mcdManager <code>EthAddress</code>
978
1323
 
1324
+ <a name="MakerRatioAction"></a>
1325
+
1326
+ ## MakerRatioAction
1327
+ MakerRatioAction
1328
+
1329
+ **Kind**: global class
1330
+ <a name="new_MakerRatioAction_new"></a>
1331
+
1332
+ ### new MakerRatioAction(vaultId)
1333
+ **Params**
1334
+
1335
+ - vaultId <code>uint256</code>
1336
+
979
1337
  <a name="MakerSupplyAction"></a>
980
1338
 
981
1339
  ## MakerSupplyAction
@@ -1007,7 +1365,7 @@ MakerWithdrawAction - Withdraw token from a Vault
1007
1365
  - vaultId <code>VaultId</code>
1008
1366
  - amount <code>string</code>
1009
1367
  - joinAddr <code>EthAddress</code>
1010
- - to <code>EthAddress</code>
1368
+ - to <code>string</code>
1011
1369
  - mcdManager <code>EthAddress</code>
1012
1370
 
1013
1371
  <a name="MStableClaimAction"></a>
@@ -1034,7 +1392,7 @@ MStableDepositAction
1034
1392
  **Kind**: global class
1035
1393
  <a name="new_MStableDepositAction_new"></a>
1036
1394
 
1037
- ### new MStableDepositAction(bAsset, mAsset, saveAddress, vaultAddress, from, to, amount, minOut, stake)
1395
+ ### new MStableDepositAction(bAsset, mAsset, saveAddress, vaultAddress, from, to, amount, minOut, assetPair)
1038
1396
  **Params**
1039
1397
 
1040
1398
  - bAsset
@@ -1045,7 +1403,7 @@ MStableDepositAction
1045
1403
  - to
1046
1404
  - amount
1047
1405
  - minOut
1048
- - stake
1406
+ - assetPair
1049
1407
 
1050
1408
  <a name="MStableWithdrawAction"></a>
1051
1409
 
@@ -1055,7 +1413,7 @@ MStableWithdrawAction
1055
1413
  **Kind**: global class
1056
1414
  <a name="new_MStableWithdrawAction_new"></a>
1057
1415
 
1058
- ### new MStableWithdrawAction(bAsset, mAsset, saveAddress, vaultAddress, from, to, amount, minOut, stake)
1416
+ ### new MStableWithdrawAction(bAsset, mAsset, saveAddress, vaultAddress, from, to, amount, minOut, assetPair)
1059
1417
  **Params**
1060
1418
 
1061
1419
  - bAsset
@@ -1066,7 +1424,7 @@ MStableWithdrawAction
1066
1424
  - to
1067
1425
  - amount
1068
1426
  - minOut
1069
- - stake
1427
+ - assetPair
1070
1428
 
1071
1429
  <a name="RariDepositAction"></a>
1072
1430
 
package/DEV.md CHANGED
@@ -1,298 +0,0 @@
1
- ## Modules
2
-
3
- <dl>
4
- <dt><a href="#utils.module_uniswapLP">uniswapLP</a></dt>
5
- <dd></dd>
6
- <dt><a href="#utils.module_uniV3">uniV3</a></dt>
7
- <dd></dd>
8
- <dt><a href="#utils.module_zeroExExchange">zeroExExchange</a></dt>
9
- <dd></dd>
10
- </dl>
11
-
12
- ## Classes
13
-
14
- <dl>
15
- <dt><a href="#Action">Action</a></dt>
16
- <dd><p>Single action that can be executed directly, or combined into a set (ie. supply a vault)</p>
17
- </dd>
18
- <dt><a href="#Recipe">Recipe</a></dt>
19
- <dd><p>Set of Actions to be performed sequentially in a single transaction</p>
20
- </dd>
21
- </dl>
22
-
23
- ## Typedefs
24
-
25
- <dl>
26
- <dt><a href="#EthAddress">EthAddress</a> : <code>string</code></dt>
27
- <dd><p>Ethereum address</p>
28
- </dd>
29
- <dt><a href="#VaultId">VaultId</a> : <code>string</code> | <code>number</code></dt>
30
- <dd><p>Maker vault ID</p>
31
- </dd>
32
- <dt><a href="#AccessListItem">AccessListItem</a> : <code>Object</code></dt>
33
- <dd><p>Access list item</p>
34
- </dd>
35
- <dt><a href="#AccessList">AccessList</a> : <code><a href="#AccessListItem">Array.&lt;AccessListItem&gt;</a></code></dt>
36
- <dd></dd>
37
- </dl>
38
-
39
- <a name="utils.module_uniswapLP"></a>
40
-
41
- ## uniswapLP
42
-
43
- * [uniswapLP](#utils.module_uniswapLP)
44
- * [.getPoolAddressByAddresses(tokenA, tokenB)](#utils.module_uniswapLP.getPoolAddressByAddresses) ⇒ [<code>EthAddress</code>](#EthAddress)
45
- * [.getPoolAddressBySymbols(symbolA, symbolB)](#utils.module_uniswapLP.getPoolAddressBySymbols) ⇒ [<code>EthAddress</code>](#EthAddress)
46
-
47
- <a name="utils.module_uniswapLP.getPoolAddressByAddresses"></a>
48
-
49
- ### uniswapLP.getPoolAddressByAddresses(tokenA, tokenB) ⇒ [<code>EthAddress</code>](#EthAddress)
50
- Computes deterministic LP address.
51
- Source: https://uniswap.org/docs/v2/javascript-SDK/getting-pair-addresses/#typescript
52
-
53
- **Kind**: static method of [<code>uniswapLP</code>](#utils.module_uniswapLP)
54
- **Params**
55
-
56
- - tokenA [<code>EthAddress</code>](#EthAddress) - Use WETH for ETH
57
- - tokenB [<code>EthAddress</code>](#EthAddress) - Use WETH for ETH
58
-
59
- <a name="utils.module_uniswapLP.getPoolAddressBySymbols"></a>
60
-
61
- ### uniswapLP.getPoolAddressBySymbols(symbolA, symbolB) ⇒ [<code>EthAddress</code>](#EthAddress)
62
- **Kind**: static method of [<code>uniswapLP</code>](#utils.module_uniswapLP)
63
- **Params**
64
-
65
- - symbolA <code>string</code>
66
- - symbolB <code>string</code>
67
-
68
- <a name="utils.module_uniV3"></a>
69
-
70
- ## uniV3
71
- <a name="utils.module_uniV3.getAssetAddrByTokenId"></a>
72
-
73
- ### uniV3.getAssetAddrByTokenId(web3, tokenId) ⇒ <code>Promise.&lt;Array.&lt;string&gt;&gt;</code>
74
- **Kind**: static method of [<code>uniV3</code>](#utils.module_uniV3)
75
- **Params**
76
-
77
- - web3 <code>Object</code> - Web3 instance
78
- - tokenId <code>string</code>
79
-
80
- <a name="utils.module_zeroExExchange"></a>
81
-
82
- ## zeroExExchange
83
-
84
- * [zeroExExchange](#utils.module_zeroExExchange)
85
- * [.estimateSellPrice(sellAmount, sellToken, buyToken)](#utils.module_zeroExExchange.estimateSellPrice) ⇒ <code>Promise.&lt;string&gt;</code>
86
- * [.estimateBuyPrice(buyAmount, buyToken, sellToken)](#utils.module_zeroExExchange.estimateBuyPrice) ⇒ <code>Promise.&lt;string&gt;</code>
87
- * [.createSellAction(sellAmount, sellToken, buyToken, expectedPrice, acceptedSlippagePercent, fromAccount, toAccount)](#utils.module_zeroExExchange.createSellAction) ⇒ <code>Promise.&lt;SellAction&gt;</code>
88
-
89
- <a name="utils.module_zeroExExchange.estimateSellPrice"></a>
90
-
91
- ### zeroExExchange.estimateSellPrice(sellAmount, sellToken, buyToken) ⇒ <code>Promise.&lt;string&gt;</code>
92
- Gets price estimate for selling a specific amount.
93
- Example: getBestExchangePrice('1', 'ETH', 'DAI') - swapping 1 ETH for some DAI
94
-
95
- **Kind**: static method of [<code>zeroExExchange</code>](#utils.module_zeroExExchange)
96
- **Returns**: <code>Promise.&lt;string&gt;</code> - price of sellToken in buyToken
97
- **Params**
98
-
99
- - sellAmount <code>String</code> - amount of sellToken (not in wei)
100
- - sellToken <code>String</code> - Symbol for asset being sold
101
- - buyToken <code>String</code> - Symbol for asset being bought
102
-
103
- <a name="utils.module_zeroExExchange.estimateBuyPrice"></a>
104
-
105
- ### zeroExExchange.estimateBuyPrice(buyAmount, buyToken, sellToken) ⇒ <code>Promise.&lt;string&gt;</code>
106
- Gets price estimate for buying a specific amount.
107
- Example: estimateBuyPrice('1000', 'DAI', 'ETH') - swapping 1000 DAI for some ETH
108
-
109
- **Kind**: static method of [<code>zeroExExchange</code>](#utils.module_zeroExExchange)
110
- **Returns**: <code>Promise.&lt;string&gt;</code> - price of sellToken in buyToken
111
- **Params**
112
-
113
- - buyAmount <code>String</code> - amount of buyToken (not in wei)
114
- - buyToken <code>String</code> - Symbol for asset being bought
115
- - sellToken <code>String</code> - Symbol for asset being sold
116
-
117
- <a name="utils.module_zeroExExchange.createSellAction"></a>
118
-
119
- ### zeroExExchange.createSellAction(sellAmount, sellToken, buyToken, expectedPrice, acceptedSlippagePercent, fromAccount, toAccount) ⇒ <code>Promise.&lt;SellAction&gt;</code>
120
- Fetches prices and creates order ready to be passed to transaction.
121
- This should only be called when before sending tx, not to be used for just querying the price.
122
- For that purpose, the estimateSellPrice method can be used.
123
-
124
- **Kind**: static method of [<code>zeroExExchange</code>](#utils.module_zeroExExchange)
125
- **Params**
126
-
127
- - sellAmount <code>string</code> - Amount of asset being sold ('1.5')
128
- - sellToken <code>string</code> - Symbol for asset being sold ('ETH')
129
- - buyToken <code>string</code> - Symbol for asset being bought ('DAI')
130
- - expectedPrice <code>string</code> - Price received from estimatePrice (so minPrice can be calculated based on what user saw)
131
- - acceptedSlippagePercent <code>string</code> | <code>Number</code> - Slippage percentage tolerated [0-100]
132
- - fromAccount [<code>EthAddress</code>](#EthAddress) - Withdraw funds from this addr
133
- - toAccount [<code>EthAddress</code>](#EthAddress) - Send funds to this addr
134
-
135
-
136
- **Kind**: static method of [<code>zeroExExchange</code>](#utils.module_zeroExExchange)
137
- **Params**
138
-
139
- - buyAmount <code>string</code> - Amount of asset being bought ('1500.123')
140
- - buyToken <code>string</code> - Symbol for asset being bought ('DAI')
141
- - sellToken <code>string</code> - Symbol for asset being sold ('ETH')
142
- - expectedPrice <code>string</code> - Price received from estimatePrice (so minPrice can be calculated based on what user saw)
143
- - acceptedSlippagePercent <code>string</code> | <code>Number</code> - Slippage percentage tolerated [0-100]
144
- - fromAccount [<code>EthAddress</code>](#EthAddress) - Withdraw funds from this addr
145
- - toAccount [<code>EthAddress</code>](#EthAddress) - Send funds to this addr
146
-
147
- <a name="Action"></a>
148
-
149
- ## Action
150
- Single action that can be executed directly, or combined into a set (ie. supply a vault)
151
-
152
- **Kind**: global class
153
-
154
- * [Action](#Action)
155
- * [new Action(name, contractAddress, paramTypes, args)](#new_Action_new)
156
- * [.encodeForDsProxyCall()](#Action+encodeForDsProxyCall) ⇒ <code>Array.&lt;string&gt;</code>
157
- * [.encodeForRecipe()](#Action+encodeForRecipe) ⇒ <code>Array.&lt;string&gt;</code>
158
- * [.getAssetsToApprove()](#Action+getAssetsToApprove) ⇒ <code>Promise.&lt;Array.&lt;{owner: string, asset: string}&gt;&gt;</code>
159
- * [.getEthValue()](#Action+getEthValue) ⇒ <code>Promise.&lt;string&gt;</code>
160
- * [.getAccessList()](#Action+getAccessList) ⇒ [<code>AccessList</code>](#AccessList)
161
-
162
- <a name="new_Action_new"></a>
163
-
164
- ### new Action(name, contractAddress, paramTypes, args)
165
- **Params**
166
-
167
- - name <code>string</code>
168
- - contractAddress <code>string</code>
169
- - paramTypes <code>Array.&lt;string&gt;</code>
170
- - args <code>Array.&lt;\*&gt;</code>
171
-
172
- <a name="Action+encodeForDsProxyCall"></a>
173
-
174
- ### action.encodeForDsProxyCall() ⇒ <code>Array.&lt;string&gt;</code>
175
- Encode arguments for calling the action via DsProxy
176
-
177
- **Kind**: instance method of [<code>Action</code>](#Action)
178
- **Returns**: <code>Array.&lt;string&gt;</code> - `address` & `data` to be passed on to DSProxy's `execute(address _target, bytes memory _data)`
179
- <a name="Action+encodeForRecipe"></a>
180
-
181
- ### action.encodeForRecipe() ⇒ <code>Array.&lt;string&gt;</code>
182
- Encodes action for Recipe call
183
-
184
- **Kind**: instance method of [<code>Action</code>](#Action)
185
- <a name="Action+getAssetsToApprove"></a>
186
-
187
- ### action.getAssetsToApprove() ⇒ <code>Promise.&lt;Array.&lt;{owner: string, asset: string}&gt;&gt;</code>
188
- Assets requiring approval to be used by DsProxy
189
- Approval is done from owner to DsProxy
190
-
191
- **Kind**: instance method of [<code>Action</code>](#Action)
192
- <a name="Action+getEthValue"></a>
193
-
194
- ### action.getEthValue() ⇒ <code>Promise.&lt;string&gt;</code>
195
- ETH value to be sent with transaction
196
-
197
- **Kind**: instance method of [<code>Action</code>](#Action)
198
- **Returns**: <code>Promise.&lt;string&gt;</code> - ETH value in wei
199
- <a name="Action+getAccessList"></a>
200
-
201
- ### action.getAccessList() ⇒ [<code>AccessList</code>](#AccessList)
202
- Access list for single action
203
-
204
- **Kind**: instance method of [<code>Action</code>](#Action)
205
- <a name="Recipe"></a>
206
-
207
- ## Recipe
208
- Set of Actions to be performed sequentially in a single transaction
209
-
210
- **Kind**: global class
211
-
212
- * [Recipe](#Recipe)
213
- * [new Recipe(name, actions)](#new_Recipe_new)
214
- * [.addAction(action)](#Recipe+addAction) ⇒ [<code>Recipe</code>](#Recipe)
215
- * [.encodeForDsProxyCall()](#Recipe+encodeForDsProxyCall) ⇒ <code>Array.&lt;string&gt;</code>
216
- * [._validateParamMappings()](#Recipe+_validateParamMappings)
217
- * [.getAssetsToApprove()](#Recipe+getAssetsToApprove) ⇒ <code>Promise.&lt;Array.&lt;{owner: string, asset: string}&gt;&gt;</code>
218
- * [.getEthValue()](#Recipe+getEthValue) ⇒ <code>Promise.&lt;string&gt;</code>
219
- * [.getAccessList()](#Recipe+getAccessList) ⇒ [<code>AccessList</code>](#AccessList)
220
-
221
- <a name="new_Recipe_new"></a>
222
-
223
- ### new Recipe(name, actions)
224
- **Params**
225
-
226
- - name <code>string</code>
227
- - actions [<code>Array.&lt;Action&gt;</code>](#Action)
228
-
229
- <a name="Recipe+addAction"></a>
230
-
231
- ### recipe.addAction(action) ⇒ [<code>Recipe</code>](#Recipe)
232
- **Kind**: instance method of [<code>Recipe</code>](#Recipe)
233
- **Params**
234
-
235
- - action [<code>Action</code>](#Action)
236
-
237
- <a name="Recipe+encodeForDsProxyCall"></a>
238
-
239
- ### recipe.encodeForDsProxyCall() ⇒ <code>Array.&lt;string&gt;</code>
240
- Encode arguments for calling the action set via DsProxy
241
-
242
- **Kind**: instance method of [<code>Recipe</code>](#Recipe)
243
- **Returns**: <code>Array.&lt;string&gt;</code> - `address` & `data` to be passed on to DSProxy's `execute(address _target, bytes memory _data)`
244
- <a name="Recipe+_validateParamMappings"></a>
245
-
246
- ### recipe.\_validateParamMappings()
247
- Logs parameter mapping in verbose format for validation. Used for testing in development.
248
-
249
- **Kind**: instance method of [<code>Recipe</code>](#Recipe)
250
- <a name="Recipe+getAssetsToApprove"></a>
251
-
252
- ### recipe.getAssetsToApprove() ⇒ <code>Promise.&lt;Array.&lt;{owner: string, asset: string}&gt;&gt;</code>
253
- Assets requiring approval to be used by DsProxy
254
- Approval is done from owner to DsProxy
255
-
256
- **Kind**: instance method of [<code>Recipe</code>](#Recipe)
257
- <a name="Recipe+getEthValue"></a>
258
-
259
- ### recipe.getEthValue() ⇒ <code>Promise.&lt;string&gt;</code>
260
- ETH value to be sent with transaction
261
-
262
- **Kind**: instance method of [<code>Recipe</code>](#Recipe)
263
- **Returns**: <code>Promise.&lt;string&gt;</code> - ETH value in wei
264
- <a name="Recipe+getAccessList"></a>
265
-
266
- ### recipe.getAccessList() ⇒ [<code>AccessList</code>](#AccessList)
267
- Generates an access list for the recipe
268
-
269
- **Kind**: instance method of [<code>Recipe</code>](#Recipe)
270
- <a name="EthAddress"></a>
271
-
272
- ## EthAddress : <code>string</code>
273
- Ethereum address
274
-
275
- **Kind**: global typedef
276
- <a name="VaultId"></a>
277
-
278
- ## VaultId : <code>string</code> \| <code>number</code>
279
- Maker vault ID
280
-
281
- **Kind**: global typedef
282
- <a name="AccessListItem"></a>
283
-
284
- ## AccessListItem : <code>Object</code>
285
- Access list item
286
-
287
- **Kind**: global typedef
288
- **Properties**
289
-
290
- | Name | Type |
291
- | --- | --- |
292
- | address | <code>string</code> |
293
- | storageKeys | <code>Array.&lt;string&gt;</code> |
294
-
295
- <a name="AccessList"></a>
296
-
297
- ## AccessList : [<code>Array.&lt;AccessListItem&gt;</code>](#AccessListItem)
298
- **Kind**: global typedef
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defisaver/sdk",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/Action.js CHANGED
@@ -140,7 +140,7 @@ class Action {
140
140
  encodeForStrategy(subSlots) {
141
141
  return [
142
142
  this.getId(),
143
- [this._getArgumentMappingWithSlots(subSlots)], // paramMappings
143
+ this._getArgumentMappingWithSlots(subSlots), // paramMappings
144
144
  ]
145
145
  }
146
146
 
@@ -0,0 +1,19 @@
1
+ const Action = require("../../Action");
2
+ const {getAddr} = require("../../addresses.js");
3
+
4
+ /**
5
+ * Sets the state of the sub to active or deactivated
6
+ */
7
+ class ToggleSubAction extends Action {
8
+ /**
9
+ * @param subId Id of the subscription in the SubStorage contract
10
+ * @param active Set to true to activate action, to false to deactivate
11
+ */
12
+ constructor(subId, active) {
13
+ super("ToggleSub", getAddr("ToggleSub"), ["uint256", "bool"], [...arguments]);
14
+
15
+ }
16
+
17
+ }
18
+
19
+ module.exports = ToggleSubAction;
@@ -10,7 +10,7 @@ class UpdateSubAction extends Action {
10
10
  * @param sub object that contains new sub information
11
11
  */
12
12
  constructor(subId, sub) {
13
- super("UpdateSub", getAddr("UpdateSub"), [["uint256", "(uint64,bool,bytes[],bytes32[])"]], [...arguments]);
13
+ super("UpdateSub", getAddr("UpdateSub"), ["uint256", "(uint64,bool,bytes[],bytes32[])"], [...arguments]);
14
14
 
15
15
  }
16
16
 
@@ -11,6 +11,7 @@ const TokenBalanceAction = require('./TokenBalanceAction');
11
11
  const AutomationV2Unsub = require('./AutomationV2Unsub');
12
12
  const GasFeeAction = require('./GasFeeAction');
13
13
  const UpdateSubAction = require('./UpdateSubAction');
14
+ const ToggleSubAction = require('./ToggleSubAction');
14
15
 
15
16
  module.exports = {
16
17
  SellAction,
@@ -26,4 +27,5 @@ module.exports = {
26
27
  GasFeeAction,
27
28
  UpdateSubAction,
28
29
  SendTokenAndUnwrapAction,
30
+ ToggleSubAction,
29
31
  };
@@ -9,8 +9,8 @@ class CurveStethPoolDepositAction extends Action {
9
9
  /**
10
10
  * @param from {address}
11
11
  * @param to {address}
12
- * @param amounts {uint256[2]}
13
- * @param minMintAmount {uint256}
12
+ * @param amounts {string[]}
13
+ * @param minMintAmount {string}
14
14
  */
15
15
  constructor(
16
16
  from,
@@ -9,21 +9,23 @@ class CurveStethPoolWithdrawAction extends Action {
9
9
  /**
10
10
  * @param from {address}
11
11
  * @param to {address}
12
- * @param amounts {uint256[2]}
13
- * @param maxBurnAmount {uint256}
12
+ * @param amounts {string[]}
13
+ * @param maxBurnAmount {string}
14
+ * @param returnValue {string}
14
15
  */
15
16
  constructor(
16
17
  from,
17
18
  to,
18
19
  amounts,
19
20
  maxBurnAmount,
21
+ returnValue,
20
22
  ) {
21
23
  requireAddress(to);
22
24
 
23
25
  super(
24
26
  'CurveStethPoolWithdraw',
25
27
  getAddr('CurveStethPoolWithdraw'),
26
- ['address', 'address', 'uint256[2]', 'uint256'],
28
+ ['address', 'address', 'uint256[2]', 'uint256', 'uint256'],
27
29
  [...arguments],
28
30
  );
29
31
 
package/src/addresses.js CHANGED
@@ -15,6 +15,8 @@ const actionAddresses = {
15
15
  'TokenBalance': '0xa92B177950F1460119940436515FD857C24494BC',
16
16
  'AutomationV2Unsub': '0xe35Fb12fE9796847751076aCf5ee7d124108612C',
17
17
  'SendTokenAndUnwrap': '0xeecd376026335261c89faD40D89625391b1eFF6a',
18
+ 'ToggleSub': '0x9A78E9d6538cfDbA0242Ca5eC46771E6132E8085',
19
+ 'UpdateSub': '0x94D707f411B852082a5ce49C3f47c49c7757761f',
18
20
 
19
21
  // exchange
20
22
  'DFSSell': '0x1abDDCae131ce200e66140d9fBd0C37F7a40e642',
@@ -0,0 +1,44 @@
1
+ const dfs = require('../index.js');
2
+
3
+ describe('Strategy', () => {
4
+
5
+ context('Yearn Repay', () => {
6
+ let repayStrategy;
7
+
8
+ it('Constructor', () => {
9
+ repayStrategy = new dfs.Strategy('McdYearnRepayStrategy');
10
+
11
+ repayStrategy.addSubSlot('&vaultId', 'uint256');
12
+ repayStrategy.addSubSlot('&targetRatio', 'uint256');
13
+ repayStrategy.addSubSlot('&daiAddr', 'address');
14
+ repayStrategy.addSubSlot('&mcdManager', 'address');
15
+
16
+ const mcdRatioTrigger = new dfs.triggers.MakerRatioTrigger('0', '0', '0');
17
+ repayStrategy.addTrigger(mcdRatioTrigger);
18
+
19
+ const yearnWithdrawAction = new dfs.actions.yearn.YearnWithdrawAction(
20
+ '%yDaiAddr',
21
+ '%amount',
22
+ '&proxy',
23
+ '&proxy',
24
+ );
25
+
26
+ const feeTakingAction = new dfs.actions.basic.GasFeeAction(
27
+ '0', '&daiAddr', '$1',
28
+ );
29
+
30
+ const mcdPaybackAction = new dfs.actions.maker.MakerPaybackAction(
31
+ '&vaultId',
32
+ '$2',
33
+ '&proxy',
34
+ '&mcdManager',
35
+ );
36
+
37
+ repayStrategy.addAction(yearnWithdrawAction);
38
+ repayStrategy.addAction(feeTakingAction);
39
+ repayStrategy.addAction(mcdPaybackAction);
40
+ })
41
+
42
+ it('encodeForDsProxyCall', () => repayStrategy.encodeForDsProxyCall());
43
+ })
44
+ })