@paraswap/dex-lib 4.1.4-bal-v3-hooks.0 → 4.1.4

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 (321) hide show
  1. package/build/abi/Aave_GSM.json +751 -0
  2. package/build/abi/Balancer.json +257 -0
  3. package/build/abi/{balancer-v3/stableSurgeHook.json → BalancerV2.json} +732 -529
  4. package/build/abi/{integral/relayer.json → RamsesV2Pool.abi.json} +850 -832
  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/angle-transmuter/ChainlinkAccessControlledOffchainAggregator.json +1246 -0
  9. package/build/abi/{integral/oracle.json → angle-transmuter/ChainlinkEACAggregatorProxy.json} +247 -239
  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/{integral/pool.json → curve-v1/StableSwapUSDN.json} +450 -487
  24. package/build/abi/curve-v1/StableSwapUSDT.json +814 -0
  25. package/build/abi/curve-v1/StableSwapY.json +814 -0
  26. package/build/abi/fluid-dex/resolver.abi.json +30 -0
  27. package/build/abi/inception/inception-ineth-pool.json +1062 -0
  28. package/build/abi/inception/inception-ineth.json +609 -0
  29. package/build/abi/inception/inception-ratio-feed.json +329 -0
  30. package/build/abi/inception/inception-vault.json +991 -0
  31. package/build/abi/kyberdmm/kyber-storage.abi.json +824 -0
  32. package/build/abi/kyberdmm.abi.json +1148 -0
  33. package/build/abi/maverick-v2/MaverickV2Quoter.json +278 -0
  34. package/build/abi/nerve/nerve-metapool.json +790 -0
  35. package/build/abi/uniswap-v3/UniswapV3Quoter.abi.json +193 -0
  36. package/build/abi/velodrome-slipstream/VelodromeSlipstreamQuoterV2.abi.json +267 -0
  37. package/build/dex/aave-v1/aave-v1.d.ts +2 -1
  38. package/build/dex/aave-v1/aave-v1.js +22 -0
  39. package/build/dex/aave-v1/aave-v1.js.map +1 -1
  40. package/build/dex/balancer-v1/balancer-pools.json +33333 -0
  41. package/build/dex/balancer-v3/balancer-v3-pool.d.ts +1 -4
  42. package/build/dex/balancer-v3/balancer-v3-pool.js +13 -20
  43. package/build/dex/balancer-v3/balancer-v3-pool.js.map +1 -1
  44. package/build/dex/balancer-v3/balancer-v3.d.ts +0 -4
  45. package/build/dex/balancer-v3/balancer-v3.js +3 -29
  46. package/build/dex/balancer-v3/balancer-v3.js.map +1 -1
  47. package/build/dex/balancer-v3/config.js +0 -39
  48. package/build/dex/balancer-v3/config.js.map +1 -1
  49. package/build/dex/balancer-v3/getOnChainState.d.ts +2 -1
  50. package/build/dex/balancer-v3/getOnChainState.js +2 -0
  51. package/build/dex/balancer-v3/getOnChainState.js.map +1 -1
  52. package/build/dex/balancer-v3/getPoolsApi.d.ts +1 -2
  53. package/build/dex/balancer-v3/getPoolsApi.js +10 -17
  54. package/build/dex/balancer-v3/getPoolsApi.js.map +1 -1
  55. package/build/dex/balancer-v3/getTopPoolsApi.d.ts +1 -5
  56. package/build/dex/balancer-v3/getTopPoolsApi.js +3 -6
  57. package/build/dex/balancer-v3/getTopPoolsApi.js.map +1 -1
  58. package/build/dex/balancer-v3/types.d.ts +1 -4
  59. package/build/dex/bebop/websocket-fetcher.d.ts +35 -0
  60. package/build/dex/bebop/websocket-fetcher.js +87 -0
  61. package/build/dex/bebop/websocket-fetcher.js.map +1 -0
  62. package/build/dex/fluid-dex/config.js +2 -2
  63. package/build/dex/fluid-dex/constants.d.ts +1 -1
  64. package/build/dex/fluid-dex/constants.js +2 -1
  65. package/build/dex/fluid-dex/constants.js.map +1 -1
  66. package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js +3 -1
  67. package/build/dex/fluid-dex/fluid-dex-liquidity-proxy.js.map +1 -1
  68. package/build/dex/fluid-dex/fluid-dex.d.ts +4 -5
  69. package/build/dex/fluid-dex/fluid-dex.js +61 -59
  70. package/build/dex/fluid-dex/fluid-dex.js.map +1 -1
  71. package/build/dex/fluid-dex/types.d.ts +3 -0
  72. package/build/dex/idle-dao/idle-dao-pool.d.ts +56 -0
  73. package/build/dex/idle-dao/idle-dao-pool.js +176 -0
  74. package/build/dex/idle-dao/idle-dao-pool.js.map +1 -0
  75. package/build/dex/idle-dao/idle-dao-pooling-pool.d.ts +16 -0
  76. package/build/dex/idle-dao/idle-dao-pooling-pool.js +57 -0
  77. package/build/dex/idle-dao/idle-dao-pooling-pool.js.map +1 -0
  78. package/build/dex/idle-dao/scripts.d.ts +9 -0
  79. package/build/dex/idle-dao/scripts.js +552 -0
  80. package/build/dex/idle-dao/scripts.js.map +1 -0
  81. package/build/dex/inception/config.d.ts +4 -0
  82. package/build/dex/inception/config.js +109 -0
  83. package/build/dex/inception/config.js.map +1 -0
  84. package/build/dex/inception/inception-event-pool.d.ts +16 -0
  85. package/build/dex/inception/inception-event-pool.js +51 -0
  86. package/build/dex/inception/inception-event-pool.js.map +1 -0
  87. package/build/dex/{integral/integral.d.ts → inception/inception-native.d.ts} +21 -19
  88. package/build/dex/inception/inception-native.js +131 -0
  89. package/build/dex/inception/inception-native.js.map +1 -0
  90. package/build/dex/inception/inception-pool.d.ts +18 -0
  91. package/build/dex/inception/inception-pool.js +32 -0
  92. package/build/dex/inception/inception-pool.js.map +1 -0
  93. package/build/dex/inception/inception-price-feed.d.ts +19 -0
  94. package/build/dex/inception/inception-price-feed.js +51 -0
  95. package/build/dex/inception/inception-price-feed.js.map +1 -0
  96. package/build/dex/inception/inception.d.ts +43 -0
  97. package/build/dex/inception/inception.js +204 -0
  98. package/build/dex/inception/inception.js.map +1 -0
  99. package/build/dex/inception/tokens.d.ts +9 -0
  100. package/build/dex/inception/tokens.js +28 -0
  101. package/build/dex/inception/tokens.js.map +1 -0
  102. package/build/dex/inception/types.d.ts +22 -0
  103. package/build/dex/inception/types.js +3 -0
  104. package/build/dex/inception/types.js.map +1 -0
  105. package/build/dex/inception/utils.d.ts +6 -0
  106. package/build/dex/inception/utils.js +37 -0
  107. package/build/dex/inception/utils.js.map +1 -0
  108. package/build/dex/jarvis.d.ts +2 -1
  109. package/build/dex/jarvis.js +58 -0
  110. package/build/dex/jarvis.js.map +1 -1
  111. package/build/dex/platypus/platypus.d.ts +2 -1
  112. package/build/dex/platypus/platypus.js +31 -0
  113. package/build/dex/platypus/platypus.js.map +1 -1
  114. package/build/dex/swaap-v1/swaap-v1.d.ts +2 -1
  115. package/build/dex/swaap-v1/swaap-v1.js +10 -0
  116. package/build/dex/swaap-v1/swaap-v1.js.map +1 -1
  117. package/build/dex/zerox/index.d.ts +4 -26
  118. package/build/dex/zerox/index.js +50 -42
  119. package/build/dex/zerox/index.js.map +1 -1
  120. package/build/dex/zerox/types.d.ts +29 -0
  121. package/build/dex/zerox/types.js +8 -1
  122. package/build/dex/zerox/types.js.map +1 -1
  123. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +16 -0
  124. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +16 -0
  125. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +16 -0
  126. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +16 -0
  127. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-dai-usdc-eth.json +16 -0
  128. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-eth-usdc-dai.json +16 -0
  129. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +16 -0
  130. package/build/executor/fixtures/executor01/exchange-params/price-route-multiswap-sushiv3-usdt-usdc-dai.json +16 -0
  131. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-eth-usdc.json +9 -0
  132. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-eth.json +9 -0
  133. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-balancerv1-usdc-wbtc.json +9 -0
  134. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-eth-steth.json +9 -0
  135. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-steth-eth.json +9 -0
  136. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-curvev1-usdc-usdt.json +9 -0
  137. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-eth-usdc.json +9 -0
  138. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-eth.json +9 -0
  139. package/build/executor/fixtures/executor01/exchange-params/price-route-simpleSwap-univ3-usdc-usdt.json +9 -0
  140. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +12 -0
  141. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +7 -0
  142. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +7 -0
  143. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-dai-usdc-eth.json +7 -0
  144. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-eth-usdc-dai.json +7 -0
  145. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +12 -0
  146. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-eth-usdc.json +7 -0
  147. package/build/executor/fixtures/executor01/maybe-weth-calldata/price-route-simpleSwap-univ3-usdc-eth.json +7 -0
  148. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-curvev1-eth-usdc-gusd.json +78 -0
  149. package/build/executor/fixtures/executor01/routes/price-route-multiswap-balancerv1-sushiv3-wbtc-eth-sushi.json +81 -0
  150. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-eth-usdc-gusd.json +78 -0
  151. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-curvev1-gusd-usdc-eth.json +78 -0
  152. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-dai-usdc-eth.json +81 -0
  153. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-eth-usdc-dai.json +81 -0
  154. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdc-eth-wbtc.json +81 -0
  155. package/build/executor/fixtures/executor01/routes/price-route-multiswap-sushiv3-usdt-usdc-dai.json +81 -0
  156. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-eth-usdc.json +64 -0
  157. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-eth.json +85 -0
  158. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-balancerv1-usdc-wbtc.json +64 -0
  159. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-eth-steth.json +52 -0
  160. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-steth-eth.json +52 -0
  161. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-curvev1-usdc-usdt.json +52 -0
  162. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-eth-usdc.json +55 -0
  163. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-eth.json +55 -0
  164. package/build/executor/fixtures/executor01/routes/price-route-simpleSwap-univ3-usdc-usdt.json +55 -0
  165. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +23 -0
  166. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +37 -0
  167. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +23 -0
  168. package/build/executor/fixtures/executor02/exchange-params/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +23 -0
  169. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +51 -0
  170. package/build/executor/fixtures/executor02/exchange-params/price-route-multiswap-univ3-usdt-dai-eth.json +58 -0
  171. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +23 -0
  172. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +23 -0
  173. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +9 -0
  174. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +16 -0
  175. package/build/executor/fixtures/executor02/exchange-params/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +23 -0
  176. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +12 -0
  177. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +7 -0
  178. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +12 -0
  179. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +12 -0
  180. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +7 -0
  181. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-multiswap-univ3-usdt-dai-eth.json +7 -0
  182. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +7 -0
  183. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +7 -0
  184. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +7 -0
  185. package/build/executor/fixtures/executor02/maybe-weth-calldata/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +7 -0
  186. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-balancerv1-sushiv3-univ3-bal-eth-sushi.json +130 -0
  187. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-maverickv1-sushiv3-univ3-eth-usdc-mav.json +136 -0
  188. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-sushi-eth-wbtc.json +100 -0
  189. package/build/executor/fixtures/executor02/routes/price-route-multiSwap-univ3-sushiv3-wbtc-eth-sushi.json +100 -0
  190. package/build/executor/fixtures/executor02/routes/price-route-multiswap-curvev1-univ3-dai-usdc-eth.json +166 -0
  191. package/build/executor/fixtures/executor02/routes/price-route-multiswap-univ3-usdt-dai-eth.json +190 -0
  192. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-eth-usdc.json +114 -0
  193. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-balancerv1-usdc-eth.json +114 -0
  194. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-eth-sushi.json +55 -0
  195. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-sushiv3-univ3-sushi-eth.json +73 -0
  196. package/build/executor/fixtures/executor02/routes/price-route-simpleSwap-univ3-curvev1-usdt-dai.json +82 -0
  197. package/package.json +2 -2
  198. package/scripts/run-dex-integration-v3.ts +4 -4
  199. package/src/abi/fluid-dex/resolver.abi.json +30 -0
  200. package/src/dex/balancer-v3/balancer-v3-e2e.test.ts +0 -20
  201. package/src/dex/balancer-v3/balancer-v3-integration.test.ts +197 -2
  202. package/src/dex/balancer-v3/balancer-v3-pool.ts +13 -37
  203. package/src/dex/balancer-v3/balancer-v3.ts +1 -42
  204. package/src/dex/balancer-v3/config.ts +0 -39
  205. package/src/dex/balancer-v3/getOnChainState.ts +4 -1
  206. package/src/dex/balancer-v3/getPoolsApi.ts +23 -42
  207. package/src/dex/balancer-v3/getTopPoolsApi.ts +2 -13
  208. package/src/dex/balancer-v3/types.ts +2 -4
  209. package/src/dex/fluid-dex/config.ts +2 -2
  210. package/src/dex/fluid-dex/constants.ts +2 -1
  211. package/src/dex/fluid-dex/fluid-dex-e2e.test.ts +61 -117
  212. package/src/dex/fluid-dex/fluid-dex-liquidity-proxy.ts +3 -0
  213. package/src/dex/fluid-dex/fluid-dex.ts +96 -94
  214. package/src/dex/fluid-dex/types.ts +3 -0
  215. package/tests/constants-e2e.ts +2 -7
  216. package/tests/tenderly-simulation.ts +1 -0
  217. package/.idea/aws.xml +0 -17
  218. package/.idea/codeStyles/Project.xml +0 -19
  219. package/.idea/codeStyles/codeStyleConfig.xml +0 -5
  220. package/.idea/misc.xml +0 -6
  221. package/.idea/modules.xml +0 -8
  222. package/.idea/paraswap-dex-lib.iml +0 -9
  223. package/.idea/prettier.xml +0 -7
  224. package/.idea/vcs.xml +0 -6
  225. package/build/abi/balancer-v3/directionalFeeHook.json +0 -684
  226. package/build/abi/integral/factory.json +0 -333
  227. package/build/dex/bProtocol.d.ts +0 -18
  228. package/build/dex/bProtocol.js +0 -39
  229. package/build/dex/bProtocol.js.map +0 -1
  230. package/build/dex/balancer-v3/balancer-test-helpers.d.ts +0 -5
  231. package/build/dex/balancer-v3/balancer-test-helpers.js +0 -122
  232. package/build/dex/balancer-v3/balancer-test-helpers.js.map +0 -1
  233. package/build/dex/balancer-v3/hooks/balancer-hook-event-subscriber.d.ts +0 -54
  234. package/build/dex/balancer-v3/hooks/balancer-hook-event-subscriber.js +0 -153
  235. package/build/dex/balancer-v3/hooks/balancer-hook-event-subscriber.js.map +0 -1
  236. package/build/dex/balancer-v3/hooks/directionalFeeHook.d.ts +0 -26
  237. package/build/dex/balancer-v3/hooks/directionalFeeHook.js +0 -41
  238. package/build/dex/balancer-v3/hooks/directionalFeeHook.js.map +0 -1
  239. package/build/dex/balancer-v3/hooks/loadHooksConfig.d.ts +0 -2
  240. package/build/dex/balancer-v3/hooks/loadHooksConfig.js +0 -11
  241. package/build/dex/balancer-v3/hooks/loadHooksConfig.js.map +0 -1
  242. package/build/dex/balancer-v3/hooks/stableSurgeHook.d.ts +0 -39
  243. package/build/dex/balancer-v3/hooks/stableSurgeHook.js +0 -99
  244. package/build/dex/balancer-v3/hooks/stableSurgeHook.js.map +0 -1
  245. package/build/dex/bancor.d.ts +0 -26
  246. package/build/dex/bancor.js +0 -58
  247. package/build/dex/bancor.js.map +0 -1
  248. package/build/dex/compound.d.ts +0 -18
  249. package/build/dex/compound.js +0 -46
  250. package/build/dex/compound.js.map +0 -1
  251. package/build/dex/curve-v2.d.ts +0 -58
  252. package/build/dex/curve-v2.js +0 -180
  253. package/build/dex/curve-v2.js.map +0 -1
  254. package/build/dex/dodo-v1.d.ts +0 -33
  255. package/build/dex/dodo-v1.js +0 -63
  256. package/build/dex/dodo-v1.js.map +0 -1
  257. package/build/dex/fluid-dex/fluid-dex-generate-pool.d.ts +0 -49
  258. package/build/dex/fluid-dex/fluid-dex-generate-pool.js +0 -104
  259. package/build/dex/fluid-dex/fluid-dex-generate-pool.js.map +0 -1
  260. package/build/dex/integral/config.d.ts +0 -4
  261. package/build/dex/integral/config.js +0 -20
  262. package/build/dex/integral/config.js.map +0 -1
  263. package/build/dex/integral/context.d.ts +0 -40
  264. package/build/dex/integral/context.js +0 -158
  265. package/build/dex/integral/context.js.map +0 -1
  266. package/build/dex/integral/integral-factory.d.ts +0 -24
  267. package/build/dex/integral/integral-factory.js +0 -95
  268. package/build/dex/integral/integral-factory.js.map +0 -1
  269. package/build/dex/integral/integral-pool.d.ts +0 -50
  270. package/build/dex/integral/integral-pool.js +0 -149
  271. package/build/dex/integral/integral-pool.js.map +0 -1
  272. package/build/dex/integral/integral-pricing.d.ts +0 -18
  273. package/build/dex/integral/integral-pricing.js +0 -114
  274. package/build/dex/integral/integral-pricing.js.map +0 -1
  275. package/build/dex/integral/integral-relayer.d.ts +0 -42
  276. package/build/dex/integral/integral-relayer.js +0 -192
  277. package/build/dex/integral/integral-relayer.js.map +0 -1
  278. package/build/dex/integral/integral-token.d.ts +0 -27
  279. package/build/dex/integral/integral-token.js +0 -59
  280. package/build/dex/integral/integral-token.js.map +0 -1
  281. package/build/dex/integral/integral.js +0 -376
  282. package/build/dex/integral/integral.js.map +0 -1
  283. package/build/dex/integral/types.d.ts +0 -85
  284. package/build/dex/integral/types.js +0 -9
  285. package/build/dex/integral/types.js.map +0 -1
  286. package/build/dex/integral/utils-e2e.d.ts +0 -9
  287. package/build/dex/integral/utils-e2e.js +0 -131
  288. package/build/dex/integral/utils-e2e.js.map +0 -1
  289. package/build/dex/integral/utils.d.ts +0 -17
  290. package/build/dex/integral/utils.js +0 -94
  291. package/build/dex/integral/utils.js.map +0 -1
  292. package/build/dex/lido.d.ts +0 -19
  293. package/build/dex/lido.js +0 -42
  294. package/build/dex/lido.js.map +0 -1
  295. package/build/dex/onebit.d.ts +0 -25
  296. package/build/dex/onebit.js +0 -42
  297. package/build/dex/onebit.js.map +0 -1
  298. package/build/dex/smoothy.d.ts +0 -26
  299. package/build/dex/smoothy.js +0 -48
  300. package/build/dex/smoothy.js.map +0 -1
  301. package/build/dex/stable-pool.d.ts +0 -28
  302. package/build/dex/stable-pool.js +0 -62
  303. package/build/dex/stable-pool.js.map +0 -1
  304. package/build/dex/trader-joe-v2.1/optimizer.d.ts +0 -2
  305. package/build/dex/trader-joe-v2.1/optimizer.js +0 -47
  306. package/build/dex/trader-joe-v2.1/optimizer.js.map +0 -1
  307. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.d.ts +0 -7
  308. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js +0 -20
  309. package/build/dex/trader-joe-v2.1/trader-joe-v2.1-new.js.map +0 -1
  310. package/build/dex/trader-joe-v2.1.d.ts +0 -43
  311. package/build/dex/trader-joe-v2.1.js +0 -79
  312. package/build/dex/trader-joe-v2.1.js.map +0 -1
  313. package/src/abi/balancer-v3/directionalFeeHook.json +0 -684
  314. package/src/abi/balancer-v3/stableSurgeHook.json +0 -976
  315. package/src/dex/balancer-v3/balancer-hooks-events.test.ts +0 -99
  316. package/src/dex/balancer-v3/balancer-stableSurge.test.ts +0 -110
  317. package/src/dex/balancer-v3/balancer-test-helpers.ts +0 -199
  318. package/src/dex/balancer-v3/hooks/balancer-hook-event-subscriber.ts +0 -226
  319. package/src/dex/balancer-v3/hooks/directionalFeeHook.ts +0 -51
  320. package/src/dex/balancer-v3/hooks/loadHooksConfig.ts +0 -12
  321. package/src/dex/balancer-v3/hooks/stableSurgeHook.ts +0 -163
