@defisaver/sdk 1.0.0 → 1.0.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.
- package/.babelrc +3 -0
- package/.eslintrc.js +100 -0
- package/esm/AccessLists/AaveAccessLists.d.ts +2 -0
- package/esm/AccessLists/AaveAccessLists.js +19 -0
- package/esm/AccessLists/BalancerAccessLists.d.ts +2 -0
- package/esm/AccessLists/BalancerAccessLists.js +14 -0
- package/esm/AccessLists/CompoundAccessLists.d.ts +2 -0
- package/esm/AccessLists/CompoundAccessLists.js +23 -0
- package/esm/AccessLists/DyDxAccessLists.d.ts +2 -0
- package/esm/AccessLists/DyDxAccessLists.js +6 -0
- package/esm/AccessLists/FlashLoanAccessLists.d.ts +2 -0
- package/esm/AccessLists/FlashLoanAccessLists.js +20 -0
- package/esm/AccessLists/GuniAccessLists.d.ts +2 -0
- package/esm/AccessLists/GuniAccessLists.js +10 -0
- package/esm/AccessLists/InstaAccessLists.d.ts +2 -0
- package/esm/AccessLists/InstaAccessLists.js +5 -0
- package/esm/AccessLists/LidoAccessLists.d.ts +2 -0
- package/esm/AccessLists/LidoAccessLists.js +15 -0
- package/esm/AccessLists/LiquityAccessLists.d.ts +2 -0
- package/esm/AccessLists/LiquityAccessLists.js +65 -0
- package/esm/AccessLists/MStableAccessLists.d.ts +2 -0
- package/esm/AccessLists/MStableAccessLists.js +12 -0
- package/esm/AccessLists/MakerAccessLists.d.ts +2 -0
- package/esm/AccessLists/MakerAccessLists.js +34 -0
- package/esm/AccessLists/RariAccessLists.d.ts +2 -0
- package/esm/AccessLists/RariAccessLists.js +8 -0
- package/esm/AccessLists/ReflexerAccessLists.d.ts +2 -0
- package/esm/AccessLists/ReflexerAccessLists.js +42 -0
- package/esm/AccessLists/UniswapAccessLists.d.ts +2 -0
- package/esm/AccessLists/UniswapAccessLists.js +31 -0
- package/esm/AccessLists/UtilsAccessLists.d.ts +2 -0
- package/esm/AccessLists/UtilsAccessLists.js +23 -0
- package/esm/AccessLists/YearnAccessLists.d.ts +2 -0
- package/esm/AccessLists/YearnAccessLists.js +9 -0
- package/esm/AccessLists/index.d.ts +3 -0
- package/esm/AccessLists/index.js +17 -0
- package/esm/src/Action.d.ts +77 -0
- package/esm/src/Action.js +193 -0
- package/esm/src/ActionWithL2.d.ts +20 -0
- package/esm/src/ActionWithL2.js +49 -0
- package/esm/src/DfsWeb3.d.ts +31 -0
- package/esm/src/DfsWeb3.js +124 -0
- package/esm/src/Recipe.d.ts +49 -0
- package/esm/src/Recipe.js +135 -0
- package/esm/src/Strategy.d.ts +19 -0
- package/esm/src/Strategy.js +47 -0
- package/esm/src/abis/Action.json +247 -0
- package/esm/src/abis/DFSProxyRegistry.json +193 -0
- package/esm/src/abis/DsProxy.json +218 -0
- package/esm/src/abis/Erc20.json +222 -0
- package/esm/src/abis/ProxyRegistry.json +65 -0
- package/esm/src/abis/Recipe.json +254 -0
- package/esm/src/actions/aave/AaveBorrowAction.d.ts +18 -0
- package/esm/src/actions/aave/AaveBorrowAction.js +22 -0
- package/esm/src/actions/aave/AaveClaimStkAaveAction.d.ts +15 -0
- package/esm/src/actions/aave/AaveClaimStkAaveAction.js +23 -0
- package/esm/src/actions/aave/AaveCollateralSwitchAction.d.ts +15 -0
- package/esm/src/actions/aave/AaveCollateralSwitchAction.js +18 -0
- package/esm/src/actions/aave/AavePaybackAction.d.ts +22 -0
- package/esm/src/actions/aave/AavePaybackAction.js +38 -0
- package/esm/src/actions/aave/AaveSupplyAction.d.ts +22 -0
- package/esm/src/actions/aave/AaveSupplyAction.js +45 -0
- package/esm/src/actions/aave/AaveWithdrawAction.d.ts +16 -0
- package/esm/src/actions/aave/AaveWithdrawAction.js +20 -0
- package/esm/src/actions/aave/index.d.ts +6 -0
- package/esm/src/actions/aave/index.js +6 -0
- package/esm/src/actions/aaveV3/AaveV3ATokenPaybackAction.d.ts +25 -0
- package/esm/src/actions/aaveV3/AaveV3ATokenPaybackAction.js +64 -0
- package/esm/src/actions/aaveV3/AaveV3BorrowAction.d.ts +21 -0
- package/esm/src/actions/aaveV3/AaveV3BorrowAction.js +59 -0
- package/esm/src/actions/aaveV3/AaveV3ClaimRewardsAction.d.ts +18 -0
- package/esm/src/actions/aaveV3/AaveV3ClaimRewardsAction.js +40 -0
- package/esm/src/actions/aaveV3/AaveV3CollateralSwitchAction.d.ts +18 -0
- package/esm/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +39 -0
- package/esm/src/actions/aaveV3/AaveV3PaybackAction.d.ts +27 -0
- package/esm/src/actions/aaveV3/AaveV3PaybackAction.js +77 -0
- package/esm/src/actions/aaveV3/AaveV3SetEModeAction.d.ts +16 -0
- package/esm/src/actions/aaveV3/AaveV3SetEModeAction.js +33 -0
- package/esm/src/actions/aaveV3/AaveV3SupplyAction.d.ts +27 -0
- package/esm/src/actions/aaveV3/AaveV3SupplyAction.js +77 -0
- package/esm/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.d.ts +18 -0
- package/esm/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.js +38 -0
- package/esm/src/actions/aaveV3/AaveV3WithdrawAction.d.ts +18 -0
- package/esm/src/actions/aaveV3/AaveV3WithdrawAction.js +45 -0
- package/esm/src/actions/aaveV3/index.d.ts +9 -0
- package/esm/src/actions/aaveV3/index.js +9 -0
- package/esm/src/actions/balancer/BalancerV2ClaimAction.d.ts +20 -0
- package/esm/src/actions/balancer/BalancerV2ClaimAction.js +49 -0
- package/esm/src/actions/balancer/BalancerV2SupplyAction.d.ts +22 -0
- package/esm/src/actions/balancer/BalancerV2SupplyAction.js +52 -0
- package/esm/src/actions/balancer/BalancerV2WithdrawAction.d.ts +24 -0
- package/esm/src/actions/balancer/BalancerV2WithdrawAction.js +56 -0
- package/esm/src/actions/balancer/index.d.ts +3 -0
- package/esm/src/actions/balancer/index.js +3 -0
- package/esm/src/actions/basic/AutomationV2Unsub.d.ts +9 -0
- package/esm/src/actions/basic/AutomationV2Unsub.js +11 -0
- package/esm/src/actions/basic/ChangeProxyOwnerAction.d.ts +13 -0
- package/esm/src/actions/basic/ChangeProxyOwnerAction.js +15 -0
- package/esm/src/actions/basic/GasFeeAction.d.ts +14 -0
- package/esm/src/actions/basic/GasFeeAction.js +21 -0
- package/esm/src/actions/basic/GasFeeActionL2.d.ts +15 -0
- package/esm/src/actions/basic/GasFeeActionL2.js +22 -0
- package/esm/src/actions/basic/PullTokenAction.d.ts +19 -0
- package/esm/src/actions/basic/PullTokenAction.js +41 -0
- package/esm/src/actions/basic/SellAction.d.ts +23 -0
- package/esm/src/actions/basic/SellAction.js +61 -0
- package/esm/src/actions/basic/SendTokenAction.d.ts +15 -0
- package/esm/src/actions/basic/SendTokenAction.js +23 -0
- package/esm/src/actions/basic/SendTokenAndUnwrapAction.d.ts +15 -0
- package/esm/src/actions/basic/SendTokenAndUnwrapAction.js +23 -0
- package/esm/src/actions/basic/SubInputsAction.d.ts +10 -0
- package/esm/src/actions/basic/SubInputsAction.js +15 -0
- package/esm/src/actions/basic/SumInputsAction.d.ts +10 -0
- package/esm/src/actions/basic/SumInputsAction.js +15 -0
- package/esm/src/actions/basic/ToggleSubAction.d.ts +14 -0
- package/esm/src/actions/basic/ToggleSubAction.js +16 -0
- package/esm/src/actions/basic/TokenBalanceAction.d.ts +8 -0
- package/esm/src/actions/basic/TokenBalanceAction.js +13 -0
- package/esm/src/actions/basic/TransferNFTAction.d.ts +8 -0
- package/esm/src/actions/basic/TransferNFTAction.js +17 -0
- package/esm/src/actions/basic/UnwrapEthAction.d.ts +15 -0
- package/esm/src/actions/basic/UnwrapEthAction.js +30 -0
- package/esm/src/actions/basic/UpdateSubAction.d.ts +14 -0
- package/esm/src/actions/basic/UpdateSubAction.js +16 -0
- package/esm/src/actions/basic/WrapEthAction.d.ts +15 -0
- package/esm/src/actions/basic/WrapEthAction.js +36 -0
- package/esm/src/actions/basic/index.d.ts +16 -0
- package/esm/src/actions/basic/index.js +16 -0
- package/esm/src/actions/checkers/AaveV3RatioCheckAction.d.ts +14 -0
- package/esm/src/actions/checkers/AaveV3RatioCheckAction.js +20 -0
- package/esm/src/actions/checkers/CompoundV3RatioCheckAction.d.ts +16 -0
- package/esm/src/actions/checkers/CompoundV3RatioCheckAction.js +24 -0
- package/esm/src/actions/checkers/MakerRatioCheckAction.d.ts +17 -0
- package/esm/src/actions/checkers/MakerRatioCheckAction.js +25 -0
- package/esm/src/actions/checkers/index.d.ts +3 -0
- package/esm/src/actions/checkers/index.js +3 -0
- package/esm/src/actions/chickenBonds/CBChickenInAction.d.ts +14 -0
- package/esm/src/actions/chickenBonds/CBChickenInAction.js +18 -0
- package/esm/src/actions/chickenBonds/CBChickenOutAction.d.ts +15 -0
- package/esm/src/actions/chickenBonds/CBChickenOutAction.js +19 -0
- package/esm/src/actions/chickenBonds/CBCreateAction.d.ts +18 -0
- package/esm/src/actions/chickenBonds/CBCreateAction.js +32 -0
- package/esm/src/actions/chickenBonds/CBRedeemAction.d.ts +20 -0
- package/esm/src/actions/chickenBonds/CBRedeemAction.js +35 -0
- package/esm/src/actions/chickenBonds/index.d.ts +4 -0
- package/esm/src/actions/chickenBonds/index.js +4 -0
- package/esm/src/actions/compound/CompoundBorrowAction.d.ts +15 -0
- package/esm/src/actions/compound/CompoundBorrowAction.js +19 -0
- package/esm/src/actions/compound/CompoundClaimAction.d.ts +16 -0
- package/esm/src/actions/compound/CompoundClaimAction.js +24 -0
- package/esm/src/actions/compound/CompoundCollateralSwitchAction.d.ts +10 -0
- package/esm/src/actions/compound/CompoundCollateralSwitchAction.js +12 -0
- package/esm/src/actions/compound/CompoundGetDebtAction.d.ts +8 -0
- package/esm/src/actions/compound/CompoundGetDebtAction.js +13 -0
- package/esm/src/actions/compound/CompoundPaybackAction.d.ts +20 -0
- package/esm/src/actions/compound/CompoundPaybackAction.js +38 -0
- package/esm/src/actions/compound/CompoundSupplyAction.d.ts +20 -0
- package/esm/src/actions/compound/CompoundSupplyAction.js +43 -0
- package/esm/src/actions/compound/CompoundWithdrawAction.d.ts +15 -0
- package/esm/src/actions/compound/CompoundWithdrawAction.js +19 -0
- package/esm/src/actions/compound/index.d.ts +7 -0
- package/esm/src/actions/compound/index.js +7 -0
- package/esm/src/actions/compoundV3/CompoundV3AllowAction.d.ts +15 -0
- package/esm/src/actions/compoundV3/CompoundV3AllowAction.js +24 -0
- package/esm/src/actions/compoundV3/CompoundV3BorrowAction.d.ts +16 -0
- package/esm/src/actions/compoundV3/CompoundV3BorrowAction.js +26 -0
- package/esm/src/actions/compoundV3/CompoundV3ClaimAction.d.ts +16 -0
- package/esm/src/actions/compoundV3/CompoundV3ClaimAction.js +27 -0
- package/esm/src/actions/compoundV3/CompoundV3PaybackAction.d.ts +22 -0
- package/esm/src/actions/compoundV3/CompoundV3PaybackAction.js +48 -0
- package/esm/src/actions/compoundV3/CompoundV3SupplyAction.d.ts +22 -0
- package/esm/src/actions/compoundV3/CompoundV3SupplyAction.js +45 -0
- package/esm/src/actions/compoundV3/CompoundV3TransferAction.d.ts +17 -0
- package/esm/src/actions/compoundV3/CompoundV3TransferAction.js +30 -0
- package/esm/src/actions/compoundV3/CompoundV3WithdrawAction.d.ts +17 -0
- package/esm/src/actions/compoundV3/CompoundV3WithdrawAction.js +29 -0
- package/esm/src/actions/compoundV3/index.d.ts +7 -0
- package/esm/src/actions/compoundV3/index.js +7 -0
- package/esm/src/actions/convex/ConvexClaimAction.d.ts +17 -0
- package/esm/src/actions/convex/ConvexClaimAction.js +59 -0
- package/esm/src/actions/convex/ConvexDepositAction.d.ts +22 -0
- package/esm/src/actions/convex/ConvexDepositAction.js +66 -0
- package/esm/src/actions/convex/ConvexWithdrawAction.d.ts +22 -0
- package/esm/src/actions/convex/ConvexWithdrawAction.js +63 -0
- package/esm/src/actions/convex/index.d.ts +3 -0
- package/esm/src/actions/convex/index.js +3 -0
- package/esm/src/actions/curve/CurveClaimFeesAction.d.ts +13 -0
- package/esm/src/actions/curve/CurveClaimFeesAction.js +22 -0
- package/esm/src/actions/curve/CurveDepositAction.d.ts +18 -0
- package/esm/src/actions/curve/CurveDepositAction.js +78 -0
- package/esm/src/actions/curve/CurveGaugeDepositAction.d.ts +20 -0
- package/esm/src/actions/curve/CurveGaugeDepositAction.js +40 -0
- package/esm/src/actions/curve/CurveGaugeWithdrawAction.d.ts +14 -0
- package/esm/src/actions/curve/CurveGaugeWithdrawAction.js +22 -0
- package/esm/src/actions/curve/CurveMintCrvAction.d.ts +12 -0
- package/esm/src/actions/curve/CurveMintCrvAction.js +19 -0
- package/esm/src/actions/curve/CurveStethPoolDepositAction.d.ts +16 -0
- package/esm/src/actions/curve/CurveStethPoolDepositAction.js +27 -0
- package/esm/src/actions/curve/CurveStethPoolWithdrawAction.d.ts +17 -0
- package/esm/src/actions/curve/CurveStethPoolWithdrawAction.js +28 -0
- package/esm/src/actions/curve/CurveSwapAction.d.ts +22 -0
- package/esm/src/actions/curve/CurveSwapAction.js +43 -0
- package/esm/src/actions/curve/CurveWithdrawAction.d.ts +22 -0
- package/esm/src/actions/curve/CurveWithdrawAction.js +72 -0
- package/esm/src/actions/curve/index.d.ts +9 -0
- package/esm/src/actions/curve/index.js +9 -0
- package/esm/src/actions/dydx/DyDxWithdrawAction.d.ts +15 -0
- package/esm/src/actions/dydx/DyDxWithdrawAction.js +19 -0
- package/esm/src/actions/dydx/index.d.ts +1 -0
- package/esm/src/actions/dydx/index.js +1 -0
- package/esm/src/actions/flashloan/AaveV2FlashLoanAction.d.ts +18 -0
- package/esm/src/actions/flashloan/AaveV2FlashLoanAction.js +20 -0
- package/esm/src/actions/flashloan/AaveV2FlashLoanPaybackAction.d.ts +14 -0
- package/esm/src/actions/flashloan/AaveV2FlashLoanPaybackAction.js +16 -0
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.d.ts +18 -0
- package/esm/src/actions/flashloan/AaveV3FlashLoanAction.js +20 -0
- package/esm/src/actions/flashloan/AaveV3FlashLoanPaybackAction.d.ts +14 -0
- package/esm/src/actions/flashloan/AaveV3FlashLoanPaybackAction.js +16 -0
- package/esm/src/actions/flashloan/BalancerFlashLoanAction.d.ts +16 -0
- package/esm/src/actions/flashloan/BalancerFlashLoanAction.js +18 -0
- package/esm/src/actions/flashloan/BalancerFlashLoanPaybackAction.d.ts +14 -0
- package/esm/src/actions/flashloan/BalancerFlashLoanPaybackAction.js +16 -0
- package/esm/src/actions/flashloan/DyDxFlashLoanAction.d.ts +16 -0
- package/esm/src/actions/flashloan/DyDxFlashLoanAction.js +18 -0
- package/esm/src/actions/flashloan/DyDxFlashLoanPaybackAction.d.ts +14 -0
- package/esm/src/actions/flashloan/DyDxFlashLoanPaybackAction.js +16 -0
- package/esm/src/actions/flashloan/EulerFlashLoanAction.d.ts +16 -0
- package/esm/src/actions/flashloan/EulerFlashLoanAction.js +18 -0
- package/esm/src/actions/flashloan/EulerFlashLoanPaybackAction.d.ts +13 -0
- package/esm/src/actions/flashloan/EulerFlashLoanPaybackAction.js +15 -0
- package/esm/src/actions/flashloan/MakerFlashLoanAction.d.ts +15 -0
- package/esm/src/actions/flashloan/MakerFlashLoanAction.js +17 -0
- package/esm/src/actions/flashloan/MakerFlashLoanPaybackAction.d.ts +13 -0
- package/esm/src/actions/flashloan/MakerFlashLoanPaybackAction.js +15 -0
- package/esm/src/actions/flashloan/index.d.ts +12 -0
- package/esm/src/actions/flashloan/index.js +12 -0
- package/esm/src/actions/guni/GUniDeposit.d.ts +24 -0
- package/esm/src/actions/guni/GUniDeposit.js +47 -0
- package/esm/src/actions/guni/GUniWithdraw.d.ts +22 -0
- package/esm/src/actions/guni/GUniWithdraw.js +39 -0
- package/esm/src/actions/guni/index.d.ts +2 -0
- package/esm/src/actions/guni/index.js +2 -0
- package/esm/src/actions/index.d.ts +24 -0
- package/esm/src/actions/index.js +24 -0
- package/esm/src/actions/insta/InstPullTokensAction.d.ts +18 -0
- package/esm/src/actions/insta/InstPullTokensAction.js +36 -0
- package/esm/src/actions/insta/index.d.ts +1 -0
- package/esm/src/actions/insta/index.js +1 -0
- package/esm/src/actions/lido/LidoStakeAction.d.ts +19 -0
- package/esm/src/actions/lido/LidoStakeAction.js +34 -0
- package/esm/src/actions/lido/LidoUnwrapAction.d.ts +19 -0
- package/esm/src/actions/lido/LidoUnwrapAction.js +33 -0
- package/esm/src/actions/lido/LidoWrapAction.d.ts +20 -0
- package/esm/src/actions/lido/LidoWrapAction.js +45 -0
- package/esm/src/actions/lido/index.d.ts +3 -0
- package/esm/src/actions/lido/index.js +3 -0
- package/esm/src/actions/liquity/LiquityBorrowAction.d.ts +15 -0
- package/esm/src/actions/liquity/LiquityBorrowAction.js +24 -0
- package/esm/src/actions/liquity/LiquityClaimAction.d.ts +13 -0
- package/esm/src/actions/liquity/LiquityClaimAction.js +20 -0
- package/esm/src/actions/liquity/LiquityClaimSPRewardsAction.d.ts +14 -0
- package/esm/src/actions/liquity/LiquityClaimSPRewardsAction.js +18 -0
- package/esm/src/actions/liquity/LiquityClaimStakingRewardsAction.d.ts +14 -0
- package/esm/src/actions/liquity/LiquityClaimStakingRewardsAction.js +18 -0
- package/esm/src/actions/liquity/LiquityCloseAction.d.ts +18 -0
- package/esm/src/actions/liquity/LiquityCloseAction.js +38 -0
- package/esm/src/actions/liquity/LiquityEthGainToTroveAction.d.ts +13 -0
- package/esm/src/actions/liquity/LiquityEthGainToTroveAction.js +20 -0
- package/esm/src/actions/liquity/LiquityOpenAction.d.ts +21 -0
- package/esm/src/actions/liquity/LiquityOpenAction.js +44 -0
- package/esm/src/actions/liquity/LiquityPaybackAction.d.ts +18 -0
- package/esm/src/actions/liquity/LiquityPaybackAction.js +37 -0
- package/esm/src/actions/liquity/LiquityRedeemAction.d.ts +20 -0
- package/esm/src/actions/liquity/LiquityRedeemAction.js +42 -0
- package/esm/src/actions/liquity/LiquitySPDepositAction.d.ts +20 -0
- package/esm/src/actions/liquity/LiquitySPDepositAction.js +43 -0
- package/esm/src/actions/liquity/LiquitySPWithdrawAction.d.ts +16 -0
- package/esm/src/actions/liquity/LiquitySPWithdrawAction.js +28 -0
- package/esm/src/actions/liquity/LiquityStakeAction.d.ts +20 -0
- package/esm/src/actions/liquity/LiquityStakeAction.js +43 -0
- package/esm/src/actions/liquity/LiquitySupplyAction.d.ts +18 -0
- package/esm/src/actions/liquity/LiquitySupplyAction.js +37 -0
- package/esm/src/actions/liquity/LiquityUnstakeAction.d.ts +16 -0
- package/esm/src/actions/liquity/LiquityUnstakeAction.js +28 -0
- package/esm/src/actions/liquity/LiquityWithdrawAction.d.ts +14 -0
- package/esm/src/actions/liquity/LiquityWithdrawAction.js +22 -0
- package/esm/src/actions/liquity/index.d.ts +15 -0
- package/esm/src/actions/liquity/index.js +15 -0
- package/esm/src/actions/maker/MakerClaimAction.d.ts +15 -0
- package/esm/src/actions/maker/MakerClaimAction.js +24 -0
- package/esm/src/actions/maker/MakerGenerateAction.d.ts +16 -0
- package/esm/src/actions/maker/MakerGenerateAction.js +20 -0
- package/esm/src/actions/maker/MakerGiveAction.d.ts +16 -0
- package/esm/src/actions/maker/MakerGiveAction.js +25 -0
- package/esm/src/actions/maker/MakerMergeAction.d.ts +15 -0
- package/esm/src/actions/maker/MakerMergeAction.js +17 -0
- package/esm/src/actions/maker/MakerOpenVaultAction.d.ts +14 -0
- package/esm/src/actions/maker/MakerOpenVaultAction.js +16 -0
- package/esm/src/actions/maker/MakerPaybackAction.d.ts +20 -0
- package/esm/src/actions/maker/MakerPaybackAction.js +33 -0
- package/esm/src/actions/maker/MakerRatioAction.d.ts +13 -0
- package/esm/src/actions/maker/MakerRatioAction.js +15 -0
- package/esm/src/actions/maker/MakerSupplyAction.d.ts +21 -0
- package/esm/src/actions/maker/MakerSupplyAction.js +37 -0
- package/esm/src/actions/maker/MakerWithdrawAction.d.ts +17 -0
- package/esm/src/actions/maker/MakerWithdrawAction.js +21 -0
- package/esm/src/actions/maker/index.d.ts +9 -0
- package/esm/src/actions/maker/index.js +9 -0
- package/esm/src/actions/mstable/MStableClaimAction.d.ts +16 -0
- package/esm/src/actions/mstable/MStableClaimAction.js +25 -0
- package/esm/src/actions/mstable/MStableDepositAction.d.ts +25 -0
- package/esm/src/actions/mstable/MStableDepositAction.js +75 -0
- package/esm/src/actions/mstable/MStableWithdrawAction.d.ts +25 -0
- package/esm/src/actions/mstable/MStableWithdrawAction.js +74 -0
- package/esm/src/actions/mstable/index.d.ts +3 -0
- package/esm/src/actions/mstable/index.js +3 -0
- package/esm/src/actions/rari/RariDepositAction.d.ts +22 -0
- package/esm/src/actions/rari/RariDepositAction.js +41 -0
- package/esm/src/actions/rari/RariWithdrawAction.d.ts +23 -0
- package/esm/src/actions/rari/RariWithdrawAction.js +43 -0
- package/esm/src/actions/rari/index.d.ts +2 -0
- package/esm/src/actions/rari/index.js +2 -0
- package/esm/src/actions/reflexer/ReflexerGenerateAction.d.ts +15 -0
- package/esm/src/actions/reflexer/ReflexerGenerateAction.js +19 -0
- package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.d.ts +19 -0
- package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +37 -0
- package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.d.ts +14 -0
- package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +21 -0
- package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.d.ts +15 -0
- package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +23 -0
- package/esm/src/actions/reflexer/ReflexerOpenSafeAction.d.ts +13 -0
- package/esm/src/actions/reflexer/ReflexerOpenSafeAction.js +15 -0
- package/esm/src/actions/reflexer/ReflexerPaybackAction.d.ts +19 -0
- package/esm/src/actions/reflexer/ReflexerPaybackAction.js +32 -0
- package/esm/src/actions/reflexer/ReflexerSupplyAction.d.ts +21 -0
- package/esm/src/actions/reflexer/ReflexerSupplyAction.js +44 -0
- package/esm/src/actions/reflexer/ReflexerWithdrawAction.d.ts +16 -0
- package/esm/src/actions/reflexer/ReflexerWithdrawAction.js +20 -0
- package/esm/src/actions/reflexer/index.d.ts +8 -0
- package/esm/src/actions/reflexer/index.js +8 -0
- package/esm/src/actions/uniswap/UniswapSupplyAction.d.ts +26 -0
- package/esm/src/actions/uniswap/UniswapSupplyAction.js +65 -0
- package/esm/src/actions/uniswap/UniswapWithdrawAction.d.ts +25 -0
- package/esm/src/actions/uniswap/UniswapWithdrawAction.js +56 -0
- package/esm/src/actions/uniswap/index.d.ts +2 -0
- package/esm/src/actions/uniswap/index.js +2 -0
- package/esm/src/actions/uniswapV3/UniswapV3CollectAction.d.ts +24 -0
- package/esm/src/actions/uniswapV3/UniswapV3CollectAction.js +47 -0
- package/esm/src/actions/uniswapV3/UniswapV3CreatePoolAction.d.ts +30 -0
- package/esm/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +69 -0
- package/esm/src/actions/uniswapV3/UniswapV3MintAction.d.ts +29 -0
- package/esm/src/actions/uniswapV3/UniswapV3MintAction.js +67 -0
- package/esm/src/actions/uniswapV3/UniswapV3SupplyAction.d.ts +26 -0
- package/esm/src/actions/uniswapV3/UniswapV3SupplyAction.js +60 -0
- package/esm/src/actions/uniswapV3/UniswapV3WithdrawAction.d.ts +28 -0
- package/esm/src/actions/uniswapV3/UniswapV3WithdrawAction.js +58 -0
- package/esm/src/actions/uniswapV3/index.d.ts +5 -0
- package/esm/src/actions/uniswapV3/index.js +5 -0
- package/esm/src/actions/yearn/YearnSupplyAction.d.ts +21 -0
- package/esm/src/actions/yearn/YearnSupplyAction.js +43 -0
- package/esm/src/actions/yearn/YearnWithdrawAction.d.ts +21 -0
- package/esm/src/actions/yearn/YearnWithdrawAction.js +43 -0
- package/esm/src/actions/yearn/index.d.ts +2 -0
- package/esm/src/actions/yearn/index.js +2 -0
- package/esm/src/addresses.d.ts +410 -0
- package/esm/src/addresses.js +257 -0
- package/esm/src/config.d.ts +20 -0
- package/esm/src/config.js +69 -0
- package/esm/src/index.d.ts +1549 -0
- package/esm/src/index.js +22 -0
- package/esm/src/triggers/AaveV3RatioTrigger.d.ts +10 -0
- package/esm/src/triggers/AaveV3RatioTrigger.js +12 -0
- package/esm/src/triggers/ChainLinkPriceTrigger.d.ts +10 -0
- package/esm/src/triggers/ChainLinkPriceTrigger.js +12 -0
- package/esm/src/triggers/CompV3RatioTrigger.d.ts +10 -0
- package/esm/src/triggers/CompV3RatioTrigger.js +12 -0
- package/esm/src/triggers/CompoundRatioTrigger.d.ts +10 -0
- package/esm/src/triggers/CompoundRatioTrigger.js +12 -0
- package/esm/src/triggers/GasPriceTrigger.d.ts +10 -0
- package/esm/src/triggers/GasPriceTrigger.js +12 -0
- package/esm/src/triggers/LiquityRatioTrigger.d.ts +10 -0
- package/esm/src/triggers/LiquityRatioTrigger.js +12 -0
- package/esm/src/triggers/MakerRatioTrigger.d.ts +10 -0
- package/esm/src/triggers/MakerRatioTrigger.js +12 -0
- package/esm/src/triggers/ReflexerRatioTrigger.d.ts +10 -0
- package/esm/src/triggers/ReflexerRatioTrigger.js +12 -0
- package/esm/src/triggers/TimestampTrigger.d.ts +10 -0
- package/esm/src/triggers/TimestampTrigger.js +12 -0
- package/esm/src/triggers/TrailingStopTrigger.d.ts +10 -0
- package/esm/src/triggers/TrailingStopTrigger.js +12 -0
- package/esm/src/triggers/UniV3CurrentTickTrigger.d.ts +10 -0
- package/esm/src/triggers/UniV3CurrentTickTrigger.js +12 -0
- package/esm/src/triggers/index.d.ts +11 -0
- package/esm/src/triggers/index.js +11 -0
- package/esm/src/types.d.ts +43 -0
- package/esm/src/types.js +1 -0
- package/esm/src/utils/convex-utils.d.ts +42 -0
- package/esm/src/utils/convex-utils.js +16 -0
- package/esm/src/utils/convexPoolInfo.json +1039 -0
- package/esm/src/utils/curve-utils.d.ts +4 -0
- package/esm/src/utils/curve-utils.js +6 -0
- package/esm/src/utils/curvePoolInfo.json +203 -0
- package/esm/src/utils/general.d.ts +17 -0
- package/esm/src/utils/general.js +39 -0
- package/esm/src/utils/index.d.ts +5 -0
- package/esm/src/utils/index.js +5 -0
- package/esm/src/utils/mstableAssetPairs.d.ts +9 -0
- package/esm/src/utils/mstableAssetPairs.js +8 -0
- package/esm/src/utils/uniswapLP.d.ts +19 -0
- package/esm/src/utils/uniswapLP.js +33 -0
- package/esm/src/utils/zeroExExchange.d.ts +39 -0
- package/esm/src/utils/zeroExExchange.js +169 -0
- package/package.json +10 -5
- package/src/Action.ts +47 -42
- package/src/ActionWithL2.ts +6 -6
- package/src/DfsWeb3.ts +20 -25
- package/src/Recipe.ts +18 -16
- package/src/Strategy.ts +10 -8
- package/src/actions/aave/AaveBorrowAction.ts +4 -4
- package/src/actions/aave/AaveClaimStkAaveAction.ts +5 -5
- package/src/actions/aave/AaveCollateralSwitchAction.ts +7 -7
- package/src/actions/aave/AavePaybackAction.ts +6 -6
- package/src/actions/aave/AaveSupplyAction.ts +7 -7
- package/src/actions/aave/AaveWithdrawAction.ts +6 -6
- package/src/actions/aaveV3/AaveV3ATokenPaybackAction.ts +13 -11
- package/src/actions/aaveV3/AaveV3BorrowAction.ts +11 -9
- package/src/actions/aaveV3/AaveV3ClaimRewardsAction.ts +7 -6
- package/src/actions/aaveV3/AaveV3CollateralSwitchAction.ts +8 -7
- package/src/actions/aaveV3/AaveV3PaybackAction.ts +20 -19
- package/src/actions/aaveV3/AaveV3SetEModeAction.ts +6 -6
- package/src/actions/aaveV3/AaveV3SupplyAction.ts +17 -18
- package/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.ts +10 -9
- package/src/actions/aaveV3/AaveV3WithdrawAction.ts +14 -13
- package/src/actions/balancer/BalancerV2ClaimAction.ts +14 -15
- package/src/actions/balancer/BalancerV2SupplyAction.ts +16 -14
- package/src/actions/balancer/BalancerV2WithdrawAction.ts +16 -14
- package/src/actions/balancer/index.ts +3 -3
- package/src/actions/basic/AutomationV2Unsub.ts +6 -6
- package/src/actions/basic/ChangeProxyOwnerAction.ts +5 -5
- package/src/actions/basic/GasFeeAction.ts +6 -7
- package/src/actions/basic/GasFeeActionL2.ts +6 -6
- package/src/actions/basic/PullTokenAction.ts +11 -11
- package/src/actions/basic/SellAction.ts +11 -12
- package/src/actions/basic/SendTokenAction.ts +8 -8
- package/src/actions/basic/SendTokenAndUnwrapAction.ts +8 -8
- package/src/actions/basic/SubInputsAction.ts +6 -6
- package/src/actions/basic/SumInputsAction.ts +6 -6
- package/src/actions/basic/ToggleSubAction.ts +5 -7
- package/src/actions/basic/TokenBalanceAction.ts +5 -5
- package/src/actions/basic/TransferNFTAction.ts +8 -8
- package/src/actions/basic/UnwrapEthAction.ts +11 -10
- package/src/actions/basic/UpdateSubAction.ts +8 -8
- package/src/actions/basic/WrapEthAction.ts +6 -6
- package/src/actions/checkers/AaveV3RatioCheckAction.ts +5 -5
- package/src/actions/checkers/CompoundV3RatioCheckAction.ts +6 -6
- package/src/actions/checkers/MakerRatioCheckAction.ts +5 -5
- package/src/actions/chickenBonds/CBChickenInAction.ts +6 -6
- package/src/actions/chickenBonds/CBChickenOutAction.ts +7 -7
- package/src/actions/chickenBonds/CBCreateAction.ts +6 -6
- package/src/actions/chickenBonds/CBRedeemAction.ts +6 -7
- package/src/actions/compound/CompoundBorrowAction.ts +5 -5
- package/src/actions/compound/CompoundClaimAction.ts +6 -6
- package/src/actions/compound/CompoundCollateralSwitchAction.ts +4 -4
- package/src/actions/compound/CompoundGetDebtAction.ts +5 -5
- package/src/actions/compound/CompoundPaybackAction.ts +8 -9
- package/src/actions/compound/CompoundSupplyAction.ts +8 -9
- package/src/actions/compound/CompoundWithdrawAction.ts +5 -5
- package/src/actions/compoundV3/CompoundV3AllowAction.ts +16 -16
- package/src/actions/compoundV3/CompoundV3BorrowAction.ts +17 -17
- package/src/actions/compoundV3/CompoundV3ClaimAction.ts +9 -9
- package/src/actions/compoundV3/CompoundV3PaybackAction.ts +32 -33
- package/src/actions/compoundV3/CompoundV3SupplyAction.ts +24 -25
- package/src/actions/compoundV3/CompoundV3TransferAction.ts +25 -25
- package/src/actions/compoundV3/CompoundV3WithdrawAction.ts +9 -9
- package/src/actions/compoundV3/index.ts +1 -1
- package/src/actions/convex/ConvexClaimAction.ts +51 -52
- package/src/actions/convex/ConvexDepositAction.ts +58 -59
- package/src/actions/convex/ConvexWithdrawAction.ts +55 -56
- package/src/actions/curve/CurveClaimFeesAction.ts +18 -19
- package/src/actions/curve/CurveDepositAction.ts +61 -62
- package/src/actions/curve/CurveGaugeDepositAction.ts +20 -21
- package/src/actions/curve/CurveGaugeWithdrawAction.ts +15 -16
- package/src/actions/curve/CurveMintCrvAction.ts +14 -15
- package/src/actions/curve/CurveStethPoolDepositAction.ts +27 -27
- package/src/actions/curve/CurveStethPoolWithdrawAction.ts +26 -26
- package/src/actions/curve/CurveSwapAction.ts +20 -21
- package/src/actions/curve/CurveWithdrawAction.ts +56 -57
- package/src/actions/dydx/DyDxWithdrawAction.ts +6 -6
- package/src/actions/flashloan/AaveV2FlashLoanAction.ts +6 -6
- package/src/actions/flashloan/AaveV2FlashLoanPaybackAction.ts +5 -5
- package/src/actions/flashloan/AaveV3FlashLoanAction.ts +6 -6
- package/src/actions/flashloan/AaveV3FlashLoanPaybackAction.ts +5 -5
- package/src/actions/flashloan/BalancerFlashLoanAction.ts +6 -6
- package/src/actions/flashloan/BalancerFlashLoanPaybackAction.ts +8 -8
- package/src/actions/flashloan/DyDxFlashLoanAction.ts +7 -7
- package/src/actions/flashloan/DyDxFlashLoanPaybackAction.ts +5 -5
- package/src/actions/flashloan/EulerFlashLoanAction.ts +6 -6
- package/src/actions/flashloan/EulerFlashLoanPaybackAction.ts +6 -5
- package/src/actions/flashloan/FLAction.ts +51 -0
- package/src/actions/flashloan/MakerFlashLoanAction.ts +6 -6
- package/src/actions/flashloan/MakerFlashLoanPaybackAction.ts +4 -4
- package/src/actions/flashloan/index.ts +3 -2
- package/src/actions/guni/GUniDeposit.ts +15 -15
- package/src/actions/guni/GUniWithdraw.ts +11 -11
- package/src/actions/index.ts +24 -24
- package/src/actions/insta/InstPullTokensAction.ts +9 -9
- package/src/actions/lido/LidoStakeAction.ts +7 -7
- package/src/actions/lido/LidoUnwrapAction.ts +6 -6
- package/src/actions/lido/LidoWrapAction.ts +9 -10
- package/src/actions/liquity/LiquityBorrowAction.ts +19 -17
- package/src/actions/liquity/LiquityClaimAction.ts +14 -14
- package/src/actions/liquity/LiquityClaimSPRewardsAction.ts +9 -9
- package/src/actions/liquity/LiquityClaimStakingRewardsAction.ts +9 -9
- package/src/actions/liquity/LiquityCloseAction.ts +19 -19
- package/src/actions/liquity/LiquityEthGainToTroveAction.ts +19 -17
- package/src/actions/liquity/LiquityOpenAction.ts +25 -23
- package/src/actions/liquity/LiquityPaybackAction.ts +21 -19
- package/src/actions/liquity/LiquityRedeemAction.ts +42 -37
- package/src/actions/liquity/LiquitySPDepositAction.ts +22 -22
- package/src/actions/liquity/LiquitySPWithdrawAction.ts +19 -19
- package/src/actions/liquity/LiquityStakeAction.ts +22 -22
- package/src/actions/liquity/LiquitySupplyAction.ts +21 -19
- package/src/actions/liquity/LiquityUnstakeAction.ts +19 -19
- package/src/actions/liquity/LiquityWithdrawAction.ts +18 -16
- package/src/actions/maker/MakerClaimAction.ts +8 -8
- package/src/actions/maker/MakerGenerateAction.ts +5 -5
- package/src/actions/maker/MakerGiveAction.ts +6 -6
- package/src/actions/maker/MakerMergeAction.ts +4 -4
- package/src/actions/maker/MakerOpenVaultAction.ts +4 -4
- package/src/actions/maker/MakerPaybackAction.ts +6 -6
- package/src/actions/maker/MakerRatioAction.ts +3 -3
- package/src/actions/maker/MakerSupplyAction.ts +6 -6
- package/src/actions/maker/MakerWithdrawAction.ts +5 -5
- package/src/actions/mstable/MStableClaimAction.ts +23 -23
- package/src/actions/mstable/MStableDepositAction.ts +60 -60
- package/src/actions/mstable/MStableWithdrawAction.ts +59 -59
- package/src/actions/rari/RariDepositAction.ts +4 -4
- package/src/actions/rari/RariWithdrawAction.ts +4 -4
- package/src/actions/reflexer/ReflexerGenerateAction.ts +6 -6
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.ts +10 -11
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.ts +7 -7
- package/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.ts +8 -8
- package/src/actions/reflexer/ReflexerOpenSafeAction.ts +3 -3
- package/src/actions/reflexer/ReflexerPaybackAction.ts +6 -6
- package/src/actions/reflexer/ReflexerSupplyAction.ts +6 -6
- package/src/actions/reflexer/ReflexerWithdrawAction.ts +5 -5
- package/src/actions/uniswap/UniswapSupplyAction.ts +18 -18
- package/src/actions/uniswap/UniswapWithdrawAction.ts +16 -16
- package/src/actions/uniswapV3/UniswapV3CollectAction.ts +9 -10
- package/src/actions/uniswapV3/UniswapV3CreatePoolAction.ts +22 -20
- package/src/actions/uniswapV3/UniswapV3MintAction.ts +21 -19
- package/src/actions/uniswapV3/UniswapV3SupplyAction.ts +15 -15
- package/src/actions/uniswapV3/UniswapV3WithdrawAction.ts +14 -15
- package/src/actions/yearn/YearnSupplyAction.ts +7 -7
- package/src/actions/yearn/YearnWithdrawAction.ts +7 -7
- package/src/addresses.ts +10 -7
- package/src/config.ts +6 -6
- package/{index.ts → src/index.ts} +36 -21
- package/src/triggers/AaveV3RatioTrigger.ts +6 -7
- package/src/triggers/ChainLinkPriceTrigger.ts +6 -8
- package/src/triggers/CompV3RatioTrigger.ts +6 -7
- package/src/triggers/CompoundRatioTrigger.ts +6 -7
- package/src/triggers/GasPriceTrigger.ts +6 -7
- package/src/triggers/LiquityRatioTrigger.ts +9 -10
- package/src/triggers/MakerRatioTrigger.ts +6 -7
- package/src/triggers/ReflexerRatioTrigger.ts +6 -7
- package/src/triggers/TimestampTrigger.ts +6 -7
- package/src/triggers/TrailingStopTrigger.ts +6 -7
- package/src/triggers/UniV3CurrentTickTrigger.ts +6 -6
- package/src/types.ts +9 -7
- package/src/utils/convex-utils.ts +9 -9
- package/src/utils/curve-utils.ts +11 -8
- package/src/utils/general.ts +4 -5
- package/src/utils/index.ts +7 -5
- package/src/utils/mstableAssetPairs.ts +6 -6
- package/src/utils/uniswapLP.ts +14 -16
- package/src/utils/uniswapV3LP.ts +5 -4
- package/src/utils/zeroExExchange.ts +9 -8
- package/tsconfig.json +1 -2
- package/umd/index.js +8639 -0
- package/webpack.umd.js +1 -1
- package/.eslintrc +0 -14
- package/src/triggers/CompV3Trigger.ts +0 -15
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfoByAddress } from "@defisaver/tokens";
|
|
11
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* AaveV3SupplyAction - Supply token to an aave position on Aave V3
|
|
15
|
+
*
|
|
16
|
+
* @category AaveV3
|
|
17
|
+
*/
|
|
18
|
+
export class AaveV3SupplyAction extends ActionWithL2 {
|
|
19
|
+
/**
|
|
20
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
21
|
+
* @param market Address provider for specific market
|
|
22
|
+
* @param amount Amount of tokens to be deposited
|
|
23
|
+
* @param from Tokens will be supplied from this address
|
|
24
|
+
* @param tokenAddress Address of the token
|
|
25
|
+
* @param assetId The id of the token to be deposited
|
|
26
|
+
* @param enableAsColl If we need to enable asset as collateral
|
|
27
|
+
* @param useOnBehalf use on behalf param or default to proxy
|
|
28
|
+
* @param onBehalf For what user we are supplying the tokens, defaults to proxy
|
|
29
|
+
*/
|
|
30
|
+
constructor(useDefaultMarket, market, amount, from, tokenAddress, assetId, enableAsColl, useOnBehalf, onBehalf = getAddr('Empty')) {
|
|
31
|
+
super('AaveV3Supply', getAddr('AaveV3Supply'), ['uint256', 'address', 'uint16', 'bool', 'bool', 'bool', 'address', 'address'], [amount, from, assetId, enableAsColl, useDefaultMarket, useOnBehalf, market, onBehalf]);
|
|
32
|
+
this.mappableArgs = [
|
|
33
|
+
this.args[0],
|
|
34
|
+
this.args[1],
|
|
35
|
+
this.args[2],
|
|
36
|
+
this.args[3],
|
|
37
|
+
this.args[4],
|
|
38
|
+
this.args[5],
|
|
39
|
+
this.args[6],
|
|
40
|
+
this.args[7],
|
|
41
|
+
];
|
|
42
|
+
this.tokenForApproval = tokenAddress;
|
|
43
|
+
}
|
|
44
|
+
getAssetsToApprove() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
47
|
+
if (asset.symbol !== 'ETH')
|
|
48
|
+
return [{ asset: this.tokenForApproval, owner: this.args[1] }];
|
|
49
|
+
return [];
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
encodeInputs() {
|
|
53
|
+
// executeActionDirectL2
|
|
54
|
+
let encodedInput = "0x2895f3aa";
|
|
55
|
+
// amount
|
|
56
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[0]));
|
|
57
|
+
// from
|
|
58
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[1]));
|
|
59
|
+
// assetId
|
|
60
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[2]));
|
|
61
|
+
// enableAsColl
|
|
62
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[3]));
|
|
63
|
+
// useDefaultMarket
|
|
64
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[4]));
|
|
65
|
+
// useOnBehalf
|
|
66
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[5]));
|
|
67
|
+
if (!this.args[4]) {
|
|
68
|
+
// market
|
|
69
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[6]));
|
|
70
|
+
}
|
|
71
|
+
if (this.args[5]) {
|
|
72
|
+
// onBehalf
|
|
73
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[7]));
|
|
74
|
+
}
|
|
75
|
+
return encodedInput;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint16, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3SwapBorrowRateModeAction - Swaps proxy positions borrow rate mode between stable and variable.
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3SwapBorrowRateModeAction extends ActionWithL2 {
|
|
9
|
+
/**
|
|
10
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
11
|
+
* @param market Address provider for specific market
|
|
12
|
+
* @param rateMode rate mode the user is swapping from.[Stable: 1, Variable: 2]
|
|
13
|
+
* @param assetId id of the underlying asset in the market
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
constructor(useDefaultMarket: boolean, market: EthAddress, rateMode: uint256, assetId: uint16);
|
|
17
|
+
encodeInputs(): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3SwapBorrowRateModeAction - Swaps proxy positions borrow rate mode between stable and variable.
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV3SwapBorrowRateModeAction extends ActionWithL2 {
|
|
9
|
+
/**
|
|
10
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
11
|
+
* @param market Address provider for specific market
|
|
12
|
+
* @param rateMode rate mode the user is swapping from.[Stable: 1, Variable: 2]
|
|
13
|
+
* @param assetId id of the underlying asset in the market
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
constructor(useDefaultMarket, market, rateMode, assetId) {
|
|
17
|
+
super('AaveV3SwapBorrowRateMode', getAddr('AaveV3SwapBorrowRateMode'), ['uint256', 'uint16', 'bool', 'address'], [rateMode, assetId, useDefaultMarket, market]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0][0],
|
|
20
|
+
this.args[3],
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
encodeInputs() {
|
|
24
|
+
// executeActionDirectL2
|
|
25
|
+
let encodedInput = "0x2895f3aa";
|
|
26
|
+
// rateMode
|
|
27
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[0]));
|
|
28
|
+
// assetId
|
|
29
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[1]));
|
|
30
|
+
// useOnDefaultMarket
|
|
31
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[2]));
|
|
32
|
+
if (!this.args[2]) {
|
|
33
|
+
// market
|
|
34
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[3]));
|
|
35
|
+
}
|
|
36
|
+
return encodedInput;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint16, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3WithdrawAction - Withdraw a previously supplied token from a position in AaveV3
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3WithdrawAction extends ActionWithL2 {
|
|
9
|
+
/**
|
|
10
|
+
* @param assetId The id of the token to be deposited
|
|
11
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
12
|
+
* @param amount Amount of tokens to be withdrawn -> send type(uint).max for whole amount
|
|
13
|
+
* @param to Where the withdrawn tokens will be sent
|
|
14
|
+
* @param market Address provider for specific market
|
|
15
|
+
*/
|
|
16
|
+
constructor(useDefaultMarket: boolean, market: EthAddress, amount: uint256, to: EthAddress, assetId: uint16);
|
|
17
|
+
encodeInputs(): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { requireAddress } from "../../utils/general";
|
|
4
|
+
/**
|
|
5
|
+
* AaveV3WithdrawAction - Withdraw a previously supplied token from a position in AaveV3
|
|
6
|
+
*
|
|
7
|
+
* @category AaveV3
|
|
8
|
+
*/
|
|
9
|
+
export class AaveV3WithdrawAction extends ActionWithL2 {
|
|
10
|
+
/**
|
|
11
|
+
* @param assetId The id of the token to be deposited
|
|
12
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
13
|
+
* @param amount Amount of tokens to be withdrawn -> send type(uint).max for whole amount
|
|
14
|
+
* @param to Where the withdrawn tokens will be sent
|
|
15
|
+
* @param market Address provider for specific market
|
|
16
|
+
*/
|
|
17
|
+
constructor(useDefaultMarket, market, amount, to, assetId) {
|
|
18
|
+
requireAddress(to);
|
|
19
|
+
super('AaveV3Withdraw', getAddr('AaveV3Withdraw'), ['uint16', 'bool', 'uint256', 'address', 'address'], [assetId, useDefaultMarket, amount, to, market]);
|
|
20
|
+
this.mappableArgs = [
|
|
21
|
+
this.args[0],
|
|
22
|
+
this.args[1],
|
|
23
|
+
this.args[2],
|
|
24
|
+
this.args[3],
|
|
25
|
+
this.args[4],
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
encodeInputs() {
|
|
29
|
+
// executeActionDirectL2
|
|
30
|
+
let encodedInput = "0x2895f3aa";
|
|
31
|
+
// assetId
|
|
32
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[0]));
|
|
33
|
+
// useOnDefaultMarket
|
|
34
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[1]));
|
|
35
|
+
// amount
|
|
36
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[2]));
|
|
37
|
+
// from
|
|
38
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[3]));
|
|
39
|
+
if (!this.args[1]) {
|
|
40
|
+
// market
|
|
41
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[4]));
|
|
42
|
+
}
|
|
43
|
+
return encodedInput;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './AaveV3SupplyAction';
|
|
2
|
+
export * from './AaveV3BorrowAction';
|
|
3
|
+
export * from './AaveV3PaybackAction';
|
|
4
|
+
export * from './AaveV3WithdrawAction';
|
|
5
|
+
export * from './AaveV3SetEModeAction';
|
|
6
|
+
export * from './AaveV3ATokenPaybackAction';
|
|
7
|
+
export * from './AaveV3CollateralSwitchAction';
|
|
8
|
+
export * from './AaveV3ClaimRewardsAction';
|
|
9
|
+
export * from './AaveV3SwapBorrowRateModeAction';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './AaveV3SupplyAction';
|
|
2
|
+
export * from './AaveV3BorrowAction';
|
|
3
|
+
export * from './AaveV3PaybackAction';
|
|
4
|
+
export * from './AaveV3WithdrawAction';
|
|
5
|
+
export * from './AaveV3SetEModeAction';
|
|
6
|
+
export * from './AaveV3ATokenPaybackAction';
|
|
7
|
+
export * from './AaveV3CollateralSwitchAction';
|
|
8
|
+
export * from './AaveV3ClaimRewardsAction';
|
|
9
|
+
export * from './AaveV3SwapBorrowRateModeAction';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256, bytes32 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* BalancerV2ClaimAction - Claim BAL governance tokens
|
|
5
|
+
* @category BalancerV2
|
|
6
|
+
*/
|
|
7
|
+
export declare class BalancerV2ClaimAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
* @param liquidityProvider
|
|
10
|
+
* @param to
|
|
11
|
+
* @param weeks
|
|
12
|
+
* @param balances
|
|
13
|
+
* @param merkleProofs
|
|
14
|
+
*/
|
|
15
|
+
constructor(liquidityProvider: EthAddress, to: EthAddress, weeks: Array<uint256>, balances: uint256, merkleProofs: Array<Array<bytes32>>);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
asset: string;
|
|
18
|
+
owner: any;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from "../../Action";
|
|
11
|
+
import { requireAddress } from "../../utils/general";
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* BalancerV2ClaimAction - Claim BAL governance tokens
|
|
15
|
+
* @category BalancerV2
|
|
16
|
+
*/
|
|
17
|
+
export class BalancerV2ClaimAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param liquidityProvider
|
|
20
|
+
* @param to
|
|
21
|
+
* @param weeks
|
|
22
|
+
* @param balances
|
|
23
|
+
* @param merkleProofs
|
|
24
|
+
*/
|
|
25
|
+
constructor(liquidityProvider, to, weeks, balances, merkleProofs) {
|
|
26
|
+
requireAddress(to);
|
|
27
|
+
super('BalancerV2Claim', getAddr('BalancerV2Claim'), [
|
|
28
|
+
"address",
|
|
29
|
+
"address",
|
|
30
|
+
"uint256[]",
|
|
31
|
+
"uint256[]",
|
|
32
|
+
"bytes32[][]",
|
|
33
|
+
], [liquidityProvider, to, weeks, balances, merkleProofs]);
|
|
34
|
+
this.mappableArgs = [
|
|
35
|
+
this.args[0],
|
|
36
|
+
this.args[1],
|
|
37
|
+
];
|
|
38
|
+
}
|
|
39
|
+
getAssetsToApprove() {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
const approveArr = [];
|
|
42
|
+
if (this.args[0] !== this.args[1]) {
|
|
43
|
+
const tokenAddress = getAddr('BalancerToken');
|
|
44
|
+
approveArr.push({ asset: tokenAddress, owner: this.args[0] });
|
|
45
|
+
}
|
|
46
|
+
return approveArr;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256, bytes32, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* BalancerV2SupplyAction - Supply tokens to Balancer pool
|
|
5
|
+
* @category BalancerV2
|
|
6
|
+
*/
|
|
7
|
+
export declare class BalancerV2SupplyAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
* @param poolId
|
|
10
|
+
* @param from
|
|
11
|
+
* @param to
|
|
12
|
+
* @param tokens
|
|
13
|
+
* @param maxAmountsIn
|
|
14
|
+
* @param userData
|
|
15
|
+
*/
|
|
16
|
+
constructor(poolId: bytes32, from: EthAddress, to: EthAddress, tokens: Array<EthAddress>, maxAmountsIn: Array<uint256>, userData: bytes);
|
|
17
|
+
getAssetsToApprove(): Promise<{
|
|
18
|
+
asset: EthAddress;
|
|
19
|
+
owner: EthAddress;
|
|
20
|
+
specialApproveLabel: string;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from "../../Action";
|
|
11
|
+
import { requireAddress } from "../../utils/general";
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* BalancerV2SupplyAction - Supply tokens to Balancer pool
|
|
15
|
+
* @category BalancerV2
|
|
16
|
+
*/
|
|
17
|
+
export class BalancerV2SupplyAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param poolId
|
|
20
|
+
* @param from
|
|
21
|
+
* @param to
|
|
22
|
+
* @param tokens
|
|
23
|
+
* @param maxAmountsIn
|
|
24
|
+
* @param userData
|
|
25
|
+
*/
|
|
26
|
+
constructor(poolId, from, to, tokens, maxAmountsIn, userData) {
|
|
27
|
+
requireAddress(to);
|
|
28
|
+
super('BalancerV2Supply', getAddr('BalancerV2Supply'), [
|
|
29
|
+
"bytes32",
|
|
30
|
+
"address",
|
|
31
|
+
"address",
|
|
32
|
+
"address[]",
|
|
33
|
+
"uint256[]",
|
|
34
|
+
"bytes",
|
|
35
|
+
], [poolId, from, to, tokens, maxAmountsIn, userData]);
|
|
36
|
+
this.mappableArgs = [
|
|
37
|
+
this.args[1],
|
|
38
|
+
this.args[2],
|
|
39
|
+
];
|
|
40
|
+
for (let i = 0; i < this.args[4].length; i++) {
|
|
41
|
+
this.mappableArgs.push(this.args[4][i]);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
getAssetsToApprove() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const approveArr = [];
|
|
47
|
+
const tokens = this.args[3];
|
|
48
|
+
tokens.forEach(token => approveArr.push({ asset: token, owner: this.args[1], specialApproveLabel: 'balancer' }));
|
|
49
|
+
return approveArr;
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256, bytes32, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* BalancerV2WithdrawAction - Withdraw tokens from Balancer pool
|
|
5
|
+
* @category BalancerV2
|
|
6
|
+
*/
|
|
7
|
+
export declare class BalancerV2WithdrawAction extends Action {
|
|
8
|
+
from: EthAddress;
|
|
9
|
+
/**
|
|
10
|
+
* @param poolId
|
|
11
|
+
* @param from
|
|
12
|
+
* @param to
|
|
13
|
+
* @param lpTokenAmount;
|
|
14
|
+
* @param tokens
|
|
15
|
+
* @param minAmountsOut
|
|
16
|
+
* @param userData
|
|
17
|
+
*/
|
|
18
|
+
constructor(poolId: bytes32, from: EthAddress, to: EthAddress, lpTokenAmount: uint256, tokens: Array<EthAddress>, minAmountsOut: Array<uint256>, userData: bytes);
|
|
19
|
+
getAssetsToApprove(): Promise<{
|
|
20
|
+
asset: any;
|
|
21
|
+
owner: any;
|
|
22
|
+
specialApproveLabel: string;
|
|
23
|
+
}[]>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from "../../Action";
|
|
11
|
+
import { requireAddress } from "../../utils/general";
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* BalancerV2WithdrawAction - Withdraw tokens from Balancer pool
|
|
15
|
+
* @category BalancerV2
|
|
16
|
+
*/
|
|
17
|
+
export class BalancerV2WithdrawAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param poolId
|
|
20
|
+
* @param from
|
|
21
|
+
* @param to
|
|
22
|
+
* @param lpTokenAmount;
|
|
23
|
+
* @param tokens
|
|
24
|
+
* @param minAmountsOut
|
|
25
|
+
* @param userData
|
|
26
|
+
*/
|
|
27
|
+
constructor(poolId, from, to, lpTokenAmount, tokens, minAmountsOut, userData) {
|
|
28
|
+
requireAddress(to);
|
|
29
|
+
super('BalancerV2Withdraw', getAddr('BalancerV2Withdraw'), [
|
|
30
|
+
"bytes32",
|
|
31
|
+
"address",
|
|
32
|
+
"address",
|
|
33
|
+
"uint256",
|
|
34
|
+
"address[]",
|
|
35
|
+
"uint256[]",
|
|
36
|
+
"bytes",
|
|
37
|
+
], [poolId, from, to, lpTokenAmount, tokens, minAmountsOut, userData]);
|
|
38
|
+
this.from = from;
|
|
39
|
+
this.mappableArgs = [
|
|
40
|
+
this.args[1],
|
|
41
|
+
this.args[2],
|
|
42
|
+
this.args[3],
|
|
43
|
+
];
|
|
44
|
+
for (let i = 0; i < this.args[5].length; i++) {
|
|
45
|
+
this.mappableArgs.push(this.args[5][i]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
getAssetsToApprove() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const approveArr = [];
|
|
51
|
+
const token = this.args[0].slice(0, 42);
|
|
52
|
+
approveArr.push({ asset: token, owner: this.args[1], specialApproveLabel: 'balancer' });
|
|
53
|
+
return approveArr;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { getAddr } from "../../addresses";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category BasicActions
|
|
6
|
+
*/
|
|
7
|
+
export class AutomationV2Unsub extends Action {
|
|
8
|
+
constructor(protocol, cdpId = '0') {
|
|
9
|
+
super('AutomationV2Unsub', getAddr('AutomationV2Unsub'), ["uint256", "uint256"], [cdpId, protocol]);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* ChangeProxyOwnerAction - Changes EOA which owns the proxy that is being called
|
|
5
|
+
*
|
|
6
|
+
* @category BasicActions
|
|
7
|
+
*/
|
|
8
|
+
export declare class ChangeProxyOwnerAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param newOwner Address of new owner
|
|
11
|
+
*/
|
|
12
|
+
constructor(newOwner: EthAddress);
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { getAddr } from "../../addresses";
|
|
3
|
+
/**
|
|
4
|
+
* ChangeProxyOwnerAction - Changes EOA which owns the proxy that is being called
|
|
5
|
+
*
|
|
6
|
+
* @category BasicActions
|
|
7
|
+
*/
|
|
8
|
+
export class ChangeProxyOwnerAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param newOwner Address of new owner
|
|
11
|
+
*/
|
|
12
|
+
constructor(newOwner) {
|
|
13
|
+
super("ChangeProxyOwner", getAddr("ChangeProxyOwner"), ["address"], [newOwner]);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @category BasicActions
|
|
5
|
+
*/
|
|
6
|
+
export declare class GasFeeAction extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param gasStart Always 0 will be inject value
|
|
9
|
+
* @param feeToken Address of the token we are taken the fee in
|
|
10
|
+
* @param availableAmount Amount we have available to pay the gas fee
|
|
11
|
+
* @param dfsFeeDivider Additional fee for DFS, default is 5bps
|
|
12
|
+
*/
|
|
13
|
+
constructor(gasStart: uint256, feeToken: EthAddress, availableAmount: uint256, dfsFeeDivider?: uint256);
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { getAddr } from "../../addresses";
|
|
3
|
+
/**
|
|
4
|
+
* @category BasicActions
|
|
5
|
+
*/
|
|
6
|
+
export class GasFeeAction extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param gasStart Always 0 will be inject value
|
|
9
|
+
* @param feeToken Address of the token we are taken the fee in
|
|
10
|
+
* @param availableAmount Amount we have available to pay the gas fee
|
|
11
|
+
* @param dfsFeeDivider Additional fee for DFS, default is 5bps
|
|
12
|
+
*/
|
|
13
|
+
constructor(gasStart, feeToken, availableAmount, dfsFeeDivider = '2000') {
|
|
14
|
+
super("GasFeeTaker", getAddr("GasFeeTaker"), ["uint256", "address", "uint256", "uint256"], [gasStart, feeToken, availableAmount, dfsFeeDivider]);
|
|
15
|
+
this.mappableArgs = [
|
|
16
|
+
this.args[1],
|
|
17
|
+
this.args[2],
|
|
18
|
+
this.args[3],
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* @category BasicActions
|
|
5
|
+
*/
|
|
6
|
+
export declare class GasFeeActionL2 extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param gasStart Always 0 will be inject value
|
|
9
|
+
* @param feeToken Address of the token we are taken the fee in
|
|
10
|
+
* @param availableAmount Amount we have available to pay the gas fee
|
|
11
|
+
* @param dfsFeeDivider Additional fee for DFS, default is 5bps
|
|
12
|
+
* @param l1GasCostInEth Additional tx cost for L1 in eth
|
|
13
|
+
*/
|
|
14
|
+
constructor(gasStart: uint256, feeToken: EthAddress, availableAmount: uint256, dfsFeeDivider?: uint256, l1GasCostInEth?: uint256);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { getAddr } from "../../addresses";
|
|
3
|
+
/**
|
|
4
|
+
* @category BasicActions
|
|
5
|
+
*/
|
|
6
|
+
export class GasFeeActionL2 extends Action {
|
|
7
|
+
/**
|
|
8
|
+
* @param gasStart Always 0 will be inject value
|
|
9
|
+
* @param feeToken Address of the token we are taken the fee in
|
|
10
|
+
* @param availableAmount Amount we have available to pay the gas fee
|
|
11
|
+
* @param dfsFeeDivider Additional fee for DFS, default is 5bps
|
|
12
|
+
* @param l1GasCostInEth Additional tx cost for L1 in eth
|
|
13
|
+
*/
|
|
14
|
+
constructor(gasStart, feeToken, availableAmount, dfsFeeDivider = '2000', l1GasCostInEth = '0') {
|
|
15
|
+
super("GasFeeTakerL2", getAddr("GasFeeTakerL2"), ["uint256", "address", "uint256", "uint256", "uint256"], [gasStart, feeToken, availableAmount, dfsFeeDivider, l1GasCostInEth]);
|
|
16
|
+
this.mappableArgs = [
|
|
17
|
+
this.args[1],
|
|
18
|
+
this.args[2],
|
|
19
|
+
this.args[3],
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Transfers specified token from a specified address to DSProxy (recipe)
|
|
5
|
+
*
|
|
6
|
+
* @category BasicActions
|
|
7
|
+
*/
|
|
8
|
+
export declare class PullTokenAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param token Token address
|
|
11
|
+
* @param from Transfer sender
|
|
12
|
+
* @param amount Transfer amount (-1 for whole sender balance)
|
|
13
|
+
*/
|
|
14
|
+
constructor(token: EthAddress, from: EthAddress, amount: uint256);
|
|
15
|
+
getAssetsToApprove(): Promise<{
|
|
16
|
+
asset: any;
|
|
17
|
+
owner: any;
|
|
18
|
+
}[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { requireAddress } from "../../utils/general";
|
|
11
|
+
import { getAssetInfoByAddress } from "@defisaver/tokens";
|
|
12
|
+
import { Action } from "../../Action";
|
|
13
|
+
import { getAddr } from "../../addresses";
|
|
14
|
+
/**
|
|
15
|
+
* Transfers specified token from a specified address to DSProxy (recipe)
|
|
16
|
+
*
|
|
17
|
+
* @category BasicActions
|
|
18
|
+
*/
|
|
19
|
+
export class PullTokenAction extends Action {
|
|
20
|
+
/**
|
|
21
|
+
* @param token Token address
|
|
22
|
+
* @param from Transfer sender
|
|
23
|
+
* @param amount Transfer amount (-1 for whole sender balance)
|
|
24
|
+
*/
|
|
25
|
+
constructor(token, from, amount) {
|
|
26
|
+
requireAddress(from);
|
|
27
|
+
super('PullToken', getAddr('PullToken'), [
|
|
28
|
+
"address",
|
|
29
|
+
"address",
|
|
30
|
+
"uint",
|
|
31
|
+
], [token, from, amount]);
|
|
32
|
+
}
|
|
33
|
+
getAssetsToApprove() {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const asset = getAssetInfoByAddress(this.args[0]);
|
|
36
|
+
if (asset.symbol !== 'ETH')
|
|
37
|
+
return [{ asset: this.args[0], owner: this.args[1] }];
|
|
38
|
+
return [];
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|