@defisaver/sdk 1.2.7 → 1.2.9

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 (167) hide show
  1. package/.mocharc.json +4 -0
  2. package/.nvmrc +1 -0
  3. package/README.md +6 -0
  4. package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.d.ts +16 -0
  5. package/esm/src/actions/checkers/AaveV3OpenRatioCheckAction.js +22 -0
  6. package/esm/src/actions/checkers/index.d.ts +1 -0
  7. package/esm/src/actions/checkers/index.js +1 -0
  8. package/esm/src/actions/eulerV2/EulerV2BorrowAction.d.ts +16 -0
  9. package/esm/src/actions/eulerV2/EulerV2BorrowAction.js +24 -0
  10. package/esm/src/actions/eulerV2/EulerV2CollateralSwitchAction.d.ts +15 -0
  11. package/esm/src/actions/eulerV2/EulerV2CollateralSwitchAction.js +22 -0
  12. package/esm/src/actions/eulerV2/EulerV2PaybackAction.d.ts +22 -0
  13. package/esm/src/actions/eulerV2/EulerV2PaybackAction.js +40 -0
  14. package/esm/src/actions/eulerV2/EulerV2PaybackWithSharesAction.d.ts +16 -0
  15. package/esm/src/actions/eulerV2/EulerV2PaybackWithSharesAction.js +24 -0
  16. package/esm/src/actions/eulerV2/EulerV2PullDebtAction.d.ts +16 -0
  17. package/esm/src/actions/eulerV2/EulerV2PullDebtAction.js +24 -0
  18. package/esm/src/actions/eulerV2/EulerV2ReorderCollateralsAction.d.ts +14 -0
  19. package/esm/src/actions/eulerV2/EulerV2ReorderCollateralsAction.js +20 -0
  20. package/esm/src/actions/eulerV2/EulerV2SupplyAction.d.ts +23 -0
  21. package/esm/src/actions/eulerV2/EulerV2SupplyAction.js +42 -0
  22. package/esm/src/actions/eulerV2/EulerV2WithdrawAction.d.ts +16 -0
  23. package/esm/src/actions/eulerV2/EulerV2WithdrawAction.js +24 -0
  24. package/esm/src/actions/eulerV2/index.d.ts +8 -0
  25. package/esm/src/actions/eulerV2/index.js +8 -0
  26. package/esm/src/actions/index.d.ts +2 -1
  27. package/esm/src/actions/index.js +2 -1
  28. package/esm/src/addresses.d.ts +24 -0
  29. package/esm/src/addresses.js +11 -7
  30. package/esm/src/index.d.ts +96 -0
  31. package/esm/src/triggers/AaveV2RatioTrigger.js +1 -1
  32. package/esm/src/triggers/AaveV3QuotePriceTrigger.js +1 -1
  33. package/esm/src/triggers/AaveV3RatioTrigger.js +1 -1
  34. package/esm/src/triggers/CBRebondTrigger.js +1 -1
  35. package/esm/src/triggers/ChainLinkPriceTrigger.js +1 -1
  36. package/esm/src/triggers/CompV3RatioTrigger.js +1 -1
  37. package/esm/src/triggers/CompoundRatioTrigger.js +1 -1
  38. package/esm/src/triggers/CurveUsdCollRatioTrigger.js +1 -1
  39. package/esm/src/triggers/CurveUsdHealthRatioTrigger.js +1 -1
  40. package/esm/src/triggers/GasPriceTrigger.js +1 -1
  41. package/esm/src/triggers/LiquityDebtInFrontWithLimitTrigger.js +1 -1
  42. package/esm/src/triggers/LiquityRatioTrigger.js +1 -1
  43. package/esm/src/triggers/MakerRatioTrigger.js +1 -1
  44. package/esm/src/triggers/MorphoAaveV2RatioTrigger.js +1 -1
  45. package/esm/src/triggers/MorphoBlueRatioTrigger.js +1 -1
  46. package/esm/src/triggers/OffchainPriceTrigger.js +1 -1
  47. package/esm/src/triggers/ReflexerRatioTrigger.js +1 -1
  48. package/esm/src/triggers/SparkQuotePriceTrigger.js +1 -1
  49. package/esm/src/triggers/SparkRatioTrigger.js +1 -1
  50. package/esm/src/triggers/TimestampTrigger.js +1 -1
  51. package/esm/src/triggers/TrailingStopTrigger.js +1 -1
  52. package/esm/src/triggers/UniV3CurrentTickTrigger.js +1 -1
  53. package/package.json +8 -5
  54. package/src/actions/checkers/AaveV3OpenRatioCheckAction.ts +30 -0
  55. package/src/actions/checkers/index.ts +2 -1
  56. package/src/actions/eulerV2/EulerV2BorrowAction.ts +37 -0
  57. package/src/actions/eulerV2/EulerV2CollateralSwitchAction.ts +34 -0
  58. package/src/actions/eulerV2/EulerV2PaybackAction.ts +47 -0
  59. package/src/actions/eulerV2/EulerV2PaybackWithSharesAction.ts +37 -0
  60. package/src/actions/eulerV2/EulerV2PullDebtAction.ts +37 -0
  61. package/src/actions/eulerV2/EulerV2ReorderCollateralsAction.ts +31 -0
  62. package/src/actions/eulerV2/EulerV2SupplyAction.ts +49 -0
  63. package/src/actions/eulerV2/EulerV2WithdrawAction.ts +37 -0
  64. package/src/actions/eulerV2/index.ts +8 -0
  65. package/src/actions/index.ts +2 -0
  66. package/src/addresses.ts +10 -5
  67. package/src/triggers/AaveV2RatioTrigger.ts +2 -2
  68. package/src/triggers/AaveV3QuotePriceTrigger.ts +2 -2
  69. package/src/triggers/AaveV3RatioTrigger.ts +2 -2
  70. package/src/triggers/CBRebondTrigger.ts +2 -2
  71. package/src/triggers/ChainLinkPriceTrigger.ts +2 -2
  72. package/src/triggers/CompV3RatioTrigger.ts +2 -2
  73. package/src/triggers/CompoundRatioTrigger.ts +2 -2
  74. package/src/triggers/CurveUsdCollRatioTrigger.ts +2 -2
  75. package/src/triggers/CurveUsdHealthRatioTrigger.ts +1 -1
  76. package/src/triggers/GasPriceTrigger.ts +2 -2
  77. package/src/triggers/LiquityDebtInFrontWithLimitTrigger.ts +2 -2
  78. package/src/triggers/LiquityRatioTrigger.ts +2 -2
  79. package/src/triggers/MakerRatioTrigger.ts +2 -2
  80. package/src/triggers/MorphoAaveV2RatioTrigger.ts +2 -2
  81. package/src/triggers/MorphoBlueRatioTrigger.ts +2 -2
  82. package/src/triggers/OffchainPriceTrigger.ts +2 -2
  83. package/src/triggers/ReflexerRatioTrigger.ts +2 -2
  84. package/src/triggers/SparkQuotePriceTrigger.ts +2 -2
  85. package/src/triggers/SparkRatioTrigger.ts +2 -2
  86. package/src/triggers/TimestampTrigger.ts +2 -2
  87. package/src/triggers/TrailingStopTrigger.ts +2 -2
  88. package/src/triggers/UniV3CurrentTickTrigger.ts +2 -2
  89. package/test/Action.js +1 -1
  90. package/test/ActionWithL2.js +1 -1
  91. package/test/DfsWeb3.js +1 -1
  92. package/test/Recipe.js +1 -1
  93. package/test/Strategy.js +1 -1
  94. package/test/accessLists/Recipe.js +1 -1
  95. package/test/accessLists/access-lists.js +1 -1
  96. package/test/actions/aave/AaveBorrowAction.js +1 -1
  97. package/test/actions/aave/AaveClaimStkAaveAction.js +1 -1
  98. package/test/actions/aave/AaveCollateralSwitchAction.js +1 -1
  99. package/test/actions/aave/AavePaybackAction.js +1 -1
  100. package/test/actions/aave/AaveSupplyAction.js +1 -1
  101. package/test/actions/aave/AaveWithdrawAction.js +1 -1
  102. package/test/actions/balancer/BalancerV2ClaimAction.js +1 -1
  103. package/test/actions/balancer/BalancerV2SupplyAction.js +1 -1
  104. package/test/actions/balancer/BalancerV2WithdrawAction.js +1 -1
  105. package/test/actions/basic/ChangeProxyOwnerAction.js +1 -1
  106. package/test/actions/basic/CreateSubAction.js +1 -2
  107. package/test/actions/basic/SellAction.js +1 -1
  108. package/test/actions/basic/SendTokenAction.js +1 -1
  109. package/test/actions/basic/TokenBalanceAction.js +1 -1
  110. package/test/actions/checkers/AaveV3OpenRatioCheckAction.js +22 -0
  111. package/test/actions/compound/CompoundBorrowAction.js +1 -1
  112. package/test/actions/compound/CompoundCollateralSwitchAction.js +1 -1
  113. package/test/actions/compound/CompoundGetDebtAction.js +1 -1
  114. package/test/actions/compound/CompoundPaybackAction.js +1 -1
  115. package/test/actions/compound/CompoundSupplyAction.js +1 -1
  116. package/test/actions/compound/CompoundWithdrawAction.js +1 -1
  117. package/test/actions/dydx/DyDxWithdrawAction.js +1 -1
  118. package/test/actions/eulerV2/EulerV2BorrowAction.js +31 -0
  119. package/test/actions/eulerV2/EulerV2CollateralSwitchAction.js +28 -0
  120. package/test/actions/eulerV2/EulerV2PaybackAction.js +39 -0
  121. package/test/actions/eulerV2/EulerV2SupplyAction.js +42 -0
  122. package/test/actions/eulerV2/EulerV2WithdrawAction.js +31 -0
  123. package/test/actions/flashloan/DyDxFlashLoanAction.js +1 -1
  124. package/test/actions/insta/InstPullTokensAction.js +1 -1
  125. package/test/actions/lido/LidoStakeAction.js +1 -1
  126. package/test/actions/liquity/LiquityBorrowAction.js +1 -1
  127. package/test/actions/liquity/LiquityClaimAction.js +1 -1
  128. package/test/actions/liquity/LiquityClaimSPRewardsAction.js +1 -1
  129. package/test/actions/liquity/LiquityClaimStakingRewardsAction.js +1 -1
  130. package/test/actions/liquity/LiquityCloseAction.js +1 -1
  131. package/test/actions/liquity/LiquityEthGainToTroveAction.js +1 -1
  132. package/test/actions/liquity/LiquityOpenAction.js +1 -1
  133. package/test/actions/liquity/LiquityPaybackAction.js +1 -1
  134. package/test/actions/liquity/LiquityRedeemAction.js +1 -1
  135. package/test/actions/liquity/LiquitySPDepositAction.js +1 -1
  136. package/test/actions/liquity/LiquitySPWithdrawAction.js +1 -1
  137. package/test/actions/liquity/LiquityStakeAction.js +1 -1
  138. package/test/actions/liquity/LiquitySupplyAction.js +1 -1
  139. package/test/actions/liquity/LiquityUnstakeAction.js +1 -1
  140. package/test/actions/liquity/LiquityWithdrawAction.js +1 -1
  141. package/test/actions/maker/MakerGenerateAction.js +1 -1
  142. package/test/actions/maker/MakerGiveAction.js +1 -1
  143. package/test/actions/maker/MakerMergeAction.js +1 -1
  144. package/test/actions/maker/MakerOpenVaultAction.js +1 -1
  145. package/test/actions/maker/MakerPaybackAction.js +1 -1
  146. package/test/actions/maker/MakerSupplyAction.js +1 -1
  147. package/test/actions/maker/MakerWithdrawAction.js +1 -1
  148. package/test/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +1 -1
  149. package/test/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +1 -1
  150. package/test/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +1 -1
  151. package/test/actions/uniswap/UniswapSupplyAction.js +1 -1
  152. package/test/actions/uniswap/UniswapWithdrawAction.js +1 -1
  153. package/test/actions/uniswapV3/UniswapV3CollectAction.js +1 -1
  154. package/test/actions/uniswapV3/UniswapV3CreatePoolAction.js +1 -1
  155. package/test/actions/uniswapV3/UniswapV3MintAction.js +1 -1
  156. package/test/actions/uniswapV3/UniswapV3SupplyAction.js +1 -1
  157. package/test/actions/uniswapV3/UniswapV3WithdrawAction.js +1 -1
  158. package/test/actions/yearn/YearnSupplyAction.js +1 -1
  159. package/test/actions/yearn/YearnWithdrawAction.js +1 -1
  160. package/test/index.js +1 -1
  161. package/test/utils/uniswapLP.js +1 -1
  162. package/test/utils/zeroExExchange.js +3 -2
  163. package/tsconfig.esm.json +11 -0
  164. package/tsconfig.json +2 -2
  165. package/umd/index.js +757 -414
  166. package/yarn-error.log +3976 -0
  167. package/.env.example +0 -1
