@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.
Files changed (415) hide show
  1. package/esm/AccessLists/AaveAccessLists.d.ts +2 -0
  2. package/esm/AccessLists/AaveAccessLists.js +19 -0
  3. package/esm/AccessLists/BalancerAccessLists.d.ts +2 -0
  4. package/esm/AccessLists/BalancerAccessLists.js +14 -0
  5. package/esm/AccessLists/CompoundAccessLists.d.ts +2 -0
  6. package/esm/AccessLists/CompoundAccessLists.js +23 -0
  7. package/esm/AccessLists/DyDxAccessLists.d.ts +2 -0
  8. package/esm/AccessLists/DyDxAccessLists.js +6 -0
  9. package/esm/AccessLists/FlashLoanAccessLists.d.ts +2 -0
  10. package/esm/AccessLists/FlashLoanAccessLists.js +20 -0
  11. package/esm/AccessLists/GuniAccessLists.d.ts +2 -0
  12. package/esm/AccessLists/GuniAccessLists.js +10 -0
  13. package/esm/AccessLists/InstaAccessLists.d.ts +2 -0
  14. package/esm/AccessLists/InstaAccessLists.js +5 -0
  15. package/esm/AccessLists/LidoAccessLists.d.ts +2 -0
  16. package/esm/AccessLists/LidoAccessLists.js +15 -0
  17. package/esm/AccessLists/LiquityAccessLists.d.ts +2 -0
  18. package/esm/AccessLists/LiquityAccessLists.js +65 -0
  19. package/esm/AccessLists/MStableAccessLists.d.ts +2 -0
  20. package/esm/AccessLists/MStableAccessLists.js +12 -0
  21. package/esm/AccessLists/MakerAccessLists.d.ts +2 -0
  22. package/esm/AccessLists/MakerAccessLists.js +34 -0
  23. package/esm/AccessLists/RariAccessLists.d.ts +2 -0
  24. package/esm/AccessLists/RariAccessLists.js +8 -0
  25. package/esm/AccessLists/ReflexerAccessLists.d.ts +2 -0
  26. package/esm/AccessLists/ReflexerAccessLists.js +42 -0
  27. package/esm/AccessLists/UniswapAccessLists.d.ts +2 -0
  28. package/esm/AccessLists/UniswapAccessLists.js +31 -0
  29. package/esm/AccessLists/UtilsAccessLists.d.ts +2 -0
  30. package/esm/AccessLists/UtilsAccessLists.js +23 -0
  31. package/esm/AccessLists/YearnAccessLists.d.ts +2 -0
  32. package/esm/AccessLists/YearnAccessLists.js +9 -0
  33. package/esm/AccessLists/index.d.ts +3 -0
  34. package/esm/AccessLists/index.js +17 -0
  35. package/esm/src/Action.d.ts +77 -0
  36. package/esm/src/Action.js +193 -0
  37. package/esm/src/ActionWithL2.d.ts +20 -0
  38. package/esm/src/ActionWithL2.js +49 -0
  39. package/esm/src/DfsWeb3.d.ts +31 -0
  40. package/esm/src/DfsWeb3.js +124 -0
  41. package/esm/src/Recipe.d.ts +49 -0
  42. package/esm/src/Recipe.js +135 -0
  43. package/esm/src/Strategy.d.ts +19 -0
  44. package/esm/src/Strategy.js +47 -0
  45. package/esm/src/abis/Action.json +247 -0
  46. package/esm/src/abis/DFSProxyRegistry.json +193 -0
  47. package/esm/src/abis/DsProxy.json +218 -0
  48. package/esm/src/abis/Erc20.json +222 -0
  49. package/esm/src/abis/ProxyRegistry.json +65 -0
  50. package/esm/src/abis/Recipe.json +254 -0
  51. package/esm/src/actions/aave/AaveBorrowAction.d.ts +18 -0
  52. package/esm/src/actions/aave/AaveBorrowAction.js +22 -0
  53. package/esm/src/actions/aave/AaveClaimStkAaveAction.d.ts +15 -0
  54. package/esm/src/actions/aave/AaveClaimStkAaveAction.js +23 -0
  55. package/esm/src/actions/aave/AaveCollateralSwitchAction.d.ts +15 -0
  56. package/esm/src/actions/aave/AaveCollateralSwitchAction.js +18 -0
  57. package/esm/src/actions/aave/AavePaybackAction.d.ts +22 -0
  58. package/esm/src/actions/aave/AavePaybackAction.js +38 -0
  59. package/esm/src/actions/aave/AaveSupplyAction.d.ts +22 -0
  60. package/esm/src/actions/aave/AaveSupplyAction.js +45 -0
  61. package/esm/src/actions/aave/AaveWithdrawAction.d.ts +16 -0
  62. package/esm/src/actions/aave/AaveWithdrawAction.js +20 -0
  63. package/esm/src/actions/aave/index.d.ts +6 -0
  64. package/esm/src/actions/aave/index.js +6 -0
  65. package/esm/src/actions/aaveV3/AaveV3ATokenPaybackAction.d.ts +25 -0
  66. package/esm/src/actions/aaveV3/AaveV3ATokenPaybackAction.js +64 -0
  67. package/esm/src/actions/aaveV3/AaveV3BorrowAction.d.ts +21 -0
  68. package/esm/src/actions/aaveV3/AaveV3BorrowAction.js +59 -0
  69. package/esm/src/actions/aaveV3/AaveV3ClaimRewardsAction.d.ts +18 -0
  70. package/esm/src/actions/aaveV3/AaveV3ClaimRewardsAction.js +40 -0
  71. package/esm/src/actions/aaveV3/AaveV3CollateralSwitchAction.d.ts +18 -0
  72. package/esm/src/actions/aaveV3/AaveV3CollateralSwitchAction.js +39 -0
  73. package/esm/src/actions/aaveV3/AaveV3PaybackAction.d.ts +27 -0
  74. package/esm/src/actions/aaveV3/AaveV3PaybackAction.js +77 -0
  75. package/esm/src/actions/aaveV3/AaveV3SetEModeAction.d.ts +16 -0
  76. package/esm/src/actions/aaveV3/AaveV3SetEModeAction.js +33 -0
  77. package/esm/src/actions/aaveV3/AaveV3SupplyAction.d.ts +27 -0
  78. package/esm/src/actions/aaveV3/AaveV3SupplyAction.js +77 -0
  79. package/esm/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.d.ts +18 -0
  80. package/esm/src/actions/aaveV3/AaveV3SwapBorrowRateModeAction.js +38 -0
  81. package/esm/src/actions/aaveV3/AaveV3WithdrawAction.d.ts +18 -0
  82. package/esm/src/actions/aaveV3/AaveV3WithdrawAction.js +45 -0
  83. package/esm/src/actions/aaveV3/index.d.ts +9 -0
  84. package/esm/src/actions/aaveV3/index.js +9 -0
  85. package/esm/src/actions/balancer/BalancerV2ClaimAction.d.ts +20 -0
  86. package/esm/src/actions/balancer/BalancerV2ClaimAction.js +49 -0
  87. package/esm/src/actions/balancer/BalancerV2SupplyAction.d.ts +22 -0
  88. package/esm/src/actions/balancer/BalancerV2SupplyAction.js +52 -0
  89. package/esm/src/actions/balancer/BalancerV2WithdrawAction.d.ts +24 -0
  90. package/esm/src/actions/balancer/BalancerV2WithdrawAction.js +56 -0
  91. package/esm/src/actions/balancer/index.d.ts +3 -0
  92. package/esm/src/actions/balancer/index.js +3 -0
  93. package/esm/src/actions/basic/AutomationV2Unsub.d.ts +9 -0
  94. package/esm/src/actions/basic/AutomationV2Unsub.js +11 -0
  95. package/esm/src/actions/basic/ChangeProxyOwnerAction.d.ts +13 -0
  96. package/esm/src/actions/basic/ChangeProxyOwnerAction.js +15 -0
  97. package/esm/src/actions/basic/GasFeeAction.d.ts +14 -0
  98. package/esm/src/actions/basic/GasFeeAction.js +21 -0
  99. package/esm/src/actions/basic/GasFeeActionL2.d.ts +15 -0
  100. package/esm/src/actions/basic/GasFeeActionL2.js +22 -0
  101. package/esm/src/actions/basic/PullTokenAction.d.ts +19 -0
  102. package/esm/src/actions/basic/PullTokenAction.js +41 -0
  103. package/esm/src/actions/basic/SellAction.d.ts +23 -0
  104. package/esm/src/actions/basic/SellAction.js +61 -0
  105. package/esm/src/actions/basic/SendTokenAction.d.ts +15 -0
  106. package/esm/src/actions/basic/SendTokenAction.js +23 -0
  107. package/esm/src/actions/basic/SendTokenAndUnwrapAction.d.ts +15 -0
  108. package/esm/src/actions/basic/SendTokenAndUnwrapAction.js +23 -0
  109. package/esm/src/actions/basic/SubInputsAction.d.ts +10 -0
  110. package/esm/src/actions/basic/SubInputsAction.js +15 -0
  111. package/esm/src/actions/basic/SumInputsAction.d.ts +10 -0
  112. package/esm/src/actions/basic/SumInputsAction.js +15 -0
  113. package/esm/src/actions/basic/ToggleSubAction.d.ts +14 -0
  114. package/esm/src/actions/basic/ToggleSubAction.js +16 -0
  115. package/esm/src/actions/basic/TokenBalanceAction.d.ts +8 -0
  116. package/esm/src/actions/basic/TokenBalanceAction.js +13 -0
  117. package/esm/src/actions/basic/TransferNFTAction.d.ts +8 -0
  118. package/esm/src/actions/basic/TransferNFTAction.js +17 -0
  119. package/esm/src/actions/basic/UnwrapEthAction.d.ts +15 -0
  120. package/esm/src/actions/basic/UnwrapEthAction.js +30 -0
  121. package/esm/src/actions/basic/UpdateSubAction.d.ts +14 -0
  122. package/esm/src/actions/basic/UpdateSubAction.js +16 -0
  123. package/esm/src/actions/basic/WrapEthAction.d.ts +15 -0
  124. package/esm/src/actions/basic/WrapEthAction.js +36 -0
  125. package/esm/src/actions/basic/index.d.ts +16 -0
  126. package/esm/src/actions/basic/index.js +16 -0
  127. package/esm/src/actions/checkers/AaveV3RatioCheckAction.d.ts +14 -0
  128. package/esm/src/actions/checkers/AaveV3RatioCheckAction.js +20 -0
  129. package/esm/src/actions/checkers/CompoundV3RatioCheckAction.d.ts +16 -0
  130. package/esm/src/actions/checkers/CompoundV3RatioCheckAction.js +24 -0
  131. package/esm/src/actions/checkers/MakerRatioCheckAction.d.ts +17 -0
  132. package/esm/src/actions/checkers/MakerRatioCheckAction.js +25 -0
  133. package/esm/src/actions/checkers/index.d.ts +3 -0
  134. package/esm/src/actions/checkers/index.js +3 -0
  135. package/esm/src/actions/chickenBonds/CBChickenInAction.d.ts +14 -0
  136. package/esm/src/actions/chickenBonds/CBChickenInAction.js +18 -0
  137. package/esm/src/actions/chickenBonds/CBChickenOutAction.d.ts +15 -0
  138. package/esm/src/actions/chickenBonds/CBChickenOutAction.js +19 -0
  139. package/esm/src/actions/chickenBonds/CBCreateAction.d.ts +18 -0
  140. package/esm/src/actions/chickenBonds/CBCreateAction.js +32 -0
  141. package/esm/src/actions/chickenBonds/CBRedeemAction.d.ts +20 -0
  142. package/esm/src/actions/chickenBonds/CBRedeemAction.js +35 -0
  143. package/esm/src/actions/chickenBonds/index.d.ts +4 -0
  144. package/esm/src/actions/chickenBonds/index.js +4 -0
  145. package/esm/src/actions/compound/CompoundBorrowAction.d.ts +15 -0
  146. package/esm/src/actions/compound/CompoundBorrowAction.js +19 -0
  147. package/esm/src/actions/compound/CompoundClaimAction.d.ts +16 -0
  148. package/esm/src/actions/compound/CompoundClaimAction.js +24 -0
  149. package/esm/src/actions/compound/CompoundCollateralSwitchAction.d.ts +10 -0
  150. package/esm/src/actions/compound/CompoundCollateralSwitchAction.js +12 -0
  151. package/esm/src/actions/compound/CompoundGetDebtAction.d.ts +8 -0
  152. package/esm/src/actions/compound/CompoundGetDebtAction.js +13 -0
  153. package/esm/src/actions/compound/CompoundPaybackAction.d.ts +20 -0
  154. package/esm/src/actions/compound/CompoundPaybackAction.js +38 -0
  155. package/esm/src/actions/compound/CompoundSupplyAction.d.ts +20 -0
  156. package/esm/src/actions/compound/CompoundSupplyAction.js +43 -0
  157. package/esm/src/actions/compound/CompoundWithdrawAction.d.ts +15 -0
  158. package/esm/src/actions/compound/CompoundWithdrawAction.js +19 -0
  159. package/esm/src/actions/compound/index.d.ts +7 -0
  160. package/esm/src/actions/compound/index.js +7 -0
  161. package/esm/src/actions/compoundV3/CompoundV3AllowAction.d.ts +15 -0
  162. package/esm/src/actions/compoundV3/CompoundV3AllowAction.js +24 -0
  163. package/esm/src/actions/compoundV3/CompoundV3BorrowAction.d.ts +16 -0
  164. package/esm/src/actions/compoundV3/CompoundV3BorrowAction.js +26 -0
  165. package/esm/src/actions/compoundV3/CompoundV3ClaimAction.d.ts +16 -0
  166. package/esm/src/actions/compoundV3/CompoundV3ClaimAction.js +27 -0
  167. package/esm/src/actions/compoundV3/CompoundV3PaybackAction.d.ts +22 -0
  168. package/esm/src/actions/compoundV3/CompoundV3PaybackAction.js +48 -0
  169. package/esm/src/actions/compoundV3/CompoundV3SupplyAction.d.ts +22 -0
  170. package/esm/src/actions/compoundV3/CompoundV3SupplyAction.js +45 -0
  171. package/esm/src/actions/compoundV3/CompoundV3TransferAction.d.ts +17 -0
  172. package/esm/src/actions/compoundV3/CompoundV3TransferAction.js +30 -0
  173. package/esm/src/actions/compoundV3/CompoundV3WithdrawAction.d.ts +17 -0
  174. package/esm/src/actions/compoundV3/CompoundV3WithdrawAction.js +29 -0
  175. package/esm/src/actions/compoundV3/index.d.ts +7 -0
  176. package/esm/src/actions/compoundV3/index.js +7 -0
  177. package/esm/src/actions/convex/ConvexClaimAction.d.ts +17 -0
  178. package/esm/src/actions/convex/ConvexClaimAction.js +59 -0
  179. package/esm/src/actions/convex/ConvexDepositAction.d.ts +22 -0
  180. package/esm/src/actions/convex/ConvexDepositAction.js +66 -0
  181. package/esm/src/actions/convex/ConvexWithdrawAction.d.ts +22 -0
  182. package/esm/src/actions/convex/ConvexWithdrawAction.js +63 -0
  183. package/esm/src/actions/convex/index.d.ts +3 -0
  184. package/esm/src/actions/convex/index.js +3 -0
  185. package/esm/src/actions/curve/CurveClaimFeesAction.d.ts +13 -0
  186. package/esm/src/actions/curve/CurveClaimFeesAction.js +22 -0
  187. package/esm/src/actions/curve/CurveDepositAction.d.ts +18 -0
  188. package/esm/src/actions/curve/CurveDepositAction.js +78 -0
  189. package/esm/src/actions/curve/CurveGaugeDepositAction.d.ts +20 -0
  190. package/esm/src/actions/curve/CurveGaugeDepositAction.js +40 -0
  191. package/esm/src/actions/curve/CurveGaugeWithdrawAction.d.ts +14 -0
  192. package/esm/src/actions/curve/CurveGaugeWithdrawAction.js +22 -0
  193. package/esm/src/actions/curve/CurveMintCrvAction.d.ts +12 -0
  194. package/esm/src/actions/curve/CurveMintCrvAction.js +19 -0
  195. package/esm/src/actions/curve/CurveStethPoolDepositAction.d.ts +16 -0
  196. package/esm/src/actions/curve/CurveStethPoolDepositAction.js +27 -0
  197. package/esm/src/actions/curve/CurveStethPoolWithdrawAction.d.ts +17 -0
  198. package/esm/src/actions/curve/CurveStethPoolWithdrawAction.js +28 -0
  199. package/esm/src/actions/curve/CurveSwapAction.d.ts +22 -0
  200. package/esm/src/actions/curve/CurveSwapAction.js +43 -0
  201. package/esm/src/actions/curve/CurveWithdrawAction.d.ts +22 -0
  202. package/esm/src/actions/curve/CurveWithdrawAction.js +72 -0
  203. package/esm/src/actions/curve/index.d.ts +9 -0
  204. package/esm/src/actions/curve/index.js +9 -0
  205. package/esm/src/actions/dydx/DyDxWithdrawAction.d.ts +15 -0
  206. package/esm/src/actions/dydx/DyDxWithdrawAction.js +19 -0
  207. package/esm/src/actions/dydx/index.d.ts +1 -0
  208. package/esm/src/actions/dydx/index.js +1 -0
  209. package/esm/src/actions/flashloan/AaveV2FlashLoanAction.d.ts +18 -0
  210. package/esm/src/actions/flashloan/AaveV2FlashLoanAction.js +20 -0
  211. package/esm/src/actions/flashloan/AaveV2FlashLoanPaybackAction.d.ts +14 -0
  212. package/esm/src/actions/flashloan/AaveV2FlashLoanPaybackAction.js +16 -0
  213. package/esm/src/actions/flashloan/AaveV3FlashLoanAction.d.ts +18 -0
  214. package/esm/src/actions/flashloan/AaveV3FlashLoanAction.js +20 -0
  215. package/esm/src/actions/flashloan/AaveV3FlashLoanPaybackAction.d.ts +14 -0
  216. package/esm/src/actions/flashloan/AaveV3FlashLoanPaybackAction.js +16 -0
  217. package/esm/src/actions/flashloan/BalancerFlashLoanAction.d.ts +16 -0
  218. package/esm/src/actions/flashloan/BalancerFlashLoanAction.js +18 -0
  219. package/esm/src/actions/flashloan/BalancerFlashLoanPaybackAction.d.ts +14 -0
  220. package/esm/src/actions/flashloan/BalancerFlashLoanPaybackAction.js +16 -0
  221. package/esm/src/actions/flashloan/DyDxFlashLoanAction.d.ts +16 -0
  222. package/esm/src/actions/flashloan/DyDxFlashLoanAction.js +18 -0
  223. package/esm/src/actions/flashloan/DyDxFlashLoanPaybackAction.d.ts +14 -0
  224. package/esm/src/actions/flashloan/DyDxFlashLoanPaybackAction.js +16 -0
  225. package/esm/src/actions/flashloan/EulerFlashLoanAction.d.ts +16 -0
  226. package/esm/src/actions/flashloan/EulerFlashLoanAction.js +18 -0
  227. package/esm/src/actions/flashloan/EulerFlashLoanPaybackAction.d.ts +13 -0
  228. package/esm/src/actions/flashloan/EulerFlashLoanPaybackAction.js +15 -0
  229. package/esm/src/actions/flashloan/MakerFlashLoanAction.d.ts +15 -0
  230. package/esm/src/actions/flashloan/MakerFlashLoanAction.js +17 -0
  231. package/esm/src/actions/flashloan/MakerFlashLoanPaybackAction.d.ts +13 -0
  232. package/esm/src/actions/flashloan/MakerFlashLoanPaybackAction.js +15 -0
  233. package/esm/src/actions/flashloan/index.d.ts +12 -0
  234. package/esm/src/actions/flashloan/index.js +12 -0
  235. package/esm/src/actions/guni/GUniDeposit.d.ts +24 -0
  236. package/esm/src/actions/guni/GUniDeposit.js +47 -0
  237. package/esm/src/actions/guni/GUniWithdraw.d.ts +22 -0
  238. package/esm/src/actions/guni/GUniWithdraw.js +39 -0
  239. package/esm/src/actions/guni/index.d.ts +2 -0
  240. package/esm/src/actions/guni/index.js +2 -0
  241. package/esm/src/actions/index.d.ts +24 -0
  242. package/esm/src/actions/index.js +24 -0
  243. package/esm/src/actions/insta/InstPullTokensAction.d.ts +18 -0
  244. package/esm/src/actions/insta/InstPullTokensAction.js +36 -0
  245. package/esm/src/actions/insta/index.d.ts +1 -0
  246. package/esm/src/actions/insta/index.js +1 -0
  247. package/esm/src/actions/lido/LidoStakeAction.d.ts +19 -0
  248. package/esm/src/actions/lido/LidoStakeAction.js +34 -0
  249. package/esm/src/actions/lido/LidoUnwrapAction.d.ts +19 -0
  250. package/esm/src/actions/lido/LidoUnwrapAction.js +33 -0
  251. package/esm/src/actions/lido/LidoWrapAction.d.ts +20 -0
  252. package/esm/src/actions/lido/LidoWrapAction.js +45 -0
  253. package/esm/src/actions/lido/index.d.ts +3 -0
  254. package/esm/src/actions/lido/index.js +3 -0
  255. package/esm/src/actions/liquity/LiquityBorrowAction.d.ts +15 -0
  256. package/esm/src/actions/liquity/LiquityBorrowAction.js +24 -0
  257. package/esm/src/actions/liquity/LiquityClaimAction.d.ts +13 -0
  258. package/esm/src/actions/liquity/LiquityClaimAction.js +20 -0
  259. package/esm/src/actions/liquity/LiquityClaimSPRewardsAction.d.ts +14 -0
  260. package/esm/src/actions/liquity/LiquityClaimSPRewardsAction.js +18 -0
  261. package/esm/src/actions/liquity/LiquityClaimStakingRewardsAction.d.ts +14 -0
  262. package/esm/src/actions/liquity/LiquityClaimStakingRewardsAction.js +18 -0
  263. package/esm/src/actions/liquity/LiquityCloseAction.d.ts +18 -0
  264. package/esm/src/actions/liquity/LiquityCloseAction.js +38 -0
  265. package/esm/src/actions/liquity/LiquityEthGainToTroveAction.d.ts +13 -0
  266. package/esm/src/actions/liquity/LiquityEthGainToTroveAction.js +20 -0
  267. package/esm/src/actions/liquity/LiquityOpenAction.d.ts +21 -0
  268. package/esm/src/actions/liquity/LiquityOpenAction.js +44 -0
  269. package/esm/src/actions/liquity/LiquityPaybackAction.d.ts +18 -0
  270. package/esm/src/actions/liquity/LiquityPaybackAction.js +37 -0
  271. package/esm/src/actions/liquity/LiquityRedeemAction.d.ts +20 -0
  272. package/esm/src/actions/liquity/LiquityRedeemAction.js +42 -0
  273. package/esm/src/actions/liquity/LiquitySPDepositAction.d.ts +20 -0
  274. package/esm/src/actions/liquity/LiquitySPDepositAction.js +43 -0
  275. package/esm/src/actions/liquity/LiquitySPWithdrawAction.d.ts +16 -0
  276. package/esm/src/actions/liquity/LiquitySPWithdrawAction.js +28 -0
  277. package/esm/src/actions/liquity/LiquityStakeAction.d.ts +20 -0
  278. package/esm/src/actions/liquity/LiquityStakeAction.js +43 -0
  279. package/esm/src/actions/liquity/LiquitySupplyAction.d.ts +18 -0
  280. package/esm/src/actions/liquity/LiquitySupplyAction.js +37 -0
  281. package/esm/src/actions/liquity/LiquityUnstakeAction.d.ts +16 -0
  282. package/esm/src/actions/liquity/LiquityUnstakeAction.js +28 -0
  283. package/esm/src/actions/liquity/LiquityWithdrawAction.d.ts +14 -0
  284. package/esm/src/actions/liquity/LiquityWithdrawAction.js +22 -0
  285. package/esm/src/actions/liquity/index.d.ts +15 -0
  286. package/esm/src/actions/liquity/index.js +15 -0
  287. package/esm/src/actions/maker/MakerClaimAction.d.ts +15 -0
  288. package/esm/src/actions/maker/MakerClaimAction.js +24 -0
  289. package/esm/src/actions/maker/MakerGenerateAction.d.ts +16 -0
  290. package/esm/src/actions/maker/MakerGenerateAction.js +20 -0
  291. package/esm/src/actions/maker/MakerGiveAction.d.ts +16 -0
  292. package/esm/src/actions/maker/MakerGiveAction.js +25 -0
  293. package/esm/src/actions/maker/MakerMergeAction.d.ts +15 -0
  294. package/esm/src/actions/maker/MakerMergeAction.js +17 -0
  295. package/esm/src/actions/maker/MakerOpenVaultAction.d.ts +14 -0
  296. package/esm/src/actions/maker/MakerOpenVaultAction.js +16 -0
  297. package/esm/src/actions/maker/MakerPaybackAction.d.ts +20 -0
  298. package/esm/src/actions/maker/MakerPaybackAction.js +33 -0
  299. package/esm/src/actions/maker/MakerRatioAction.d.ts +13 -0
  300. package/esm/src/actions/maker/MakerRatioAction.js +15 -0
  301. package/esm/src/actions/maker/MakerSupplyAction.d.ts +21 -0
  302. package/esm/src/actions/maker/MakerSupplyAction.js +37 -0
  303. package/esm/src/actions/maker/MakerWithdrawAction.d.ts +17 -0
  304. package/esm/src/actions/maker/MakerWithdrawAction.js +21 -0
  305. package/esm/src/actions/maker/index.d.ts +9 -0
  306. package/esm/src/actions/maker/index.js +9 -0
  307. package/esm/src/actions/mstable/MStableClaimAction.d.ts +16 -0
  308. package/esm/src/actions/mstable/MStableClaimAction.js +25 -0
  309. package/esm/src/actions/mstable/MStableDepositAction.d.ts +25 -0
  310. package/esm/src/actions/mstable/MStableDepositAction.js +75 -0
  311. package/esm/src/actions/mstable/MStableWithdrawAction.d.ts +25 -0
  312. package/esm/src/actions/mstable/MStableWithdrawAction.js +74 -0
  313. package/esm/src/actions/mstable/index.d.ts +3 -0
  314. package/esm/src/actions/mstable/index.js +3 -0
  315. package/esm/src/actions/rari/RariDepositAction.d.ts +22 -0
  316. package/esm/src/actions/rari/RariDepositAction.js +41 -0
  317. package/esm/src/actions/rari/RariWithdrawAction.d.ts +23 -0
  318. package/esm/src/actions/rari/RariWithdrawAction.js +43 -0
  319. package/esm/src/actions/rari/index.d.ts +2 -0
  320. package/esm/src/actions/rari/index.js +2 -0
  321. package/esm/src/actions/reflexer/ReflexerGenerateAction.d.ts +15 -0
  322. package/esm/src/actions/reflexer/ReflexerGenerateAction.js +19 -0
  323. package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.d.ts +19 -0
  324. package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourDepositAction.js +37 -0
  325. package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.d.ts +14 -0
  326. package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourGetReservesAction.js +21 -0
  327. package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.d.ts +15 -0
  328. package/esm/src/actions/reflexer/ReflexerNativeUniV2SaviourWithdrawAction.js +23 -0
  329. package/esm/src/actions/reflexer/ReflexerOpenSafeAction.d.ts +13 -0
  330. package/esm/src/actions/reflexer/ReflexerOpenSafeAction.js +15 -0
  331. package/esm/src/actions/reflexer/ReflexerPaybackAction.d.ts +19 -0
  332. package/esm/src/actions/reflexer/ReflexerPaybackAction.js +32 -0
  333. package/esm/src/actions/reflexer/ReflexerSupplyAction.d.ts +21 -0
  334. package/esm/src/actions/reflexer/ReflexerSupplyAction.js +44 -0
  335. package/esm/src/actions/reflexer/ReflexerWithdrawAction.d.ts +16 -0
  336. package/esm/src/actions/reflexer/ReflexerWithdrawAction.js +20 -0
  337. package/esm/src/actions/reflexer/index.d.ts +8 -0
  338. package/esm/src/actions/reflexer/index.js +8 -0
  339. package/esm/src/actions/uniswap/UniswapSupplyAction.d.ts +26 -0
  340. package/esm/src/actions/uniswap/UniswapSupplyAction.js +65 -0
  341. package/esm/src/actions/uniswap/UniswapWithdrawAction.d.ts +25 -0
  342. package/esm/src/actions/uniswap/UniswapWithdrawAction.js +56 -0
  343. package/esm/src/actions/uniswap/index.d.ts +2 -0
  344. package/esm/src/actions/uniswap/index.js +2 -0
  345. package/esm/src/actions/uniswapV3/UniswapV3CollectAction.d.ts +24 -0
  346. package/esm/src/actions/uniswapV3/UniswapV3CollectAction.js +47 -0
  347. package/esm/src/actions/uniswapV3/UniswapV3CreatePoolAction.d.ts +30 -0
  348. package/esm/src/actions/uniswapV3/UniswapV3CreatePoolAction.js +69 -0
  349. package/esm/src/actions/uniswapV3/UniswapV3MintAction.d.ts +29 -0
  350. package/esm/src/actions/uniswapV3/UniswapV3MintAction.js +67 -0
  351. package/esm/src/actions/uniswapV3/UniswapV3SupplyAction.d.ts +26 -0
  352. package/esm/src/actions/uniswapV3/UniswapV3SupplyAction.js +60 -0
  353. package/esm/src/actions/uniswapV3/UniswapV3WithdrawAction.d.ts +28 -0
  354. package/esm/src/actions/uniswapV3/UniswapV3WithdrawAction.js +58 -0
  355. package/esm/src/actions/uniswapV3/index.d.ts +5 -0
  356. package/esm/src/actions/uniswapV3/index.js +5 -0
  357. package/esm/src/actions/yearn/YearnSupplyAction.d.ts +21 -0
  358. package/esm/src/actions/yearn/YearnSupplyAction.js +43 -0
  359. package/esm/src/actions/yearn/YearnWithdrawAction.d.ts +21 -0
  360. package/esm/src/actions/yearn/YearnWithdrawAction.js +43 -0
  361. package/esm/src/actions/yearn/index.d.ts +2 -0
  362. package/esm/src/actions/yearn/index.js +2 -0
  363. package/esm/src/addresses.d.ts +410 -0
  364. package/esm/src/addresses.js +257 -0
  365. package/esm/src/config.d.ts +20 -0
  366. package/esm/src/config.js +69 -0
  367. package/esm/src/index.d.ts +1549 -0
  368. package/esm/src/index.js +22 -0
  369. package/esm/src/triggers/AaveV3RatioTrigger.d.ts +10 -0
  370. package/esm/src/triggers/AaveV3RatioTrigger.js +12 -0
  371. package/esm/src/triggers/ChainLinkPriceTrigger.d.ts +10 -0
  372. package/esm/src/triggers/ChainLinkPriceTrigger.js +12 -0
  373. package/esm/src/triggers/CompV3RatioTrigger.d.ts +10 -0
  374. package/esm/src/triggers/CompV3RatioTrigger.js +12 -0
  375. package/esm/src/triggers/CompoundRatioTrigger.d.ts +10 -0
  376. package/esm/src/triggers/CompoundRatioTrigger.js +12 -0
  377. package/esm/src/triggers/GasPriceTrigger.d.ts +10 -0
  378. package/esm/src/triggers/GasPriceTrigger.js +12 -0
  379. package/esm/src/triggers/LiquityRatioTrigger.d.ts +10 -0
  380. package/esm/src/triggers/LiquityRatioTrigger.js +12 -0
  381. package/esm/src/triggers/MakerRatioTrigger.d.ts +10 -0
  382. package/esm/src/triggers/MakerRatioTrigger.js +12 -0
  383. package/esm/src/triggers/ReflexerRatioTrigger.d.ts +10 -0
  384. package/esm/src/triggers/ReflexerRatioTrigger.js +12 -0
  385. package/esm/src/triggers/TimestampTrigger.d.ts +10 -0
  386. package/esm/src/triggers/TimestampTrigger.js +12 -0
  387. package/esm/src/triggers/TrailingStopTrigger.d.ts +10 -0
  388. package/esm/src/triggers/TrailingStopTrigger.js +12 -0
  389. package/esm/src/triggers/UniV3CurrentTickTrigger.d.ts +10 -0
  390. package/esm/src/triggers/UniV3CurrentTickTrigger.js +12 -0
  391. package/esm/src/triggers/index.d.ts +11 -0
  392. package/esm/src/triggers/index.js +11 -0
  393. package/esm/src/types.d.ts +43 -0
  394. package/esm/src/types.js +1 -0
  395. package/esm/src/utils/convex-utils.d.ts +42 -0
  396. package/esm/src/utils/convex-utils.js +16 -0
  397. package/esm/src/utils/convexPoolInfo.json +1039 -0
  398. package/esm/src/utils/curve-utils.d.ts +4 -0
  399. package/esm/src/utils/curve-utils.js +6 -0
  400. package/esm/src/utils/curvePoolInfo.json +203 -0
  401. package/esm/src/utils/general.d.ts +17 -0
  402. package/esm/src/utils/general.js +39 -0
  403. package/esm/src/utils/index.d.ts +5 -0
  404. package/esm/src/utils/index.js +5 -0
  405. package/esm/src/utils/mstableAssetPairs.d.ts +9 -0
  406. package/esm/src/utils/mstableAssetPairs.js +8 -0
  407. package/esm/src/utils/uniswapLP.d.ts +19 -0
  408. package/esm/src/utils/uniswapLP.js +33 -0
  409. package/esm/src/utils/zeroExExchange.d.ts +39 -0
  410. package/esm/src/utils/zeroExExchange.js +169 -0
  411. package/package.json +3 -3
  412. package/{index.ts → src/index.ts} +13 -13
  413. package/tsconfig.json +1 -2
  414. package/umd/index.js +8639 -0
  415. 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,6 @@
1
+ export * from './AaveBorrowAction';
2
+ export * from './AaveSupplyAction';
3
+ export * from './AavePaybackAction';
4
+ export * from './AaveWithdrawAction';
5
+ export * from './AaveClaimStkAaveAction';
6
+ export * from './AaveCollateralSwitchAction';
@@ -0,0 +1,6 @@
1
+ export * from './AaveBorrowAction';
2
+ export * from './AaveSupplyAction';
3
+ export * from './AavePaybackAction';
4
+ export * from './AaveWithdrawAction';
5
+ export * from './AaveClaimStkAaveAction';
6
+ export * from './AaveCollateralSwitchAction';
@@ -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
+ }