@defisaver/sdk 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/package.json +1 -1
  2. package/src/Action.js +4 -8
  3. package/src/actions/aave/AaveBorrowAction.js +2 -11
  4. package/src/actions/aave/AaveClaimStkAaveAction.js +5 -5
  5. package/src/actions/aave/AaveCollateralSwitchAction.js +4 -5
  6. package/src/actions/aave/AavePaybackAction.js +2 -11
  7. package/src/actions/aave/AaveSupplyAction.js +6 -6
  8. package/src/actions/aave/AaveWithdrawAction.js +1 -8
  9. package/src/actions/balancer/BalancerV2ClaimAction.js +10 -12
  10. package/src/actions/balancer/BalancerV2SupplyAction.js +14 -16
  11. package/src/actions/balancer/BalancerV2WithdrawAction.js +15 -17
  12. package/src/actions/basic/AutomationV2Unsub.js +3 -3
  13. package/src/actions/basic/ChangeProxyOwnerAction.js +2 -4
  14. package/src/actions/basic/GasFeeAction.js +6 -6
  15. package/src/actions/basic/PullTokenAction.js +3 -9
  16. package/src/actions/basic/SellAction.js +5 -6
  17. package/src/actions/basic/SendTokenAction.js +3 -9
  18. package/src/actions/basic/SendTokenAndUnwrapAction.js +3 -9
  19. package/src/actions/basic/SubInputsAction.js +3 -8
  20. package/src/actions/basic/SumInputsAction.js +3 -8
  21. package/src/actions/basic/TokenBalanceAction.js +3 -3
  22. package/src/actions/basic/UnwrapEthAction.js +3 -8
  23. package/src/actions/basic/UpdateSubAction.js +1 -1
  24. package/src/actions/basic/WrapEthAction.js +1 -5
  25. package/src/actions/checkers/MakerRatioCheckAction.js +5 -5
  26. package/src/actions/compound/CompoundBorrowAction.js +1 -7
  27. package/src/actions/compound/CompoundClaimAction.js +3 -3
  28. package/src/actions/compound/CompoundCollateralSwitchAction.js +2 -4
  29. package/src/actions/compound/CompoundGetDebtAction.js +3 -3
  30. package/src/actions/compound/CompoundPaybackAction.js +1 -7
  31. package/src/actions/compound/CompoundSupplyAction.js +4 -4
  32. package/src/actions/compound/CompoundWithdrawAction.js +1 -7
  33. package/src/actions/curve/CurveClaimFeesAction.js +4 -4
  34. package/src/actions/curve/CurveDepositAction.js +7 -7
  35. package/src/actions/curve/CurveGaugeDepositAction.js +6 -6
  36. package/src/actions/curve/CurveGaugeWithdrawAction.js +4 -4
  37. package/src/actions/curve/CurveMintCrvAction.js +3 -3
  38. package/src/actions/curve/CurveStethPoolDepositAction.js +7 -7
  39. package/src/actions/curve/CurveStethPoolWithdrawAction.js +7 -7
  40. package/src/actions/curve/CurveSwapAction.js +15 -15
  41. package/src/actions/curve/CurveWithdrawAction.js +7 -7
  42. package/src/actions/dydx/DyDxWithdrawAction.js +1 -7
  43. package/src/actions/flashloan/AaveV2FlashLoanAction.js +2 -2
  44. package/src/actions/flashloan/BalancerFlashLoanAction.js +2 -2
  45. package/src/actions/flashloan/DyDxFlashLoanAction.js +5 -1
  46. package/src/actions/flashloan/MakerFlashLoanAction.js +2 -2
  47. package/src/actions/guni/GUniDeposit.js +9 -9
  48. package/src/actions/guni/GUniWithdraw.js +5 -5
  49. package/src/actions/insta/InstPullTokensAction.js +4 -4
  50. package/src/actions/lido/LidoStakeAction.js +2 -7
  51. package/src/actions/lido/LidoUnwrapAction.js +2 -7
  52. package/src/actions/lido/LidoWrapAction.js +7 -7
  53. package/src/actions/liquity/LiquityBorrowAction.js +5 -5
  54. package/src/actions/liquity/LiquityClaimAction.js +3 -3
  55. package/src/actions/liquity/LiquityCloseAction.js +4 -4
  56. package/src/actions/liquity/LiquityEthGainToTroveAction.js +3 -3
  57. package/src/actions/liquity/LiquityOpenAction.js +8 -8
  58. package/src/actions/liquity/LiquityPaybackAction.js +5 -5
  59. package/src/actions/liquity/LiquityRedeemAction.js +7 -7
  60. package/src/actions/liquity/LiquitySPDepositAction.js +7 -7
  61. package/src/actions/liquity/LiquitySPWithdrawAction.js +6 -6
  62. package/src/actions/liquity/LiquityStakeAction.js +7 -7
  63. package/src/actions/liquity/LiquitySupplyAction.js +5 -5
  64. package/src/actions/liquity/LiquityUnstakeAction.js +6 -6
  65. package/src/actions/liquity/LiquityWithdrawAction.js +4 -4
  66. package/src/actions/maker/MakerClaimAction.js +4 -4
  67. package/src/actions/maker/MakerGenerateAction.js +1 -8
  68. package/src/actions/maker/MakerGiveAction.js +4 -4
  69. package/src/actions/maker/MakerMergeAction.js +1 -7
  70. package/src/actions/maker/MakerOpenVaultAction.js +1 -6
  71. package/src/actions/maker/MakerPaybackAction.js +2 -9
  72. package/src/actions/maker/MakerRatioAction.js +1 -5
  73. package/src/actions/maker/MakerSupplyAction.js +1 -9
  74. package/src/actions/maker/MakerWithdrawAction.js +1 -9
  75. package/src/actions/mstable/MStableClaimAction.js +4 -4
  76. package/src/actions/mstable/MStableDepositAction.js +16 -16
  77. package/src/actions/mstable/MStableWithdrawAction.js +15 -15
  78. package/src/actions/rari/RariDepositAction.js +5 -5
  79. package/src/actions/rari/RariWithdrawAction.js +6 -6
  80. package/src/actions/reflexer/ReflexerGenerateAction.js +1 -7
  81. package/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +5 -5
  82. package/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +3 -8
  83. package/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +4 -9
  84. package/src/actions/reflexer/ReflexerOpenSafeAction.js +1 -5
  85. package/src/actions/reflexer/ReflexerPaybackAction.js +1 -7
  86. package/src/actions/reflexer/ReflexerSupplyAction.js +1 -8
  87. package/src/actions/reflexer/ReflexerWithdrawAction.js +1 -8
  88. package/src/actions/uniswap/UniswapSupplyAction.js +20 -22
  89. package/src/actions/uniswap/UniswapWithdrawAction.js +16 -18
  90. package/src/actions/uniswapV3/UniswapV3CollectAction.js +7 -9
  91. package/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +20 -22
  92. package/src/actions/uniswapV3/UniswapV3MintAction.js +19 -21
  93. package/src/actions/uniswapV3/UniswapV3SupplyAction.js +17 -19
  94. package/src/actions/uniswapV3/UniswapV3WithdrawAction.js +12 -14
  95. package/src/actions/yearn/YearnSupplyAction.js +6 -6
  96. package/src/actions/yearn/YearnWithdrawAction.js +6 -6
  97. package/src/triggers/ChainLinkPriceTrigger.js +2 -2
  98. package/src/triggers/CompoundRatioTrigger.js +1 -1
  99. package/src/triggers/GasPriceTrigger.js +1 -1
  100. package/src/triggers/LiquityRatioTrigger.js +3 -2
  101. package/src/triggers/MakerRatioTrigger.js +1 -5
  102. package/src/triggers/ReflexerRatioTrigger.js +2 -1
  103. package/src/triggers/TimestampTrigger.js +1 -1
  104. package/src/triggers/UniV3CurrentTickTrigger.js +1 -1
  105. package/test/Action.js +2 -1
  106. package/test/accessLists/access-lists.js +1 -2
  107. package/test/actions/maker/MakerPaybackAction.js +2 -2
