@paraswap/dex-lib 4.1.12 → 4.1.13

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 (353) hide show
  1. package/.idea/aws.xml +17 -0
  2. package/.idea/codeStyles/Project.xml +19 -0
  3. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  4. package/.idea/misc.xml +6 -0
  5. package/.idea/modules.xml +8 -0
  6. package/.idea/paraswap-dex-lib.iml +9 -0
  7. package/.idea/prettier.xml +7 -0
  8. package/.idea/vcs.xml +6 -0
  9. package/build/abi/integral/factory.json +333 -0
  10. package/build/abi/integral/oracle.json +501 -0
  11. package/build/abi/{curve-v1/StableSwapUSDN.json → integral/pool.json} +487 -450
  12. package/build/abi/{RamsesV2Pool.abi.json → integral/relayer.json} +833 -851
  13. package/build/abi/{inception/inception-ineth.json → sdai/PSM3.abi.json} +354 -242
  14. package/build/abi/{angle-transmuter/ChainlinkEACAggregatorProxy.json → sdai/SSRAuthOracle.abi.json} +233 -220
  15. package/build/abi/uniswap-v4/pool-manager.abi.json +1366 -0
  16. package/build/abi/uniswap-v4/quoter.abi.json +461 -0
  17. package/build/abi/uniswap-v4/router.abi.json +230 -0
  18. package/build/abi/uniswap-v4/state-view.abi.json +365 -0
  19. package/build/dex/aave-v1/aave-v1.d.ts +1 -2
  20. package/build/dex/aave-v1/aave-v1.js +0 -22
  21. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  22. package/build/dex/bProtocol.d.ts +18 -0
  23. package/build/dex/bProtocol.js +39 -0
  24. package/build/dex/bProtocol.js.map +1 -0
  25. package/build/dex/bancor.d.ts +26 -0
  26. package/build/dex/bancor.js +58 -0
  27. package/build/dex/bancor.js.map +1 -0
  28. package/build/dex/compound.d.ts +18 -0
  29. package/build/dex/compound.js +46 -0
  30. package/build/dex/compound.js.map +1 -0
  31. package/build/dex/curve-v2.d.ts +58 -0
  32. package/build/dex/curve-v2.js +180 -0
  33. package/build/dex/curve-v2.js.map +1 -0
  34. package/build/dex/dodo-v1.d.ts +33 -0
  35. package/build/dex/dodo-v1.js +63 -0
  36. package/build/dex/dodo-v1.js.map +1 -0
  37. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +49 -0
  38. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +104 -0
  39. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +1 -0
  40. package/build/dex/index.js +2 -0
  41. package/build/dex/index.js.map +1 -1
  42. package/build/dex/integral/config.d.ts +4 -0
  43. package/build/dex/integral/config.js +20 -0
  44. package/build/dex/integral/config.js.map +1 -0
  45. package/build/dex/integral/context.d.ts +40 -0
  46. package/build/dex/integral/context.js +158 -0
  47. package/build/dex/integral/context.js.map +1 -0
  48. package/build/dex/integral/integral-factory.d.ts +24 -0
  49. package/build/dex/integral/integral-factory.js +95 -0
  50. package/build/dex/integral/integral-factory.js.map +1 -0
  51. package/build/dex/integral/integral-pool.d.ts +50 -0
  52. package/build/dex/integral/integral-pool.js +149 -0
  53. package/build/dex/integral/integral-pool.js.map +1 -0
  54. package/build/dex/integral/integral-pricing.d.ts +18 -0
  55. package/build/dex/integral/integral-pricing.js +114 -0
  56. package/build/dex/integral/integral-pricing.js.map +1 -0
  57. package/build/dex/integral/integral-relayer.d.ts +42 -0
  58. package/build/dex/integral/integral-relayer.js +192 -0
  59. package/build/dex/integral/integral-relayer.js.map +1 -0
  60. package/build/dex/integral/integral-token.d.ts +27 -0
  61. package/build/dex/integral/integral-token.js +59 -0
  62. package/build/dex/integral/integral-token.js.map +1 -0
  63. package/build/dex/{inception/inception-native.d.ts → integral/integral.d.ts} +19 -21
  64. package/build/dex/integral/integral.js +376 -0
  65. package/build/dex/integral/integral.js.map +1 -0
  66. package/build/dex/integral/types.d.ts +85 -0
  67. package/build/dex/integral/types.js +9 -0
  68. package/build/dex/integral/types.js.map +1 -0
  69. package/build/dex/integral/utils-e2e.d.ts +9 -0
  70. package/build/dex/integral/utils-e2e.js +131 -0
  71. package/build/dex/integral/utils-e2e.js.map +1 -0
  72. package/build/dex/integral/utils.d.ts +17 -0
  73. package/build/dex/integral/utils.js +94 -0
  74. package/build/dex/integral/utils.js.map +1 -0
  75. package/build/dex/jarvis.d.ts +1 -2
  76. package/build/dex/jarvis.js +0 -58
  77. package/build/dex/jarvis.js.map +1 -1
  78. package/build/dex/lido.d.ts +19 -0
  79. package/build/dex/lido.js +42 -0
  80. package/build/dex/lido.js.map +1 -0
  81. package/build/dex/m-token/config.d.ts +3 -0
  82. package/build/dex/m-token/config.js +19 -0
  83. package/build/dex/m-token/config.js.map +1 -0
  84. package/build/dex/m-token/m-token.d.ts +29 -0
  85. package/build/dex/m-token/m-token.js +145 -0
  86. package/build/dex/m-token/m-token.js.map +1 -0
  87. package/build/dex/m-token/m-wrapped-m.d.ts +17 -0
  88. package/build/dex/m-token/m-wrapped-m.js +50 -0
  89. package/build/dex/m-token/m-wrapped-m.js.map +1 -0
  90. package/build/dex/m-token/types.d.ts +12 -0
  91. package/build/dex/{inception → m-token}/types.js.map +1 -1
  92. package/build/dex/onebit.d.ts +25 -0
  93. package/build/dex/onebit.js +42 -0
  94. package/build/dex/onebit.js.map +1 -0
  95. package/build/dex/platypus/platypus.d.ts +1 -2
  96. package/build/dex/platypus/platypus.js +0 -31
  97. package/build/dex/platypus/platypus.js.map +1 -1
  98. package/build/dex/smoothy.d.ts +26 -0
  99. package/build/dex/smoothy.js +48 -0
  100. package/build/dex/smoothy.js.map +1 -0
  101. package/build/dex/spark/config.js.map +1 -1
  102. package/build/dex/spark/spark-psm.d.ts +51 -0
  103. package/build/dex/spark/spark-psm.js +276 -0
  104. package/build/dex/spark/spark-psm.js.map +1 -0
  105. package/build/dex/spark/spark-sdai-pool.d.ts +1 -1
  106. package/build/dex/spark/spark-sdai-pool.js.map +1 -1
  107. package/build/dex/spark/spark.d.ts +4 -3
  108. package/build/dex/spark/spark.js +4 -2
  109. package/build/dex/spark/spark.js.map +1 -1
  110. package/build/dex/spark/susds-psm.d.ts +49 -0
  111. package/build/dex/spark/susds-psm.js +245 -0
  112. package/build/dex/spark/susds-psm.js.map +1 -0
  113. package/build/dex/spark/types.d.ts +13 -2
  114. package/build/dex/spark/types.js +8 -1
  115. package/build/dex/spark/types.js.map +1 -1
  116. package/build/dex/spark/utils.d.ts +2 -1
  117. package/build/dex/spark/utils.js +23 -0
  118. package/build/dex/spark/utils.js.map +1 -1
  119. package/build/dex/stable-pool.d.ts +28 -0
  120. package/build/dex/stable-pool.js +62 -0
  121. package/build/dex/stable-pool.js.map +1 -0
  122. package/build/dex/swaap-v1/swaap-v1.d.ts +1 -2
  123. package/build/dex/swaap-v1/swaap-v1.js +0 -10
  124. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  125. package/build/dex/trader-joe-v2.1/optimizer.d.ts +2 -0
  126. package/build/dex/trader-joe-v2.1/optimizer.js +47 -0
  127. package/build/dex/trader-joe-v2.1/optimizer.js.map +1 -0
  128. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +7 -0
  129. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +20 -0
  130. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +1 -0
  131. package/build/dex/trader-joe-v2.1.d.ts +43 -0
  132. package/build/dex/trader-joe-v2.1.js +79 -0
  133. package/build/dex/trader-joe-v2.1.js.map +1 -0
  134. package/build/dex/uniswap-v4/config.d.ts +3 -0
  135. package/build/dex/uniswap-v4/config.js +58 -0
  136. package/build/dex/uniswap-v4/config.js.map +1 -0
  137. package/build/dex/uniswap-v4/constants.d.ts +7 -0
  138. package/build/dex/uniswap-v4/constants.js +18 -0
  139. package/build/dex/uniswap-v4/constants.js.map +1 -0
  140. package/build/dex/uniswap-v4/contract-math/BitMath.d.ts +4 -0
  141. package/build/dex/uniswap-v4/contract-math/BitMath.js +93 -0
  142. package/build/dex/uniswap-v4/contract-math/BitMath.js.map +1 -0
  143. package/build/dex/uniswap-v4/contract-math/FixedPoint128.d.ts +3 -0
  144. package/build/dex/uniswap-v4/contract-math/FixedPoint128.js +8 -0
  145. package/build/dex/uniswap-v4/contract-math/FixedPoint128.js.map +1 -0
  146. package/build/dex/uniswap-v4/contract-math/FixedPoint96.d.ts +4 -0
  147. package/build/dex/uniswap-v4/contract-math/FixedPoint96.js +9 -0
  148. package/build/dex/uniswap-v4/contract-math/FixedPoint96.js.map +1 -0
  149. package/build/dex/uniswap-v4/contract-math/FullMath.d.ts +4 -0
  150. package/build/dex/uniswap-v4/contract-math/FullMath.js +19 -0
  151. package/build/dex/uniswap-v4/contract-math/FullMath.js.map +1 -0
  152. package/build/dex/uniswap-v4/contract-math/LiquidityMath.d.ts +3 -0
  153. package/build/dex/uniswap-v4/contract-math/LiquidityMath.js +22 -0
  154. package/build/dex/uniswap-v4/contract-math/LiquidityMath.js.map +1 -0
  155. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.d.ts +10 -0
  156. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.js +91 -0
  157. package/build/dex/uniswap-v4/contract-math/SqrtPriceMath.js.map +1 -0
  158. package/build/dex/uniswap-v4/contract-math/SwapMath.d.ts +8 -0
  159. package/build/dex/uniswap-v4/contract-math/SwapMath.js +70 -0
  160. package/build/dex/uniswap-v4/contract-math/SwapMath.js.map +1 -0
  161. package/build/dex/uniswap-v4/contract-math/TickBitMap.d.ts +7 -0
  162. package/build/dex/uniswap-v4/contract-math/TickBitMap.js +86 -0
  163. package/build/dex/uniswap-v4/contract-math/TickBitMap.js.map +1 -0
  164. package/build/dex/uniswap-v4/contract-math/TickMath.d.ts +8 -0
  165. package/build/dex/uniswap-v4/contract-math/TickMath.js +162 -0
  166. package/build/dex/uniswap-v4/contract-math/TickMath.js.map +1 -0
  167. package/build/dex/uniswap-v4/contract-math/UnsafeMath.d.ts +3 -0
  168. package/build/dex/uniswap-v4/contract-math/UnsafeMath.js +10 -0
  169. package/build/dex/uniswap-v4/contract-math/UnsafeMath.js.map +1 -0
  170. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.d.ts +8 -0
  171. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.js +11 -0
  172. package/build/dex/uniswap-v4/contract-math/uniswap-v4-math.js.map +1 -0
  173. package/build/dex/uniswap-v4/encoder.d.ts +16 -0
  174. package/build/dex/uniswap-v4/encoder.js +104 -0
  175. package/build/dex/uniswap-v4/encoder.js.map +1 -0
  176. package/build/dex/uniswap-v4/subgraph.d.ts +5 -0
  177. package/build/dex/uniswap-v4/subgraph.js +80 -0
  178. package/build/dex/uniswap-v4/subgraph.js.map +1 -0
  179. package/build/dex/uniswap-v4/types.d.ts +64 -0
  180. package/build/dex/uniswap-v4/types.js +3 -0
  181. package/build/dex/uniswap-v4/types.js.map +1 -0
  182. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.d.ts +33 -0
  183. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js +152 -0
  184. package/build/dex/uniswap-v4/uniswap-v4-pool-manager.js.map +1 -0
  185. package/build/dex/uniswap-v4/uniswap-v4.d.ts +38 -0
  186. package/build/dex/uniswap-v4/uniswap-v4.js +169 -0
  187. package/build/dex/uniswap-v4/uniswap-v4.js.map +1 -0
  188. package/build/dex/uniswap-v4/utils.d.ts +2 -0
  189. package/build/dex/uniswap-v4/utils.js +15 -0
  190. package/build/dex/uniswap-v4/utils.js.map +1 -0
  191. package/build/dex/zerox/index.d.ts +26 -4
  192. package/build/dex/zerox/index.js +42 -50
  193. package/build/dex/zerox/index.js.map +1 -1
  194. package/build/dex/zerox/types.d.ts +0 -29
  195. package/build/dex/zerox/types.js +1 -8
  196. package/build/dex/zerox/types.js.map +1 -1
  197. package/package.json +1 -1
  198. package/src/abi/sdai/PSM3.abi.json +721 -0
  199. package/src/abi/sdai/SSRAuthOracle.abi.json +522 -0
  200. package/src/dex/index.ts +2 -0
  201. package/src/dex/spark/config.ts +15 -2
  202. package/src/dex/spark/spark-e2e.test.ts +130 -13
  203. package/src/dex/spark/spark-events.test.ts +97 -0
  204. package/src/dex/spark/spark-integration.test.ts +256 -0
  205. package/src/dex/spark/spark-psm.ts +361 -0
  206. package/src/dex/spark/spark-sdai-pool.ts +1 -2
  207. package/src/dex/spark/spark.ts +4 -3
  208. package/src/dex/spark/types.ts +17 -2
  209. package/src/dex/spark/utils.ts +41 -1
  210. package/tests/constants-e2e.ts +18 -3
  211. package/build/abi/Aave_GSM.json +0 -751
  212. package/build/abi/Balancer.json +0 -257
  213. package/build/abi/BalancerV2.json +0 -1179
  214. package/build/abi/RamsesV2Quoter.abi.json +0 -274
  215. package/build/abi/USDM.json +0 -807
  216. package/build/abi/UniswapV2Router.json +0 -397
  217. package/build/abi/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +0 -1246
  218. package/build/abi/curve-v1/CurveBUSDv2.abi.json +0 -1356
  219. package/build/abi/curve-v1/CurveTokenV1.json +0 -305
  220. package/build/abi/curve-v1/CurveTokenV2.json +0 -318
  221. package/build/abi/curve-v1/CurveV1StableNg.json +0 -1452
  222. package/build/abi/curve-v1/CurveV2Swap.json +0 -700
  223. package/build/abi/curve-v1/FactoryCryptoRegistry.json +0 -316
  224. package/build/abi/curve-v1/FactoryRegistry.json +0 -508
  225. package/build/abi/curve-v1/StableSwapAave.json +0 -1152
  226. package/build/abi/curve-v1/StableSwapBUSD.json +0 -814
  227. package/build/abi/curve-v1/StableSwapCompound.json +0 -814
  228. package/build/abi/curve-v1/StableSwapIDLE.json +0 -1253
  229. package/build/abi/curve-v1/StableSwapPax.json +0 -865
  230. package/build/abi/curve-v1/StableSwapSnow.json +0 -900
  231. package/build/abi/curve-v1/StableSwapUSDT.json +0 -814
  232. package/build/abi/curve-v1/StableSwapY.json +0 -814
  233. package/build/abi/inception/inception-ineth-pool.json +0 -1062
  234. package/build/abi/inception/inception-ratio-feed.json +0 -329
  235. package/build/abi/inception/inception-vault.json +0 -991
  236. package/build/abi/kyberdmm/kyber-storage.abi.json +0 -824
  237. package/build/abi/kyberdmm.abi.json +0 -1148
  238. package/build/abi/maverick-v2/MaverickV2Quoter.json +0 -278
  239. package/build/abi/nerve/nerve-metapool.json +0 -790
  240. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +0 -193
  241. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +0 -267
  242. package/build/dex/balancer-v1/balancer-pools.json +0 -33333
  243. package/build/dex/bebop/websocket-fetcher.d.ts +0 -35
  244. package/build/dex/bebop/websocket-fetcher.js +0 -87
  245. package/build/dex/bebop/websocket-fetcher.js.map +0 -1
  246. package/build/dex/idle-dao/idle-dao-pool.d.ts +0 -56
  247. package/build/dex/idle-dao/idle-dao-pool.js +0 -176
  248. package/build/dex/idle-dao/idle-dao-pool.js.map +0 -1
  249. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +0 -16
  250. package/build/dex/idle-dao/idle-dao-pooling-pool.js +0 -57
  251. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +0 -1
  252. package/build/dex/idle-dao/scripts.d.ts +0 -9
  253. package/build/dex/idle-dao/scripts.js +0 -552
  254. package/build/dex/idle-dao/scripts.js.map +0 -1
  255. package/build/dex/inception/config.d.ts +0 -4
  256. package/build/dex/inception/config.js +0 -109
  257. package/build/dex/inception/config.js.map +0 -1
  258. package/build/dex/inception/inception-event-pool.d.ts +0 -16
  259. package/build/dex/inception/inception-event-pool.js +0 -51
  260. package/build/dex/inception/inception-event-pool.js.map +0 -1
  261. package/build/dex/inception/inception-native.js +0 -131
  262. package/build/dex/inception/inception-native.js.map +0 -1
  263. package/build/dex/inception/inception-pool.d.ts +0 -18
  264. package/build/dex/inception/inception-pool.js +0 -32
  265. package/build/dex/inception/inception-pool.js.map +0 -1
  266. package/build/dex/inception/inception-price-feed.d.ts +0 -19
  267. package/build/dex/inception/inception-price-feed.js +0 -51
  268. package/build/dex/inception/inception-price-feed.js.map +0 -1
  269. package/build/dex/inception/inception.d.ts +0 -43
  270. package/build/dex/inception/inception.js +0 -204
  271. package/build/dex/inception/inception.js.map +0 -1
  272. package/build/dex/inception/tokens.d.ts +0 -9
  273. package/build/dex/inception/tokens.js +0 -28
  274. package/build/dex/inception/tokens.js.map +0 -1
  275. package/build/dex/inception/types.d.ts +0 -22
  276. package/build/dex/inception/utils.d.ts +0 -6
  277. package/build/dex/inception/utils.js +0 -37
  278. package/build/dex/inception/utils.js.map +0 -1
  279. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -16
  280. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -16
  281. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -16
  282. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -16
  283. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -16
  284. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -16
  285. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -16
  286. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -16
  287. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -9
  288. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -9
  289. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -9
  290. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +0 -9
  291. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +0 -9
  292. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -9
  293. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +0 -9
  294. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +0 -9
  295. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +0 -9
  296. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -12
  297. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -7
  298. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -7
  299. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -7
  300. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -7
  301. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -12
  302. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +0 -7
  303. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +0 -7
  304. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +0 -78
  305. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +0 -81
  306. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +0 -78
  307. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +0 -78
  308. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +0 -81
  309. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +0 -81
  310. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +0 -81
  311. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +0 -81
  312. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +0 -64
  313. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +0 -85
  314. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +0 -64
  315. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +0 -52
  316. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +0 -52
  317. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +0 -52
  318. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +0 -55
  319. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +0 -55
  320. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +0 -55
  321. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -23
  322. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -37
  323. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -23
  324. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -23
  325. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -51
  326. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +0 -58
  327. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -23
  328. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -23
  329. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -9
  330. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -16
  331. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -23
  332. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -12
  333. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -7
  334. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -12
  335. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -12
  336. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -7
  337. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +0 -7
  338. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -7
  339. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -7
  340. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -7
  341. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -7
  342. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +0 -130
  343. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +0 -136
  344. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +0 -100
  345. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +0 -100
  346. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +0 -166
  347. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +0 -190
  348. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +0 -114
  349. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +0 -114
  350. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +0 -55
  351. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +0 -73
  352. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +0 -82
  353. /package/build/dex/{inception → m-token}/types.js +0 -0
