@paraswap/dex-lib 4.7.24-inactive-dexs-cleanup.0 → 4.7.25-uni-v2-rpc-optimisation.0

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 (265) hide show
  1. package/build/abi/{apex-defi/ApexDefiRouter.abi.json → BProtocol.json} +573 -538
  2. package/build/abi/Jarvis.json +1172 -0
  3. package/build/abi/{apex-defi/ApexDefiFactory.abi.json → MStableAsset.json} +781 -985
  4. package/build/abi/{apex-defi/ApexDefiWrapperFactory.abi.json → OneInchLp.json} +766 -569
  5. package/build/abi/Onebit.json +736 -0
  6. package/build/abi/Shell.json +1294 -0
  7. package/build/abi/TraderJoeV2Router.json +50 -0
  8. package/build/abi/wUSDM.json +757 -0
  9. package/build/abi/zrx.v2.json +1967 -0
  10. package/build/abi/zrx.v3.json +3454 -0
  11. package/build/abi/zrx.v4.json +2193 -0
  12. package/build/dex/OneInchLp.d.ts +24 -0
  13. package/build/dex/OneInchLp.js +43 -0
  14. package/build/dex/OneInchLp.js.map +1 -0
  15. package/build/dex/algebra/config.js +30 -0
  16. package/build/dex/algebra/config.js.map +1 -1
  17. package/build/dex/algebra-integral/config.js +7 -0
  18. package/build/dex/algebra-integral/config.js.map +1 -1
  19. package/build/dex/bProtocol/bProtocol.d.ts +15 -0
  20. package/build/dex/bProtocol/bProtocol.js +56 -0
  21. package/build/dex/bProtocol/bProtocol.js.map +1 -0
  22. package/build/dex/bProtocol/types.d.ts +11 -0
  23. package/build/dex/bProtocol/types.js +8 -0
  24. package/build/dex/bProtocol/types.js.map +1 -0
  25. package/build/dex/erc4626/config.js +4 -0
  26. package/build/dex/erc4626/config.js.map +1 -1
  27. package/build/dex/index.js +8 -2
  28. package/build/dex/index.js.map +1 -1
  29. package/build/dex/infusion/infusion-stable-pool.d.ts +1 -1
  30. package/build/dex/infusion/infusion-stable-pool.js +1 -1
  31. package/build/dex/infusion/infusion-stable-pool.js.map +1 -1
  32. package/build/dex/infusion/infusion.d.ts +3 -3
  33. package/build/dex/infusion/infusion.js +104 -65
  34. package/build/dex/infusion/infusion.js.map +1 -1
  35. package/build/dex/jarvis.d.ts +56 -0
  36. package/build/dex/jarvis.js +163 -0
  37. package/build/dex/jarvis.js.map +1 -0
  38. package/build/dex/mStable.d.ts +44 -0
  39. package/build/dex/mStable.js +75 -0
  40. package/build/dex/mStable.js.map +1 -0
  41. package/build/dex/onebit/onebit.d.ts +16 -0
  42. package/build/dex/onebit/onebit.js +61 -0
  43. package/build/dex/onebit/onebit.js.map +1 -0
  44. package/build/dex/onebit/types.d.ts +14 -0
  45. package/build/dex/onebit/types.js +8 -0
  46. package/build/dex/onebit/types.js.map +1 -0
  47. package/build/dex/{yo → se-vlr}/config.d.ts +1 -1
  48. package/build/dex/se-vlr/config.js +24 -0
  49. package/build/dex/se-vlr/config.js.map +1 -0
  50. package/build/dex/{stabull/stabull-pool.d.ts → se-vlr/se-vlr-pool.d.ts} +6 -13
  51. package/build/dex/se-vlr/se-vlr-pool.js +70 -0
  52. package/build/dex/se-vlr/se-vlr-pool.js.map +1 -0
  53. package/build/dex/se-vlr/se-vlr.d.ts +35 -0
  54. package/build/dex/se-vlr/se-vlr.js +131 -0
  55. package/build/dex/se-vlr/se-vlr.js.map +1 -0
  56. package/build/dex/se-vlr/types.d.ts +6 -0
  57. package/build/dex/{yo → se-vlr}/types.js.map +1 -1
  58. package/build/dex/shell.d.ts +25 -0
  59. package/build/dex/shell.js +41 -0
  60. package/build/dex/shell.js.map +1 -0
  61. package/build/dex/solidly/config.js +6 -0
  62. package/build/dex/solidly/config.js.map +1 -1
  63. package/build/dex/solidly/forks-override/aerodrome.d.ts +1 -1
  64. package/build/dex/solidly/forks-override/aerodrome.js +14 -18
  65. package/build/dex/solidly/forks-override/aerodrome.js.map +1 -1
  66. package/build/dex/solidly/forks-override/velodromeV2.js +1 -1
  67. package/build/dex/solidly/forks-override/velodromeV2.js.map +1 -1
  68. package/build/dex/solidly/solidly-stable-pool.d.ts +1 -1
  69. package/build/dex/solidly/solidly-stable-pool.js +1 -1
  70. package/build/dex/solidly/solidly-stable-pool.js.map +1 -1
  71. package/build/dex/solidly/solidly.d.ts +5 -4
  72. package/build/dex/solidly/solidly.js +112 -72
  73. package/build/dex/solidly/solidly.js.map +1 -1
  74. package/build/dex/solidly/types.d.ts +3 -0
  75. package/build/dex/trader-joe-v2.1/config.js +2 -0
  76. package/build/dex/trader-joe-v2.1/config.js.map +1 -1
  77. package/build/dex/trader-joe-v2.d.ts +40 -0
  78. package/build/dex/trader-joe-v2.js +74 -0
  79. package/build/dex/trader-joe-v2.js.map +1 -0
  80. package/build/dex/uniswap-v2/config.js +77 -0
  81. package/build/dex/uniswap-v2/config.js.map +1 -1
  82. package/build/dex/uniswap-v2/uniswap-v2.d.ts +6 -4
  83. package/build/dex/uniswap-v2/uniswap-v2.js +32 -10
  84. package/build/dex/uniswap-v2/uniswap-v2.js.map +1 -1
  85. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.d.ts +5 -0
  86. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.js +11 -0
  87. package/build/dex/uniswap-v3/forks/pharaoh-v3/pharaoh-v3.js.map +1 -1
  88. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.d.ts +1 -4
  89. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js +0 -30
  90. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream-pool.js.map +1 -1
  91. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.d.ts +7 -0
  92. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js +58 -0
  93. package/build/dex/uniswap-v3/forks/velodrome-slipstream/velodrome-slipstream.js.map +1 -1
  94. package/build/dex/uniswap-v3/uniswap-v3-new.d.ts +94 -0
  95. package/build/dex/uniswap-v3/uniswap-v3-new.js +923 -0
  96. package/build/dex/uniswap-v3/uniswap-v3-new.js.map +1 -0
  97. package/build/dex/uniswap-v4/contract-math/Position.d.ts +0 -6
  98. package/build/dex/uniswap-v4/contract-math/Position.js +0 -29
  99. package/build/dex/uniswap-v4/contract-math/Position.js.map +1 -1
  100. package/build/dex/{stabull → usual-bond}/config.d.ts +1 -1
  101. package/build/dex/usual-bond/config.js +13 -0
  102. package/build/dex/usual-bond/config.js.map +1 -0
  103. package/build/dex/usual-bond/types.d.ts +7 -0
  104. package/build/dex/{apex-defi → usual-bond}/types.js.map +1 -1
  105. package/build/dex/{aave-pt-to-underlying/aave-pt-to-underlying.d.ts → usual-bond/usual-bond.d.ts} +18 -23
  106. package/build/dex/usual-bond/usual-bond.js +176 -0
  107. package/build/dex/usual-bond/usual-bond.js.map +1 -0
  108. package/build/dex/wombat/config.js +9 -0
  109. package/build/dex/wombat/config.js.map +1 -1
  110. package/build/dex/wusdm/config.d.ts +3 -0
  111. package/build/dex/wusdm/config.js +43 -0
  112. package/build/dex/wusdm/config.js.map +1 -0
  113. package/build/dex/wusdm/constants.d.ts +2 -0
  114. package/build/dex/wusdm/constants.js +6 -0
  115. package/build/dex/wusdm/constants.js.map +1 -0
  116. package/build/dex/wusdm/types.d.ts +18 -0
  117. package/build/dex/wusdm/types.js +11 -0
  118. package/build/dex/wusdm/types.js.map +1 -0
  119. package/build/dex/wusdm/wusdm-pool.d.ts +21 -0
  120. package/build/dex/wusdm/wusdm-pool.js +74 -0
  121. package/build/dex/wusdm/wusdm-pool.js.map +1 -0
  122. package/build/dex/wusdm/wusdm.d.ts +46 -0
  123. package/build/dex/wusdm/wusdm.js +243 -0
  124. package/build/dex/wusdm/wusdm.js.map +1 -0
  125. package/build/dex/zerox/config.d.ts +2 -0
  126. package/build/dex/zerox/config.js +33 -0
  127. package/build/dex/zerox/config.js.map +1 -0
  128. package/build/dex/zerox/index.d.ts +22 -0
  129. package/build/dex/zerox/index.js +225 -0
  130. package/build/dex/zerox/index.js.map +1 -0
  131. package/build/dex/zerox/order.d.ts +88 -0
  132. package/build/dex/zerox/order.js +53 -0
  133. package/build/dex/zerox/order.js.map +1 -0
  134. package/build/dex/zerox/types.d.ts +73 -0
  135. package/build/dex/zerox/types.js +21 -0
  136. package/build/dex/zerox/types.js.map +1 -0
  137. package/package.json +1 -1
  138. package/build/abi/PendleRouterStatic.json +0 -19
  139. package/build/abi/apex-defi/ApexDefiToken.abi.json +0 -229
  140. package/build/abi/apex-defi/ApexDefiWrapper.abi.json +0 -92
  141. package/build/abi/pangolin-v3/PangolinV3StateMulticall.abi.json +0 -796
  142. package/build/abi/pendle/pendle-deployer.abi.json +0 -520
  143. package/build/abi/pendle/pendle-oracle.abi.json +0 -413
  144. package/build/abi/ring-v2/few-wrapped-token.json +0 -587
  145. package/build/abi/ring-v2/ring-v2-factory.json +0 -125
  146. package/build/abi/ring-v2/ring-v2-pool.json +0 -461
  147. package/build/abi/ring-v2/ring-v2-router.json +0 -332
  148. package/build/abi/stabull/stabull-curve.json +0 -738
  149. package/build/abi/stabull/stabull-router.json +0 -76
  150. package/build/abi/uniswap-v4/hooks/SpotDynamicFeeManager.json +0 -26
  151. package/build/abi/uniswap-v4/hooks/SpotHook.json +0 -54
  152. package/build/abi/uniswap-v4/hooks/SpotPolicyManager.json +0 -45
  153. package/build/abi/uniswap-v4/hooks/cabalcoin-hook.abi.json +0 -682
  154. package/build/abi/uniswap-v4/hooks/fee-hook.abi.json +0 -1335
  155. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.d.ts +0 -29
  156. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js +0 -153
  157. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying-factory.js.map +0 -1
  158. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js +0 -323
  159. package/build/dex/aave-pt-to-underlying/aave-pt-to-underlying.js.map +0 -1
  160. package/build/dex/aave-pt-to-underlying/config.d.ts +0 -3
  161. package/build/dex/aave-pt-to-underlying/config.js +0 -24
  162. package/build/dex/aave-pt-to-underlying/config.js.map +0 -1
  163. package/build/dex/aave-pt-to-underlying/constants.d.ts +0 -2
  164. package/build/dex/aave-pt-to-underlying/constants.js +0 -6
  165. package/build/dex/aave-pt-to-underlying/constants.js.map +0 -1
  166. package/build/dex/aave-pt-to-underlying/types.d.ts +0 -24
  167. package/build/dex/aave-pt-to-underlying/types.js.map +0 -1
  168. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.d.ts +0 -39
  169. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js +0 -244
  170. package/build/dex/aave-pt-to-usdc/aave-pt-to-usdc.js.map +0 -1
  171. package/build/dex/aave-pt-to-usdc/config.d.ts +0 -3
  172. package/build/dex/aave-pt-to-usdc/config.js +0 -47
  173. package/build/dex/aave-pt-to-usdc/config.js.map +0 -1
  174. package/build/dex/aave-pt-to-usdc/constants.d.ts +0 -2
  175. package/build/dex/aave-pt-to-usdc/constants.js +0 -6
  176. package/build/dex/aave-pt-to-usdc/constants.js.map +0 -1
  177. package/build/dex/aave-pt-to-usdc/types.d.ts +0 -22
  178. package/build/dex/aave-pt-to-usdc/types.js.map +0 -1
  179. package/build/dex/apex-defi/apex-defi-factory.d.ts +0 -26
  180. package/build/dex/apex-defi/apex-defi-factory.js +0 -53
  181. package/build/dex/apex-defi/apex-defi-factory.js.map +0 -1
  182. package/build/dex/apex-defi/apex-defi-pool.d.ts +0 -55
  183. package/build/dex/apex-defi/apex-defi-pool.js +0 -247
  184. package/build/dex/apex-defi/apex-defi-pool.js.map +0 -1
  185. package/build/dex/apex-defi/apex-defi-wrapper-factory.d.ts +0 -57
  186. package/build/dex/apex-defi/apex-defi-wrapper-factory.js +0 -250
  187. package/build/dex/apex-defi/apex-defi-wrapper-factory.js.map +0 -1
  188. package/build/dex/apex-defi/apex-defi.d.ts +0 -97
  189. package/build/dex/apex-defi/apex-defi.js +0 -1021
  190. package/build/dex/apex-defi/apex-defi.js.map +0 -1
  191. package/build/dex/apex-defi/config.d.ts +0 -4
  192. package/build/dex/apex-defi/config.js +0 -138
  193. package/build/dex/apex-defi/config.js.map +0 -1
  194. package/build/dex/apex-defi/types.d.ts +0 -32
  195. package/build/dex/apex-defi/types.js +0 -3
  196. package/build/dex/apex-defi/utils.d.ts +0 -46
  197. package/build/dex/apex-defi/utils.js +0 -133
  198. package/build/dex/apex-defi/utils.js.map +0 -1
  199. package/build/dex/maker-psm/maker-psm-event-pool.d.ts +0 -43
  200. package/build/dex/maker-psm/maker-psm-event-pool.js +0 -132
  201. package/build/dex/maker-psm/maker-psm-event-pool.js.map +0 -1
  202. package/build/dex/miro-migrator/miro-migrator-state.d.ts +0 -27
  203. package/build/dex/miro-migrator/miro-migrator-state.js +0 -89
  204. package/build/dex/miro-migrator/miro-migrator-state.js.map +0 -1
  205. package/build/dex/stabull/config.js +0 -177
  206. package/build/dex/stabull/config.js.map +0 -1
  207. package/build/dex/stabull/stabull-pool.js +0 -113
  208. package/build/dex/stabull/stabull-pool.js.map +0 -1
  209. package/build/dex/stabull/stabull.d.ts +0 -55
  210. package/build/dex/stabull/stabull.js +0 -286
  211. package/build/dex/stabull/stabull.js.map +0 -1
  212. package/build/dex/stabull/types.d.ts +0 -21
  213. package/build/dex/stabull/types.js +0 -3
  214. package/build/dex/stabull/types.js.map +0 -1
  215. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.d.ts +0 -4
  216. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js +0 -56
  217. package/build/dex/uniswap-v3/forks/pangolin-v3/utils.js.map +0 -1
  218. package/build/dex/uniswap-v4/hooks/arena.d.ts +0 -6
  219. package/build/dex/uniswap-v4/hooks/arena.js +0 -10
  220. package/build/dex/uniswap-v4/hooks/arena.js.map +0 -1
  221. package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.d.ts +0 -0
  222. package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.js +0 -2
  223. package/build/dex/uniswap-v4/hooks/base-fee/base-fee-hook.js.map +0 -1
  224. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.d.ts +0 -7
  225. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js +0 -28
  226. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/cabalcoin-hook-pool.js.map +0 -1
  227. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.d.ts +0 -0
  228. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js +0 -2
  229. package/build/dex/uniswap-v4/hooks/cabalcoin-hook/types.js.map +0 -1
  230. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.d.ts +0 -7
  231. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js +0 -28
  232. package/build/dex/uniswap-v4/hooks/fee-hook/fee-hook-pool.js.map +0 -1
  233. package/build/dex/uniswap-v4/hooks/fee-hook/types.d.ts +0 -0
  234. package/build/dex/uniswap-v4/hooks/fee-hook/types.js +0 -2
  235. package/build/dex/uniswap-v4/hooks/fee-hook/types.js.map +0 -1
  236. package/build/dex/uniswap-v4/hooks/index.d.ts +0 -1
  237. package/build/dex/uniswap-v4/hooks/index.js +0 -18
  238. package/build/dex/uniswap-v4/hooks/index.js.map +0 -1
  239. package/build/dex/uniswap-v4/hooks/spot.d.ts +0 -15
  240. package/build/dex/uniswap-v4/hooks/spot.js +0 -109
  241. package/build/dex/uniswap-v4/hooks/spot.js.map +0 -1
  242. package/build/dex/uniswap-v4/hooks/template.d.ts +0 -150
  243. package/build/dex/uniswap-v4/hooks/template.js +0 -104
  244. package/build/dex/uniswap-v4/hooks/template.js.map +0 -1
  245. package/build/dex/usdc-transmuter/usdc-transmuter-pool.d.ts +0 -26
  246. package/build/dex/usdc-transmuter/usdc-transmuter-pool.js +0 -75
  247. package/build/dex/usdc-transmuter/usdc-transmuter-pool.js.map +0 -1
  248. package/build/dex/usual/usual-usdc-usdc.d.ts +0 -17
  249. package/build/dex/usual/usual-usdc-usdc.js +0 -59
  250. package/build/dex/usual/usual-usdc-usdc.js.map +0 -1
  251. package/build/dex/yo/config.js +0 -21
  252. package/build/dex/yo/config.js.map +0 -1
  253. package/build/dex/yo/types.d.ts +0 -13
  254. package/build/dex/yo/types.js +0 -3
  255. package/build/dex/yo/yo-pool.d.ts +0 -13
  256. package/build/dex/yo/yo-pool.js +0 -26
  257. package/build/dex/yo/yo-pool.js.map +0 -1
  258. package/build/dex/yo/yo.d.ts +0 -39
  259. package/build/dex/yo/yo.js +0 -248
  260. package/build/dex/yo/yo.js.map +0 -1
  261. package/build/implementations/api-paraswap-sdk.d.ts +0 -25
  262. package/build/implementations/api-paraswap-sdk.js +0 -102
  263. package/build/implementations/api-paraswap-sdk.js.map +0 -1
  264. /package/build/dex/{aave-pt-to-underlying → se-vlr}/types.js +0 -0
  265. /package/build/dex/{aave-pt-to-usdc → usual-bond}/types.js +0 -0