@@ -22,39 +22,37 @@ class UniswapSupplyAction extends Action {
22
22
  'UniSupply',
23
23
  getAddr('UniSupply'),
24
24
  [
25
- [
26
- "address",
27
- "address",
28
- "address",
29
- "address",
30
- "uint256",
31
- "uint256",
32
- "uint256",
33
- "uint256",
34
- "uint256",
35
- ],
25
+ "address",
26
+ "address",
27
+ "address",
28
+ "address",
29
+ "uint256",
30
+ "uint256",
31
+ "uint256",
32
+ "uint256",
33
+ "uint256",
36
34
  ],
37
- [[...arguments]]
35
+ [...arguments]
38
36
  );
39
37
 
40
38
  this.mappableArgs = [
41
- this.args[0][0],
42
- this.args[0][1],
43
- this.args[0][2],
44
- this.args[0][3],
45
- this.args[0][4],
46
- this.args[0][5]
39
+ this.args[0],
40
+ this.args[1],
41
+ this.args[2],
42
+ this.args[3],
43
+ this.args[4],
44
+ this.args[5]
47
45
  ];
48
46
  }
49
47
 
50
48
  async getAssetsToApprove() {
51
- const assetA = getAssetInfoByAddress(this.args[0][0]);
52
- const assetB = getAssetInfoByAddress(this.args[0][1]);
49
+ const assetA = getAssetInfoByAddress(this.args[0]);
50
+ const assetB = getAssetInfoByAddress(this.args[1]);
53
51
 
54
52
  const approveArr = [];
55
53
 
56
- if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][0], owner: this.args[0][2], specialApproveLabel: 'uniswap v2'});
57
- if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][1], owner: this.args[0][2], specialApproveLabel: 'uniswap v2'});
54
+ if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[2], specialApproveLabel: 'uniswap v2'});
55
+ if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[2], specialApproveLabel: 'uniswap v2'});
58
56
 
