@paraswap/dex-lib 4.0.27 → 4.0.28-partner-encoding

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 (246) hide show
  1. package/build/abi/Aave_GSM.json +751 -0
  2. package/build/abi/Balancer.json +257 -0
  3. package/build/abi/BalancerV2.json +1179 -0
  4. package/build/abi/RamsesV2Pool.abi.json +1554 -0
  5. package/build/abi/RamsesV2Quoter.abi.json +274 -0
  6. package/build/abi/USDM.json +807 -0
  7. package/build/abi/UniswapV2Router.json +397 -0
  8. package/build/abi/{wombat/pool.json → angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json} +594 -637
  9. package/build/abi/angle-transmuter/ChainlinkEACAggregatorProxy.json +509 -0
  10. package/build/abi/curve-v1/CurveBUSDv2.abi.json +1356 -0
  11. package/build/abi/curve-v1/CurveTokenV1.json +305 -0
  12. package/build/abi/curve-v1/CurveTokenV2.json +318 -0
  13. package/build/abi/curve-v1/CurveV1StableNg.json +1452 -0
  14. package/build/abi/curve-v1/CurveV2Swap.json +700 -0
  15. package/build/abi/curve-v1/FactoryCryptoRegistry.json +316 -0
  16. package/build/abi/curve-v1/FactoryRegistry.json +508 -0
  17. package/build/abi/curve-v1/StableSwapAave.json +1152 -0
  18. package/build/abi/curve-v1/StableSwapBUSD.json +814 -0
  19. package/build/abi/curve-v1/StableSwapCompound.json +814 -0
  20. package/build/abi/curve-v1/StableSwapIDLE.json +1253 -0
  21. package/build/abi/curve-v1/StableSwapPax.json +865 -0
  22. package/build/abi/curve-v1/StableSwapSnow.json +900 -0
  23. package/build/abi/curve-v1/StableSwapUSDN.json +1004 -0
  24. package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
  25. package/build/abi/curve-v1/StableSwapY.json +814 -0
  26. package/build/abi/inception/inception-ineth.json +609 -0
  27. package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
  28. package/build/abi/kyberdmm.abi.json +1148 -0
  29. package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
  30. package/build/abi/nerve/nerve-metapool.json +790 -0
  31. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
  32. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
  33. package/build/dex/aave-v1/aave-v1.js +0 -1
  34. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  35. package/build/dex/algebra/config.js +1 -1
  36. package/build/dex/algebra/config.js.map +1 -1
  37. package/build/dex/balancer-v1/balancer-pools.json +33333 -0
  38. package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
  39. package/build/dex/bebop/websocket-fetcher.js +87 -0
  40. package/build/dex/bebop/websocket-fetcher.js.map +1 -0
  41. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  42. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  43. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  44. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  45. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  46. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  47. package/build/dex/idle-dao/scripts.d.ts +9 -0
  48. package/build/dex/idle-dao/scripts.js +552 -0
  49. package/build/dex/idle-dao/scripts.js.map +1 -0
  50. package/build/dex/inception/inception-event-pool.d.ts +4 -4
  51. package/build/dex/inception/inception-event-pool.js +9 -7
  52. package/build/dex/inception/inception-event-pool.js.map +1 -1
  53. package/build/dex/inception/inception-native.d.ts +43 -0
  54. package/build/dex/inception/inception-native.js +131 -0
  55. package/build/dex/inception/inception-native.js.map +1 -0
  56. package/build/dex/inception/inception-pool.d.ts +18 -0
  57. package/build/dex/inception/inception-pool.js +32 -0
  58. package/build/dex/inception/inception-pool.js.map +1 -0
  59. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  60. package/build/dex/inception/inception-price-feed.js +51 -0
  61. package/build/dex/inception/inception-price-feed.js.map +1 -0
  62. package/build/dex/inception/inception.d.ts +6 -6
  63. package/build/dex/inception/inception.js +40 -16
  64. package/build/dex/inception/inception.js.map +1 -1
  65. package/build/dex/inception/utils.d.ts +0 -1
  66. package/build/dex/inception/utils.js +1 -22
  67. package/build/dex/inception/utils.js.map +1 -1
  68. package/build/dex/platypus/platypus.js +3 -17
  69. package/build/dex/platypus/platypus.js.map +1 -1
  70. package/build/dex/swaap-v1/swaap-v1.js +0 -4
  71. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  72. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
  73. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
  74. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
  75. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
  76. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
  77. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
  78. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
  79. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
  80. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
  81. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
  82. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
  83. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
  84. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
  85. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
  86. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
  87. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
  88. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
  89. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
  90. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
  91. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
  92. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
  93. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
  94. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
  95. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
  96. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
  97. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
  98. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
  99. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
  100. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
  101. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
  102. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
  103. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
  104. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
  105. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
  106. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
  107. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
  108. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
  109. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
  110. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
  111. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
  112. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
  113. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
  114. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
  115. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
  116. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
  117. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
  118. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
  119. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
  120. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
  121. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
  122. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
  123. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
  124. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
  125. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
  126. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
  127. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
  128. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
  129. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
  130. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
  131. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
  132. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
  133. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
  134. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
  135. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
  136. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
  137. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
  138. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
  139. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
  140. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
  141. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
  142. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
  143. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
  144. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
  145. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
  146. package/build/generic-swap-transaction-builder.js +2 -1
  147. package/build/generic-swap-transaction-builder.js.map +1 -1
  148. package/package.json +1 -1
  149. package/src/dex/algebra/config.ts +1 -1
  150. package/src/generic-swap-transaction-builder.ts +5 -1
  151. package/.vscode/launch.json +0 -53
  152. package/.vscode/settings.json +0 -2
  153. package/.vscode/tasks.json +0 -15
  154. package/build/abi/uniswap-v3/AlienBaseV3Router.abi.json +0 -52
  155. package/build/abi/usual-m-smart-m/usualM.abi.json +0 -483
  156. package/build/dex/aave-v2/tokens-avalanche.json +0 -44
  157. package/build/dex/aave-v2/tokens-mainnet.json +0 -188
  158. package/build/dex/aave-v2/tokens-polygon.json +0 -44
  159. package/build/dex/bProtocol.d.ts +0 -18
  160. package/build/dex/bProtocol.js +0 -39
  161. package/build/dex/bProtocol.js.map +0 -1
  162. package/build/dex/balancer-v3/abi/balancerBatchRouter.d.ts +0 -729
  163. package/build/dex/balancer-v3/abi/balancerBatchRouter.js +0 -732
  164. package/build/dex/balancer-v3/abi/balancerBatchRouter.js.map +0 -1
  165. package/build/dex/balancer-v3/abi/balancerRouter.d.ts +0 -1406
  166. package/build/dex/balancer-v3/abi/balancerRouter.js +0 -1175
  167. package/build/dex/balancer-v3/abi/balancerRouter.js.map +0 -1
  168. package/build/dex/balancer-v3/abi/vaultExtension.V3.d.ts +0 -2081
  169. package/build/dex/balancer-v3/abi/vaultExtension.V3.js +0 -1851
  170. package/build/dex/balancer-v3/abi/vaultExtension.V3.js.map +0 -1
  171. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.d.ts +0 -34
  172. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js +0 -406
  173. package/build/dex/balancer-v3/balancer-v3-sepolia-pools.js.map +0 -1
  174. package/build/dex/bancor.d.ts +0 -26
  175. package/build/dex/bancor.js +0 -58
  176. package/build/dex/bancor.js.map +0 -1
  177. package/build/dex/compound.d.ts +0 -18
  178. package/build/dex/compound.js +0 -46
  179. package/build/dex/compound.js.map +0 -1
  180. package/build/dex/curve-v2.d.ts +0 -58
  181. package/build/dex/curve-v2.js +0 -180
  182. package/build/dex/curve-v2.js.map +0 -1
  183. package/build/dex/dodo-v1.d.ts +0 -33
  184. package/build/dex/dodo-v1.js +0 -63
  185. package/build/dex/dodo-v1.js.map +0 -1
  186. package/build/dex/lido.d.ts +0 -19
  187. package/build/dex/lido.js +0 -42
  188. package/build/dex/lido.js.map +0 -1
  189. package/build/dex/maker-psm/scripts/gem.abi.json +0 -136
  190. package/build/dex/maker-psm/scripts/validate-state.d.ts +0 -0
  191. package/build/dex/maker-psm/scripts/validate-state.js +0 -185
  192. package/build/dex/maker-psm/scripts/validate-state.js.map +0 -1
  193. package/build/dex/maker-psm/scripts/vat.abi.json +0 -243
  194. package/build/dex/onebit.d.ts +0 -25
  195. package/build/dex/onebit.js +0 -42
  196. package/build/dex/onebit.js.map +0 -1
  197. package/build/dex/smoothy.d.ts +0 -26
  198. package/build/dex/smoothy.js +0 -48
  199. package/build/dex/smoothy.js.map +0 -1
  200. package/build/dex/solidly-v3/scripts/check-event-pool-event.d.ts +0 -1
  201. package/build/dex/solidly-v3/scripts/check-event-pool-event.js +0 -53
  202. package/build/dex/solidly-v3/scripts/check-event-pool-event.js.map +0 -1
  203. package/build/dex/stable-pool.d.ts +0 -28
  204. package/build/dex/stable-pool.js +0 -55
  205. package/build/dex/stable-pool.js.map +0 -1
  206. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  207. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  208. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  209. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  210. package/build/dex/trader-joe-v2.1.js +0 -79
  211. package/build/dex/trader-joe-v2.1.js.map +0 -1
  212. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.d.ts +0 -17
  213. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js +0 -64
  214. package/build/dex/uniswap-v3/forks/alien-base-v3/alien-base-v3.js.map +0 -1
  215. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.d.ts +0 -17
  216. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js +0 -79
  217. package/build/dex/uniswap-v3/forks/alien-v3/alien-v3.js.map +0 -1
  218. package/build/dex/uniswap-v3/uniswap-v3-pricing.d.ts +0 -4
  219. package/build/dex/uniswap-v3/uniswap-v3-pricing.js +0 -43
  220. package/build/dex/uniswap-v3/uniswap-v3-pricing.js.map +0 -1
  221. package/build/dex/uniswap-v3/uniswap-v3-worker.d.ts +0 -1
  222. package/build/dex/uniswap-v3/uniswap-v3-worker.js +0 -10
  223. package/build/dex/uniswap-v3/uniswap-v3-worker.js.map +0 -1
  224. package/build/dex/usual/usual-m-smart-m.d.ts +0 -17
  225. package/build/dex/usual/usual-m-smart-m.js +0 -50
  226. package/build/dex/usual/usual-m-smart-m.js.map +0 -1
  227. package/build/dex/usual-m-smart-m/config.d.ts +0 -3
  228. package/build/dex/usual-m-smart-m/config.js +0 -13
  229. package/build/dex/usual-m-smart-m/config.js.map +0 -1
  230. package/build/dex/usual-m-smart-m/types.d.ts +0 -7
  231. package/build/dex/usual-m-smart-m/types.js +0 -3
  232. package/build/dex/usual-m-smart-m/types.js.map +0 -1
  233. package/build/dex/usual-m-smart-m/usual-m-smart-m.d.ts +0 -35
  234. package/build/dex/usual-m-smart-m/usual-m-smart-m.js +0 -161
  235. package/build/dex/usual-m-smart-m/usual-m-smart-m.js.map +0 -1
  236. package/build/dex/usual-m-usd0/config.d.ts +0 -3
  237. package/build/dex/usual-m-usd0/config.js +0 -14
  238. package/build/dex/usual-m-usd0/config.js.map +0 -1
  239. package/build/dex/usual-m-usd0/types.d.ts +0 -8
  240. package/build/dex/usual-m-usd0/types.js +0 -3
  241. package/build/dex/usual-m-usd0/types.js.map +0 -1
  242. package/build/dex/usual-m-usd0/usual-m-usd0.d.ts +0 -35
  243. package/build/dex/usual-m-usd0/usual-m-usd0.js +0 -159
  244. package/build/dex/usual-m-usd0/usual-m-usd0.js.map +0 -1
  245. package/src/dex/balancer-v2/scripts/abi.json +0 -339
  246. package/src/dex/balancer-v2/scripts/test.test.ts +0 -121