@@ -0,0 +1,230 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "components": [
6
+ { "internalType": "address", "name": "permit2", "type": "address" },
7
+ { "internalType": "address", "name": "weth9", "type": "address" },
8
+ { "internalType": "address", "name": "v2Factory", "type": "address" },
9
+ { "internalType": "address", "name": "v3Factory", "type": "address" },
10
+ {
11
+ "internalType": "bytes32",
12
+ "name": "pairInitCodeHash",
13
+ "type": "bytes32"
14
+ },
15
+ {
16
+ "internalType": "bytes32",
17
+ "name": "poolInitCodeHash",
18
+ "type": "bytes32"
19
+ },
20
+ {
21
+ "internalType": "address",
22
+ "name": "v4PoolManager",
23
+ "type": "address"
24
+ },
25
+ {
26
+ "internalType": "address",
27
+ "name": "v3NFTPositionManager",
28
+ "type": "address"
29
+ },
30
+ {
31
+ "internalType": "address",
32
+ "name": "v4PositionManager",
33
+ "type": "address"
34
+ }
35
+ ],
36
+ "internalType": "struct RouterParameters",
37
+ "name": "params",
38
+ "type": "tuple"
39
+ }
40
+ ],
41
+ "stateMutability": "nonpayable",
42
+ "type": "constructor"
43
+ },
44
+ { "inputs": [], "name": "BalanceTooLow", "type": "error" },
45
+ { "inputs": [], "name": "ContractLocked", "type": "error" },
46
+ {
47
+ "inputs": [
48
+ { "internalType": "Currency", "name": "currency", "type": "address" }
49
+ ],
50
+ "name": "DeltaNotNegative",
51
+ "type": "error"
52
+ },
53
+ {
54
+ "inputs": [
55
+ { "internalType": "Currency", "name": "currency", "type": "address" }
56
+ ],
57
+ "name": "DeltaNotPositive",
58
+ "type": "error"
59
+ },
60
+ { "inputs": [], "name": "ETHNotAccepted", "type": "error" },
61
+ {
62
+ "inputs": [
63
+ { "internalType": "uint256", "name": "commandIndex", "type": "uint256" },
64
+ { "internalType": "bytes", "name": "message", "type": "bytes" }
65
+ ],
66
+ "name": "ExecutionFailed",
67
+ "type": "error"
68
+ },
69
+ { "inputs": [], "name": "FromAddressIsNotOwner", "type": "error" },
70
+ { "inputs": [], "name": "InputLengthMismatch", "type": "error" },
71
+ { "inputs": [], "name": "InsufficientBalance", "type": "error" },
72
+ { "inputs": [], "name": "InsufficientETH", "type": "error" },
73
+ { "inputs": [], "name": "InsufficientToken", "type": "error" },
74
+ {
75
+ "inputs": [
76
+ { "internalType": "bytes4", "name": "action", "type": "bytes4" }
77
+ ],
78
+ "name": "InvalidAction",
79
+ "type": "error"
80
+ },
81
+ { "inputs": [], "name": "InvalidBips", "type": "error" },
82
+ {
83
+ "inputs": [
84
+ { "internalType": "uint256", "name": "commandType", "type": "uint256" }
85
+ ],
86
+ "name": "InvalidCommandType",
87
+ "type": "error"
88
+ },
89
+ { "inputs": [], "name": "InvalidEthSender", "type": "error" },
90
+ { "inputs": [], "name": "InvalidPath", "type": "error" },
91
+ { "inputs": [], "name": "InvalidReserves", "type": "error" },
92
+ { "inputs": [], "name": "LengthMismatch", "type": "error" },
93
+ {
94
+ "inputs": [
95
+ { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
96
+ ],
97
+ "name": "NotAuthorizedForToken",
98
+ "type": "error"
99
+ },
100
+ { "inputs": [], "name": "NotPoolManager", "type": "error" },
101
+ { "inputs": [], "name": "OnlyMintAllowed", "type": "error" },
102
+ { "inputs": [], "name": "SliceOutOfBounds", "type": "error" },
103
+ { "inputs": [], "name": "TransactionDeadlinePassed", "type": "error" },
104
+ { "inputs": [], "name": "UnsafeCast", "type": "error" },
105
+ {
106
+ "inputs": [
107
+ { "internalType": "uint256", "name": "action", "type": "uint256" }
108
+ ],
109
+ "name": "UnsupportedAction",
110
+ "type": "error"
111
+ },
112
+ { "inputs": [], "name": "V2InvalidPath", "type": "error" },
113
+ { "inputs": [], "name": "V2TooLittleReceived", "type": "error" },
114
+ { "inputs": [], "name": "V2TooMuchRequested", "type": "error" },
115
+ { "inputs": [], "name": "V3InvalidAmountOut", "type": "error" },
116
+ { "inputs": [], "name": "V3InvalidCaller", "type": "error" },
117
+ { "inputs": [], "name": "V3InvalidSwap", "type": "error" },
118
+ { "inputs": [], "name": "V3TooLittleReceived", "type": "error" },
119
+ { "inputs": [], "name": "V3TooMuchRequested", "type": "error" },
120
+ {
121
+ "inputs": [
122
+ {
123
+ "internalType": "uint256",
124
+ "name": "minAmountOutReceived",
125
+ "type": "uint256"
126
+ },
127
+ { "internalType": "uint256", "name": "amountReceived", "type": "uint256" }
128
+ ],
129
+ "name": "V4TooLittleReceived",
130
+ "type": "error"
131
+ },
132
+ {
133
+ "inputs": [
134
+ {
135
+ "internalType": "uint256",
136
+ "name": "maxAmountInRequested",
137
+ "type": "uint256"
138
+ },
139
+ {
140
+ "internalType": "uint256",
141
+ "name": "amountRequested",
142
+ "type": "uint256"
143
+ }
144
+ ],
145
+ "name": "V4TooMuchRequested",
146
+ "type": "error"
147
+ },
148
+ {
149
+ "inputs": [],
150
+ "name": "V3_POSITION_MANAGER",
151
+ "outputs": [
152
+ {
153
+ "internalType": "contract INonfungiblePositionManager",
154
+ "name": "",
155
+ "type": "address"
156
+ }
157
+ ],
158
+ "stateMutability": "view",
159
+ "type": "function"
160
+ },
161
+ {
162
+ "inputs": [],
163
+ "name": "V4_POSITION_MANAGER",
164
+ "outputs": [
165
+ {
166
+ "internalType": "contract IPositionManager",
167
+ "name": "",
168
+ "type": "address"
169
+ }
170
+ ],
171
+ "stateMutability": "view",
172
+ "type": "function"
173
+ },
174
+ {
175
+ "inputs": [
176
+ { "internalType": "bytes", "name": "commands", "type": "bytes" },
177
+ { "internalType": "bytes[]", "name": "inputs", "type": "bytes[]" }
178
+ ],
179
+ "name": "execute",
180
+ "outputs": [],
181
+ "stateMutability": "payable",
182
+ "type": "function"
183
+ },
184
+ {
185
+ "inputs": [
186
+ { "internalType": "bytes", "name": "commands", "type": "bytes" },
187
+ { "internalType": "bytes[]", "name": "inputs", "type": "bytes[]" },
188
+ { "internalType": "uint256", "name": "deadline", "type": "uint256" }
189
+ ],
190
+ "name": "execute",
191
+ "outputs": [],
192
+ "stateMutability": "payable",
193
+ "type": "function"
194
+ },
195
+ {
196
+ "inputs": [],
197
+ "name": "msgSender",
198
+ "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
199
+ "stateMutability": "view",
200
+ "type": "function"
201
+ },
202
+ {
203
+ "inputs": [],
204
+ "name": "poolManager",
205
+ "outputs": [
206
+ { "internalType": "contract IPoolManager", "name": "", "type": "address" }
207
+ ],
208
+ "stateMutability": "view",
209
+ "type": "function"
210
+ },
211
+ {
212
+ "inputs": [
213
+ { "internalType": "int256", "name": "amount0Delta", "type": "int256" },
214
+ { "internalType": "int256", "name": "amount1Delta", "type": "int256" },
215
+ { "internalType": "bytes", "name": "data", "type": "bytes" }
216
+ ],
217
+ "name": "uniswapV3SwapCallback",
218
+ "outputs": [],
219
+ "stateMutability": "nonpayable",
220
+ "type": "function"
221
+ },
222
+ {
223
+ "inputs": [{ "internalType": "bytes", "name": "data", "type": "bytes" }],
224
+ "name": "unlockCallback",
225
+ "outputs": [{ "internalType": "bytes", "name": "", "type": "bytes" }],
226
+ "stateMutability": "nonpayable",
227
+ "type": "function"
228
+ },
229
+ { "stateMutability": "payable", "type": "receive" }
230
+ ]
@@ -0,0 +1,365 @@
1
+ [
2
+ {
3
+ "inputs": [
4
+ {
5
+ "internalType": "contract IPoolManager",
6
+ "name": "_poolManager",
7
+ "type": "address"
8
+ }
9
+ ],
10
+ "stateMutability": "nonpayable",
11
+ "type": "constructor"
12
+ },
13
+ {
14
+ "inputs": [
15
+ {
16
+ "internalType": "PoolId",
17
+ "name": "poolId",
18
+ "type": "bytes32"
19
+ }
20
+ ],
21
+ "name": "getFeeGrowthGlobals",
22
+ "outputs": [
23
+ {
24
+ "internalType": "uint256",
25
+ "name": "feeGrowthGlobal0",
26
+ "type": "uint256"
27
+ },
28
+ {
29
+ "internalType": "uint256",
30
+ "name": "feeGrowthGlobal1",
31
+ "type": "uint256"
32
+ }
33
+ ],
34
+ "stateMutability": "view",
35
+ "type": "function"
36
+ },
37
+ {
38
+ "inputs": [
39
+ {
40
+ "internalType": "PoolId",
41
+ "name": "poolId",
42
+ "type": "bytes32"
43
+ },
44
+ {
45
+ "internalType": "int24",
46
+ "name": "tickLower",
47
+ "type": "int24"
48
+ },
49
+ {
50
+ "internalType": "int24",
51
+ "name": "tickUpper",
52
+ "type": "int24"
53
+ }
54
+ ],
55
+ "name": "getFeeGrowthInside",
56
+ "outputs": [
57
+ {
58
+ "internalType": "uint256",
59
+ "name": "feeGrowthInside0X128",
60
+ "type": "uint256"
61
+ },
62
+ {
63
+ "internalType": "uint256",
64
+ "name": "feeGrowthInside1X128",
65
+ "type": "uint256"
66
+ }
67
+ ],
68
+ "stateMutability": "view",
69
+ "type": "function"
70
+ },
71
+ {
72
+ "inputs": [
73
+ {
74
+ "internalType": "PoolId",
75
+ "name": "poolId",
76
+ "type": "bytes32"
77
+ }
78
+ ],
79
+ "name": "getLiquidity",
80
+ "outputs": [
81
+ {
82
+ "internalType": "uint128",
83
+ "name": "liquidity",
84
+ "type": "uint128"
85
+ }
86
+ ],
87
+ "stateMutability": "view",
88
+ "type": "function"
89
+ },
90
+ {
91
+ "inputs": [
92
+ {
93
+ "internalType": "PoolId",
94
+ "name": "poolId",
95
+ "type": "bytes32"
96
+ },
97
+ {
98
+ "internalType": "bytes32",
99
+ "name": "positionId",
100
+ "type": "bytes32"
101
+ }
102
+ ],
103
+ "name": "getPositionInfo",
104
+ "outputs": [
105
+ {
106
+ "internalType": "uint128",
107
+ "name": "liquidity",
108
+ "type": "uint128"
109
+ },
110
+ {
111
+ "internalType": "uint256",
112
+ "name": "feeGrowthInside0LastX128",
113
+ "type": "uint256"
114
+ },
115
+ {
116
+ "internalType": "uint256",
117
+ "name": "feeGrowthInside1LastX128",
118
+ "type": "uint256"
119
+ }
120
+ ],
121
+ "stateMutability": "view",
122
+ "type": "function"
123
+ },
124
+ {
125
+ "inputs": [
126
+ {
127
+ "internalType": "PoolId",
128
+ "name": "poolId",
129
+ "type": "bytes32"
130
+ },
131
+ {
132
+ "internalType": "address",
133
+ "name": "owner",
134
+ "type": "address"
135
+ },
136
+ {
137
+ "internalType": "int24",
138
+ "name": "tickLower",
139
+ "type": "int24"
140
+ },
141
+ {
142
+ "internalType": "int24",
143
+ "name": "tickUpper",
144
+ "type": "int24"
145
+ },
146
+ {
147
+ "internalType": "bytes32",
148
+ "name": "salt",
149
+ "type": "bytes32"
150
+ }
151
+ ],
152
+ "name": "getPositionInfo",
153
+ "outputs": [
154
+ {
155
+ "internalType": "uint128",
156
+ "name": "liquidity",
157
+ "type": "uint128"
158
+ },
159
+ {
160
+ "internalType": "uint256",
161
+ "name": "feeGrowthInside0LastX128",
162
+ "type": "uint256"
163
+ },
164
+ {
165
+ "internalType": "uint256",
166
+ "name": "feeGrowthInside1LastX128",
167
+ "type": "uint256"
168
+ }
169
+ ],
170
+ "stateMutability": "view",
171
+ "type": "function"
172
+ },
173
+ {
174
+ "inputs": [
175
+ {
176
+ "internalType": "PoolId",
177
+ "name": "poolId",
178
+ "type": "bytes32"
179
+ },
180
+ {
181
+ "internalType": "bytes32",
182
+ "name": "positionId",
183
+ "type": "bytes32"
184
+ }
185
+ ],
186
+ "name": "getPositionLiquidity",
187
+ "outputs": [
188
+ {
189
+ "internalType": "uint128",
190
+ "name": "liquidity",
191
+ "type": "uint128"
192
+ }
193
+ ],
194
+ "stateMutability": "view",
195
+ "type": "function"
196
+ },
197
+ {
198
+ "inputs": [
199
+ {
200
+ "internalType": "PoolId",
201
+ "name": "poolId",
202
+ "type": "bytes32"
203
+ }
204
+ ],
205
+ "name": "getSlot0",
206
+ "outputs": [
207
+ {
208
+ "internalType": "uint160",
209
+ "name": "sqrtPriceX96",
210
+ "type": "uint160"
211
+ },
212
+ {
213
+ "internalType": "int24",
214
+ "name": "tick",
215
+ "type": "int24"
216
+ },
217
+ {
218
+ "internalType": "uint24",
219
+ "name": "protocolFee",
220
+ "type": "uint24"
221
+ },
222
+ {
223
+ "internalType": "uint24",
224
+ "name": "lpFee",
225
+ "type": "uint24"
226
+ }
227
+ ],
228
+ "stateMutability": "view",
229
+ "type": "function"
230
+ },
231
+ {
232
+ "inputs": [
233
+ {
234
+ "internalType": "PoolId",
235
+ "name": "poolId",
236
+ "type": "bytes32"
237
+ },
238
+ {
239
+ "internalType": "int16",
240
+ "name": "tick",
241
+ "type": "int16"
242
+ }
243
+ ],
244
+ "name": "getTickBitmap",
245
+ "outputs": [
246
+ {
247
+ "internalType": "uint256",
248
+ "name": "tickBitmap",
249
+ "type": "uint256"
250
+ }
251
+ ],
252
+ "stateMutability": "view",
253
+ "type": "function"
254
+ },
255
+ {
256
+ "inputs": [
257
+ {
258
+ "internalType": "PoolId",
259
+ "name": "poolId",
260
+ "type": "bytes32"
261
+ },
262
+ {
263
+ "internalType": "int24",
264
+ "name": "tick",
265
+ "type": "int24"
266
+ }
267
+ ],
268
+ "name": "getTickFeeGrowthOutside",
269
+ "outputs": [
270
+ {
271
+ "internalType": "uint256",
272
+ "name": "feeGrowthOutside0X128",
273
+ "type": "uint256"
274
+ },
275
+ {
276
+ "internalType": "uint256",
277
+ "name": "feeGrowthOutside1X128",
278
+ "type": "uint256"
279
+ }
280
+ ],
281
+ "stateMutability": "view",
282
+ "type": "function"
283
+ },
284
+ {
285
+ "inputs": [
286
+ {
287
+ "internalType": "PoolId",
288
+ "name": "poolId",
289
+ "type": "bytes32"
290
+ },
291
+ {
292
+ "internalType": "int24",
293
+ "name": "tick",
294
+ "type": "int24"
295
+ }
296
+ ],
297
+ "name": "getTickInfo",
298
+ "outputs": [
299
+ {
300
+ "internalType": "uint128",
301
+ "name": "liquidityGross",
302
+ "type": "uint128"
303
+ },
304
+ {
305
+ "internalType": "int128",
306
+ "name": "liquidityNet",
307
+ "type": "int128"
308
+ },
309
+ {
310
+ "internalType": "uint256",
311
+ "name": "feeGrowthOutside0X128",
312
+ "type": "uint256"
313
+ },
314
+ {
315
+ "internalType": "uint256",
316
+ "name": "feeGrowthOutside1X128",
317
+ "type": "uint256"
318
+ }
319
+ ],
320
+ "stateMutability": "view",
321
+ "type": "function"
322
+ },
323
+ {
324
+ "inputs": [
325
+ {
326
+ "internalType": "PoolId",
327
+ "name": "poolId",
328
+ "type": "bytes32"
329
+ },
330
+ {
331
+ "internalType": "int24",
332
+ "name": "tick",
333
+ "type": "int24"
334
+ }
335
+ ],
336
+ "name": "getTickLiquidity",
337
+ "outputs": [
338
+ {
339
+ "internalType": "uint128",
340
+ "name": "liquidityGross",
341
+ "type": "uint128"
342
+ },
343
+ {
344
+ "internalType": "int128",
345
+ "name": "liquidityNet",
346
+ "type": "int128"
347
+ }
348
+ ],
349
+ "stateMutability": "view",
350
+ "type": "function"
351
+ },
352
+ {
353
+ "inputs": [],
354
+ "name": "poolManager",
355
+ "outputs": [
356
+ {
357
+ "internalType": "contract IPoolManager",
358
+ "name": "",
359
+ "type": "address"
360
+ }
361
+ ],
362
+ "stateMutability": "view",
363
+ "type": "function"
364
+ }
365
+ ]
@@ -1,5 +1,5 @@
1
1
  import { Interface } from '@ethersproject/abi';