59
57
  return approveArr;
60
58
  }
@@ -21,32 +21,30 @@ class UniswapWithdrawAction extends Action {
21
21
  'UniWithdraw',
22
22
  getAddr('UniWithdraw'),
23
23
  [
24
- [
25
- "address",
26
- "address",
27
- "uint256",
28
- "address",
29
- "address",
30
- "uint256",
31
- "uint256",
32
- "uint256",
33
- ],
24
+ "address",
25
+ "address",
26
+ "uint256",
27
+ "address",
28
+ "address",
29
+ "uint256",
30
+ "uint256",
31
+ "uint256",
34
32
  ],
35
- [[...arguments]]
33
+ [...arguments]
36
34
  );
37
35
 
38
36
  this.mappableArgs = [
39
- this.args[0][0],
40
- this.args[0][1],
41
- this.args[0][2],
42
- this.args[0][3],
43
- this.args[0][4],
37
+ this.args[0],
38
+ this.args[1],
39
+ this.args[2],
40
+ this.args[3],
41
+ this.args[4],
44
42
  ];
45
43
  }
46
44
 
47
45
  async getAssetsToApprove() {
48
- const lpAddress = getPoolAddressByAddresses(this.args[0][0], this.args[0][1])
49
- return [{asset: lpAddress, owner: this.args[0][4], specialApproveLabel: 'uniswap v2'}];
46
+ const lpAddress = getPoolAddressByAddresses(this.args[0], this.args[1])
47
+ return [{asset: lpAddress, owner: this.args[4], specialApproveLabel: 'uniswap v2'}];
50
48
  }
51
49
  }
52
50
 
@@ -17,27 +17,25 @@ class UniswapV3CollectAction extends Action {
17
17
  'UniCollectV3',
18
18
  getAddr('UniCollectV3'),
19
19
  [
20
- [
21
- "uint256",
22
- "address",
23
- "uint128",
24
- "uint128",
25
- ],
20
+ "uint256",
21
+ "address",
22
+ "uint128",
23
+ "uint128",
26
24
  ],
27
- [[tokenId, recipient, amount0Max, amount1Max]]
25
+ [tokenId, recipient, amount0Max, amount1Max]
28
26
  );
29
27
 
30
28
  this.from = from;
31
29
 
32
30
  this.mappableArgs = [
33
- this.args[0][0],
31
+ this.args[0],
34
32
  ];
35
33
  }
36
34
 