@@ -0,0 +1,37 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2PullDebtAction - Pull debt from one Euler account to another
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2PullDebtAction extends Action {
11
+ /**
12
+ * @param vault The address of the Euler vault
13
+ * @param account The address of the Euler account taking the debt, defaults to user's wallet
14
+ * @param from The address of the Euler account from which debt is pulled
15
+ * @param amount The amount of debt to be pulled (uint256.max for full debt pull)
16
+ */
17
+ constructor(
18
+ vault: EthAddress,
19
+ account: EthAddress,
20
+ from: EthAddress,
21
+ amount: uint256,
22
+ ) {
23
+ super(
24
+ 'EulerV2PullDebt',
25
+ getAddr('Empty'),
26
+ ['address', 'address', 'address', 'uint256'],
27
+ [vault, account, from, amount],
28
+ );
29
+
30
+ this.mappableArgs = [
31
+ this.args[0],
32
+ this.args[1],
33
+ this.args[2],
34
+ this.args[3],
35
+ ];
36
+ }
37
+ }
@@ -0,0 +1,31 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint8 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2ReorderCollateralsAction - Reorder account collaterals. Can be used to optimize gas costs when checking account health status
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2ReorderCollateralsAction extends Action {
11
+ /**
12
+ * @param account The address of the Euler account, defaults to user's wallet
13
+ * @param indexes The array of swap steps to reorder collaterals
14
+ */
15
+ constructor(
16
+ account: EthAddress,
17
+ indexes: Array<Array<uint8>>,
18
+ ) {
19
+ super(
20
+ 'EulerV2ReorderCollaterals',
21
+ getAddr('Empty'),
22
+ ['address', 'uint8[][]'],
23
+ [account, indexes],
24
+ );
25
+
26
+ this.mappableArgs = [
27
+ this.args[0],
28
+ this.args[1],
29
+ ];
30
+ }
31
+ }
@@ -0,0 +1,49 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2SupplyAction - Supply assets to a Euler vault and gets eTokens vault shares
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2SupplyAction extends Action {
11
+ tokenForApproval: EthAddress;
12
+
13
+ /**
14
+ * @param vault The address of the supply vault
15
+ * @param tokenAddress Underlying token address
16
+ * @param account The address of the Euler account, defaults to user's wallet
17
+ * @param from The address from which to pull tokens to be supplied
18
+ * @param amount The amount of assets to supply
19
+ * @param enableAsColl Whether to enable supply vault as collateral
20
+ */
21
+ constructor(
22
+ vault:EthAddress,
23
+ tokenAddress:EthAddress,
24
+ account:EthAddress,
25
+ from:EthAddress,
26
+ amount:uint256,
27
+ enableAsColl:boolean,
28
+ ) {
29
+ super(
30
+ 'EulerV2Supply',
31
+ getAddr('EulerV2Supply'),
32
+ ['address', 'address', 'address', 'uint256', 'bool'],
33
+ [vault, account, from, amount, enableAsColl],
34
+ );
35
+
36
+ this.mappableArgs = [
37
+ this.args[0],
38
+ this.args[1],
39
+ this.args[2],
40
+ this.args[3],
41
+ this.args[4],
42
+ ];
43
+ this.tokenForApproval = tokenAddress;
44
+ }
45
+
46
+ async getAssetsToApprove() {
47
+ return [{ asset: this.tokenForApproval, owner: this.args[2] }];
48
+ }
49
+ }
@@ -0,0 +1,37 @@
1
+ import { Action } from '../../Action';
2
+ import { getAddr } from '../../addresses';
3
+ import { EthAddress, uint256 } from '../../types';
4
+
5
+ /**
6
+ * EulerV2WithdrawAction - Withdraws assets from Euler vault
7
+ *
8
+ * @category EulerV2
9
+ */
10
+ export class EulerV2WithdrawAction extends Action {
11
+ /**
12
+ * @param vault The address of the Euler vault
13
+ * @param account The address of the Euler account, defaults to user's wallet
14
+ * @param receiver The address to receive the withdrawn assets
15
+ * @param amount The amount of assets to withdraw (uint256.max for max withdrawal)
16
+ */
17
+ constructor(
18
+ vault:EthAddress,
19
+ account:EthAddress,
20
+ receiver:EthAddress,
21
+ amount:uint256,
22
+ ) {
23
+ super(
24
+ 'EulerV2Withdraw',
25
+ getAddr('EulerV2Withdraw'),
26
+ ['address', 'address', 'address', 'uint256'],
27
+ [vault, account, receiver, amount],
28
+ );
29
+
30
+ this.mappableArgs = [
31
+ this.args[0],
32
+ this.args[1],
33
+ this.args[2],
34
+ this.args[3],
35
+ ];
36
+ }
37
+ }
@@ -0,0 +1,8 @@
1
+ export * from './EulerV2SupplyAction';
2
+ export * from './EulerV2WithdrawAction';
3
+ export * from './EulerV2BorrowAction';
4
+ export * from './EulerV2PaybackAction';
5
+ export * from './EulerV2PaybackWithSharesAction';
6
+ export * from './EulerV2PullDebtAction';
7
+ export * from './EulerV2ReorderCollateralsAction';
8
+ export * from './EulerV2CollateralSwitchAction';
@@ -29,6 +29,7 @@ import * as spark from './spark';
29
29
  import * as morphoblue from './morpho-blue';