2
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger, NumberAsString, DexExchangeParam } from '../../types';
2
+ import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, SimpleExchangeParam, PoolLiquidity, Logger } from '../../types';
3
3
  import { SwapSide, Network } from '../../constants';
4
4
  import { IDex } from '../../dex/idex';
5
5
  import { IDexHelper } from '../../dex-helper/idex-helper';
@@ -28,7 +28,6 @@ export declare class AaveV1 extends SimpleExchange implements IDex<AaveV1Data, A
28
28
  getCalldataGasCost(poolPrices: PoolPrices<AaveV1Data>): number | number[];
29
29
  getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV1Data, side: SwapSide): AdapterExchangeParam;
30
30
  getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: AaveV1Data, side: SwapSide): Promise<SimpleExchangeParam>;
31
- getDexParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, recipient: Address, data: AaveV1Data, side: SwapSide): DexExchangeParam;
32
31
  updatePoolState(): Promise<void>;
33
32
  getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
34
33
  }
@@ -139,28 +139,6 @@ class AaveV1 extends simple_exchange_1.SimpleExchange {
139
139
  const swapData = Interface.encodeFunctionData(swapFunction, swapFunctionParams);
140
140
  return this.buildSimpleParamWithoutWETHConversion(srcToken, amount, destToken, destAmount, swapData, swapCallee, spender);
141
141
  }