37
35
  async getAssetsToApprove() {
38
36
  return [{
39
37
  nft: getAddr('UniswapV3PositionManager'),
40
- tokenId: this.args[0][0],
38
+ tokenId: this.args[0],
41
39
  owner: this.from,
42
40
  specialApproveLabel: 'uniswap v3'
43
41
  }];
@@ -26,39 +26,37 @@ class UniswapV3CreatePoolAction extends Action {
26
26
  'UniCreatePoolV3',
27
27
  getAddr('UniCreatePoolV3'),
28
28
  [
29
- [
30
- "address",
31
- "address",
32
- "uint24",
33
- "int24",
34
- "int24",
35
- "uint256",
36
- "uint256",
37
- "uint256",
38
- "uint256",
39
- "address",
40
- "uint256",
41
- "address",
42
- "uint160",
43
- ],
29
+ "address",
30
+ "address",
31
+ "uint24",
32
+ "int24",
33
+ "int24",
34
+ "uint256",
35
+ "uint256",
36
+ "uint256",
37
+ "uint256",
38
+ "address",
39
+ "uint256",
40
+ "address",
41
+ "uint160",
44
42
  ],
45
- [[...arguments]]
43
+ [...arguments]
46
44
  );
47
45
 
48
46
  this.mappableArgs = [
49
- this.args[0][5],
50
- this.args[0][6],
47
+ this.args[5],
48
+ this.args[6],
51
49
  ];
52
50
  }
53
51
 
54
52
  async getAssetsToApprove() {
55
- const assetA = getAssetInfoByAddress(this.args[0][0]);
56
- const assetB = getAssetInfoByAddress(this.args[0][1]);
53
+ const assetA = getAssetInfoByAddress(this.args[0]);
54
+ const assetB = getAssetInfoByAddress(this.args[1]);
57
55
 
58
56
  const approveArr = [];
59
57
 
60
- if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][0], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
61
- if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][1], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
58
+ if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
59
+ if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
62
60
 
63
61
  return approveArr;
64
62
  }
@@ -26,38 +26,36 @@ class UniswapV3MintAction extends Action {
26
26
  'UniMintV3',
27
27
  getAddr('UniMintV3'),
28
28
  [
29
- [
30
- "address",
31
- "address",
32
- "uint24",
33
- "int24",
34
- "int24",
35
- "uint256",
36
- "uint256",
37
- "uint256",
38
- "uint256",
39
- "address",
40
- "uint256",
41
- "address",
42
- ],
29
+ "address",
30
+ "address",
31
+ "uint24",
32
+ "int24",
33
+ "int24",
34
+ "uint256",
35
+ "uint256",
36
+ "uint256",
37
+ "uint256",
38
+ "address",
39
+ "uint256",
40
+ "address",
43
41
  ],
44
- [[...arguments]]
42
+ [...arguments]
45
43
  );
46
44
 
47
45
  this.mappableArgs = [
48
- this.args[0][5],
49
- this.args[0][6],
46
+ this.args[5],
47
+ this.args[6],
50
48
  ];
51
49
  }
52
50
 
53
51
  async getAssetsToApprove() {
54
- const assetA = getAssetInfoByAddress(this.args[0][0]);
55
- const assetB = getAssetInfoByAddress(this.args[0][1]);
52
+ const assetA = getAssetInfoByAddress(this.args[0]);
53
+ const assetB = getAssetInfoByAddress(this.args[1]);
56
54
 
57
55
  const approveArr = [];
58
56
 
59
- if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][0], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
60
- if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][1], owner: this.args[0][11], specialApproveLabel: 'uniswap v3'});
57
+ if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
58
+ if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[1], owner: this.args[11], specialApproveLabel: 'uniswap v3'});
61
59
 
62
60
  return approveArr;
63
61
  }
@@ -22,36 +22,34 @@ class UniswapV3SupplyAction extends Action {
22
22
  'UniSupplyV3',
23
23
  getAddr('UniSupplyV3'),
24
24
  [
25
- [
26
- "uint256",
27
- "uint256",
28
- "uint256",
29
- "uint256",
30
- "uint256",
31
- "uint256",
32
- "address",
33
- "address",
34
- "address",
35
- ],
25
+ "uint256",
26
+ "uint256",
27
+ "uint256",
28
+ "uint256",
29
+ "uint256",
30
+ "uint256",
31
+ "address",
32
+ "address",
33
+ "address",
36
34
  ],
37
- [[...arguments]]
35
+ [...arguments]
38
36
  );
39
37
 