@@ -1,333 +0,0 @@
1
- [
2
- {
3
- "inputs": [],
4
- "stateMutability": "nonpayable",
5
- "type": "constructor"
6
- },
7
- {
8
- "anonymous": false,
9
- "inputs": [
10
- {
11
- "indexed": false,
12
- "internalType": "address",
13
- "name": "owner",
14
- "type": "address"
15
- }
16
- ],
17
- "name": "OwnerSet",
18
- "type": "event"
19
- },
20
- {
21
- "anonymous": false,
22
- "inputs": [
23
- {
24
- "indexed": true,
25
- "internalType": "address",
26
- "name": "token0",
27
- "type": "address"
28
- },
29
- {
30
- "indexed": true,
31
- "internalType": "address",
32
- "name": "token1",
33
- "type": "address"
34
- },
35
- {
36
- "indexed": false,
37
- "internalType": "address",
38
- "name": "pair",
39
- "type": "address"
40
- },
41
- {
42
- "indexed": false,
43
- "internalType": "uint256",
44
- "name": "",
45
- "type": "uint256"
46
- }
47
- ],
48
- "name": "PairCreated",
49
- "type": "event"
50
- },
51
- {
52
- "inputs": [
53
- {
54
- "internalType": "uint256",
55
- "name": "",
56
- "type": "uint256"
57
- }
58
- ],
59
- "name": "allPairs",
60
- "outputs": [
61
- {
62
- "internalType": "address",
63
- "name": "",
64
- "type": "address"
65
- }
66
- ],
67
- "stateMutability": "view",
68
- "type": "function"
69
- },
70
- {
71
- "inputs": [],
72
- "name": "allPairsLength",
73
- "outputs": [
74
- {
75
- "internalType": "uint256",
76
- "name": "",
77
- "type": "uint256"
78
- }
79
- ],
80
- "stateMutability": "view",
81
- "type": "function"
82
- },
83
- {
84
- "inputs": [
85
- {
86
- "internalType": "address",
87
- "name": "tokenA",
88
- "type": "address"
89
- },
90
- {
91
- "internalType": "address",
92
- "name": "tokenB",
93
- "type": "address"
94
- },
95
- {
96
- "internalType": "address",
97
- "name": "to",
98
- "type": "address"
99
- }
100
- ],
101
- "name": "collect",
102
- "outputs": [],
103
- "stateMutability": "nonpayable",
104
- "type": "function"
105
- },
106
- {
107
- "inputs": [
108
- {
109
- "internalType": "address",
110
- "name": "tokenA",
111
- "type": "address"
112
- },
113
- {
114
- "internalType": "address",
115
- "name": "tokenB",
116
- "type": "address"
117
- },
118
- {
119
- "internalType": "address",
120
- "name": "oracle",
121
- "type": "address"
122
- },
123
- {
124
- "internalType": "address",
125
- "name": "trader",
126
- "type": "address"
127
- }
128
- ],
129
- "name": "createPair",
130
- "outputs": [
131
- {
132
- "internalType": "address",
133
- "name": "pair",
134
- "type": "address"
135
- }
136
- ],
137
- "stateMutability": "nonpayable",
138
- "type": "function"
139
- },
140
- {
141
- "inputs": [
142
- {
143
- "internalType": "address",
144
- "name": "",
145
- "type": "address"
146
- },
147
- {
148
- "internalType": "address",
149
- "name": "",
150
- "type": "address"
151
- }
152
- ],
153
- "name": "getPair",
154
- "outputs": [
155
- {
156
- "internalType": "address",
157
- "name": "",
158
- "type": "address"
159
- }
160
- ],
161
- "stateMutability": "view",
162
- "type": "function"
163
- },
164
- {
165
- "inputs": [],
166
- "name": "owner",
167
- "outputs": [
168
- {
169
- "internalType": "address",
170
- "name": "",
171
- "type": "address"
172
- }
173
- ],
174
- "stateMutability": "view",
175
- "type": "function"
176
- },
177
- {
178
- "inputs": [
179
- {
180
- "internalType": "address",
181
- "name": "tokenA",
182
- "type": "address"
183
- },
184
- {
185
- "internalType": "address",
186
- "name": "tokenB",
187
- "type": "address"
188
- },
189
- {
190
- "internalType": "uint256",
191
- "name": "fee",
192
- "type": "uint256"
193
- }
194
- ],
195
- "name": "setBurnFee",
196
- "outputs": [],
197
- "stateMutability": "nonpayable",
198
- "type": "function"
199
- },
200
- {
201
- "inputs": [
202
- {
203
- "internalType": "address",
204
- "name": "tokenA",
205
- "type": "address"
206
- },
207
- {
208
- "internalType": "address",
209
- "name": "tokenB",
210
- "type": "address"
211
- },
212
- {
213
- "internalType": "uint256",
214
- "name": "fee",
215
- "type": "uint256"
216
- }
217
- ],
218
- "name": "setMintFee",
219
- "outputs": [],
220
- "stateMutability": "nonpayable",
221
- "type": "function"
222
- },
223
- {
224
- "inputs": [
225
- {
226
- "internalType": "address",
227
- "name": "tokenA",
228
- "type": "address"
229
- },
230
- {
231
- "internalType": "address",
232
- "name": "tokenB",
233
- "type": "address"
234
- },
235
- {
236
- "internalType": "address",
237
- "name": "oracle",
238
- "type": "address"
239
- }
240
- ],
241
- "name": "setOracle",
242
- "outputs": [],
243
- "stateMutability": "nonpayable",
244
- "type": "function"
245
- },
246
- {
247
- "inputs": [
248
- {
249
- "internalType": "address",
250
- "name": "_owner",
251
- "type": "address"
252
- }
253
- ],
254
- "name": "setOwner",
255
- "outputs": [],
256
- "stateMutability": "nonpayable",
257
- "type": "function"
258
- },
259
- {
260
- "inputs": [
261
- {
262
- "internalType": "address",
263
- "name": "tokenA",
264
- "type": "address"
265
- },
266
- {
267
- "internalType": "address",
268
- "name": "tokenB",
269
- "type": "address"
270
- },
271
- {
272
- "internalType": "uint256",
273
- "name": "fee",
274
- "type": "uint256"
275
- }
276
- ],
277
- "name": "setSwapFee",
278
- "outputs": [],
279
- "stateMutability": "nonpayable",
280
- "type": "function"
281
- },
282
- {
283
- "inputs": [
284
- {
285
- "internalType": "address",
286
- "name": "tokenA",
287
- "type": "address"
288
- },
289
- {
290
- "internalType": "address",
291
- "name": "tokenB",
292
- "type": "address"
293
- },
294
- {
295
- "internalType": "address",
296
- "name": "trader",
297
- "type": "address"
298
- }
299
- ],
300
- "name": "setTrader",
301
- "outputs": [],
302
- "stateMutability": "nonpayable",
303
- "type": "function"
304
- },
305
- {
306
- "inputs": [
307
- {
308
- "internalType": "address",
309
- "name": "tokenA",
310
- "type": "address"
311
- },
312
- {
313
- "internalType": "address",
314
- "name": "tokenB",
315
- "type": "address"
316
- },
317
- {
318
- "internalType": "uint256",
319
- "name": "amount",
320
- "type": "uint256"
321
- },
322
- {
323
- "internalType": "address",
324
- "name": "to",
325
- "type": "address"
326
- }
327
- ],
328
- "name": "withdraw",
329
- "outputs": [],
330
- "stateMutability": "nonpayable",
331
- "type": "function"
332
- }
333
- ]
@@ -1,18 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { SwapSide } from '../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 {};
@@ -1,39 +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.BProtocol = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const simple_exchange_1 = require("./simple-exchange");
9
- const BProtocol_json_1 = __importDefault(require("../abi/BProtocol.json"));
10
- var BProtocolFunctions;
11
- (function (BProtocolFunctions) {
12
- BProtocolFunctions["swap"] = "swap";
13
- })(BProtocolFunctions || (BProtocolFunctions = {}));
14
- class BProtocol extends simple_exchange_1.SimpleExchange {
15
- constructor(dexHelper) {
16
- super(dexHelper, 'bprotocol');
17
- this.exchangeRouterInterface = new abi_1.Interface(BProtocol_json_1.default);
18
- }
19
- getAdapterParam(srcToken, destToken, srcAmount, destAmount, data, side) {
20
- return {
21
- targetExchange: data.exchange,
22
- payload: '0x',
23
- networkFee: '0',
24
- };
25
- }
26
- async getSimpleParam(srcToken, destToken, srcAmount, destAmount, data, side) {
27
- const swapFunction = BProtocolFunctions.swap;
28
- const swapFunctionParams = [
29
- srcAmount,
30
- destAmount,
31
- this.augustusAddress,
32
- ];
33
- const swapData = this.exchangeRouterInterface.encodeFunctionData(swapFunction, swapFunctionParams);
34
- return this.buildSimpleParamWithoutWETHConversion(srcToken, srcAmount, destToken, destAmount, swapData, data.exchange);
35
- }
36
- }
37
- exports.BProtocol = BProtocol;
38
- BProtocol.dexKeys = ['bprotocol'];
39
- //# sourceMappingURL=bProtocol.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"bProtocol.js","sourceRoot":"","sources":["../../src/dex/bProtocol.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA6D;AAI7D,uDAAmD;AACnD,2EAAiD;AAOjD,IAAK,kBAEJ;AAFD,WAAK,kBAAkB;IACrB,mCAAa,CAAA;AACf,CAAC,EAFI,kBAAkB,KAAlB,kBAAkB,QAEtB;AAED,MAAa,SACX,SAAQ,gCAAc;IAMtB,YAAY,SAAqB;QAC/B,KAAK,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QAC9B,IAAI,CAAC,uBAAuB,GAAG,IAAI,eAAS,CAC1C,wBAA8B,CAC/B,CAAC;IACJ,CAAC;IAED,eAAe,CACb,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,QAAQ;YAC7B,OAAO,EAAE,IAAI;YACb,UAAU,EAAE,GAAG;SAChB,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,SAAiB,EACjB,SAAiB,EACjB,UAAkB,EAClB,IAAmB,EACnB,IAAc;QAEd,MAAM,YAAY,GAAG,kBAAkB,CAAC,IAAI,CAAC;QAC7C,MAAM,kBAAkB,GAAmB;YACzC,SAAS;YACT,UAAU;YACV,IAAI,CAAC,eAAe;SACrB,CAAC;QACF,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,kBAAkB,CAC9D,YAAY,EACZ,kBAAkB,CACnB,CAAC;QAEF,OAAO,IAAI,CAAC,qCAAqC,CAC/C,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,IAAI,CAAC,QAAQ,CACd,CAAC;IACJ,CAAC;;AAxDH,8BAyDC;AArDQ,iBAAO,GAAG,CAAC,WAAW,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare function checkOnChainPricingNonMulti(network: number, side: SwapSide, balancerV3: BalancerV3, blockNumber: number, prices: ExchangePrices<BalancerV3Data>, amounts: bigint[]): Promise<void>;
2
- import { SwapSide } from '../../constants';
3
- import { BalancerV3 } from './balancer-v3';
4
- import { BalancerV3Data } from './types';
5
- import { ExchangePrices } from '../../types';
@@ -1,122 +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.checkOnChainPricingNonMulti = checkOnChainPricingNonMulti;
7
- /* eslint-disable no-console */
8
- // Note - this is currently needed because queries won't work with multicall but should be updated in future
9
- async function checkOnChainPricingNonMulti(network, side, balancerV3, blockNumber, prices, amounts) {
10
- // test match for each returned price
11
- for (const price of prices) {
12
- let expectedPrices = [];
13
- if (price.data.steps.length === 1 && !price.data.steps[0].isBuffer)
14
- expectedPrices = await querySinglePathPrices(network, side, balancerV3, blockNumber, price, amounts);
15
- else
16
- expectedPrices = await queryMultiPathPrices(network, side, balancerV3, blockNumber, price, amounts);
17
- expect(price.prices).toEqual(expectedPrices);
18
- }
19
- }
20
- async function querySinglePathPrices(network, side, balancerV3, blockNumber, price, amounts) {
21
- const balancerRouter = new abi_1.Interface(router_json_1.default);
22
- const readerCallData = getQuerySwapSingleTokenCalldata(config_1.BalancerV3Config.BalancerV3[network].balancerRouterAddress, balancerRouter, amounts, price.data.steps[0], side);
23
- const expectedPrices = [0n];
24
- for (const call of readerCallData) {
25
- try {
26
- const result = await balancerV3.dexHelper.provider.call({
27
- to: call.target,
28
- data: call.callData,
29
- }, blockNumber);
30
- const parsed = balancerRouter.decodeFunctionResult(side === constants_1.SwapSide.SELL
31
- ? `querySwapSingleTokenExactIn`
32
- : `querySwapSingleTokenExactOut`, result);
33
- expectedPrices.push(BigInt(parsed[0]._hex));
34
- }
35
- catch (error) {
36
- console.log('Error in querySinglePathPrices', error);
37
- expectedPrices.push(0n);
38
- }
39
- }
40
- return expectedPrices;
41
- }
42
- async function queryMultiPathPrices(network, side, balancerV3, blockNumber, price, amounts) {
43
- const balancerBatchRouter = new abi_1.Interface(batch_router_json_1.default);
44
- const readerCallData = getQuerySwapMultiTokenCalldata(config_1.BalancerV3Config.BalancerV3[network].balancerBatchRouterAddress, balancerBatchRouter, amounts, price.data.steps, side);
45
- const expectedPrices = [0n];
46
- for (const call of readerCallData) {
47
- try {
48
- const result = await balancerV3.dexHelper.provider.call({
49
- to: call.target,
50
- data: call.callData,
51
- }, blockNumber);
52
- const parsed = balancerBatchRouter.decodeFunctionResult(side === constants_1.SwapSide.SELL ? `querySwapExactIn` : `querySwapExactOut`, result);
53
- expectedPrices.push(BigInt(parsed[2][0]._hex));
54
- }
55
- catch (error) {
56
- console.log('Error in queryMultiPathPrices', error);
57
- expectedPrices.push(0n);
58
- }
59
- }
60
- return expectedPrices;
61
- }
62
- function getQuerySwapSingleTokenCalldata(routerAddress, routerInterface, amounts, step, side) {
63
- return amounts
64
- .filter(amount => amount !== 0n)
65
- .map(amount => {
66
- return {
67
- target: routerAddress,
68
- callData: routerInterface.encodeFunctionData(side === constants_1.SwapSide.SELL
69
- ? `querySwapSingleTokenExactIn`
70
- : `querySwapSingleTokenExactOut`, [
71
- step.pool,
72
- step.swapInput.tokenIn,
73
- step.swapInput.tokenOut,
74
- amount,
75
- constants_1.NULL_ADDRESS,
76
- '0x',
77
- ]),
78
- };
79
- });
80
- }
81
- /* eslint-disable no-console */
82
- const abi_1 = require("@ethersproject/abi");
83
- const constants_1 = require("../../constants");
84
- const config_1 = require("./config");
85
- const batch_router_json_1 = __importDefault(require("../../abi/balancer-v3/batch-router.json"));
86
- const router_json_1 = __importDefault(require("../../abi/balancer-v3/router.json"));
87
- function getQuerySwapMultiTokenCalldata(routerAddress, routerInterface, amounts, steps, side) {
88
- const tokenIn = steps[0].swapInput.tokenIn;
89
- const stepsNew = steps.map(s => ({
90
- pool: s.pool,
91
- tokenOut: s.swapInput.tokenOut,
92
- isBuffer: s.isBuffer,
93
- }));
94
- return amounts
95
- .filter(amount => amount !== 0n)
96
- .map(amount => {
97
- let args = [];
98
- if (side === constants_1.SwapSide.SELL)
99
- args = [
100
- {
101
- tokenIn,
102
- steps: stepsNew,
103
- exactAmountIn: amount,
104
- minAmountOut: 0n,
105
- },
106
- ];
107
- else
108
- args = [
109
- {
110
- tokenIn,
111
- steps: stepsNew,
112
- exactAmountOut: amount,
113
- maxAmountIn: 0n,
114
- },
115
- ];
116
- return {
117
- target: routerAddress,
118
- callData: routerInterface.encodeFunctionData(side === constants_1.SwapSide.SELL ? `querySwapExactIn` : `querySwapExactOut`, [args, constants_1.NULL_ADDRESS, '0x']),
119
- };
120
- });
121
- }
122
- //# sourceMappingURL=balancer-test-helpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"balancer-test-helpers.js","sourceRoot":"","sources":["../../../src/dex/balancer-v3/balancer-test-helpers.ts"],"names":[],"mappings":";;;;;AAEA,kEA+BC;AAjCD,+BAA+B;AAC/B,4GAA4G;AACrG,KAAK,UAAU,2BAA2B,CAC/C,OAAe,EACf,IAAc,EACd,UAAsB,EACtB,WAAmB,EACnB,MAAsC,EACtC,OAAiB;IAEjB,qCAAqC;IACrC,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,cAAc,GAAa,EAAE,CAAC;QAClC,IAAI,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ;YAChE,cAAc,GAAG,MAAM,qBAAqB,CAC1C,OAAO,EACP,IAAI,EACJ,UAAU,EACV,WAAW,EACX,KAAK,EACL,OAAO,CACR,CAAC;;YAEF,cAAc,GAAG,MAAM,oBAAoB,CACzC,OAAO,EACP,IAAI,EACJ,UAAU,EACV,WAAW,EACX,KAAK,EACL,OAAO,CACR,CAAC;QACJ,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC;AAED,KAAK,UAAU,qBA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;oBACtB,WAAW,EAAE,EAAE;iBAChB;aACF,CAAC;QACJ,OAAO;YACL,MAAM,EAAE,aAAa;YACrB,QAAQ,EAAE,eAAe,CAAC,kBAAkB,CAC1C,IAAI,KAAK,oBAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,mBAAmB,EACjE,CAAC,IAAI,EAAE,wBAAY,EAAE,IAAI,CAAC,CAC3B;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -1,54 +0,0 @@
1
- import { Interface } from '@ethersproject/abi';
2
- import { DeepReadonly } from 'ts-essentials';
3
- import { Log, Logger } from '../../../types';
4
- import { StatefulEventSubscriber } from '../../../stateful-event-subscriber';
5
- import { IDexHelper } from '../../../dex-helper/idex-helper';
6
- import { DirectionalFeeConfig, DirectionalFeeHookState } from './directionalFeeHook';
7
- import { StableSurgeConfig, StableSurgeHookState } from './stableSurgeHook';
8
- export type HookState = DirectionalFeeHookState | StableSurgeHookState;
9
- export type HookStateMap = {
10
- [address: string]: HookState;
11
- };
12
- export type HookConfig = DirectionalFeeConfig | StableSurgeConfig;
13
- export type HooksConfigMap = {
14
- [hookAddress: string]: HookConfig;
15
- };
16
- /**
17
- * This will handle events/state for each supported hook contract. State is used during swap calculations.
18
- * Each hook should have its own implementation file for state typing, fetching state and handling events.
19
- */
20
- export declare class BalancerEventHook extends StatefulEventSubscriber<HookStateMap> {
21
- readonly parentName: string;
22
- protected network: number;
23
- protected dexHelper: IDexHelper;
24
- handlers: {
25
- [event: string]: (event: any, state: DeepReadonly<HookStateMap>, log: Readonly<Log>) => DeepReadonly<HookStateMap> | null;
26
- };
27
- interfaces: Interface[];
28
- logDecoder: (log: Log) => any;
29
- addressesSubscribed: string[];
30
- hooksConfigMap: HooksConfigMap;
31
- constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger);
32
- /**
33
- * The function is called every time any of the subscribed
34
- * addresses release log. The function accepts the current
35
- * state, updates the state according to the log, and returns
36
- * the updated state.
37
- * @param state - Current state of event subscriber
38
- * @param log - Log released by one of the subscribed addresses
39
- * @returns Updates state of the event subscriber after the log
40
- */
41
- protected processLog(state: DeepReadonly<HookStateMap>, log: Readonly<Log>): DeepReadonly<HookStateMap> | null;
42
- /**
43
- * The function generates state using on-chain calls. This
44
- * function is called to regenerate state if the event based
45
- * system fails to fetch events and the local state is no
46
- * more correct.
47
- * @param blockNumber - Blocknumber for which the state should
48
- * should be generated
49
- * @returns state of the event subscriber at blocknumber
50
- */
51
- generateState(blockNumber: number): Promise<DeepReadonly<HookStateMap>>;
52
- updateHookState(): Promise<void>;
53
- combineInterfaces: (interfaces: Interface[]) => Interface;
54
- }