142
- // DEAD
143
- getDexParam(srcToken, destToken, srcAmount, destAmount, recipient, data, side) {
144
- const amount = side === constants_1.SwapSide.SELL ? srcAmount : destAmount;
145
- const [Interface, swapFunction, swapFunctionParams, swapCallee] = (() => {
146
- if (data.fromAToken) {
147
- return [this.aContract, AaveV1Functions.redeem, [amount], srcToken];
148
- }
149
- return [
150
- this.aavePool,
151
- AaveV1Functions.deposit,
152
- [srcToken, amount, REF_CODE],
153
- AAVE_LENDING_POOL,
154
- ];
155
- })();
156
- const exchangeData = Interface.encodeFunctionData(swapFunction, swapFunctionParams);
157
- return {
158
- needWrapNative: this.needWrapNative,
159
- dexFuncHasRecipient: false,
160
- exchangeData,
161
- targetExchange: swapCallee,
162
- };
163
- }
164
142
  // This is called once before getTopPoolsForToken is
165
143
  // called for multiple tokens. This can be helpful to
166
144
  // update common state required for calculating
@@ -1 +1 @@
1
- {"version":3,"file":"aave-v1.js","sourceRoot":"","sources":["../../../src/dex/aave-v1/aave-v1.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4CAA6D;AAa7D,+CAAoD;AACpD,2EAA6D;AAC7D,uCAAkE;AAIlE,wDAAoD;AACpD,qCAAkD;AAClD,kGAA0E;AAC1E,sEAAyC;AACzC,qCAAsC;AAEtC,MAAM,WAAW,GAAG,GAAG,GAAG,IAAI,CAAC;AAE/B,IAAK,eAGJ;AAHD,WAAK,eAAe;IAClB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;AACnB,CAAC,EAHI,eAAe,KAAf,eAAe,QAGnB;AAED,MAAM,iBAAiB,GAAG,4CAA4C,CAAC;AACvE,MAAM,UAAU,GAAG,4CAA4C,CAAC;AAChE,MAAM,QAAQ,GAAG,CAAC,CAAC;AAEnB,MAAa,MACX,SAAQ,gCAAc;IAatB,YACY,OAAgB,EAC1B,MAAc,EACJ,SAAqB;QAE/B,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;QAJf,YAAO,GAAP,OAAO,CAAS;QAEhB,cAAS,GAAT,SAAS,CAAY;QAbxB,iCAA4B,GAAG,IAAI,CAAC;QACpC,6BAAwB,GAAG,KAAK,CAAC;QAexC,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,eAAS,CAAC,kCAA0C,CAAC,CAAC;QAC1E,IAAI,CAAC,SAAS,GAAG,IAAI,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constants';
3
+ import { AdapterExchangeParam, SimpleExchangeParam } from '../types';
4
+ import { IDexTxBuilder } from './idex';
5
+ import { SimpleExchange } from './simple-exchange';
6
+ import { IDexHelper } from '../dex-helper';
7
+ export declare type BProtocolData = {
8
+ exchange: string;
9
+ };
10
+ declare type BProtocolParam = [lusdAmount: string, minEthReturn: string, dest: string];
11
+ export declare class BProtocol extends SimpleExchange implements IDexTxBuilder<BProtocolData, BProtocolParam> {
12
+ static dexKeys: string[];
13
+ exchangeRouterInterface: Interface;
14
+ constructor(dexHelper: IDexHelper);
15
+ getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: BProtocolData, side: SwapSide): AdapterExchangeParam;
16
+ getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: BProtocolData, side: SwapSide): Promise<SimpleExchangeParam>;
17
+ }
18
+ export {};