40
38
  this.mappableArgs = [
41
- this.args[0][0],
42
- this.args[0][1],
43
- this.args[0][2],
39
+ this.args[0],
40
+ this.args[1],
41
+ this.args[2],
44
42
  ];
45
43
  }
46
44
 
47
45
  async getAssetsToApprove() {
48
- const assetA = getAssetInfoByAddress(this.args[0][7]);
49
- const assetB = getAssetInfoByAddress(this.args[0][8]);
46
+ const assetA = getAssetInfoByAddress(this.args[7]);
47
+ const assetB = getAssetInfoByAddress(this.args[8]);
50
48
 
51
49
  const approveArr = [];
52
50
 
53
- if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[0][7], owner: this.args[0][6], specialApproveLabel: 'uniswap v3'});
54
- if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[0][8], owner: this.args[0][6], specialApproveLabel: 'uniswap v3'});
51
+ if (assetA.symbol !== 'ETH') approveArr.push({asset: this.args[7], owner: this.args[6], specialApproveLabel: 'uniswap v3'});
52
+ if (assetB.symbol !== 'ETH') approveArr.push({asset: this.args[8], owner: this.args[6], specialApproveLabel: 'uniswap v3'});
55
53
 
56
54
  return approveArr;
57
55
  }
@@ -21,32 +21,30 @@ class UniswapV3WithdrawAction extends Action {
21
21
  'UniWithdrawV3',
22
22
  getAddr('UniWithdrawV3'),
23
23
  [
24
- [
25
- "uint256",
26
- "uint128",
27
- "uint256",
28
- "uint256",
29
- "uint256",
30
- "address",
31
- "uint128",
32
- "uint128",
33
- ],
24
+ "uint256",
25
+ "uint128",
26
+ "uint256",
27
+ "uint256",
28
+ "uint256",
29
+ "address",
30
+ "uint128",
31
+ "uint128",
34
32
  ],
35
- [[tokenId, liquidity, amount0Min, amount1Min, deadline, recipient, amount0Max, amount1Max]]
33
+ [tokenId, liquidity, amount0Min, amount1Min, deadline, recipient, amount0Max, amount1Max]
36
34
  );
37
35
 
38
36
  this.from = from;
39
37
 
40
38
  this.mappableArgs = [
41
- this.args[0][0],
42
- this.args[0][1],
39
+ this.args[0],
40
+ this.args[1],
43
41
  ];
44
42
  }
45
43
 