30
30
  import * as llamalend from './llamalend';
31
31
  import * as merkl from './merkl';
32
+ import * as eulerV2 from './eulerV2';
32
33
  import * as sky from './sky';
33
34
 
34
35
  export {
@@ -63,5 +64,6 @@ export {
63
64
  morphoblue,
64
65
  llamalend,
65
66
  merkl,
67
+ eulerV2,
66
68
  sky,
67
69
  };
package/src/addresses.ts CHANGED
@@ -283,6 +283,14 @@ export const actionAddresses = {
283
283
  LlamaLendLevCreate: '0x534b704a62385cfe5EEB8d9605419743d4fe105E',
284
284
  LlamaLendSelfLiquidateWithColl: '0xA99DD1D91141cA63C423DB763dE75078336803B2',
285
285
 
286
+ // eulerV2
287
+ EulerV2Supply: '0xa067787D086841437D112e0C847dDB3e5D95173f',
288
+ EulerV2Withdraw: '0x5bf1a54fe1e65B134E7920e53A5eB0D14b9e6aD1',
289
+ EulerV2Borrow: '0x38d66ecD38b7800D8FD0Bc29489c2306170a9Ede',
290
+ EulerV2Payback: '0x738b1df6b6962D8795Bda5bc5EFCd8b0B8c74d01',
291
+ EulerV2CollateralSwitch: '0x38950b50Fb38aC19D06e8CE5AAE632D6dF1EEb1a',
292
+ EulerV2View: '0x8932E46Ecf96b5Fe033F5e27Ab6dC755Cb668967',
293
+
286
294
  MerklClaim: '0xE88036F3F0D7e216D63726356cA2bC334e305fe5',
287
295
  },
288
296
  [NETWORKS.optimism.chainId]: {
@@ -540,11 +548,8 @@ export const getAddr = (name: string, chainId:number = CONFIG.chainId) : EthAddr
540
548
  const actions = actionAddresses[_chainId];
541
549
  const other = otherAddresses[_chainId];
542
550
 
543
- // skip this check if we're in testing mode
544
- if (!CONFIG.testingMode) {
545
- if (!actions && !other) throw new Error(`Cannot find address for chainId: ${_chainId}.`);
546
- if (!actions[name as keyof typeof actions] && !other[name as keyof typeof other]) throw new Error(`Cannot find address for name: ${name} (chainId: ${_chainId}).`);
547
- }
551
+ if (!actions && !other) throw new Error(`Cannot find address for chainId: ${_chainId}.`);
552
+ if (!actions[name as keyof typeof actions] && !other[name as keyof typeof other]) throw new Error(`Cannot find address for name: ${name} (chainId: ${_chainId}).`);
548
553
 
549
554
  if (actions[name as keyof typeof actions]) return actions[name as keyof typeof actions]!;
550
555
  return other[name as keyof typeof other]!;
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class AaveV2RatioTrigger extends Action {
11
11
  constructor(user:EthAddress, market:EthAddress, ratio:uint256, state:uint8) {
12
- super('AaveV2RatioTrigger', getAddr('AaveV2RatioTrigger'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
12
+ super('AaveV2RatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class AaveV3QuotePriceTrigger extends Action {
11
11
  constructor(baseTokenAddr:EthAddress, quoteTokenAddr:EthAddress, price:uint256, state:uint8) {
12
- super('AaveV3QuotePriceTrigger', getAddr('AaveV3QuotePriceTrigger'), [['address', 'address', 'uint256', 'uint8']], [[baseTokenAddr, quoteTokenAddr, price, state]]);
12
+ super('AaveV3QuotePriceTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[baseTokenAddr, quoteTokenAddr, price, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class AaveV3RatioTrigger extends Action {
11
11
  constructor(user:EthAddress, market:EthAddress, ratio:uint256, state:uint8) {
12
- super('AaveV3RatioTrigger', getAddr('AaveV3RatioTrigger'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
12
+ super('AaveV3RatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { uint256 } from '../types';
9
9
  */
10
10
  export class CBRebondTrigger extends Action {
11
11
  constructor(bondID:uint256) {
12
- super('CBRebondTrigger', getAddr('CBRebondTrigger'), ['uint256'], [bondID]);
12
+ super('CBRebondTrigger', getAddr('Empty'), ['uint256'], [bondID]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class ChainLinkPriceTrigger extends Action {
11
11
  constructor(tokenAddr:EthAddress, price:uint256, state:uint8) {
12
- super('ChainLinkPriceTrigger', getAddr('ChainLinkPriceTrigger'), ['address', 'uint256', 'uint8'], [tokenAddr, price, state]);
12
+ super('ChainLinkPriceTrigger', getAddr('Empty'), ['address', 'uint256', 'uint8'], [tokenAddr, price, state]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class CompV3RatioTrigger extends Action {
11
11
  constructor(user:EthAddress, market:EthAddress, ratio:uint256, state:uint8) {
12
- super('CompV3RatioTrigger', getAddr('CompV3RatioTrigger'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
12
+ super('CompV3RatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class CompoundRatioTrigger extends Action {
11
11
  constructor(user:EthAddress, ratio:uint256, state:uint8) {
12
- super('CompoundRatioTrigger', getAddr('CompoundRatioTrigger'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
12
+ super('CompoundRatioTrigger', getAddr('Empty'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class CurveUsdCollRatioTrigger extends Action {
11
11
  constructor(user:EthAddress, controller:EthAddress, ratio:uint256, state:uint8) {
12
- super('CurveUsdCollRatioTrigger', getAddr('CurveUsdCollRatioTrigger'), [['address', 'address', 'uint256', 'uint8']], [[user, controller, ratio, state]]);
12
+ super('CurveUsdCollRatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[user, controller, ratio, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256 } from '../types';
9
9
  */
10
10
  export class CurveUsdHealthRatioTrigger extends Action {
11
11
  constructor(user:EthAddress, controller:EthAddress, ratio:uint256) {
12
- super('CurveUsdHealthRatioTrigger', getAddr('CurveUsdHealthRatioTrigger'), [['address', 'address', 'uint256']], [[user, controller, ratio]]);
12
+ super('CurveUsdHealthRatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256']], [[user, controller, ratio]]);
13
13
  }
14
14
  }
@@ -9,6 +9,6 @@ import { uint256 } from '../types';
9
9
  */
10
10
  export class GasPriceTrigger extends Action {
11
11
  constructor(maxGasPrice:uint256) {
12
- super('GasPriceTrigger', getAddr('GasPriceTrigger'), ['uint256'], [maxGasPrice]);
12
+ super('GasPriceTrigger', getAddr('Empty'), ['uint256'], [maxGasPrice]);
13
13
  }
14
- }
14
+ }
@@ -11,9 +11,9 @@ export class LiquityDebtInFrontWithLimitTrigger extends Action {
11
11
  constructor(troveOwner:EthAddress, debtInFront:uint256) {
12
12
  super(
13
13
  'LiquityDebtInFrontWithLimitTrigger',
14
- getAddr('LiquityDebtInFrontWithLimitTrigger'),
14
+ getAddr('Empty'),
15
15
  ['address', 'uint256'],
16
16
  [troveOwner, debtInFront],
17
17
  );
18
18
  }
19
- }
19
+ }
@@ -11,9 +11,9 @@ export class LiquityRatioTrigger extends Action {
11
11
  constructor(troveOwner:EthAddress, ratio:uint256, state:uint8) {
12
12
  super(
13
13
  'LiquityRatioTrigger',
14
- getAddr('LiquityRatioTrigger'),
14
+ getAddr('Empty'),
15
15
  ['addresss', 'uint256', 'uint8'],
16
16
  [troveOwner, ratio, state],
17
17
  );
18
18
  }
19
- }
19
+ }
@@ -10,6 +10,6 @@ import { uint256, uint8 } from '../types';
10
10
  */
11
11
  export class MakerRatioTrigger extends Action {
12
12
  constructor(vaultId:uint256, ratio:uint256, state:uint8) {
13
- super('McdRatioTrigger', getAddr('McdRatioTrigger'), ['uint256', 'uint256', 'uint8'], [vaultId, ratio, state]);
13
+ super('McdRatioTrigger', getAddr('Empty'), ['uint256', 'uint256', 'uint8'], [vaultId, ratio, state]);
14
14
  }
15
- }
15
+ }
@@ -10,6 +10,6 @@ import { EthAddress, uint256, uint8 } from '../types';
10
10
  */
11
11
  export class MorphoAaveV2RatioTrigger extends Action {
12
12
  constructor(user:EthAddress, ratio:uint256, state:uint8) {
13
- super('MorphoAaveV2RatioTrigger', getAddr('MorphoAaveV2RatioTrigger'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
13
+ super('MorphoAaveV2RatioTrigger', getAddr('Empty'), ['address', 'uint256', 'uint8'], [user, ratio, state]);
14
14
  }
15
- }
15
+ }
@@ -18,8 +18,8 @@ export class MorphoBlueRatioTrigger extends Action {
18
18
  ) {
19
19
  super(
20
20
  'MorphoBlueRatioTrigger',
21
- getAddr('MorphoBlueRatioTrigger'),
21
+ getAddr('Empty'),
22
22
  [['bytes32', 'address', 'uint256', 'uint8']],
23
23
  [[marketId, user, ratio, state]]);
24
24
  }
25
- }
25
+ }
@@ -9,6 +9,6 @@ import { uint256, uint8 } from '../types';
9
9
  */
10
10
  export class OffchainPriceTrigger extends Action {
11
11
  constructor(limitPrice:uint256, limitType: uint8) {
12
- super('OffchainPriceTrigger', getAddr('OffchainPriceTrigger'), ['uint256', 'uint8'], [limitPrice, limitType]);
12
+ super('OffchainPriceTrigger', getAddr('Empty'), ['uint256', 'uint8'], [limitPrice, limitType]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { uint256, uint8 } from '../types';
9
9
  */
10
10
  export class ReflexerRatioTrigger extends Action {
11
11
  constructor(vaultId:uint256, ratio:uint256, state:uint8) {
12
- super('ReflexerRatioTrigger', getAddr('ReflexerRatioTrigger'), ['uint256', 'uint256', 'uint8'], [vaultId, ratio, state]);
12
+ super('ReflexerRatioTrigger', getAddr('Empty'), ['uint256', 'uint256', 'uint8'], [vaultId, ratio, state]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class SparkQuotePriceTrigger extends Action {
11
11
  constructor(baseTokenAddr:EthAddress, quoteTokenAddr:EthAddress, price:uint256, state:uint8) {
12
- super('SparkQuotePriceTrigger', getAddr('SparkQuotePriceTrigger'), [['address', 'address', 'uint256', 'uint8']], [[baseTokenAddr, quoteTokenAddr, price, state]]);
12
+ super('SparkQuotePriceTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[baseTokenAddr, quoteTokenAddr, price, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint8 } from '../types';
9
9
  */
10
10
  export class SparkRatioTrigger extends Action {
11
11
  constructor(user:EthAddress, market:EthAddress, ratio:uint256, state:uint8) {
12
- super('SparkRatioTrigger', getAddr('SparkRatioTrigger'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
12
+ super('SparkRatioTrigger', getAddr('Empty'), [['address', 'address', 'uint256', 'uint8']], [[user, market, ratio, state]]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { uint256 } from '../types';
9
9
  */
10
10
  export class TimestampTrigger extends Action {
11
11
  constructor(nextTimestamp:uint256) {
12
- super('TimestampTrigger', getAddr('TimestampTrigger'), ['uint256'], [nextTimestamp]);
12
+ super('TimestampTrigger', getAddr('Empty'), ['uint256'], [nextTimestamp]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { EthAddress, uint256, uint80 } from '../types';
9
9
  */
10
10
  export class TrailingStopTrigger extends Action {
11
11
  constructor(tokenAddr:EthAddress, percentage:uint256, roundId:uint80) {
12
- super('TrailingStopTrigger', getAddr('TrailingStopTrigger'), ['address', 'uint256', 'uint80'], [tokenAddr, percentage, roundId]);
12
+ super('TrailingStopTrigger', getAddr('Empty'), ['address', 'uint256', 'uint80'], [tokenAddr, percentage, roundId]);
13
13
  }
14
- }
14
+ }
@@ -9,6 +9,6 @@ import { uint256, uint8 } from '../types';
9
9
  */
10
10
  export class UniV3CurrentTickTrigger extends Action {
11
11
  constructor(tokenId:uint256, state:uint8) {
12
- super('UniV3CurrentTickTrigger', getAddr('UniV3CurrentTickTrigger'), ['uint256', 'uint8'], [tokenId, state]);
12
+ super('UniV3CurrentTickTrigger', getAddr('Empty'), ['uint256', 'uint8'], [tokenId, state]);
13
13
  }
14
- }
14
+ }
package/test/Action.js CHANGED
@@ -1,4 +1,4 @@
1
- const dfs = require('../umd');
1
+ const dfs = require('../src');
2
2
  const {encodeForDsProxyCall, encodeForRecipe} = require('./_actionUtils');
3
3
  const {assert} = require('chai');
4
4
 
@@ -1,4 +1,4 @@
1
- const dfs = require('../umd');
1
+ const dfs = require('../src');
2
2
  const {encodeForDsProxyCall, encodeForRecipe} = require('./_actionUtils');
3
3
  const {assert} = require('chai');
4
4
 
package/test/DfsWeb3.js CHANGED
@@ -1,7 +1,7 @@
1
1
  require('dotenv').config();
2
2
  const {assert} = require('chai');
3
3
  const Web3 = require('web3');
4
- const dfs = require('../umd');
4
+ const dfs = require('../src');
5
5
  const {getIlkInfo, assetAmountInWei} = require("@defisaver/tokens");
6
6
 
7
7
  describe('DfsWeb3', () => {
package/test/Recipe.js CHANGED
@@ -1,4 +1,4 @@
1
- const dfs = require('../umd');
1
+ const dfs = require('../src');
2
2
  const {getAssetInfo} = require("@defisaver/tokens");
3
3
  const {getIlkInfo} = require("@defisaver/tokens");
4
4
  const {assetAmountInWei} = require("@defisaver/tokens");
package/test/Strategy.js CHANGED
@@ -1,4 +1,4 @@
1
- const dfs = require('../umd');
1
+ const dfs = require('../src');
2
2
 
3
3
  describe('Strategy', () => {
4
4
 
@@ -3,7 +3,7 @@ const { BN, padLeft, toHex } = require('web3-utils');
3
3
  const {getAssetInfo, utils: {compare}} = require("@defisaver/tokens");
4
4
  const RecipeAbi = require('../../src/abis/Recipe.json');
5
5
  const MockAccessLists = require('./MockAccessLists');
6
- const dfs = require("../../umd");
6
+ const dfs = require("../../src");
7
7
 
8
8
  /**
9
9
  * Set of Actions to be performed sequentially in a single transaction
@@ -1,5 +1,5 @@
1
1
  const { assert } = require("chai");
2
- const dfs = require("../../umd");
2
+ const dfs = require("../../src");
3
3
  const Recipe = require("./Recipe");
4
4
  const MockAccessLists = require('./MockAccessLists');
5
5
  const { padLeft, toHex } = require('web3-utils');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {getAaveV2MarketInfo, assetAmountInWei,getAssetInfo} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {assetAmountInWei, getAssetInfo, assetAmountInEth} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {assetAmountInWei, getAssetInfo, assetAmountInEth} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {getAaveV2MarketInfo, assetAmountInWei, assetAmountInEth, getAssetInfo} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {getAaveV2MarketInfo, assetAmountInWei, getAssetInfo, assetAmountInEth} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {getAaveV2MarketInfo, assetAmountInWei,getAssetInfo} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
3
3
  const {getAssetInfo, assetAmountInWei, assetAmountInEth} = require("@defisaver/tokens");
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
3
3
  const {getAssetInfo, assetAmountInWei, assetAmountInEth} = require("@defisaver/tokens");
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
3
3
  const {getAssetInfo, assetAmountInWei, assetAmountInEth} = require("@defisaver/tokens");
4
4
  const {assert} = require('chai');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {assetAmountInWei} = require("@defisaver/tokens");
3
3
  const {getAssetInfo} = require("@defisaver/tokens");
4
4
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
@@ -1,4 +1,4 @@
1
- const dfs = require("../../../umd");
1
+ const dfs = require("../../../src");
2
2
  const {encodeForDsProxyCall, encodeForRecipe} = require("../../_actionUtils");
3
3
 
4
4
  describe('Action: CreateSubAction', () => {
@@ -19,7 +19,6 @@ describe('Action: CreateSubAction', () => {
19
19
  ],
20
20
  ]
21
21
  );
22
- console.log(action);
23
22
  });
24
23
 
25
24
  it('encodeForDsProxyCall', () => encodeForDsProxyCall(action));
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {assetAmountInEth} = require("@defisaver/tokens");
3
3
  const {assetAmountInWei} = require("@defisaver/tokens");
4
4
  const {getAssetInfo} = require("@defisaver/tokens");
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {assetAmountInWei} = require("@defisaver/tokens");
3
3
  const {getAssetInfo} = require("@defisaver/tokens");
4
4
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
@@ -1,4 +1,4 @@
1
- const dfs = require('../../../umd');
1
+ const dfs = require('../../../src');
2
2
  const {assetAmountInWei, getAssetInfo, assetAmountInEth} = require("@defisaver/tokens");
3
3
  const {encodeForDsProxyCall, encodeForRecipe} = require('../../_actionUtils');
4
4
  const {assert} = require('chai');