@@ -1,27 +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 { MiroMigratorState } from './types';
7
- export declare class MiroMigratorEventState extends StatefulEventSubscriber<MiroMigratorState> {
8
- readonly parentName: string;
9
- protected network: number;
10
- protected dexHelper: IDexHelper;
11
- protected migratorAddress: string;
12
- protected xyzAddress: string;
13
- protected transferTopic: string;
14
- protected migratorInterface: Interface;
15
- protected xyzInterface: Interface;
16
- handlers: {
17
- [event: string]: (event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>) => DeepReadonly<MiroMigratorState> | null;
18
- };
19
- logDecoder: (log: Log) => any;
20
- addressesSubscribed: string[];
21
- constructor(parentName: string, network: number, dexHelper: IDexHelper, logger: Logger, migratorAddress: string, xyzAddress: string, transferTopic: string, migratorInterface?: Interface, xyzInterface?: Interface);
22
- protected processLog(state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState> | null>;
23
- generateState(blockNumber?: number | 'latest'): Promise<DeepReadonly<MiroMigratorState>>;
24
- getOrGenerateState(blockNumber: number): Promise<MiroMigratorState>;
25
- handleTransferTo(event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState>>;
26
- handleTransferFrom(event: any, state: DeepReadonly<MiroMigratorState>, log: Readonly<Log>): Promise<DeepReadonly<MiroMigratorState>>;
27
- }
@@ -1,89 +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.MiroMigratorEventState = void 0;
7
- const abi_1 = require("@ethersproject/abi");
8
- const utils_1 = require("../../utils");
9
- const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
10
- const decoders_1 = require("../../lib/decoders");
11
- const MiroMigrator_abi_json_1 = __importDefault(require("../../abi/miro-migrator/MiroMigrator.abi.json"));
12
- const erc20_json_1 = __importDefault(require("../../abi/erc20.json"));
13
- class MiroMigratorEventState extends stateful_event_subscriber_1.StatefulEventSubscriber {
14
- parentName;
15
- network;
16
- dexHelper;
17
- migratorAddress;
18
- xyzAddress;
19
- transferTopic;
20
- migratorInterface;
21
- xyzInterface;
22
- handlers = {};
23
- logDecoder;
24
- addressesSubscribed;
25
- constructor(parentName, network, dexHelper, logger, migratorAddress, xyzAddress, transferTopic, migratorInterface = new abi_1.Interface(MiroMigrator_abi_json_1.default), xyzInterface = new abi_1.Interface(erc20_json_1.default)) {
26
- super(parentName, 'state', dexHelper, logger);
27
- this.parentName = parentName;
28
- this.network = network;
29
- this.dexHelper = dexHelper;
30
- this.migratorAddress = migratorAddress;
31
- this.xyzAddress = xyzAddress;
32
- this.transferTopic = transferTopic;
33
- this.migratorInterface = migratorInterface;
34
- this.xyzInterface = xyzInterface;
35
- this.logDecoder = (log) => this.migratorInterface.parseLog(log);
36
- this.addressesSubscribed = [xyzAddress];
37
- }
38
- async processLog(state, log) {
39
- try {
40
- const event = this.logDecoder(log);
41
- if (log.topics[0] === this.transferTopic &&
42
- event.args.to.toLowerCase() === this.migratorAddress.toLowerCase()) {
43
- return this.handleTransferTo(event, state, log);
44
- }
45
- if (log.topics[0] === this.transferTopic &&
46
- event.args.from.toLowerCase() === this.migratorAddress.toLowerCase()) {
47
- return this.handleTransferFrom(event, state, log);
48
- }
49
- return null;
50
- }
51
- catch (e) {
52
- (0, utils_1.catchParseLogError)(e, this.logger);
53
- return null;
54
- }
55
- }
56
- async generateState(blockNumber = 'latest') {
57
- const calls = [
58
- {
59
- target: this.xyzAddress,
60
- callData: this.xyzInterface.encodeFunctionData('balanceOf', [
61
- this.migratorAddress,
62
- ]),
63
- decodeFunction: decoders_1.uint256ToBigInt,
64
- },
65
- ];
66
- const [balance] = await this.dexHelper.multiWrapper.tryAggregate(true, calls, blockNumber);
67
- return { balance: balance.returnData };
68
- }
69
- async getOrGenerateState(blockNumber) {
70
- let state = this.getState(blockNumber);
71
- if (!state) {
72
- state = await this.generateState(blockNumber);
73
- this.setState(state, blockNumber);
74
- }
75
- return state;
76
- }
77
- async handleTransferTo(event, state, log) {
78
- return {
79
- balance: state.balance + BigInt(event.args.value),
80
- };
81
- }
82
- async handleTransferFrom(event, state, log) {
83
- return {
84
- balance: state.balance - BigInt(event.args.value),
85
- };
86
- }
87
- }
88
- exports.MiroMigratorEventState = MiroMigratorEventState;
89
- //# sourceMappingURL=miro-migrator-state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"miro-migrator-state.js","sourceRoot":"","sources":["../../../src/dex/miro-migrator/miro-migrator-state.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA+C;AAG/C,uCAAiD;AACjD,+EAA0E;AAG1E,iDAAqD;AACrD,0GAA4E;AAC5E,sEAA4C;AAE5C,MAAa,sBAAuB,SAAQ,mDAA0C;IAczE;IACC;IACA;IAEA;IACA;IACA;IACA;IACA;IAr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ACV,KAAsC,EACtC,GAAkB;QAElB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,KAAU,EACV,KAAsC,EACtC,GAAkB;QAElB,OAAO;YACL,OAAO,EAAE,KAAK,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;SAClD,CAAC;IACJ,CAAC;CACF;AA3GD,wDA2GC"}
@@ -1,177 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StabullConfig = void 0;
4
- const constants_1 = require("../../constants");
5
- exports.StabullConfig = {
6
- Stabull: {
7
- [constants_1.Network.MAINNET]: {
8
- router: '0x871af97122d08890193e8d6465015f6d9e2889b2',
9
- quoteCurrency: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
10
- pools: {
11
- '0xe37d763c7c4cdd9a8f085f7db70139a0843529f3': {
12
- tokens: [
13
- {
14
- address: '0xda446fad08277b4d2591536f204e018f32b6831c',
15
- decimals: 18,
16
- }, // NZDS
17
- {
18
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
19
- decimals: 6,
20
- }, // USDC
21
- ],
22
- },
23
- '0x865040f92ac6cca1b9683c03d843799d8e6d1282': {
24
- tokens: [
25
- {
26
- address: '0xdb25f211ab05b1c97d595516f45794528a807ad8',
27
- decimals: 2,
28
- }, // EURS
29
- {
30
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
31
- decimals: 6,
32
- }, // USDC
33
- ],
34
- },
35
- '0xc1a195fdb17da5771d470a232545550a7d264809': {
36
- tokens: [
37
- {
38
- address: '0x2c537e5624e4af88a7ae4060c022609376c8d0eb',
39
- decimals: 6,
40
- }, // TRYB
41
- {
42
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
43
- decimals: 6,
44
- }, // USDC
45
- ],
46
- },
47
- '0x402878106b88b41fad1200b47e998c8effd0d887': {
48
- tokens: [
49
- {
50
- address: '0x86b4dbe5d203e634a12364c0e428fa242a3fba98',
51
- decimals: 18,
52
- }, // 1GBP
53
- {
54
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
55
- decimals: 6,
56
- }, // USDC
57
- ],
58
- },
59
- '0x01e4013c478d7f02112c3cf178f2771c842edbd0': {
60
- tokens: [
61
- {
62
- address: '0xc08512927d12348f6620a698105e1baac6ecd911',
63
- decimals: 6,
64
- }, // GYEN
65
- {
66
- address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
67
- decimals: 6,
68
- }, // USDC
69
- ],
70
- },
71
- },
72
- },
73
- [constants_1.Network.POLYGON]: {
74
- router: '0x0c1f53e7b5a770f4c0d4bef139f752eeb08de88d',
75
- quoteCurrency: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
76
- pools: {
77
- '0xdcb7efaca996fe2985138bf31b647efcd1d0901a': {
78
- tokens: [
79
- {
80
- address: '0xfbbe4b730e1e77d02dc40fedf9438e2802eab3b5',
81
- decimals: 18,
82
- }, // NZDS
83
- {
84
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
85
- decimals: 6,
86
- }, // USDC
87
- ],
88
- },
89
- '0xf80b3a8977d34a443a836a380b2fce69a1a4e819': {
90
- tokens: [
91
- {
92
- address: '0xe111178a87a3bff0c8d18decba5798827539ae99',
93
- decimals: 2,
94
- }, // EURS
95
- {
96
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
97
- decimals: 6,
98
- }, // USDC
99
- ],
100
- },
101
- '0x55bdf7f0223e8b1d509141a8d852dd86b3553d59': {
102
- tokens: [
103
- {
104
- address: '0x4fb71290ac171e1d144f7221d882becac7196eb5',
105
- decimals: 6,
106
- }, // TRYB
107
- {
108
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
109
- decimals: 6,
110
- }, // USDC
111
- ],
112
- },
113
- '0x509aacb7746166252ecb0d62bfba097cc9731e20': {
114
- tokens: [
115
- {
116
- address: '0xdc3326e71d45186f113a2f448984ca0e8d201995',
117
- decimals: 6,
118
- }, // XSGD
119
- {
120
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
121
- decimals: 6,
122
- }, // USDC
123
- ],
124
- },
125
- '0xce0abd182d2cf5844f2a0cb52cfcc55d4ff4fcba': {
126
- tokens: [
127
- {
128
- address: '0x4ed141110f6eeeaba9a1df36d8c26f684d2475dc',
129
- decimals: 4,
130
- }, // BRZ
131
- {
132
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
133
- decimals: 6,
134
- }, // USDC
135
- ],
136
- },
137
- '0x3d4436ba3ae7e0e6361c83ab940ea779cd598206': {
138
- tokens: [
139
- {
140
- address: '0xc2132d05d31c914a87c6611c10748aeb04b58e8f',
141
- decimals: 6,
142
- }, // USDT
143
- {
144
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
145
- decimals: 6,
146
- }, // USDC
147
- ],
148
- },
149
- '0xa52508b1822ca9261b33213b233694f846abd0ed': {
150
- tokens: [
151
- {
152
- address: '0x8f3cf7ad23cd3cadbd9735aff958023239c6a063',
153
- decimals: 18,
154
- }, // DAI
155
- {
156
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
157
- decimals: 6,
158
- }, // USDC
159
- ],
160
- },
161
- '0x1233003461f654cf1c0d7db19e753badef05a87f': {
162
- tokens: [
163
- {
164
- address: '0x87a25dc121db52369f4a9971f664ae5e372cf69a',
165
- decimals: 6,
166
- }, // PHPC
167
- {
168
- address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359',
169
- decimals: 6,
170
- }, // USDC
171
- ],
172
- },
173
- },
174
- },
175
- },
176
- };
177
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src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N;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;wBACV;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;gBACD,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,EAAE;yBACb,EAAE,MAAM;wBACT;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;gBACD,4CAA4C,EAAE;oBAC5C,MAAM,EAAE;wBACN;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;wBACV;4BACE,OAAO,EAAE,4CAA4C;4BACrD,QAAQ,EAAE,CAAC;yBACZ,EAAE,OAAO;qBACX;iBACF;aACF;SACF;KACF;CACF,CAAC"}
@@ -1,113 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StabullEventPool = void 0;
4
- const utils_1 = require("../../utils");
5
- const stateful_event_subscriber_1 = require("../../stateful-event-subscriber");
6
- const utils_2 = require("../../lib/tokens/utils");
7
- const decoders_1 = require("../../lib/decoders");
8
- class StabullEventPool extends stateful_event_subscriber_1.StatefulEventSubscriber {
9
- parentName;
10
- network;
11
- dexHelper;
12
- poolAddress;
13
- addressesSubscribed_;
14
- handlers = {};
15
- logDecoder;
16
- constructor(parentName, network, dexHelper, poolAddress, addressesSubscribed_, logger) {
17
- super(parentName, poolAddress.toLowerCase(), dexHelper, logger);
18
- this.parentName = parentName;
19
- this.network = network;
20
- this.dexHelper = dexHelper;
21
- this.poolAddress = poolAddress;
22
- this.addressesSubscribed_ = addressesSubscribed_;
23
- this.logDecoder = (log) => utils_2.erc20Iface.parseLog(log);
24
- this.addressesSubscribed = addressesSubscribed_;
25
- this.poolAddress = poolAddress.toLowerCase();
26
- }
27
- /**
28
- * The function is called every time any of the subscribed
29
- * addresses release log. The function accepts the current
30
- * state, updates the state according to the log, and returns
31
- * the updated state.
32
- * @param state - Current state of event subscriber
33
- * @param log - Log released by one of the subscribed addresses
34
- * @returns Updates state of the event subscriber after the log
35
- */
36
- processLog(state, log) {
37
- try {
38
- const event = this.logDecoder(log);
39
- if (event.name in this.handlers) {
40
- return this.handlers[event.name](event, state, log);
41
- }
42
- }
43
- catch (e) {
44
- (0, utils_1.catchParseLogError)(e, this.logger);
45
- }
46
- return null;
47
- }
48
- /**
49
- * The function generates state using on-chain calls. This
50
- * function is called to regenerate state if the event based
51
- * system fails to fetch events and the local state is no
52
- * more correct.
53
- * @param blockNumber - Blocknumber for which the state should
54
- * should be generated
55
- * @returns state of the event subscriber at blocknumber
56
- */
57
- async generateState(blockNumber) {
58
- let calldata = [
59
- {
60
- target: this.addressesSubscribed[0],
61
- callData: utils_2.erc20Iface.encodeFunctionData('balanceOf', [
62
- this.poolAddress,
63
- ]),
64
- decodeFunction: decoders_1.uint256ToBigInt,
65
- },
66
- {
67
- target: this.addressesSubscribed[1],
68
- callData: utils_2.erc20Iface.encodeFunctionData('balanceOf', [
69
- this.poolAddress,
70
- ]),
71
- decodeFunction: decoders_1.uint256ToBigInt,
72
- },
73
- ];
74
- const data = await this.dexHelper.multiWrapper.tryAggregate(true, calldata, blockNumber);
75
- return {
76
- reserves0: data[0].success ? data[0].returnData : 0n,
77
- reserves1: data[1].success ? data[1].returnData : 0n,
78
- };
79
- }
80
- /**
81
- * Handles a transfer event and updates the pool state accordingly.
82
- *
83
- * @param event - The transfer event object containing details about the transfer.
84
- * @param state - The current state of the pool.
85
- * @param log - The log object containing additional information about the event.
86
- * @returns The updated pool state if the transfer involves the pool, otherwise null.
87
- */
88
- handleTransfer(event, state, log) {
89
- const from = event.args.from.toLowerCase();
90
- const to = event.args.to.toLowerCase();
91
- // Check if pool is involved in the transfer
92
- if (from !== this.poolAddress && to !== this.poolAddress) {
93
- return null;
94
- }
95
- // Determine which token this is
96
- const eventTokenAddress = log.address.toLowerCase();
97
- const isToken0 = eventTokenAddress === this.addressesSubscribed[0].toLowerCase();
98
- const value = event.args.value.toBigInt();
99
- const reserveKey = isToken0 ? 'reserves0' : 'reserves1';
100
- const currentReserve = state[reserveKey];
101
- // Pool is sending tokens (decrease) or receiving tokens (increase)
102
- const isFromPool = from === this.poolAddress;
103
- const newReserve = isFromPool
104
- ? currentReserve - value
105
- : currentReserve + value;
106
- return {
107
- ...state,
108
- [reserveKey]: newReserve,
109
- };
110
- }
111
- }
112
- exports.StabullEventPool = StabullEventPool;
113
- //# sourceMappingURL=stabull-pool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stabull-pool.js","sourceRoot":"","sources":["../../../src/dex/stabull/stabull-pool.ts"],"names":[],"mappings":";;;AAEA,uCAAiD;AACjD,+EAA0E;AAG1E,kDAAoD;AACpD,iDAAqD;AAErD,MAAa,gBAAiB,SAAQ,mDAAkC;IAY3D;IACC;IACA;IACD;IACC;IAfZ,QAAQ,GAMJ,EAAE,CAAC;IAEP,UAAU,CAAoB;IAE9B,YACW,UAAkB,EACjB,OAAe,EACf,SAAqB,EACtB,WAAmB,EAClB,oBAA8B,EACxC,MAAc;QAEd,KAAK,CAAC,UAAU,EAAE,WAAW,CAAC,WAAW,EAAE,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;QAPvD,eAAU,GAAV,UAAU,CAAQ;QACjB,YAAO,GAAP,OAAO,CAAQ;QACf,cAAS,GAAT,SAAS,CAAY;QACtB,gBAAW,GAAX,WAAW,CAAQ;QAClB,yBAAoB,GAApB,oBAAoB,CAAU;QAKxC,IAAI,CAAC,UAAU,GAAG,CAAC,GAAQ,EAAE,EAAE,CAAC,kBAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;QACzD,IAAI,CAAC,mBAAmB,GAAG,oBAAoB,CAAC;QAChD,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC,WAAW,EA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C"}
@@ -1,55 +0,0 @@
1
- import { Token, Address, ExchangePrices, PoolPrices, AdapterExchangeParam, PoolLiquidity, Logger, DexExchangeParam } from '../../types';
2
- import { SwapSide, Network } from '../../constants';
3
- import { IDex } from '../../dex/idex';
4
- import { IDexHelper } from '../../dex-helper/idex-helper';
5
- import { StabullData } from './types';
6
- import { SimpleExchange } from '../simple-exchange';
7
- import { ethers } from 'ethers';
8
- export declare class Stabull extends SimpleExchange implements IDex<StabullData> {
9
- readonly network: Network;
10
- readonly dexKey: string;
11
- readonly dexHelper: IDexHelper;
12
- protected poolIface: ethers.utils.Interface;
13
- protected routerIface: ethers.utils.Interface;
14
- protected routerAddress: string;
15
- protected quoteCurrency: string;
16
- private pools;
17
- private poolsConfig;
18
- readonly hasConstantPriceLargeAmounts = false;
19
- readonly needWrapNative = true;
20
- readonly isFeeOnTransferSupported = false;
21
- static dexKeysWithNetwork: {
22
- key: string;
23
- networks: Network[];
24
- }[];
25
- logger: Logger;
26
- constructor(network: Network, dexKey: string, dexHelper: IDexHelper, poolIface?: ethers.utils.Interface, routerIface?: ethers.utils.Interface, routerAddress?: string, quoteCurrency?: string);
27
- getAdapters(side: SwapSide): {
28
- name: string;
29
- index: number;
30
- }[] | null;
31
- getPoolIdentifiers(srcToken: Token, destToken: Token, side: SwapSide, blockNumber: number): Promise<string[]>;
32
- getPricesVolume(srcToken: Token, destToken: Token, amounts: bigint[], side: SwapSide, blockNumber: number, limitPools?: string[]): Promise<null | ExchangePrices<StabullData>>;
33
- getCalldataGasCost(poolPrices: PoolPrices<StabullData>): number | number[];
34
- getAdapterParam: (srcToken: string, destToken: string, srcAmount: string, destAmount: string, data: StabullData, side: SwapSide) => AdapterExchangeParam;
35
- updatePoolState(): Promise<void>;
36
- getTopPoolsForToken(tokenAddress: Address, limit: number): Promise<PoolLiquidity[]>;
37
- /**
38
- * Retrieves the decentralized exchange (DEX) parameters for a swap operation.
39
- *
40
- * @param srcToken - The address of the source token.
41
- * @param destToken - The address of the destination token.
42
- * @param srcAmount - The amount of the source token to swap.
43
- * @param destAmount - The desired amount of the destination token.
44
- * @param recipient - The address of the recipient.
45
- * @param data - Additional data required for the swap.
46
- * @param side - The side of the swap (SELL or BUY).
47
- * @param options - Options for global tokens.
48
- * @param executorAddress - The address of the executor.
49
- * @returns A promise that resolves to the DEX exchange parameters.
50
- */
51
- getDexParam(srcToken: string, destToken: string, srcAmount: string, destAmount: string, recipient: string, data: StabullData, side: SwapSide, options: {
52
- isGlobalSrcToken: boolean;
53
- isGlobalDestToken: boolean;
54
- }, executorAddress: string): Promise<DexExchangeParam>;
55
- }