46
44
  async getAssetsToApprove() {
47
45
  return [{
48
46
  nft: getAddr('UniswapV3PositionManager'),
49
- tokenId: this.args[0][0],
47
+ tokenId: this.args[0],
50
48
  owner: this.from,
51
49
  specialApproveLabel: 'uniswap v3'
52
50
  }];
@@ -13,17 +13,17 @@ class YearnSupplyAction extends Action {
13
13
  * @param to {ETHAddress} yTokens will be sent to this address
14
14
  */
15
15
  constructor(tokenAddr, amount, from, to) {
16
- super('YearnSupply', getAddr('YearnSupply'), [['address','uint256','address', 'address']], [[tokenAddr, amount, from, to]]);
16
+ super('YearnSupply', getAddr('YearnSupply'), ['address','uint256','address', 'address'], [tokenAddr, amount, from, to]);
17
17
  this.mappableArgs = [
18
- this.args[0][1],
19
- this.args[0][2],
20
- this.args[0][3],
18
+ this.args[1],
19
+ this.args[2],
20
+ this.args[3],
21
21
  ];
22
22
  }
23
23
 
24
24
  async getAssetsToApprove() {
25
- const asset = getAssetInfoByAddress(this.args[0][0]);
26
- if (asset.symbol !== 'ETH') return [{asset: this.args[0][0], owner: this.args[0][2], specialApproveLabel: 'yearn'}];
25
+ const asset = getAssetInfoByAddress(this.args[0]);
26
+ if (asset.symbol !== 'ETH') return [{asset: this.args[0], owner: this.args[2], specialApproveLabel: 'yearn'}];
27
27
  return [];
28
28
  }
29
29
  }
@@ -13,17 +13,17 @@ class YearnWithdrawAction extends Action {
13
13
  * @param to {ETHAddress} underlying tokens will be sent to this address
14
14
  */
15
15
  constructor(tokenAddr, amount, from, to) {
16
- super('YearnWithdraw', getAddr('YearnWithdraw'), [['address','uint256','address', 'address']], [[tokenAddr, amount, from, to]]);
16
+ super('YearnWithdraw', getAddr('YearnWithdraw'), ['address','uint256','address', 'address'], [tokenAddr, amount, from, to]);
17
17
  this.mappableArgs = [
18
- this.args[0][1],
19
- this.args[0][2],
20
- this.args[0][3],
18
+ this.args[1],
19
+ this.args[2],
20
+ this.args[3],
21
21
  ];
22
22
  }
23
23
 
24
24
  async getAssetsToApprove() {
25
- const asset = getAssetInfoByAddress(this.args[0][0]);
26
- if (asset.symbol !== 'ETH') return [{asset: this.args[0][0], owner: this.args[0][2], specialApproveLabel: 'yearn'}];
25
+ const asset = getAssetInfoByAddress(this.args[0]);
26
+ if (asset.symbol !== 'ETH') return [{asset: this.args[0], owner: this.args[2], specialApproveLabel: 'yearn'}];
27
27
  return [];
28
28
  }
29
29
  }
@@ -4,9 +4,9 @@ const {getAddr} = require("../addresses.js");
4
4
  class ChainLinkPriceTrigger extends Action {
5
5
 
6
6
  constructor(tokenAddr, price, state) {
7
- super("ChainLinkPriceTrigger", getAddr("ChainLinkPriceTrigger"), [["address", "uint256", "uint8"]], [[...arguments]]);
7
+ super("ChainLinkPriceTrigger", getAddr("ChainLinkPriceTrigger"), ["address", "uint256", "uint8"], [...arguments]);
8
8
  }
9
9
 
10
10
  }
11
11
 
12
- module.exports = ChainLinkPriceTrigger;
12
+ module.exports = ChainLinkPriceTrigger;
@@ -4,7 +4,7 @@ const {getAddr} = require("../addresses.js");
4
4
  class CompoundRatioTrigger extends Action {
5
5
 
6
6
  constructor(user, ratio, state) {
7
- super("CompoundRatioTrigger", getAddr("CompoundRatioTrigger"), [["address", "uint256", "uint8"]], [[...arguments]]);
7
+ super("CompoundRatioTrigger", getAddr("CompoundRatioTrigger"), ["address", "uint256", "uint8"], [...arguments]);
8
8
  }
9
9
  }
10
10
 
@@ -4,7 +4,7 @@ const {getAddr} = require("../addresses.js");
4
4
  class GasPriceTrigger extends Action {
5
5
 
6
6
  constructor(maxGasPrice) {
7
- super("GasPriceTrigger", getAddr("GasPriceTrigger"), [["uint256"]], [[...arguments]]);
7
+ super("GasPriceTrigger", getAddr("GasPriceTrigger"), ["uint256"], [...arguments]);
8
8
  }
9
9
  }
10
10
 
@@ -1,4 +1,5 @@
1
1
  const Action = require("../Action");
2
+ const {getAddr} = require("../addresses");
2
3
 
3
4
  class LiquityRatioTrigger extends Action {
4
5
 
@@ -6,8 +7,8 @@ class LiquityRatioTrigger extends Action {
6
7
  super(
7
8
  "LiquityRatioTrigger",
8
9
  getAddr("LiquityRatioTrigger"),
9
- [["addresss", "uint256", "uint8"]],
10
- [[...arguments]]
10
+ ["addresss", "uint256", "uint8"],
11
+ [...arguments]
11
12
  );
12
13
  }
13
14
  }
@@ -4,11 +4,7 @@ const {getAddr} = require("../addresses.js");
4
4
  class MakerRatioTrigger extends Action {
5
5
 
6
6
  constructor(vaultId, ratio, state) {
7
- super("McdRatioTrigger", getAddr("McdRatioTrigger"), [["uint256", "uint256", "uint8"]], [[...arguments]]);
8
- }
9
-
10
- async getEthValue() {
11
- return this.args[0];
7
+ super("McdRatioTrigger", getAddr("McdRatioTrigger"), ["uint256", "uint256", "uint8"], [...arguments]);
12
8
  }
13
9
  }
14
10
 
@@ -1,9 +1,10 @@
1
1
  const Action = require("../Action");
2
+ const {getAddr} = require("../addresses");
2
3
 
3
4
  class ReflexerRatioTrigger extends Action {
4
5
 
5
6
  constructor(vaultId, ratio, state) {
6
- super("ReflexerRatioTrigger", getAddr("ReflexerRatioTrigger"), [["uint256", "uint256", "uint8"]], [[...arguments]]);
7
+ super("ReflexerRatioTrigger", getAddr("ReflexerRatioTrigger"), ["uint256", "uint256", "uint8"], [...arguments]);
7
8
  }
8
9
  }
9
10
 
@@ -4,7 +4,7 @@ const {getAddr} = require("../addresses.js");
4
4
  class TimestampTrigger extends Action {
5
5
 
6
6
  constructor(nextTimestamp) {
7
- super("TimestampTrigger", getAddr("TimestampTrigger"), [["uint256"]], [[...arguments]]);
7
+ super("TimestampTrigger", getAddr("TimestampTrigger"), ["uint256"], [...arguments]);
8
8
  }
9
9
  }
10
10
 
@@ -4,7 +4,7 @@ const {getAddr} = require("../addresses.js");
4
4
  class UniV3CurrentTickTrigger extends Action {
5
5
 
6
6
  constructor(tokenId, state) {
7
- super("UniV3CurrentTickTrigger", getAddr("UniV3CurrentTickTrigger"), [["uint256", "uint8"]], [[...arguments]]);
7
+ super("UniV3CurrentTickTrigger", getAddr("UniV3CurrentTickTrigger"), ["uint256", "uint8"], [...arguments]);
8
8
  }
9
9
 
10
10
  }
package/test/Action.js CHANGED
@@ -39,6 +39,7 @@ describe('Action', () => {
39
39
  let action;
40
40
  it('Constructor', () => {
41
41
  action = new dfs.Action('MockSwap', '0x0a80C3C540eEF99811f4579fa7b1A0617294e06f', ['uint256', 'address'], ['$1', '0x6b175474e89094c44da98b954eedeac495271d0f']);
42
+ action.mappableArgs = [action.args[0][0], action.args[0][1]];
42
43
  })
43
44
  it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
44
45
  it('encodeForRecipe', () => encodeForRecipe(action));
@@ -54,7 +55,7 @@ describe('Action', () => {
54
55
  assert.throws(() => encodeForRecipe(action));
55
56
  });
56
57
  it('encodeForRecipe with custom mappableArgs', () => {
57
- action.mappableArgs = [action.args[0][0], action.args[1]];
58
+ action.mappableArgs = [action.args[0][0][0], action.args[0][1]];
58
59
  encodeForRecipe(action)
59
60
  });
60
61
  })
@@ -85,8 +85,7 @@ describe('Access-Lists', () => {
85
85
  sampleRecipes.forEach((recipe) => {
86
86
  it(`... should make an access list for recipe ${recipe.name}`, () => {
87
87
  const recipeAccessList = recipe.getAccessList();
88
- console.log(recipeAccessList);
89
- testDuplicates(recipeAccessList);
88
+ testDuplicates(recipeAccessList);
90
89
  testInclusion(recipe, recipeAccessList);
91
90
  });
92
91
  });
@@ -14,7 +14,7 @@ describe('Action: MakerPaybackAction', () => {
14
14
  assetAmountInWei(1, 'DAI'),
15
15
  '0x0a80C3C540eEF99811f4579fa7b1A0617294e06f'
16
16
  );
17
- assert.equal(action.args[0][3], getAddr('McdCdpManager'));
17
+ assert.equal(action.args[3], getAddr('McdCdpManager'));
18
18
  })
19
19
  it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
20
20
  it('encodeForRecipe', () => encodeForRecipe(action));
@@ -38,7 +38,7 @@ describe('Action: MakerPaybackAction', () => {
38
38
  '0x0a80C3C540eEF99811f4579fa7b1A0617294e06f',
39
39
  getAddr('BCdpManager'),
40
40
  );
41
- assert.equal(action.args[0][3], getAddr('BCdpManager'));
41
+ assert.equal(action.args[3], getAddr('BCdpManager'));
42
42
  })
43
43
  it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
44
44
  it('encodeForRecipe', () => encodeForRecipe(action));