@@ -1,46 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Compound = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const constants_1 = require("../constants");
9
- const simple_exchange_1 = require("./simple-exchange");
10
- const Compound_CETH_json_1 = __importDefault(require("../abi/Compound_CETH.json")); // CETH abi
11
- const utils_1 = require("../utils");
12
- var CompoundFunctions;
13
- (function (CompoundFunctions) {
14
- CompoundFunctions["redeem"] = "redeem";
15
- CompoundFunctions["mint"] = "mint";
16
- })(CompoundFunctions || (CompoundFunctions = {}));
17
- class Compound extends simple_exchange_1.SimpleExchange {
18
- constructor(dexHelper) {
19
- super(dexHelper, 'compound');
20
- this.cethInterface = new abi_1.Interface(Compound_CETH_json_1.default);
21
- }
22
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
23
- const cToken = data.fromCToken ? srcToken : destToken; // Warning
24
- const payload = this.abiCoder.encodeParameter({
25
- ParentStruct: {
26
- cToken: 'address',
27
- },
28
- }, { cToken });
29
- return {
30
- // target exchange is not used by the contract
31
- targetExchange: constants_1.NULL_ADDRESS,
32
- payload,
33
- networkFee: '0',
34
- };
35
- }
36
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
37
- const cToken = data.fromCToken ? srcToken : destToken;
38
- const swapData = (0, utils_1.isETHAddress)(srcToken)
39
- ? this.cethInterface.encodeFunctionData(CompoundFunctions.mint)
40
- : this.erc20Interface.encodeFunctionData(data.fromCToken ? CompoundFunctions.redeem : CompoundFunctions.mint, [srcAmount]);
41
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, cToken);
42
- }
43
- }
44
- exports.Compound = Compound;
45
- Compound.dexKeys = ['compound'];
46
- //# sourceMappingURL=compound.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"compound.js","sourceRoot":"","sources":["../../src/dex/compound.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAsD;AAGtD,uDAAmD;AACnD,mFAA6C,CAAC,WAAW;AACzD,oCAAwC;AAQxC,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,sCAAiB,CAAA;IACjB,kCAAa,CAAA;AACf,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,MAAa,QACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;QAC7B,IAAI,CAAC,aAAa,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"}
@@ -1,58 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { SwapSide } from '../constants';
3
- import { AdapterExchangeParam, Address, ExchangeTxInfo, NumberAsString, PreprocessTransactionOptions, SimpleExchangeParam, Token, TxInfo } from '../types';
4
- import { IDexTxBuilder } from './idex';
5
- import { SimpleExchange } from './simple-exchange';
6
- import { IDexHelper } from '../dex-helper';
7
- import { Logger } from 'log4js';
8
- import { OptimalSwapExchange } from '@paraswap/core';
9
- export declare enum CurveV2SwapType {
10
- EXCHANGE = 0,
11
- EXCHANGE_UNDERLYING = 1,
12
- EXCHANGE_GENERIC_FACTORY_ZAP = 2
13
- }
14
- declare type CurveV2Data = {
15
- i: number;
16
- j: number;
17
- exchange: string;
18
- originalPoolAddress: Address;
19
- swapType: CurveV2SwapType;
20
- isApproved?: boolean;
21
- };
22
- export declare type DirectCurveV2Param = [
23
- fromToken: Address,
24
- toToken: Address,
25
- exchange: Address,
26
- poolAddress: Address,
27
- fromAmount: NumberAsString,
28
- toAmount: NumberAsString,
29
- expectedAmount: NumberAsString,
30
- feePercent: NumberAsString,
31
- i: NumberAsString,
32
- j: NumberAsString,
33
- partner: Address,
34
- isApproved: boolean,
35
- swapType: CurveV2SwapType,
36
- beneficiary: Address,
37
- needWrapNative: boolean,
38
- permit: string,
39
- uuid: string
40
- ];
41
- export declare class CurveV2 extends SimpleExchange implements IDexTxBuilder<CurveV2Data, DirectCurveV2Param> {
42
- readonly dexHelper: IDexHelper;
43
- static dexKeys: string[];
44
- exchangeRouterInterface: Interface;
45
- genericFactoryZapIface: Interface;
46
- minConversionRate: string;
47
- needWrapNative: boolean;
48
- logger: Logger;
49
- readonly directSwapIface: Interface;
50
- constructor(dexHelper: IDexHelper);
51
- getAdapterParam(_0: string, _1: string, _2: string, _3: string, data: CurveV2Data, side: SwapSide): AdapterExchangeParam;
52
- getTokenFromAddress(address: Address): Token;
53
- preProcessTransaction(optimalSwapExchange: OptimalSwapExchange<CurveV2Data>, srcToken: Token, _0: Token, _1: SwapSide, options: PreprocessTransactionOptions): Promise<[OptimalSwapExchange<CurveV2Data>, ExchangeTxInfo]>;
54
- getDirectParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, expectedAmount: NumberAsString, data: CurveV2Data, side: SwapSide, permit: string, uuid: string, feePercent: NumberAsString, _0: NumberAsString, partner: string, beneficiary: string, contractMethod?: string): TxInfo<DirectCurveV2Param>;
55
- static getDirectFunctionName(): string[];
56
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: CurveV2Data, side: SwapSide): Promise<SimpleExchangeParam>;
57
- }
58
- export {};
@@ -1,180 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.CurveV2 = exports.CurveV2SwapType = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const constants_1 = require("../constants");
9
- const simple_exchange_1 = require("./simple-exchange");
10
- const GenericFactoryZap_json_1 = __importDefault(require("../abi/curve-v2/GenericFactoryZap.json"));
11
- const DirectSwap_json_1 = __importDefault(require("../abi/DirectSwap.json"));
12
- const CurveV2_json_1 = __importDefault(require("../abi/CurveV2.json"));
13
- const ts_essentials_1 = require("ts-essentials");
14
- const utils_1 = require("../utils");
15
- var CurveV2SwapType;
16
- (function (CurveV2SwapType) {
17
- CurveV2SwapType[CurveV2SwapType["EXCHANGE"] = 0] = "EXCHANGE";
18
- CurveV2SwapType[CurveV2SwapType["EXCHANGE_UNDERLYING"] = 1] = "EXCHANGE_UNDERLYING";
19
- CurveV2SwapType[CurveV2SwapType["EXCHANGE_GENERIC_FACTORY_ZAP"] = 2] = "EXCHANGE_GENERIC_FACTORY_ZAP";
20
- })(CurveV2SwapType = exports.CurveV2SwapType || (exports.CurveV2SwapType = {}));
21
- const DIRECT_METHOD_NAME = 'directCurveV2Swap';
22
- var CurveV2SwapFunctions;
23
- (function (CurveV2SwapFunctions) {
24
- CurveV2SwapFunctions["exchange"] = "exchange(uint256 i, uint256 j, uint256 dx, uint256 minDy)";
25
- CurveV2SwapFunctions["exchange_underlying"] = "exchange_underlying(uint256 i, uint256 j, uint256 dx, uint256 minDy)";
26
- CurveV2SwapFunctions["exchange_in_generic_factory_zap"] = "exchange(address _pool, uint256 i, uint256 j, uint256 _dx, uint256 _min_dy)";
27
- })(CurveV2SwapFunctions || (CurveV2SwapFunctions = {}));
28
- class CurveV2 extends simple_exchange_1.SimpleExchange {
29
- constructor(dexHelper) {
30
- super(dexHelper, 'curvev2');
31
- this.dexHelper = dexHelper;
32
- this.minConversionRate = '1';
33
- this.needWrapNative = true;
34
- this.directSwapIface = new abi_1.Interface(DirectSwap_json_1.default);
35
- this.exchangeRouterInterface = new abi_1.Interface(CurveV2_json_1.default);
36
- this.genericFactoryZapIface = new abi_1.Interface(GenericFactoryZap_json_1.default);
37
- this.logger = dexHelper.getLogger(`CurveV2_${dexHelper.config.data.network}`);
38
- }
39
- getAdapterParam(_0, _1, _2, _3, data, side) {
40
- if (side === constants_1.SwapSide.BUY)
41
- throw new Error(`Buy not supported`);
42
- const { i, j, originalPoolAddress, swapType } = data;
43
- const payload = this.abiCoder.encodeParameter({
44
- ParentStruct: {
45
- i: 'uint256',
46
- j: 'uint256',
47
- originalPoolAddress: 'address',
48
- swapType: 'uint8',
49
- },
50
- }, {
51
- i,
52
- j,
53
- originalPoolAddress,
54
- swapType,
55
- });
56
- return {
57
- targetExchange: data.exchange,
58
- payload,
59
- networkFee: '0',
60
- };
61
- }
62
- getTokenFromAddress(address) {
63
- // In this Dex decimals are not used
64
- return { address, decimals: 0 };
65
- }
66
- async preProcessTransaction(optimalSwapExchange, srcToken, _0, _1, options) {
67
- if (!options.isDirectMethod) {
68
- return [
69
- optimalSwapExchange,
70
- {
71
- deadline: BigInt((0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)()),
72
- },
73
- ];
74
- }
75
- (0, ts_essentials_1.assert)(optimalSwapExchange.data !== undefined, `preProcessTransaction: data field is missing`);
76
- let isApproved;
77
- try {
78
- this.erc20Contract.options.address =
79
- this.dexHelper.config.wrapETH(srcToken).address;
80
- const allowance = await this.erc20Contract.methods
81
- .allowance(this.augustusAddress, optimalSwapExchange.data.exchange)
82
- .call(undefined, 'latest');
83
- isApproved =
84
- BigInt(allowance.toString()) >= BigInt(optimalSwapExchange.srcAmount);
85
- }
86
- catch (e) {
87
- this.logger.error(`preProcessTransaction failed to retrieve allowance info: `, e);
88
- }
89
- return [
90
- {
91
- ...optimalSwapExchange,
92
- data: {
93
- ...optimalSwapExchange.data,
94
- isApproved,
95
- },
96
- },
97
- {
98
- deadline: BigInt((0, simple_exchange_1.getLocalDeadlineAsFriendlyPlaceholder)()),
99
- },
100
- ];
101
- }
102
- getDirectParam(srcToken, destToken, srcAmount, destAmount, expectedAmount, data, side, permit, uuid, feePercent, _0, partner, beneficiary, contractMethod) {
103
- if (contractMethod !== DIRECT_METHOD_NAME) {
104
- throw new Error(`Invalid contract method ${contractMethod}`);
105
- }
106
- (0, ts_essentials_1.assert)(side === constants_1.SwapSide.SELL, 'Buy not supported');
107
- let isApproved = !!data.isApproved;
108
- if (data.isApproved === undefined) {
109
- this.logger.warn(`isApproved is undefined, defaulting to false`);
110
- }
111
- const swapParams = [
112
- srcToken,
113
- destToken,
114
- data.exchange,
115
- data.originalPoolAddress,
116
- srcAmount,
117
- destAmount,
118
- expectedAmount,
119
- feePercent,
120
- data.i.toString(),
121
- data.j.toString(),
122
- partner,
123
- isApproved,
124
- data.swapType,
125
- beneficiary,
126
- // For now we always wrap native. We don't support non native trade
127
- true,
128
- permit,
129
- (0, utils_1.uuidToBytes16)(uuid),
130
- ];
131
- const encoder = (...params) => {
132
- return this.directSwapIface.encodeFunctionData(DIRECT_METHOD_NAME, [
133
- params,
134
- ]);
135
- };
136
- return {
137
- params: swapParams,
138
- encoder,
139
- networkFee: '0',
140
- };
141
- }
142
- static getDirectFunctionName() {
143
- return [DIRECT_METHOD_NAME];
144
- }
145
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
146
- if (side === constants_1.SwapSide.BUY)
147
- throw new Error(`Buy not supported`);
148
- const { exchange, i, j, originalPoolAddress, swapType } = data;
149
- const args = swapType === CurveV2SwapType.EXCHANGE_GENERIC_FACTORY_ZAP
150
- ? [
151
- originalPoolAddress,
152
- i.toString(),
153
- j.toString(),
154
- srcAmount,
155
- this.minConversionRate,
156
- ]
157
- : [i.toString(), j.toString(), srcAmount, this.minConversionRate];
158
- let swapMethod;
159
- switch (swapType) {
160
- case CurveV2SwapType.EXCHANGE:
161
- swapMethod = CurveV2SwapFunctions.exchange;
162
- break;
163
- case CurveV2SwapType.EXCHANGE_UNDERLYING:
164
- swapMethod = CurveV2SwapFunctions.exchange_underlying;
165
- break;
166
- case CurveV2SwapType.EXCHANGE_GENERIC_FACTORY_ZAP:
167
- swapMethod = CurveV2SwapFunctions.exchange_in_generic_factory_zap;
168
- break;
169
- default:
170
- throw new Error(`getSimpleParam: not all cases covered for CurveV2SwapTypes`);
171
- }
172
- const swapData = swapMethod === CurveV2SwapFunctions.exchange_in_generic_factory_zap
173
- ? this.genericFactoryZapIface.encodeFunctionData(swapMethod, args)
174
- : this.exchangeRouterInterface.encodeFunctionData(swapMethod, args);
175
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, exchange);
176
- }
177
- }
178
- exports.CurveV2 = CurveV2;
179
- CurveV2.dexKeys = ['curvev2'];
180
- //# sourceMappingURL=curve-v2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"curve-v2.js","sourceRoot":"","sources":["../../src/dex/curve-v2.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAwC;AAYxC,uDAG2B;AAC3B,oGAA0E;AAC1E,6EAAmD;AACnD,uEAA6C;AAE7C,iDAAuC;AAGvC,oCAAyC;AAEzC,IAAY,eAIX;AAJ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B,CAAC,+BAA+B,CAAC;gBAClE,MAAM;YACR;gBACE,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;SACL;QAED,MAAM,QAAQ,GACZ,UAAU,KAAK,oBAAoB,CAAC,+BAA+B;YACjE,CAAC,CAAC,IAAI,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC;YAClE,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAExE,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,CACT,CAAC;IACJ,CAAC;;AAvOH,0BAwOC;AApOQ,eAAO,GAAG,CAAC,SAAS,CAAC,CAAC"}
@@ -1,33 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { SwapSide } from '../constants';
3
- import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
4
- import { IDexTxBuilder } from './idex';
5
- import { SimpleExchange } from './simple-exchange';
6
- import { NumberAsString } from '@paraswap/core';
7
- import { IDexHelper } from '../dex-helper';
8
- export declare type DodoV1Data = {
9
- fromToken: Address;
10
- toToken: Address;
11
- dodoPairs: Address[];
12
- directions: string;
13
- isIncentive: boolean;
14
- deadLine: string;
15
- };
16
- declare type DodoV1Param = [
17
- fromToken: Address,
18
- toToken: Address,
19
- fromTokenAmount: NumberAsString,
20
- minReturnAmount: NumberAsString,
21
- dodoPairs: Address[],
22
- directions: NumberAsString,
23
- isIncentive: boolean,
24
- deadLine: NumberAsString
25
- ];
26
- export declare class DodoV1 extends SimpleExchange implements IDexTxBuilder<DodoV1Data, DodoV1Param> {
27
- static dexKeys: string[];
28
- dodoV2Proxy: Interface;
29
- constructor(dexHelper: IDexHelper);
30
- getAdapterParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: DodoV1Data, side: SwapSide): AdapterExchangeParam;
31
- getSimpleParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: DodoV1Data, side: SwapSide): Promise<SimpleExchangeParam>;
32
- }
33
- export {};
@@ -1,63 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DodoV1 = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const constants_1 = require("../constants");
9
- const simple_exchange_1 = require("./simple-exchange");
10
- const dodo_v2_proxy_json_1 = __importDefault(require("../abi/dodo-v2-proxy.json"));
11
- // We use dodo-v2 proxy as the new proxy supports both v1 and v2
12
- const DODOV2ProxyAddress = {
13
- 1: '0xa356867fdcea8e71aeaf87805808803806231fdc',
14
- 56: '0x8F8Dd7DB1bDA5eD3da8C9daf3bfa471c12d58486',
15
- 42161: '0x88CBf433471A0CD8240D2a12354362988b4593E5',
16
- };
17
- const DODOAproveAddress = {
18
- 1: '0xCB859eA579b28e02B87A1FDE08d087ab9dbE5149',
19
- 56: '0xa128Ba44B2738A558A1fdC06d6303d52D3Cef8c1',
20
- 42161: '0xA867241cDC8d3b0C07C85cC06F25a0cD3b5474d8',
21
- };
22
- var DodoV1Functions;
23
- (function (DodoV1Functions) {
24
- DodoV1Functions["dodoSwapV1"] = "dodoSwapV1";
25
- })(DodoV1Functions || (DodoV1Functions = {}));
26
- class DodoV1 extends simple_exchange_1.SimpleExchange {
27
- constructor(dexHelper) {
28
- super(dexHelper, 'dodov1');
29
- this.dodoV2Proxy = new abi_1.Interface(dodo_v2_proxy_json_1.default);
30
- }
31
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
32
- const { dodoPairs, directions } = data;
33
- const payload = this.abiCoder.encodeParameter({
34
- ParentStruct: {
35
- dodoPairs: 'address[]',
36
- directions: 'uint256',
37
- },
38
- }, { dodoPairs, directions });
39
- return {
40
- targetExchange: DODOV2ProxyAddress[this.network],
41
- payload,
42
- networkFee: '0',
43
- };
44
- }
45
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
46
- const swapFunction = DodoV1Functions.dodoSwapV1;
47
- const swapFunctionParams = [
48
- srcToken,
49
- destToken,
50
- srcAmount,
51
- destAmount,
52
- data.dodoPairs,
53
- data.directions,
54
- data.isIncentive,
55
- constants_1.MAX_UINT,
56
- ];
57
- const swapData = this.dodoV2Proxy.encodeFunctionData(swapFunction, swapFunctionParams);
58
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, DODOV2ProxyAddress[this.network], DODOAproveAddress[this.network]);
59
- }
60
- }
61
- exports.DodoV1 = DodoV1;
62
- DodoV1.dexKeys = ['dodov1'];
63
- //# sourceMappingURL=dodo-v1.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dodo-v1.js","sourceRoot":"","sources":["../../src/dex/dodo-v1.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAC7D,4CAAkD;AAGlD,uDAAmD;AACnD,mFAAuD;AAKvD,gEAAgE;AAChE,MAAM,kBAAkB,GAAmC;IACzD,CAAC,EAAE,4CAA4C;IAC/C,EAAE,EAAE,4CAA4C;IAChD,KAAK,EAAE,4CAA4C;CACpD,CAAC;AAEF,MAAM,iBAAiB,GAAmC;IACxD,CAAC,EAAE,4CAA4C;IAC/C,EAAE,EAAE,4CAA4C;IAChD,KAAK,EAAE,4CAA4C;CACpD,CAAC;AAqBF,IAAK,eAEJ;AAFD,WAAK,eAAe;IAClB,4CAAyB,CAAA;AAC3B,CAAC,EAFI,eAAe,KAAf,eAAe,QAEnB;AAED,MAAa,MACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,eAAS,CAAC,4BAAgC,CAAC,CAAC;IACrE,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,eAAe,CAC3C;YACE,YAAY,EAAE;gBACZ,SAAS,EAAE,WAAW;gBACtB,UAAU,EAAE,SAAS;aACtB;SACF,EACD,EAAE,SAAS,EAAE,UAAU,EAAE,CAC1B,CAAC;QAEF,OAAO;YACL,cAAc,EAAE,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC;YAChD,OAAO;YACP,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAgB,EAChB,IAAc;QAEd,MAAM,YAAY,GAAG,eAAe,CAAC,UAAU,CAAC;QAChD,MAAM,kBAAkB,GAAgB;YACtC,QAAQ;YACR,SAAS;YACT,SAAS;YACT,UAAU;YACV,IAAI,CAAC,SAAS;YACd,IAAI,CAAC,UAAU;YACf,IAAI,CAAC,WAAW;YAChB,oBAAQ;SACT,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAClD,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,EAChC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAChC,CAAC;IACJ,CAAC;;AAvEH,wBAwEC;AApEQ,cAAO,GAAG,CAAC,QAAQ,CAAC,CAAC"}
@@ -1,19 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { NumberAsString, SwapSide } from '@paraswap/core';
3
- import { AdapterExchangeParam, Address, SimpleExchangeParam } from '../types';
4
- import { IDexTxBuilder } from './idex';
5
- import { IDexHelper } from '../dex-helper';
6
- export declare const stETH: any;
7
- export declare enum stETHFunctions {
8
- submit = "submit"
9
- }
10
- export declare type LidoData = {};
11
- export declare class Lido implements IDexTxBuilder<LidoData, any> {
12
- static dexKeys: string[];
13
- stETHInterface: Interface;
14
- needWrapNative: boolean;
15
- private network;
16
- constructor(dexHelper: IDexHelper);
17
- getAdapterParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: LidoData, side: SwapSide): AdapterExchangeParam;
18
- getSimpleParam(srcToken: Address, destToken: Address, srcAmount: NumberAsString, destAmount: NumberAsString, data: LidoData, side: SwapSide): Promise<SimpleExchangeParam>;
19
- }
package/build/dex/lido.js DELETED
@@ -1,42 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Lido = exports.stETHFunctions = exports.stETH = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const stETH_json_1 = __importDefault(require("../abi/stETH.json"));
9
- const constants_1 = require("../constants");
10
- exports.stETH = {
11
- 1: '0xae7ab96520de3a18e5e111b5eaab095312d7fe84',
12
- };
13
- var stETHFunctions;
14
- (function (stETHFunctions) {
15
- stETHFunctions["submit"] = "submit";
16
- })(stETHFunctions = exports.stETHFunctions || (exports.stETHFunctions = {}));
17
- class Lido {
18
- constructor(dexHelper) {
19
- this.needWrapNative = false;
20
- this.network = dexHelper.config.data.network;
21
- this.stETHInterface = new abi_1.Interface(stETH_json_1.default);
22
- }
23
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
24
- return {
25
- targetExchange: exports.stETH[this.network],
26
- payload: '0x',
27
- networkFee: '0',
28
- };
29
- }
30
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
31
- const swapData = this.stETHInterface.encodeFunctionData(stETHFunctions.submit, [constants_1.NULL_ADDRESS]);
32
- return {
33
- callees: [exports.stETH[this.network]],
34
- calldata: [swapData],
35
- values: [srcAmount],
36
- networkFee: '0',
37
- };
38
- }
39
- }
40
- exports.Lido = Lido;
41
- Lido.dexKeys = ['lido'];
42
- //# sourceMappingURL=lido.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lido.js","sourceRoot":"","sources":["../../src/dex/lido.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,mEAAyC;AACzC,4CAA4C;AAI/B,QAAA,KAAK,GAAQ;IACxB,CAAC,EAAE,4CAA4C;CAChD,CAAC;AAEF,IAAY,cAEX;AAFD,WAAY,cAAc;IACxB,mCAAiB,CAAA;AACnB,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAID,MAAa,IAAI;IAQf,YAAY,SAAqB;QAJjC,mBAAc,GAAG,KAAK,CAAC;QAKrB,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;QAE7C,IAAI,CAAC,cAAc,GAAG,IAAI,eAAS,CAAC,oBAA0B,CAAC,CAAC;IAClE,CAAC;IAED,eAAe,CACb,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAc,EACd,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,aAAK,CAAC,IAAI,CAAC,OAAO,CAAC;YACnC,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAiB,EACjB,SAAkB,EAClB,SAAyB,EACzB,UAA0B,EAC1B,IAAc,EACd,IAAc;QAEd,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,CACrD,cAAc,CAAC,MAAM,EACrB,CAAC,wBAAY,CAAC,CACf,CAAC;QAEF,OAAO;YACL,OAAO,EAAE,CAAC,aAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC9B,QAAQ,EAAE,CAAC,QAAQ,CAAC;YACpB,MAAM,EAAE,CAAC,SAAS,CAAC;YACnB,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;;AAhDH,oBAiDC;AAhDQ,YAAO,GAAG,CAAC,MAAM,CAAC,CAAC"}
@@ -1,136 +0,0 @@
1
- [
2
- {
3
- "inputs": [
4
- { "internalType": "address", "name": "vat_", "type": "address" },
5
- { "internalType": "bytes32", "name": "ilk_", "type": "bytes32" },
6
- { "internalType": "address", "name": "gem_", "type": "address" }
7
- ],
8
- "stateMutability": "nonpayable",
9
- "type": "constructor"
10
- },
11
- {
12
- "anonymous": true,
13
- "inputs": [
14
- {
15
- "indexed": true,
16
- "internalType": "bytes4",
17
- "name": "sig",
18
- "type": "bytes4"
19
- },
20
- {
21
- "indexed": true,
22
- "internalType": "address",
23
- "name": "usr",
24
- "type": "address"
25
- },
26
- {
27
- "indexed": true,
28
- "internalType": "bytes32",
29
- "name": "arg1",
30
- "type": "bytes32"
31
- },
32
- {
33
- "indexed": true,
34
- "internalType": "bytes32",
35
- "name": "arg2",
36
- "type": "bytes32"
37
- },
38
- {
39
- "indexed": false,
40
- "internalType": "bytes",
41
- "name": "data",
42
- "type": "bytes"
43
- }
44
- ],
45
- "name": "LogNote",
46
- "type": "event"
47
- },
48
- {
49
- "inputs": [],
50
- "name": "cage",
51
- "outputs": [],
52
- "stateMutability": "nonpayable",
53
- "type": "function"
54
- },
55
- {
56
- "inputs": [],
57
- "name": "dec",
58
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
59
- "stateMutability": "view",
60
- "type": "function"
61
- },
62
- {
63
- "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
64
- "name": "deny",
65
- "outputs": [],
66
- "stateMutability": "nonpayable",
67
- "type": "function"
68
- },
69
- {
70
- "inputs": [
71
- { "internalType": "address", "name": "guy", "type": "address" },
72
- { "internalType": "uint256", "name": "wad", "type": "uint256" }
73
- ],
74
- "name": "exit",
75
- "outputs": [],
76
- "stateMutability": "nonpayable",
77
- "type": "function"
78
- },
79
- {
80
- "inputs": [],
81
- "name": "gem",
82
- "outputs": [
83
- { "internalType": "contract GemLike_2", "name": "", "type": "address" }
84
- ],
85
- "stateMutability": "view",
86
- "type": "function"
87
- },
88
- {
89
- "inputs": [],
90
- "name": "ilk",
91
- "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
92
- "stateMutability": "view",
93
- "type": "function"
94
- },
95
- {
96
- "inputs": [
97
- { "internalType": "address", "name": "urn", "type": "address" },
98
- { "internalType": "uint256", "name": "wad", "type": "uint256" },
99
- { "internalType": "address", "name": "_msgSender", "type": "address" }
100
- ],
101
- "name": "join",
102
- "outputs": [],
103
- "stateMutability": "nonpayable",
104
- "type": "function"
105
- },
106
- {
107
- "inputs": [],
108
- "name": "live",
109
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
110
- "stateMutability": "view",
111
- "type": "function"
112
- },
113
- {
114
- "inputs": [{ "internalType": "address", "name": "usr", "type": "address" }],
115
- "name": "rely",
116
- "outputs": [],
117
- "stateMutability": "nonpayable",
118
- "type": "function"
119
- },
120
- {
121
- "inputs": [],
122
- "name": "vat",
123
- "outputs": [
124
- { "internalType": "contract VatLike_4", "name": "", "type": "address" }
125
- ],
126
- "stateMutability": "view",
127
- "type": "function"
128
- },
129
- {
130
- "inputs": [{ "internalType": "address", "name": "", "type": "address" }],
131
- "name": "wards",
132
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
133
- "stateMutability": "view",
134
- "type": "function"
135
- }
136
- ]
File without changes