@defisaver/sdk 1.0.0 → 1.0.1
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/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 +3 -3
- package/{index.ts → src/index.ts} +13 -13
- package/tsconfig.json +1 -2
- package/umd/index.js +8639 -0
- package/webpack.umd.js +1 -1
|
@@ -0,0 +1,38 @@
|
|
|
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 { getAddr } from '../../addresses';
|
|
12
|
+
import { getAssetInfoByAddress } from "@defisaver/tokens";
|
|
13
|
+
/**
|
|
14
|
+
* AavePaybackAction - Payback borrowed tokens from Aave
|
|
15
|
+
*
|
|
16
|
+
* @category Aave
|
|
17
|
+
*/
|
|
18
|
+
export class AavePaybackAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param market - Address of market
|
|
21
|
+
* @param tokenAddr - Address of Token
|
|
22
|
+
* @param amount - Token amount
|
|
23
|
+
* @param rateMode - Borrow rate mode: Stable: 1, Variable: 2
|
|
24
|
+
* @param from - Tokens will be sent from this address
|
|
25
|
+
* @param onBehalf - Tokens will be paid back to this address' position (defaults to sender's proxy)
|
|
26
|
+
*/
|
|
27
|
+
constructor(market, tokenAddr, amount, rateMode, from, onBehalf = getAddr('Empty')) {
|
|
28
|
+
super('AavePayback', getAddr('AavePayback'), ['address', 'address', 'uint256', 'uint256', 'address', 'address'], [market, tokenAddr, amount, rateMode, from, onBehalf]);
|
|
29
|
+
}
|
|
30
|
+
getAssetsToApprove() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const asset = getAssetInfoByAddress(this.args[1]);
|
|
33
|
+
if (asset.symbol !== 'ETH')
|
|
34
|
+
return [{ asset: this.args[1], owner: this.args[4] }];
|
|
35
|
+
return [];
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveSupplyAction - Supply token to an aave position
|
|
5
|
+
*
|
|
6
|
+
* @category Aave
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveSupplyAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market - Address of market
|
|
11
|
+
* @param tokenAddr - Address of Token
|
|
12
|
+
* @param amount - Token amount
|
|
13
|
+
* @param from - Tokens will be sent from this address
|
|
14
|
+
* @param onBehalf - Tokens will be supplied to this address' position (defaults to sender's proxy)
|
|
15
|
+
* @param enableAsColl - If we need to enable asset as collateral
|
|
16
|
+
*/
|
|
17
|
+
constructor(market: EthAddress, tokenAddr: EthAddress, amount: uint256, from: EthAddress, onBehalf: string | undefined, enableAsColl: boolean);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: any;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 { getAddr } from '../../addresses';
|
|
12
|
+
import { getAssetInfoByAddress } from "@defisaver/tokens";
|
|
13
|
+
/**
|
|
14
|
+
* AaveSupplyAction - Supply token to an aave position
|
|
15
|
+
*
|
|
16
|
+
* @category Aave
|
|
17
|
+
*/
|
|
18
|
+
export class AaveSupplyAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param market - Address of market
|
|
21
|
+
* @param tokenAddr - Address of Token
|
|
22
|
+
* @param amount - Token amount
|
|
23
|
+
* @param from - Tokens will be sent from this address
|
|
24
|
+
* @param onBehalf - Tokens will be supplied to this address' position (defaults to sender's proxy)
|
|
25
|
+
* @param enableAsColl - If we need to enable asset as collateral
|
|
26
|
+
*/
|
|
27
|
+
constructor(market, tokenAddr, amount, from, onBehalf = getAddr('Empty'), enableAsColl) {
|
|
28
|
+
super('AaveSupply', getAddr('AaveSupply'), ['address', 'address', 'uint256', 'address', 'address', 'bool'], [market, tokenAddr, amount, from, onBehalf, enableAsColl]);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
this.args[4],
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
getAssetsToApprove() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const asset = getAssetInfoByAddress(this.args[1]);
|
|
40
|
+
if (asset.symbol !== 'ETH')
|
|
41
|
+
return [{ asset: this.args[1], owner: this.args[3] }];
|
|
42
|
+
return [];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveWithdrawAction - Withdraw token from an aave position
|
|
5
|
+
*
|
|
6
|
+
* @category Aave
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveWithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market - Address of market
|
|
11
|
+
* @param tokenAddr - Address of Token
|
|
12
|
+
* @param amount - Token amount
|
|
13
|
+
* @param to - Tokens will be withdrawn to this address
|
|
14
|
+
*/
|
|
15
|
+
constructor(market: EthAddress, tokenAddr: EthAddress, amount: uint256, to: EthAddress);
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from "../../Action";
|
|
2
|
+
import { requireAddress } from "../../utils/general";
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
/**
|
|
5
|
+
* AaveWithdrawAction - Withdraw token from an aave position
|
|
6
|
+
*
|
|
7
|
+
* @category Aave
|
|
8
|
+
*/
|
|
9
|
+
export class AaveWithdrawAction extends Action {
|
|
10
|
+
/**
|
|
11
|
+
* @param market - Address of market
|
|
12
|
+
* @param tokenAddr - Address of Token
|
|
13
|
+
* @param amount - Token amount
|
|
14
|
+
* @param to - Tokens will be withdrawn to this address
|
|
15
|
+
*/
|
|
16
|
+
constructor(market, tokenAddr, amount, to) {
|
|
17
|
+
requireAddress(to);
|
|
18
|
+
super('AaveWithdraw', getAddr('AaveWithdraw'), ['address', 'address', 'uint256', 'address'], [market, tokenAddr, amount, to]);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint8, uint16, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3ATokenPaybackAction - Repay Aave V3 debt using aTokens
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3ATokenPaybackAction extends ActionWithL2 {
|
|
9
|
+
addressForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
12
|
+
* @param market Address provider for specific market
|
|
13
|
+
* @param amount Amount of tokens to be payed back (uint.max for full debt)
|
|
14
|
+
* @param from Where are we pulling the payback aTokens from
|
|
15
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
16
|
+
* @param aTokenAddr address of the aToken to be pulled
|
|
17
|
+
* @param assetId The id of the underlying asset to be repaid
|
|
18
|
+
*/
|
|
19
|
+
constructor(useDefaultMarket: boolean, market: EthAddress, amount: uint256, from: EthAddress, rateMode: uint8, aTokenAddr: EthAddress, assetId: uint16);
|
|
20
|
+
getAssetsToApprove(): Promise<{
|
|
21
|
+
asset: string;
|
|
22
|
+
owner: any;
|
|
23
|
+
}[]>;
|
|
24
|
+
encodeInputs(): string;
|
|
25
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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 { ActionWithL2 } from "../../ActionWithL2";
|
|
11
|
+
import { getAssetInfoByAddress } from "@defisaver/tokens";
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* AaveV3ATokenPaybackAction - Repay Aave V3 debt using aTokens
|
|
15
|
+
*
|
|
16
|
+
* @category AaveV3
|
|
17
|
+
*/
|
|
18
|
+
export class AaveV3ATokenPaybackAction 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 payed back (uint.max for full debt)
|
|
23
|
+
* @param from Where are we pulling the payback aTokens from
|
|
24
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
25
|
+
* @param aTokenAddr address of the aToken to be pulled
|
|
26
|
+
* @param assetId The id of the underlying asset to be repaid
|
|
27
|
+
*/
|
|
28
|
+
constructor(useDefaultMarket, market, amount, from, rateMode, aTokenAddr, assetId) {
|
|
29
|
+
super('AaveV3ATokenPayback', getAddr('AaveV3ATokenPayback'), ['uint256', 'address', 'uint8', 'uint16', 'bool', 'address'], [amount, from, rateMode, assetId, useDefaultMarket, market]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[5],
|
|
34
|
+
];
|
|
35
|
+
this.addressForApproval = aTokenAddr;
|
|
36
|
+
}
|
|
37
|
+
getAssetsToApprove() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const asset = getAssetInfoByAddress(this.addressForApproval);
|
|
40
|
+
if (asset.symbol !== 'ETH')
|
|
41
|
+
return [{ asset: this.addressForApproval, owner: this.args[1] }];
|
|
42
|
+
return [];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
encodeInputs() {
|
|
46
|
+
// executeActionDirectL2
|
|
47
|
+
let encodedInput = "0x2895f3aa";
|
|
48
|
+
// amount
|
|
49
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[0]));
|
|
50
|
+
// from
|
|
51
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[1]));
|
|
52
|
+
// rateMode
|
|
53
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[2]));
|
|
54
|
+
// assetId
|
|
55
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[3]));
|
|
56
|
+
// useDefaultMarket
|
|
57
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[4]));
|
|
58
|
+
if (!this.args[4]) {
|
|
59
|
+
// market
|
|
60
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[5]));
|
|
61
|
+
}
|
|
62
|
+
return encodedInput;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint8, uint16, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3BorrowAction - Borrow a token from AaveV3
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3BorrowAction 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 amount Amount of tokens to be borrowed
|
|
13
|
+
* @param to The address we are sending the borrowed tokens to
|
|
14
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
15
|
+
* @param assetId The id of the token to be borrowed
|
|
16
|
+
* @param useOnBehalf use on behalf or default to proxy
|
|
17
|
+
* @param onBehalf On whose behalf we borrow the tokens, defaults to proxy
|
|
18
|
+
*/
|
|
19
|
+
constructor(useDefaultMarket: boolean, market: EthAddress, amount: uint256, to: EthAddress, rateMode: uint8, assetId: uint16, useOnBehalf: boolean, onBehalf?: EthAddress);
|
|
20
|
+
encodeInputs(): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { requireAddress } from "../../utils/general";
|
|
4
|
+
/**
|
|
5
|
+
* AaveV3BorrowAction - Borrow a token from AaveV3
|
|
6
|
+
*
|
|
7
|
+
* @category AaveV3
|
|
8
|
+
*/
|
|
9
|
+
export class AaveV3BorrowAction extends ActionWithL2 {
|
|
10
|
+
/**
|
|
11
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
12
|
+
* @param market Address provider for specific market
|
|
13
|
+
* @param amount Amount of tokens to be borrowed
|
|
14
|
+
* @param to The address we are sending the borrowed tokens to
|
|
15
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
16
|
+
* @param assetId The id of the token to be borrowed
|
|
17
|
+
* @param useOnBehalf use on behalf or default to proxy
|
|
18
|
+
* @param onBehalf On whose behalf we borrow the tokens, defaults to proxy
|
|
19
|
+
*/
|
|
20
|
+
constructor(useDefaultMarket, market, amount, to, rateMode, assetId, useOnBehalf, onBehalf = getAddr('Empty')) {
|
|
21
|
+
requireAddress(to);
|
|
22
|
+
super('AaveV3Borrow', getAddr('AaveV3Borrow'), ['uint256', 'address', 'uint8', 'uint16', 'bool', 'bool', 'address', 'address'], [amount, to, rateMode, assetId, useDefaultMarket, useOnBehalf, market, onBehalf]);
|
|
23
|
+
this.mappableArgs = [
|
|
24
|
+
this.args[0],
|
|
25
|
+
this.args[1],
|
|
26
|
+
this.args[2],
|
|
27
|
+
this.args[3],
|
|
28
|
+
this.args[4],
|
|
29
|
+
this.args[5],
|
|
30
|
+
this.args[6],
|
|
31
|
+
this.args[7],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
encodeInputs() {
|
|
35
|
+
// executeActionDirectL2
|
|
36
|
+
let encodedInput = "0x2895f3aa";
|
|
37
|
+
// amount
|
|
38
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[0]));
|
|
39
|
+
// to
|
|
40
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[1]));
|
|
41
|
+
// rateMode
|
|
42
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[2]));
|
|
43
|
+
// assetId
|
|
44
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[3]));
|
|
45
|
+
// useDefaultMarket
|
|
46
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[4]));
|
|
47
|
+
// useOnBehalf
|
|
48
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[5]));
|
|
49
|
+
if (!this.args[4]) {
|
|
50
|
+
// market
|
|
51
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[6]));
|
|
52
|
+
}
|
|
53
|
+
if (this.args[5]) {
|
|
54
|
+
// onBehalf
|
|
55
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[7]));
|
|
56
|
+
}
|
|
57
|
+
return encodedInput;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint8, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3ClaimRewardsAction
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3ClaimRewardsAction extends ActionWithL2 {
|
|
9
|
+
/**
|
|
10
|
+
* @param assetsLength Address provider for specific market
|
|
11
|
+
* @param amount length of two arrays
|
|
12
|
+
* @param to Address where claimed tokens will end up on .
|
|
13
|
+
* @param reward
|
|
14
|
+
* @param assets
|
|
15
|
+
*/
|
|
16
|
+
constructor(assetsLength: uint8, amount: uint256, to: EthAddress, reward: EthAddress, assets: Array<EthAddress>);
|
|
17
|
+
encodeInputs(): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { requireAddress } from "../../utils/general";
|
|
4
|
+
/**
|
|
5
|
+
* AaveV3ClaimRewardsAction
|
|
6
|
+
*
|
|
7
|
+
* @category AaveV3
|
|
8
|
+
*/
|
|
9
|
+
export class AaveV3ClaimRewardsAction extends ActionWithL2 {
|
|
10
|
+
/**
|
|
11
|
+
* @param assetsLength Address provider for specific market
|
|
12
|
+
* @param amount length of two arrays
|
|
13
|
+
* @param to Address where claimed tokens will end up on .
|
|
14
|
+
* @param reward
|
|
15
|
+
* @param assets
|
|
16
|
+
*/
|
|
17
|
+
constructor(assetsLength, amount, to, reward, assets) {
|
|
18
|
+
requireAddress(to);
|
|
19
|
+
super('AaveV3ClaimRewards', getAddr('AaveV3ClaimRewards'), ['uint8', 'uint256', 'address', 'address', 'address[]'], [assetsLength, amount, to, reward, assets]);
|
|
20
|
+
}
|
|
21
|
+
encodeInputs() {
|
|
22
|
+
// executeActionDirectL2
|
|
23
|
+
let encodedInput = "0x2895f3aa";
|
|
24
|
+
// assetsLength
|
|
25
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[0]));
|
|
26
|
+
// amount
|
|
27
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[1]));
|
|
28
|
+
// to
|
|
29
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[2]));
|
|
30
|
+
// reward
|
|
31
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[3]));
|
|
32
|
+
// assets
|
|
33
|
+
const arrayLength = this.args[0];
|
|
34
|
+
for (let i = 0; i < arrayLength; i++) {
|
|
35
|
+
// assets[i]
|
|
36
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[4][i]));
|
|
37
|
+
}
|
|
38
|
+
return encodedInput;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint8, uint16 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3CollateralSwitchAction - Aave enable/disable token usage as collateral for AaveV3 position
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3CollateralSwitchAction 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 arrayLength length of two arrays
|
|
13
|
+
* @param assetIds
|
|
14
|
+
* @param useAsCollateral
|
|
15
|
+
*/
|
|
16
|
+
constructor(useDefaultMarket: boolean, market: EthAddress, arrayLength: uint8, assetIds: Array<uint16>, useAsCollateral: Array<boolean>);
|
|
17
|
+
encodeInputs(): string;
|
|
18
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3CollateralSwitchAction - Aave enable/disable token usage as collateral for AaveV3 position
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV3CollateralSwitchAction 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 arrayLength length of two arrays
|
|
13
|
+
* @param assetIds
|
|
14
|
+
* @param useAsCollateral
|
|
15
|
+
*/
|
|
16
|
+
constructor(useDefaultMarket, market, arrayLength, assetIds, useAsCollateral) {
|
|
17
|
+
super('AaveV3CollateralSwitch', getAddr('AaveV3CollateralSwitch'), ['uint8', 'bool', 'uint16[]', 'bool[]', 'address'], [arrayLength, useDefaultMarket, assetIds, useAsCollateral, market]);
|
|
18
|
+
}
|
|
19
|
+
encodeInputs() {
|
|
20
|
+
// executeActionDirectL2
|
|
21
|
+
let encodedInput = "0x2895f3aa";
|
|
22
|
+
// arrayLength
|
|
23
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[0]));
|
|
24
|
+
// useDefaultMarket
|
|
25
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[1]));
|
|
26
|
+
const arrayLength = this.args[0];
|
|
27
|
+
for (let i = 0; i < arrayLength; i++) {
|
|
28
|
+
// assetIds[i]
|
|
29
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[2][i]));
|
|
30
|
+
// useAsCollateral[i]
|
|
31
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[3][i]));
|
|
32
|
+
}
|
|
33
|
+
if (!this.args[1]) {
|
|
34
|
+
// market
|
|
35
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[4]));
|
|
36
|
+
}
|
|
37
|
+
return encodedInput;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint8, uint16, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3PaybackAction - Payback debt on Aave using underlying token
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3PaybackAction extends ActionWithL2 {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param useOnDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
12
|
+
* @param market Address provider for specific market
|
|
13
|
+
* @param amount Amount of tokens to be payed back
|
|
14
|
+
* @param from Tokens will be supplied from this address
|
|
15
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
16
|
+
* @param tokenAddress Address of token to pay back.
|
|
17
|
+
* @param assetId The id of the underlying asset to be repaid
|
|
18
|
+
* @param useOnBehalf use on behalf param or default to proxy
|
|
19
|
+
* @param onBehalf For what user we are paying back the debt, defaults to proxy
|
|
20
|
+
*/
|
|
21
|
+
constructor(useOnDefaultMarket: boolean, market: EthAddress, amount: uint256, from: EthAddress, rateMode: uint8, tokenAddress: EthAddress, assetId: uint16, useOnBehalf: boolean, onBehalf?: EthAddress);
|
|
22
|
+
getAssetsToApprove(): Promise<{
|
|
23
|
+
asset: string;
|
|
24
|
+
owner: any;
|
|
25
|
+
}[]>;
|
|
26
|
+
encodeInputs(): string;
|
|
27
|
+
}
|
|
@@ -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
|
+
* AaveV3PaybackAction - Payback debt on Aave using underlying token
|
|
15
|
+
*
|
|
16
|
+
* @category AaveV3
|
|
17
|
+
*/
|
|
18
|
+
export class AaveV3PaybackAction extends ActionWithL2 {
|
|
19
|
+
/**
|
|
20
|
+
* @param useOnDefaultMarket 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 payed back
|
|
23
|
+
* @param from Tokens will be supplied from this address
|
|
24
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
25
|
+
* @param tokenAddress Address of token to pay back.
|
|
26
|
+
* @param assetId The id of the underlying asset to be repaid
|
|
27
|
+
* @param useOnBehalf use on behalf param or default to proxy
|
|
28
|
+
* @param onBehalf For what user we are paying back the debt, defaults to proxy
|
|
29
|
+
*/
|
|
30
|
+
constructor(useOnDefaultMarket, market, amount, from, rateMode, tokenAddress, assetId, useOnBehalf, onBehalf = getAddr('Empty')) {
|
|
31
|
+
super('AaveV3Payback', getAddr('AaveV3Payback'), ['uint256', 'address', 'uint8', 'uint16', 'bool', 'bool', 'address', 'address'], [amount, from, rateMode, assetId, useOnDefaultMarket, 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
|
+
// rateMode
|
|
60
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[2]));
|
|
61
|
+
// assetId
|
|
62
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(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,16 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint8 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3SetEModeAction - Set EMode for the proxy AaveV3 position
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3SetEModeAction extends ActionWithL2 {
|
|
9
|
+
/**
|
|
10
|
+
* @param useOnDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
11
|
+
* @param market Address provider for specific market
|
|
12
|
+
* @param categoryId ID of the category emode
|
|
13
|
+
*/
|
|
14
|
+
constructor(useOnDefaultMarket: boolean, market: EthAddress, categoryId: uint8);
|
|
15
|
+
encodeInputs(): string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3SetEModeAction - Set EMode for the proxy AaveV3 position
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export class AaveV3SetEModeAction extends ActionWithL2 {
|
|
9
|
+
/**
|
|
10
|
+
* @param useOnDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
11
|
+
* @param market Address provider for specific market
|
|
12
|
+
* @param categoryId ID of the category emode
|
|
13
|
+
*/
|
|
14
|
+
constructor(useOnDefaultMarket, market, categoryId) {
|
|
15
|
+
super('AaveV3SetEMode', getAddr('AaveV3SetEMode'), ['uint8', 'bool', 'address'], [categoryId, useOnDefaultMarket, market]);
|
|
16
|
+
this.mappableArgs = [
|
|
17
|
+
this.args[2],
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
encodeInputs() {
|
|
21
|
+
// executeActionDirectL2
|
|
22
|
+
let encodedInput = "0x2895f3aa";
|
|
23
|
+
// categoryId
|
|
24
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[0]));
|
|
25
|
+
// useOnDefaultMarket
|
|
26
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[1]));
|
|
27
|
+
if (!this.args[1]) {
|
|
28
|
+
// market
|
|
29
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[2]));
|
|
30
|
+
}
|
|
31
|
+
return encodedInput;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ActionWithL2 } from "../../ActionWithL2";
|
|
2
|
+
import { EthAddress, uint16, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* AaveV3SupplyAction - Supply token to an aave position on Aave V3
|
|
5
|
+
*
|
|
6
|
+
* @category AaveV3
|
|
7
|
+
*/
|
|
8
|
+
export declare class AaveV3SupplyAction extends ActionWithL2 {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param useDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
12
|
+
* @param market Address provider for specific market
|
|
13
|
+
* @param amount Amount of tokens to be deposited
|
|
14
|
+
* @param from Tokens will be supplied from this address
|
|
15
|
+
* @param tokenAddress Address of the token
|
|
16
|
+
* @param assetId The id of the token to be deposited
|
|
17
|
+
* @param enableAsColl If we need to enable asset as collateral
|
|
18
|
+
* @param useOnBehalf use on behalf param or default to proxy
|
|
19
|
+
* @param onBehalf For what user we are supplying the tokens, defaults to proxy
|
|
20
|
+
*/
|
|
21
|
+
constructor(useDefaultMarket: boolean, market: EthAddress, amount: uint256, from: EthAddress, tokenAddress: EthAddress, assetId: uint16, enableAsColl: boolean, useOnBehalf: boolean, onBehalf?: EthAddress);
|
|
22
|
+
getAssetsToApprove(): Promise<{
|
|
23
|
+
asset: string;
|
|
24
|
+
owner: any;
|
|
25
|
+
}[]>;
|
|
26
|
+
encodeInputs(): string;
|
|
27
|
+
}
|