@steerprotocol/sdk 1.30.4 → 1.30.5

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 (355) hide show
  1. package/dist/cjs/const/amm/configs/ammConfig.js +33 -34
  2. package/dist/cjs/const/amm/configs/ammConfig.js.map +1 -1
  3. package/dist/cjs/const/amm/configs/protocols/index.js +0 -39
  4. package/dist/cjs/const/amm/configs/protocols/index.js.map +1 -1
  5. package/dist/cjs/const/stabilityVaults/index.js +1 -1
  6. package/dist/cjs/const/stabilityVaults/index.js.map +1 -1
  7. package/dist/esm/base/FeeManagerClient.js +26 -22
  8. package/dist/esm/base/FeeManagerClient.js.map +1 -1
  9. package/dist/esm/base/PoolClient.js +19 -15
  10. package/dist/esm/base/PoolClient.js.map +1 -1
  11. package/dist/esm/base/SmartRewardClient.js +10 -6
  12. package/dist/esm/base/SmartRewardClient.js.map +1 -1
  13. package/dist/esm/base/SmartRewards.js +11 -7
  14. package/dist/esm/base/SmartRewards.js.map +1 -1
  15. package/dist/esm/base/StakingClient.js +18 -14
  16. package/dist/esm/base/StakingClient.js.map +1 -1
  17. package/dist/esm/base/SubgraphClient.js +8 -4
  18. package/dist/esm/base/SubgraphClient.js.map +1 -1
  19. package/dist/esm/base/VaultClient.js +55 -37
  20. package/dist/esm/base/VaultClient.js.map +1 -1
  21. package/dist/esm/base/vault/deposit/index.js +42 -38
  22. package/dist/esm/base/vault/deposit/index.js.map +1 -1
  23. package/dist/esm/base/vault/deposit/types.js +2 -1
  24. package/dist/esm/base/vault/single-asset/calculateLimitPrice.js +39 -32
  25. package/dist/esm/base/vault/single-asset/calculateLimitPrice.js.map +1 -1
  26. package/dist/esm/base/vault/single-asset/calculateSwapAmount.js +8 -5
  27. package/dist/esm/base/vault/single-asset/calculateSwapAmount.js.map +1 -1
  28. package/dist/esm/base/vault/single-asset/estimateLpTokens.js +12 -7
  29. package/dist/esm/base/vault/single-asset/estimateLpTokens.js.map +1 -1
  30. package/dist/esm/base/vault/single-asset/index.js +32 -6
  31. package/dist/esm/base/vault/single-asset/index.js.map +1 -1
  32. package/dist/esm/base/vault/single-asset/simulateSwap.js +30 -24
  33. package/dist/esm/base/vault/single-asset/simulateSwap.js.map +1 -1
  34. package/dist/esm/base/vault/single-asset/singleAssetDeposit.js +33 -29
  35. package/dist/esm/base/vault/single-asset/singleAssetDeposit.js.map +1 -1
  36. package/dist/esm/base/vault/single-asset/types.js +5 -2
  37. package/dist/esm/base/vault/single-asset/types.js.map +1 -1
  38. package/dist/esm/base/vault/utils.js +16 -7
  39. package/dist/esm/base/vault/utils.js.map +1 -1
  40. package/dist/esm/base/vault/withdraw/index.js +10 -6
  41. package/dist/esm/base/vault/withdraw/index.js.map +1 -1
  42. package/dist/esm/base/vault/withdraw/types.js +2 -1
  43. package/dist/esm/client.js +15 -11
  44. package/dist/esm/client.js.map +1 -1
  45. package/dist/esm/const/abis/UniswapPool.js +4 -1
  46. package/dist/esm/const/abis/UniswapPool.js.map +1 -1
  47. package/dist/esm/const/abis/erc1155.js +4 -1
  48. package/dist/esm/const/abis/erc1155.js.map +1 -1
  49. package/dist/esm/const/abis/erc20.js +4 -1
  50. package/dist/esm/const/abis/erc20.js.map +1 -1
  51. package/dist/esm/const/abis/erc721.js +4 -1
  52. package/dist/esm/const/abis/erc721.js.map +1 -1
  53. package/dist/esm/const/abis/feeManager.js +4 -1
  54. package/dist/esm/const/abis/feeManager.js.map +1 -1
  55. package/dist/esm/const/abis/index.js +24 -8
  56. package/dist/esm/const/abis/index.js.map +1 -1
  57. package/dist/esm/const/abis/quoter.js +9 -6
  58. package/dist/esm/const/abis/quoter.js.map +1 -1
  59. package/dist/esm/const/abis/singleTokenDeposit.js +4 -1
  60. package/dist/esm/const/abis/singleTokenDeposit.js.map +1 -1
  61. package/dist/esm/const/abis/vaultFees.js +4 -1
  62. package/dist/esm/const/abis/vaultFees.js.map +1 -1
  63. package/dist/esm/const/amm/configs/ammConfig.js +98 -95
  64. package/dist/esm/const/amm/configs/ammConfig.js.map +1 -1
  65. package/dist/esm/const/amm/configs/protocols/aerodrome-v2.js +12 -8
  66. package/dist/esm/const/amm/configs/protocols/aerodrome-v2.js.map +1 -1
  67. package/dist/esm/const/amm/configs/protocols/aerodrome.js +12 -8
  68. package/dist/esm/const/amm/configs/protocols/aerodrome.js.map +1 -1
  69. package/dist/esm/const/amm/configs/protocols/arthswap.js +14 -10
  70. package/dist/esm/const/amm/configs/protocols/arthswap.js.map +1 -1
  71. package/dist/esm/const/amm/configs/protocols/baseswap.js +11 -7
  72. package/dist/esm/const/amm/configs/protocols/baseswap.js.map +1 -1
  73. package/dist/esm/const/amm/configs/protocols/basex.js +12 -8
  74. package/dist/esm/const/amm/configs/protocols/basex.js.map +1 -1
  75. package/dist/esm/const/amm/configs/protocols/beam.js +11 -7
  76. package/dist/esm/const/amm/configs/protocols/beam.js.map +1 -1
  77. package/dist/esm/const/amm/configs/protocols/beamswap.js +11 -7
  78. package/dist/esm/const/amm/configs/protocols/beamswap.js.map +1 -1
  79. package/dist/esm/const/amm/configs/protocols/blackhole.js +12 -8
  80. package/dist/esm/const/amm/configs/protocols/blackhole.js.map +1 -1
  81. package/dist/esm/const/amm/configs/protocols/camelot.js +17 -13
  82. package/dist/esm/const/amm/configs/protocols/camelot.js.map +1 -1
  83. package/dist/esm/const/amm/configs/protocols/crust.js +11 -7
  84. package/dist/esm/const/amm/configs/protocols/crust.js.map +1 -1
  85. package/dist/esm/const/amm/configs/protocols/cypher.js +13 -9
  86. package/dist/esm/const/amm/configs/protocols/cypher.js.map +1 -1
  87. package/dist/esm/const/amm/configs/protocols/dodo.js +11 -7
  88. package/dist/esm/const/amm/configs/protocols/dodo.js.map +1 -1
  89. package/dist/esm/const/amm/configs/protocols/dragonswap.js +11 -7
  90. package/dist/esm/const/amm/configs/protocols/dragonswap.js.map +1 -1
  91. package/dist/esm/const/amm/configs/protocols/eddy.js +11 -7
  92. package/dist/esm/const/amm/configs/protocols/eddy.js.map +1 -1
  93. package/dist/esm/const/amm/configs/protocols/equilibre.js +11 -7
  94. package/dist/esm/const/amm/configs/protocols/equilibre.js.map +1 -1
  95. package/dist/esm/const/amm/configs/protocols/fenix.js +11 -7
  96. package/dist/esm/const/amm/configs/protocols/fenix.js.map +1 -1
  97. package/dist/esm/const/amm/configs/protocols/forge.js +13 -9
  98. package/dist/esm/const/amm/configs/protocols/forge.js.map +1 -1
  99. package/dist/esm/const/amm/configs/protocols/fusionx.js +12 -8
  100. package/dist/esm/const/amm/configs/protocols/fusionx.js.map +1 -1
  101. package/dist/esm/const/amm/configs/protocols/glyph.js +13 -9
  102. package/dist/esm/const/amm/configs/protocols/glyph.js.map +1 -1
  103. package/dist/esm/const/amm/configs/protocols/henjin.js +11 -7
  104. package/dist/esm/const/amm/configs/protocols/henjin.js.map +1 -1
  105. package/dist/esm/const/amm/configs/protocols/hercules.js +11 -7
  106. package/dist/esm/const/amm/configs/protocols/hercules.js.map +1 -1
  107. package/dist/esm/const/amm/configs/protocols/horiza.js +13 -9
  108. package/dist/esm/const/amm/configs/protocols/horiza.js.map +1 -1
  109. package/dist/esm/const/amm/configs/protocols/index.js +56 -79
  110. package/dist/esm/const/amm/configs/protocols/index.js.map +1 -1
  111. package/dist/esm/const/amm/configs/protocols/katana.js +10 -6
  112. package/dist/esm/const/amm/configs/protocols/katana.js.map +1 -1
  113. package/dist/esm/const/amm/configs/protocols/katanaIntegral.js +10 -6
  114. package/dist/esm/const/amm/configs/protocols/katanaIntegral.js.map +1 -1
  115. package/dist/esm/const/amm/configs/protocols/kim.js +15 -11
  116. package/dist/esm/const/amm/configs/protocols/kim.js.map +1 -1
  117. package/dist/esm/const/amm/configs/protocols/kinetix.js +14 -10
  118. package/dist/esm/const/amm/configs/protocols/kinetix.js.map +1 -1
  119. package/dist/esm/const/amm/configs/protocols/kodiak.js +14 -10
  120. package/dist/esm/const/amm/configs/protocols/kodiak.js.map +1 -1
  121. package/dist/esm/const/amm/configs/protocols/kyo.js +12 -8
  122. package/dist/esm/const/amm/configs/protocols/kyo.js.map +1 -1
  123. package/dist/esm/const/amm/configs/protocols/linehub.js +11 -7
  124. package/dist/esm/const/amm/configs/protocols/linehub.js.map +1 -1
  125. package/dist/esm/const/amm/configs/protocols/lynex.js +13 -9
  126. package/dist/esm/const/amm/configs/protocols/lynex.js.map +1 -1
  127. package/dist/esm/const/amm/configs/protocols/machinex.js +13 -9
  128. package/dist/esm/const/amm/configs/protocols/machinex.js.map +1 -1
  129. package/dist/esm/const/amm/configs/protocols/maia.js +13 -9
  130. package/dist/esm/const/amm/configs/protocols/maia.js.map +1 -1
  131. package/dist/esm/const/amm/configs/protocols/metavault.js +16 -12
  132. package/dist/esm/const/amm/configs/protocols/metavault.js.map +1 -1
  133. package/dist/esm/const/amm/configs/protocols/nest.js +12 -8
  134. package/dist/esm/const/amm/configs/protocols/nest.js.map +1 -1
  135. package/dist/esm/const/amm/configs/protocols/novaswap.js +11 -7
  136. package/dist/esm/const/amm/configs/protocols/novaswap.js.map +1 -1
  137. package/dist/esm/const/amm/configs/protocols/ocelex.js +11 -7
  138. package/dist/esm/const/amm/configs/protocols/ocelex.js.map +1 -1
  139. package/dist/esm/const/amm/configs/protocols/pancakeswap.js +17 -13
  140. package/dist/esm/const/amm/configs/protocols/pancakeswap.js.map +1 -1
  141. package/dist/esm/const/amm/configs/protocols/poolshark.js +11 -7
  142. package/dist/esm/const/amm/configs/protocols/poolshark.js.map +1 -1
  143. package/dist/esm/const/amm/configs/protocols/quickswap-algebra.js +12 -8
  144. package/dist/esm/const/amm/configs/protocols/quickswap-algebra.js.map +1 -1
  145. package/dist/esm/const/amm/configs/protocols/quickswap-integral.js +17 -13
  146. package/dist/esm/const/amm/configs/protocols/quickswap-integral.js.map +1 -1
  147. package/dist/esm/const/amm/configs/protocols/quickswap-univ3.js +20 -16
  148. package/dist/esm/const/amm/configs/protocols/quickswap-univ3.js.map +1 -1
  149. package/dist/esm/const/amm/configs/protocols/quickswap.js +18 -14
  150. package/dist/esm/const/amm/configs/protocols/quickswap.js.map +1 -1
  151. package/dist/esm/const/amm/configs/protocols/retro.js +13 -9
  152. package/dist/esm/const/amm/configs/protocols/retro.js.map +1 -1
  153. package/dist/esm/const/amm/configs/protocols/sailor.js +11 -7
  154. package/dist/esm/const/amm/configs/protocols/sailor.js.map +1 -1
  155. package/dist/esm/const/amm/configs/protocols/shadow.js +13 -9
  156. package/dist/esm/const/amm/configs/protocols/shadow.js.map +1 -1
  157. package/dist/esm/const/amm/configs/protocols/silverswap.js +15 -11
  158. package/dist/esm/const/amm/configs/protocols/silverswap.js.map +1 -1
  159. package/dist/esm/const/amm/configs/protocols/spark-integral.js +12 -8
  160. package/dist/esm/const/amm/configs/protocols/spark-integral.js.map +1 -1
  161. package/dist/esm/const/amm/configs/protocols/spark.js +11 -7
  162. package/dist/esm/const/amm/configs/protocols/spark.js.map +1 -1
  163. package/dist/esm/const/amm/configs/protocols/spark32.js +11 -7
  164. package/dist/esm/const/amm/configs/protocols/spark32.js.map +1 -1
  165. package/dist/esm/const/amm/configs/protocols/spookyswap.js +11 -7
  166. package/dist/esm/const/amm/configs/protocols/spookyswap.js.map +1 -1
  167. package/dist/esm/const/amm/configs/protocols/stellaswap.js +13 -9
  168. package/dist/esm/const/amm/configs/protocols/stellaswap.js.map +1 -1
  169. package/dist/esm/const/amm/configs/protocols/supswap.js +11 -7
  170. package/dist/esm/const/amm/configs/protocols/supswap.js.map +1 -1
  171. package/dist/esm/const/amm/configs/protocols/sushi.js +73 -69
  172. package/dist/esm/const/amm/configs/protocols/sushi.js.map +1 -1
  173. package/dist/esm/const/amm/configs/protocols/swapmode.js +11 -7
  174. package/dist/esm/const/amm/configs/protocols/swapmode.js.map +1 -1
  175. package/dist/esm/const/amm/configs/protocols/swapsicle.js +11 -7
  176. package/dist/esm/const/amm/configs/protocols/swapsicle.js.map +1 -1
  177. package/dist/esm/const/amm/configs/protocols/thena.js +13 -9
  178. package/dist/esm/const/amm/configs/protocols/thena.js.map +1 -1
  179. package/dist/esm/const/amm/configs/protocols/thick.js +12 -8
  180. package/dist/esm/const/amm/configs/protocols/thick.js.map +1 -1
  181. package/dist/esm/const/amm/configs/protocols/thickv2.js +12 -8
  182. package/dist/esm/const/amm/configs/protocols/thickv2.js.map +1 -1
  183. package/dist/esm/const/amm/configs/protocols/thruster.js +12 -8
  184. package/dist/esm/const/amm/configs/protocols/thruster.js.map +1 -1
  185. package/dist/esm/const/amm/configs/protocols/uniswap.js +83 -79
  186. package/dist/esm/const/amm/configs/protocols/uniswap.js.map +1 -1
  187. package/dist/esm/const/amm/configs/protocols/wasabee.js +11 -7
  188. package/dist/esm/const/amm/configs/protocols/wasabee.js.map +1 -1
  189. package/dist/esm/const/amm/index.js +19 -3
  190. package/dist/esm/const/amm/index.js.map +1 -1
  191. package/dist/esm/const/amm/utils/beacon.js +76 -70
  192. package/dist/esm/const/amm/utils/beacon.js.map +1 -1
  193. package/dist/esm/const/amm/utils/contracts.js +26 -16
  194. package/dist/esm/const/amm/utils/contracts.js.map +1 -1
  195. package/dist/esm/const/amm/utils/index.js +46 -22
  196. package/dist/esm/const/amm/utils/index.js.map +1 -1
  197. package/dist/esm/const/amm/utils/protocol.js +24 -16
  198. package/dist/esm/const/amm/utils/protocol.js.map +1 -1
  199. package/dist/esm/const/api.js +7 -3
  200. package/dist/esm/const/api.js.map +1 -1
  201. package/dist/esm/const/capabilities.js +20 -15
  202. package/dist/esm/const/capabilities.js.map +1 -1
  203. package/dist/esm/const/chain.js +12 -9
  204. package/dist/esm/const/chain.js.map +1 -1
  205. package/dist/esm/const/deployments/abis.js +4 -1
  206. package/dist/esm/const/deployments/abis.js.map +1 -1
  207. package/dist/esm/const/deployments/apechain.js +4 -1
  208. package/dist/esm/const/deployments/apechain.js.map +1 -1
  209. package/dist/esm/const/deployments/arbitrum.js +4 -1
  210. package/dist/esm/const/deployments/arbitrum.js.map +1 -1
  211. package/dist/esm/const/deployments/arbitrumgoerli.js +4 -1
  212. package/dist/esm/const/deployments/arbitrumgoerli.js.map +1 -1
  213. package/dist/esm/const/deployments/astar.js +4 -1
  214. package/dist/esm/const/deployments/astar.js.map +1 -1
  215. package/dist/esm/const/deployments/astarzkevm.js +4 -1
  216. package/dist/esm/const/deployments/astarzkevm.js.map +1 -1
  217. package/dist/esm/const/deployments/avalanche.js +4 -1
  218. package/dist/esm/const/deployments/avalanche.js.map +1 -1
  219. package/dist/esm/const/deployments/bartiotest.js +4 -1
  220. package/dist/esm/const/deployments/bartiotest.js.map +1 -1
  221. package/dist/esm/const/deployments/base.js +4 -1
  222. package/dist/esm/const/deployments/base.js.map +1 -1
  223. package/dist/esm/const/deployments/bera.js +4 -1
  224. package/dist/esm/const/deployments/bera.js.map +1 -1
  225. package/dist/esm/const/deployments/berachainbartio.js +4 -1
  226. package/dist/esm/const/deployments/berachainbartio.js.map +1 -1
  227. package/dist/esm/const/deployments/blast.js +4 -1
  228. package/dist/esm/const/deployments/blast.js.map +1 -1
  229. package/dist/esm/const/deployments/bsc.js +4 -1
  230. package/dist/esm/const/deployments/bsc.js.map +1 -1
  231. package/dist/esm/const/deployments/celo.js +4 -1
  232. package/dist/esm/const/deployments/celo.js.map +1 -1
  233. package/dist/esm/const/deployments/core.js +4 -1
  234. package/dist/esm/const/deployments/core.js.map +1 -1
  235. package/dist/esm/const/deployments/eth.js +4 -1
  236. package/dist/esm/const/deployments/eth.js.map +1 -1
  237. package/dist/esm/const/deployments/evmos.js +4 -1
  238. package/dist/esm/const/deployments/evmos.js.map +1 -1
  239. package/dist/esm/const/deployments/fantom.js +4 -1
  240. package/dist/esm/const/deployments/fantom.js.map +1 -1
  241. package/dist/esm/const/deployments/filecoin.js +4 -1
  242. package/dist/esm/const/deployments/filecoin.js.map +1 -1
  243. package/dist/esm/const/deployments/flare.js +4 -1
  244. package/dist/esm/const/deployments/flare.js.map +1 -1
  245. package/dist/esm/const/deployments/goerli.js +4 -1
  246. package/dist/esm/const/deployments/goerli.js.map +1 -1
  247. package/dist/esm/const/deployments/hemi.js +4 -1
  248. package/dist/esm/const/deployments/hemi.js.map +1 -1
  249. package/dist/esm/const/deployments/hyperevm.js +4 -1
  250. package/dist/esm/const/deployments/hyperevm.js.map +1 -1
  251. package/dist/esm/const/deployments/index.js +99 -48
  252. package/dist/esm/const/deployments/index.js.map +1 -1
  253. package/dist/esm/const/deployments/katana.js +4 -1
  254. package/dist/esm/const/deployments/katana.js.map +1 -1
  255. package/dist/esm/const/deployments/kava.js +4 -1
  256. package/dist/esm/const/deployments/kava.js.map +1 -1
  257. package/dist/esm/const/deployments/linea.js +4 -1
  258. package/dist/esm/const/deployments/linea.js.map +1 -1
  259. package/dist/esm/const/deployments/localhost.js +4 -1
  260. package/dist/esm/const/deployments/localhost.js.map +1 -1
  261. package/dist/esm/const/deployments/manta.js +4 -1
  262. package/dist/esm/const/deployments/manta.js.map +1 -1
  263. package/dist/esm/const/deployments/mantle.js +4 -1
  264. package/dist/esm/const/deployments/mantle.js.map +1 -1
  265. package/dist/esm/const/deployments/metis.js +4 -1
  266. package/dist/esm/const/deployments/metis.js.map +1 -1
  267. package/dist/esm/const/deployments/mode.js +4 -1
  268. package/dist/esm/const/deployments/mode.js.map +1 -1
  269. package/dist/esm/const/deployments/moonbeam.js +4 -1
  270. package/dist/esm/const/deployments/moonbeam.js.map +1 -1
  271. package/dist/esm/const/deployments/mumbai.js +4 -1
  272. package/dist/esm/const/deployments/mumbai.js.map +1 -1
  273. package/dist/esm/const/deployments/nibiru.js +4 -1
  274. package/dist/esm/const/deployments/nibiru.js.map +1 -1
  275. package/dist/esm/const/deployments/okxtestnet.js +4 -1
  276. package/dist/esm/const/deployments/okxtestnet.js.map +1 -1
  277. package/dist/esm/const/deployments/optimism.js +4 -1
  278. package/dist/esm/const/deployments/optimism.js.map +1 -1
  279. package/dist/esm/const/deployments/optimismgoerli.js +4 -1
  280. package/dist/esm/const/deployments/optimismgoerli.js.map +1 -1
  281. package/dist/esm/const/deployments/peaq.js +4 -1
  282. package/dist/esm/const/deployments/peaq.js.map +1 -1
  283. package/dist/esm/const/deployments/polygon.js +4 -1
  284. package/dist/esm/const/deployments/polygon.js.map +1 -1
  285. package/dist/esm/const/deployments/polyzkevm.js +4 -1
  286. package/dist/esm/const/deployments/polyzkevm.js.map +1 -1
  287. package/dist/esm/const/deployments/pyzkevm.js +4 -1
  288. package/dist/esm/const/deployments/pyzkevm.js.map +1 -1
  289. package/dist/esm/const/deployments/ronin.js +4 -1
  290. package/dist/esm/const/deployments/ronin.js.map +1 -1
  291. package/dist/esm/const/deployments/rootstock.js +4 -1
  292. package/dist/esm/const/deployments/rootstock.js.map +1 -1
  293. package/dist/esm/const/deployments/saga.js +4 -1
  294. package/dist/esm/const/deployments/saga.js.map +1 -1
  295. package/dist/esm/const/deployments/scroll.js +4 -1
  296. package/dist/esm/const/deployments/scroll.js.map +1 -1
  297. package/dist/esm/const/deployments/sei.js +4 -1
  298. package/dist/esm/const/deployments/sei.js.map +1 -1
  299. package/dist/esm/const/deployments/soneium.js +4 -1
  300. package/dist/esm/const/deployments/soneium.js.map +1 -1
  301. package/dist/esm/const/deployments/sonic.js +4 -1
  302. package/dist/esm/const/deployments/sonic.js.map +1 -1
  303. package/dist/esm/const/deployments/taiko.js +4 -1
  304. package/dist/esm/const/deployments/taiko.js.map +1 -1
  305. package/dist/esm/const/deployments/tataratestnet.js +4 -1
  306. package/dist/esm/const/deployments/tataratestnet.js.map +1 -1
  307. package/dist/esm/const/deployments/telos.js +4 -1
  308. package/dist/esm/const/deployments/telos.js.map +1 -1
  309. package/dist/esm/const/deployments/thundercore.js +4 -1
  310. package/dist/esm/const/deployments/thundercore.js.map +1 -1
  311. package/dist/esm/const/deployments/uni.js +4 -1
  312. package/dist/esm/const/deployments/uni.js.map +1 -1
  313. package/dist/esm/const/deployments/xlayer.js +4 -1
  314. package/dist/esm/const/deployments/xlayer.js.map +1 -1
  315. package/dist/esm/const/deployments/zeta.js +4 -1
  316. package/dist/esm/const/deployments/zeta.js.map +1 -1
  317. package/dist/esm/const/deployments/zircuit.js +4 -1
  318. package/dist/esm/const/deployments/zircuit.js.map +1 -1
  319. package/dist/esm/const/deployments/zklinknova.js +4 -1
  320. package/dist/esm/const/deployments/zklinknova.js.map +1 -1
  321. package/dist/esm/const/index.js +28 -12
  322. package/dist/esm/const/index.js.map +1 -1
  323. package/dist/esm/const/network.js +232 -223
  324. package/dist/esm/const/network.js.map +1 -1
  325. package/dist/esm/const/protocol.js +97 -83
  326. package/dist/esm/const/protocol.js.map +1 -1
  327. package/dist/esm/const/quoter.js +53 -42
  328. package/dist/esm/const/quoter.js.map +1 -1
  329. package/dist/esm/const/stabilityVaults/index.js +17 -1
  330. package/dist/esm/const/stabilityVaults/index.js.map +1 -1
  331. package/dist/esm/const/stabilityVaults/stabilityVaultsConfig.js +15 -10
  332. package/dist/esm/const/stabilityVaults/stabilityVaultsConfig.js.map +1 -1
  333. package/dist/esm/const/subgraph.js +60 -56
  334. package/dist/esm/const/subgraph.js.map +1 -1
  335. package/dist/esm/const/thegraph.js +5 -1
  336. package/dist/esm/const/thegraph.js.map +1 -1
  337. package/dist/esm/index.js +31 -12
  338. package/dist/esm/index.js.map +1 -1
  339. package/dist/esm/scripts/processDeployments.js +15 -10
  340. package/dist/esm/scripts/processDeployments.js.map +1 -1
  341. package/dist/esm/types.js +2 -1
  342. package/dist/esm/utils/PoolQueryAdapter.js +44 -38
  343. package/dist/esm/utils/PoolQueryAdapter.js.map +1 -1
  344. package/dist/esm/utils/SubgraphVaultClient.js +10 -6
  345. package/dist/esm/utils/SubgraphVaultClient.js.map +1 -1
  346. package/dist/esm/utils/subgraph-types.js +2 -1
  347. package/dist/types/const/amm/configs/ammConfig.d.ts.map +1 -1
  348. package/dist/types/const/amm/configs/protocols/index.d.ts +0 -39
  349. package/dist/types/const/amm/configs/protocols/index.d.ts.map +1 -1
  350. package/dist/types/const/stabilityVaults/index.d.ts +1 -1
  351. package/dist/types/const/stabilityVaults/index.d.ts.map +1 -1
  352. package/package.json +1 -1
  353. package/src/const/amm/configs/ammConfig.ts +2 -3
  354. package/src/const/amm/configs/protocols/index.ts +1 -40
  355. package/src/const/stabilityVaults/index.ts +1 -1
@@ -1,4 +1,14 @@
1
- import { getAmmConfig } from '../configs/ammConfig.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSwapRouterAddress = getSwapRouterAddress;
4
+ exports.getQuoterV2Address = getQuoterV2Address;
5
+ exports.getInitCodeHash = getInitCodeHash;
6
+ exports.getFactoryAddress = getFactoryAddress;
7
+ exports.getTickLensAddress = getTickLensAddress;
8
+ exports.getNFTManagerAddress = getNFTManagerAddress;
9
+ exports.getProtocolSubgraphURL = getProtocolSubgraphURL;
10
+ exports.getProtocolContractAddresses = getProtocolContractAddresses;
11
+ const ammConfig_js_1 = require("../configs/ammConfig.js");
2
12
  /**
3
13
  * Retrieves the swap router contract address for a given protocol and chain.
4
14
  *
@@ -7,8 +17,8 @@ import { getAmmConfig } from '../configs/ammConfig.js';
7
17
  * @param theGraphApiKey - The Graph API key for accessing protocol data
8
18
  * @returns The swap router contract address or undefined if not found
9
19
  */
10
- export function getSwapRouterAddress(protocol, chain, theGraphApiKey) {
11
- return getAmmConfig(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];
20
+ function getSwapRouterAddress(protocol, chain, theGraphApiKey) {
21
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];
12
22
  }
13
23
  /**
14
24
  * Gets the init code hash for a given protocol and chain.
@@ -18,11 +28,11 @@ export function getSwapRouterAddress(protocol, chain, theGraphApiKey) {
18
28
  * @param theGraphApiKey - The Graph API key for accessing protocol data
19
29
  * @returns The init code hash or undefined if not found
20
30
  */
21
- export function getQuoterV2Address(protocol, chain, theGraphApiKey) {
22
- return getAmmConfig(theGraphApiKey)[protocol]?.QuoterV2Address?.[chain];
31
+ function getQuoterV2Address(protocol, chain, theGraphApiKey) {
32
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.QuoterV2Address?.[chain];
23
33
  }
24
- export function getInitCodeHash(protocol, chain, theGraphApiKey) {
25
- return getAmmConfig(theGraphApiKey)[protocol]?.initCodeHash?.[chain];
34
+ function getInitCodeHash(protocol, chain, theGraphApiKey) {
35
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.initCodeHash?.[chain];
26
36
  }
27
37
  /**
28
38
  * Retrieves the factory contract address for a given protocol and chain.
@@ -32,8 +42,8 @@ export function getInitCodeHash(protocol, chain, theGraphApiKey) {
32
42
  * @param theGraphApiKey - The Graph API key for accessing protocol data
33
43
  * @returns The factory contract address or undefined if not found
34
44
  */
35
- export function getFactoryAddress(protocol, chain, theGraphApiKey) {
36
- return getAmmConfig(theGraphApiKey)[protocol]?.factoryAddress?.[chain];
45
+ function getFactoryAddress(protocol, chain, theGraphApiKey) {
46
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.factoryAddress?.[chain];
37
47
  }
38
48
  /**
39
49
  * Gets the tick lens contract address for a given protocol and chain.
@@ -43,8 +53,8 @@ export function getFactoryAddress(protocol, chain, theGraphApiKey) {
43
53
  * @param theGraphApiKey - The Graph API key for accessing protocol data
44
54
  * @returns The tick lens contract address or undefined if not found
45
55
  */
46
- export function getTickLensAddress(protocol, chain, theGraphApiKey) {
47
- return getAmmConfig(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];
56
+ function getTickLensAddress(protocol, chain, theGraphApiKey) {
57
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];
48
58
  }
49
59
  /**
50
60
  * Retrieves the NFT manager contract address for a given protocol and chain.
@@ -54,8 +64,8 @@ export function getTickLensAddress(protocol, chain, theGraphApiKey) {
54
64
  * @param theGraphApiKey - The Graph API key for accessing protocol data
55
65
  * @returns The NFT manager contract address or undefined if not found
56
66
  */
57
- export function getNFTManagerAddress(protocol, chain, theGraphApiKey) {
58
- return getAmmConfig(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];
67
+ function getNFTManagerAddress(protocol, chain, theGraphApiKey) {
68
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];
59
69
  }
60
70
  /**
61
71
  * Gets the subgraph URL for a given protocol and chain.
@@ -66,8 +76,8 @@ export function getNFTManagerAddress(protocol, chain, theGraphApiKey) {
66
76
  * @returns The subgraph URL string
67
77
  * @throws Error if subgraph URL is not found
68
78
  */
69
- export function getProtocolSubgraphURL(protocol, chain, theGraphApiKey) {
70
- const url = getAmmConfig(theGraphApiKey)[protocol]?.subgraph?.[chain];
79
+ function getProtocolSubgraphURL(protocol, chain, theGraphApiKey) {
80
+ const url = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.subgraph?.[chain];
71
81
  if (url) {
72
82
  return url;
73
83
  }
@@ -85,7 +95,7 @@ export function getProtocolSubgraphURL(protocol, chain, theGraphApiKey) {
85
95
  * const addresses = getProtocolContractAddresses('Uniswap', Chain.MAINNET, 'api-key');
86
96
  * ```
87
97
  */
88
- export function getProtocolContractAddresses(protocol, chain, theGraphApiKey) {
98
+ function getProtocolContractAddresses(protocol, chain, theGraphApiKey) {
89
99
  const swapRouterAddress = getSwapRouterAddress(protocol, chain, theGraphApiKey);
90
100
  const NFTManagerAddress = getNFTManagerAddress(protocol, chain, theGraphApiKey);
91
101
  const UniswapV3Factory = getFactoryAddress(protocol, chain, theGraphApiKey);
@@ -1 +1 @@
1
- {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../../src/const/amm/utils/contracts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAClC,QAA2B,EAC3B,KAAY,EACZ,cAAsB;IAEtB,OAAO,YAAY,CAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,EAAE,iBAAiB,EAAE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,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,OAAO,KAAK,EAAE,CAAC,CAAC;AACxE,CAAC;AAcD;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,4BAA4B,CAC1C,QAA2B,EAC3B,KAAY,EACZ,cAAsB;IAEtB,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAChF,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAChF,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC5E,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAE5E,OAAO;QACL,iBAAiB;QACjB,iBAAiB;QACjB,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import { SupportedProtocol } from '../../../types.js';\nimport { Chain } from '../../chain.js';\nimport { getAmmConfig } from '../configs/ammConfig.js';\n\n/**\n * Retrieves the swap router contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the router address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The swap router contract address or undefined if not found\n */\nexport function getSwapRouterAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];\n}\n\n/**\n * Gets the init code hash for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the init code hash for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The init code hash or undefined if not found\n */\nexport function getQuoterV2Address(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.QuoterV2Address?.[chain];\n}\n\n\n\nexport function getInitCodeHash(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.initCodeHash?.[chain];\n}\n\n\n/**\n * Retrieves the factory contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the factory address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The factory contract address or undefined if not found\n */\nexport function getFactoryAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.factoryAddress?.[chain];\n}\n\n/**\n * Gets the tick lens contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the tick lens address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The tick lens contract address or undefined if not found\n */\nexport function getTickLensAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];\n}\n\n/**\n * Retrieves the NFT manager contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the NFT manager address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The NFT manager contract address or undefined if not found\n */\nexport function getNFTManagerAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];\n}\n\n/**\n * Gets the subgraph URL for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the subgraph URL for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The subgraph URL string\n * @throws Error if subgraph URL is not found\n */\nexport function getProtocolSubgraphURL(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string {\n const url = getAmmConfig(theGraphApiKey)[protocol]?.subgraph?.[chain];\n if (url) {\n return url;\n }\n\n throw new Error(`Subgraph URL not found for ${protocol} on ${chain}`);\n}\n\n/**\n * Interface representing all contract addresses for a protocol\n */\nexport type ProtocolContractAddresses = {\n swapRouterAddress: string | undefined;\n NFTManagerAddress: string | undefined;\n UniswapV3Factory: string | undefined;\n TickLensAddress: string | undefined;\n initCodeHash: string | undefined;\n quoterV2Address: string | undefined\n}\n\n/**\n * Retrieves all relevant contract addresses for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the contract addresses for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns An object containing all contract addresses\n * @example\n * ```typescript\n * const addresses = getProtocolContractAddresses('Uniswap', Chain.MAINNET, 'api-key');\n * ```\n */\nexport function getProtocolContractAddresses(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): ProtocolContractAddresses {\n const swapRouterAddress = getSwapRouterAddress(protocol, chain, theGraphApiKey);\n const NFTManagerAddress = getNFTManagerAddress(protocol, chain, theGraphApiKey);\n const UniswapV3Factory = getFactoryAddress(protocol, chain, theGraphApiKey);\n const TickLensAddress = getTickLensAddress(protocol, chain, theGraphApiKey);\n const initCodeHash = getInitCodeHash(protocol, chain, theGraphApiKey);\n const quoterV2Address = getQuoterV2Address(protocol, chain, theGraphApiKey);\n\n return {\n swapRouterAddress,\n NFTManagerAddress,\n UniswapV3Factory,\n TickLensAddress,\n initCodeHash,\n quoterV2Address\n };\n} "]}
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../../../src/const/amm/utils/contracts.ts"],"names":[],"mappings":";;AAYA,oDAMC;AAUD,gDAMC;AAID,0CAMC;AAW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,CAAC;AAC5E,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,sBAAsB,CACpC,QAA2B,EAC3B,KAAY,EACZ,cAAsB;IAEtB,MAAM,GAAG,GAAG,IAAA,2BAAY,EAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;IACtE,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,OAAO,KAAK,EAAE,CAAC,CAAC;AACxE,CAAC;AAcD;;;;;;;;;;;GAWG;AACH,SAAgB,4BAA4B,CAC1C,QAA2B,EAC3B,KAAY,EACZ,cAAsB;IAEtB,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAChF,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAChF,MAAM,gBAAgB,GAAG,iBAAiB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC5E,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAC5E,MAAM,YAAY,GAAG,eAAe,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IACtE,MAAM,eAAe,GAAG,kBAAkB,CAAC,QAAQ,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;IAE5E,OAAO;QACL,iBAAiB;QACjB,iBAAiB;QACjB,gBAAgB;QAChB,eAAe;QACf,YAAY;QACZ,eAAe;KAChB,CAAC;AACJ,CAAC","sourcesContent":["import { SupportedProtocol } from '../../../types.js';\nimport { Chain } from '../../chain.js';\nimport { getAmmConfig } from '../configs/ammConfig.js';\n\n/**\n * Retrieves the swap router contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the router address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The swap router contract address or undefined if not found\n */\nexport function getSwapRouterAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];\n}\n\n/**\n * Gets the init code hash for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the init code hash for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The init code hash or undefined if not found\n */\nexport function getQuoterV2Address(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.QuoterV2Address?.[chain];\n}\n\n\n\nexport function getInitCodeHash(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.initCodeHash?.[chain];\n}\n\n\n/**\n * Retrieves the factory contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the factory address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The factory contract address or undefined if not found\n */\nexport function getFactoryAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.factoryAddress?.[chain];\n}\n\n/**\n * Gets the tick lens contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the tick lens address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The tick lens contract address or undefined if not found\n */\nexport function getTickLensAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];\n}\n\n/**\n * Retrieves the NFT manager contract address for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the NFT manager address for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The NFT manager contract address or undefined if not found\n */\nexport function getNFTManagerAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];\n}\n\n/**\n * Gets the subgraph URL for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the subgraph URL for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The subgraph URL string\n * @throws Error if subgraph URL is not found\n */\nexport function getProtocolSubgraphURL(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string {\n const url = getAmmConfig(theGraphApiKey)[protocol]?.subgraph?.[chain];\n if (url) {\n return url;\n }\n\n throw new Error(`Subgraph URL not found for ${protocol} on ${chain}`);\n}\n\n/**\n * Interface representing all contract addresses for a protocol\n */\nexport type ProtocolContractAddresses = {\n swapRouterAddress: string | undefined;\n NFTManagerAddress: string | undefined;\n UniswapV3Factory: string | undefined;\n TickLensAddress: string | undefined;\n initCodeHash: string | undefined;\n quoterV2Address: string | undefined\n}\n\n/**\n * Retrieves all relevant contract addresses for a given protocol and chain.\n * \n * @param protocol - The supported protocol to get the contract addresses for\n * @param chain - The blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns An object containing all contract addresses\n * @example\n * ```typescript\n * const addresses = getProtocolContractAddresses('Uniswap', Chain.MAINNET, 'api-key');\n * ```\n */\nexport function getProtocolContractAddresses(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): ProtocolContractAddresses {\n const swapRouterAddress = getSwapRouterAddress(protocol, chain, theGraphApiKey);\n const NFTManagerAddress = getNFTManagerAddress(protocol, chain, theGraphApiKey);\n const UniswapV3Factory = getFactoryAddress(protocol, chain, theGraphApiKey);\n const TickLensAddress = getTickLensAddress(protocol, chain, theGraphApiKey);\n const initCodeHash = getInitCodeHash(protocol, chain, theGraphApiKey);\n const quoterV2Address = getQuoterV2Address(protocol, chain, theGraphApiKey);\n\n return {\n swapRouterAddress,\n NFTManagerAddress,\n UniswapV3Factory,\n TickLensAddress,\n initCodeHash,\n quoterV2Address\n };\n} "]}
@@ -1,13 +1,36 @@
1
- import { Chain } from '../../chain.js';
2
- import { chainIdToName } from '../../network.js';
3
- import { getAmmConfig } from '../configs/ammConfig.js';
4
- export const getAmmConfigByChainId = (chainId, theGraphApiKey) => {
5
- const chainName = chainIdToName(chainId);
6
- const config = getAmmConfig(theGraphApiKey);
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.getAmmConfigByChainId = void 0;
18
+ exports.getFactoryAddress = getFactoryAddress;
19
+ exports.getTickLensAddress = getTickLensAddress;
20
+ exports.getNFTManagerAddress = getNFTManagerAddress;
21
+ exports.getProtocolSubgraphURL = getProtocolSubgraphURL;
22
+ exports.getSwapRouterAddress = getSwapRouterAddress;
23
+ exports.getInitCodeHash = getInitCodeHash;
24
+ const chain_js_1 = require("../../chain.js");
25
+ const network_js_1 = require("../../network.js");
26
+ const ammConfig_js_1 = require("../configs/ammConfig.js");
27
+ const getAmmConfigByChainId = (chainId, theGraphApiKey) => {
28
+ const chainName = (0, network_js_1.chainIdToName)(chainId);
29
+ const config = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey);
7
30
  if (!chainName) {
8
31
  throw new Error(`Chain ${chainId} not supported`);
9
32
  }
10
- const chainEnum = Chain[chainName];
33
+ const chainEnum = chain_js_1.Chain[chainName];
11
34
  // Filter protocols that support the specified chain
12
35
  const filteredConfig = {};
13
36
  for (const protocol in config) {
@@ -53,29 +76,30 @@ export const getAmmConfigByChainId = (chainId, theGraphApiKey) => {
53
76
  }
54
77
  return filteredConfig;
55
78
  };
56
- export function getFactoryAddress(protocol, chain, theGraphApiKey) {
57
- return getAmmConfig(theGraphApiKey)[protocol]?.factoryAddress?.[chain];
79
+ exports.getAmmConfigByChainId = getAmmConfigByChainId;
80
+ function getFactoryAddress(protocol, chain, theGraphApiKey) {
81
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.factoryAddress?.[chain];
58
82
  }
59
- export function getTickLensAddress(protocol, chain, theGraphApiKey) {
60
- return getAmmConfig(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];
83
+ function getTickLensAddress(protocol, chain, theGraphApiKey) {
84
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];
61
85
  }
62
- export function getNFTManagerAddress(protocol, chain, theGraphApiKey) {
63
- return getAmmConfig(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];
86
+ function getNFTManagerAddress(protocol, chain, theGraphApiKey) {
87
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];
64
88
  }
65
- export function getProtocolSubgraphURL(protocol, chain, theGraphApiKey) {
66
- const url = getAmmConfig(theGraphApiKey)[protocol]?.subgraph?.[chain];
89
+ function getProtocolSubgraphURL(protocol, chain, theGraphApiKey) {
90
+ const url = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.subgraph?.[chain];
67
91
  if (url) {
68
92
  return url;
69
93
  }
70
94
  throw new Error(`Subgraph URL not found for ${protocol} on ${chain}`);
71
95
  }
72
- export function getSwapRouterAddress(protocol, chain, theGraphApiKey) {
73
- return getAmmConfig(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];
96
+ function getSwapRouterAddress(protocol, chain, theGraphApiKey) {
97
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];
74
98
  }
75
- export function getInitCodeHash(protocol, chain, theGraphApiKey) {
76
- return getAmmConfig(theGraphApiKey)[protocol]?.initCodeHash?.[chain];
99
+ function getInitCodeHash(protocol, chain, theGraphApiKey) {
100
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocol]?.initCodeHash?.[chain];
77
101
  }
78
- export * from './beacon.js';
79
- export * from './contracts.js';
80
- export * from './protocol.js';
102
+ __exportStar(require("./beacon.js"), exports);
103
+ __exportStar(require("./contracts.js"), exports);
104
+ __exportStar(require("./protocol.js"), exports);
81
105
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/const/amm/utils/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,OAAe,EAAE,cAAsB,EAAiB,EAAE;IAC9F,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;IAE5C,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,SAAS,OAAO,gBAAgB,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,SAAS,GAAG,KAAK,CAAC,SAA+B,CAAC,CAAC;IAEzD,oDAAoD;IACpD,MAAM,cAAc,GAA2B,EAAE,CAAC;IAElD,KAA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CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAGD,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC","sourcesContent":["import { AMMConfigType, ProtocolInfo, SupportedProtocol } from '../../../types.js';\nimport { Chain } from '../../chain.js';\nimport { chainIdToName } from '../../network.js';\nimport { getAmmConfig } from '../configs/ammConfig.js';\n\nexport const getAmmConfigByChainId = (chainId: number, theGraphApiKey: string): AMMConfigType => {\n const chainName = chainIdToName(chainId);\n const config = getAmmConfig(theGraphApiKey);\n\n if (!chainName) {\n throw new Error(`Chain ${chainId} not supported`);\n }\n\n const chainEnum = Chain[chainName as keyof typeof Chain];\n\n // Filter protocols that support the specified chain\n const filteredConfig: Partial<AMMConfigType> = {};\n\n for (const protocol in config) {\n const protocolConfig = config[protocol as SupportedProtocol];\n if (!protocolConfig) continue;\n\n // Check if this protocol supports the specified chain in any of its configurations\n const hasChainSupport = Object.values(protocolConfig).some((configSection) => {\n if (typeof configSection === 'object' && configSection !== null) {\n return chainEnum in configSection;\n }\n return false;\n });\n\n // If the protocol supports this chain, include it in the filtered config but only with the specified chain\n if (hasChainSupport) {\n // Create a new protocol config with only the specified chain\n const filteredProtocolConfig: ProtocolInfo = {\n subgraph: {},\n factoryAddress: {},\n };\n\n // For each section in the protocol config (subgraph, factoryAddress, etc.)\n for (const sectionKey in protocolConfig) {\n const section = protocolConfig[sectionKey as keyof typeof protocolConfig];\n\n // If this section is an object with chain mappings\n if (typeof section === 'object' && section !== null) {\n // Create a new section with only the specified chain\n const filteredSection: Record<Chain, string> = {} as Record<Chain, string>;\n\n // If this chain exists in this section, include only that chain\n if (chainEnum in section) {\n filteredSection[chainEnum] = section[chainEnum as keyof typeof section] as string;\n\n // Add this filtered section to the filtered protocol config\n (filteredProtocolConfig[sectionKey as keyof ProtocolInfo] as Record<Chain, string>) =\n filteredSection;\n }\n } else if (section !== undefined) {\n // For non-object sections (like beaconContract), include as is\n (filteredProtocolConfig as Record<keyof ProtocolInfo, unknown>)[sectionKey as keyof ProtocolInfo] = section;\n }\n }\n\n filteredConfig[protocol as SupportedProtocol] = filteredProtocolConfig;\n }\n }\n\n return filteredConfig as AMMConfigType;\n};\n\n\nexport function getFactoryAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.factoryAddress?.[chain];\n}\n\nexport function getTickLensAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];\n}\n\nexport function getNFTManagerAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];\n}\n\nexport function getProtocolSubgraphURL(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string {\n const url = getAmmConfig(theGraphApiKey)[protocol]?.subgraph?.[chain];\n if (url) {\n return url;\n }\n\n throw new Error(`Subgraph URL not found for ${protocol} on ${chain}`);\n}\n\nexport function getSwapRouterAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];\n}\n\nexport function getInitCodeHash(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.initCodeHash?.[chain];\n}\n\n\nexport * from './beacon.js';\nexport * from './contracts.js';\nexport * from './protocol.js';\n\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/const/amm/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAqEA,8CAMC;AAED,gDAMC;AAED,oDAMC;AAED,wDAWC;AAED,oDAMC;AAED,0CAMC;AAvHD,6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C,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;IACtE,IAAI,GAAG,EAAE,CAAC;QACR,OAAO,GAAG,CAAC;IACb,CAAC;IAED,MAAM,IAAI,KAAK,CAAC,8BAA8B,QAAQ,OAAO,KAAK,EAAE,CAAC,CAAC;AACxE,CAAC;AAED,SAAgB,oBAAoB,CAClC,QAA2B,EAC3B,KAAY,EACZ,cAAsB;IAEtB,OAAO,IAAA,2BAAY,EAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;AAC5E,CAAC;AAED,SAAgB,eAAe,CAC7B,QAA2B,EAC3B,KAAY,EACZ,cAAsB;IAEtB,OAAO,IAAA,2BAAY,EAAC,cAAc,CAAC,CAAC,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAGD,8CAA4B;AAC5B,iDAA+B;AAC/B,gDAA8B","sourcesContent":["import { AMMConfigType, ProtocolInfo, SupportedProtocol } from '../../../types.js';\nimport { Chain } from '../../chain.js';\nimport { chainIdToName } from '../../network.js';\nimport { getAmmConfig } from '../configs/ammConfig.js';\n\nexport const getAmmConfigByChainId = (chainId: number, theGraphApiKey: string): AMMConfigType => {\n const chainName = chainIdToName(chainId);\n const config = getAmmConfig(theGraphApiKey);\n\n if (!chainName) {\n throw new Error(`Chain ${chainId} not supported`);\n }\n\n const chainEnum = Chain[chainName as keyof typeof Chain];\n\n // Filter protocols that support the specified chain\n const filteredConfig: Partial<AMMConfigType> = {};\n\n for (const protocol in config) {\n const protocolConfig = config[protocol as SupportedProtocol];\n if (!protocolConfig) continue;\n\n // Check if this protocol supports the specified chain in any of its configurations\n const hasChainSupport = Object.values(protocolConfig).some((configSection) => {\n if (typeof configSection === 'object' && configSection !== null) {\n return chainEnum in configSection;\n }\n return false;\n });\n\n // If the protocol supports this chain, include it in the filtered config but only with the specified chain\n if (hasChainSupport) {\n // Create a new protocol config with only the specified chain\n const filteredProtocolConfig: ProtocolInfo = {\n subgraph: {},\n factoryAddress: {},\n };\n\n // For each section in the protocol config (subgraph, factoryAddress, etc.)\n for (const sectionKey in protocolConfig) {\n const section = protocolConfig[sectionKey as keyof typeof protocolConfig];\n\n // If this section is an object with chain mappings\n if (typeof section === 'object' && section !== null) {\n // Create a new section with only the specified chain\n const filteredSection: Record<Chain, string> = {} as Record<Chain, string>;\n\n // If this chain exists in this section, include only that chain\n if (chainEnum in section) {\n filteredSection[chainEnum] = section[chainEnum as keyof typeof section] as string;\n\n // Add this filtered section to the filtered protocol config\n (filteredProtocolConfig[sectionKey as keyof ProtocolInfo] as Record<Chain, string>) =\n filteredSection;\n }\n } else if (section !== undefined) {\n // For non-object sections (like beaconContract), include as is\n (filteredProtocolConfig as Record<keyof ProtocolInfo, unknown>)[sectionKey as keyof ProtocolInfo] = section;\n }\n }\n\n filteredConfig[protocol as SupportedProtocol] = filteredProtocolConfig;\n }\n }\n\n return filteredConfig as AMMConfigType;\n};\n\n\nexport function getFactoryAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.factoryAddress?.[chain];\n}\n\nexport function getTickLensAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.TickLensAddress?.[chain];\n}\n\nexport function getNFTManagerAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.NFTManagerAddress?.[chain];\n}\n\nexport function getProtocolSubgraphURL(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string {\n const url = getAmmConfig(theGraphApiKey)[protocol]?.subgraph?.[chain];\n if (url) {\n return url;\n }\n\n throw new Error(`Subgraph URL not found for ${protocol} on ${chain}`);\n}\n\nexport function getSwapRouterAddress(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.swapRouterAddress?.[chain];\n}\n\nexport function getInitCodeHash(\n protocol: SupportedProtocol,\n chain: Chain,\n theGraphApiKey: string\n): string | undefined {\n return getAmmConfig(theGraphApiKey)[protocol]?.initCodeHash?.[chain];\n}\n\n\nexport * from './beacon.js';\nexport * from './contracts.js';\nexport * from './protocol.js';\n\n"]}
@@ -1,6 +1,10 @@
1
- import { chainIdToName } from '../../network.js';
2
- import { ALGEBRA_PROTOCOLS } from '../../protocol.js';
3
- import { getAmmConfig } from '../configs/ammConfig.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getProtocolBySubgraph = exports.getProtocolInfoByName = exports.getProtocolsForChainId = exports.getProtocolInfoByChainId = void 0;
4
+ exports.isAlgebraProtocolBySubgraph = isAlgebraProtocolBySubgraph;
5
+ const network_js_1 = require("../../network.js");
6
+ const protocol_js_1 = require("../../protocol.js");
7
+ const ammConfig_js_1 = require("../configs/ammConfig.js");
4
8
  /**
5
9
  * Retrieves detailed protocol information for a specific blockchain network.
6
10
  *
@@ -13,14 +17,14 @@ import { getAmmConfig } from '../configs/ammConfig.js';
13
17
  * // Returns array of protocol details for Ethereum mainnet
14
18
  * ```
15
19
  */
16
- export const getProtocolInfoByChainId = (chainId, theGraphApiKey) => {
20
+ const getProtocolInfoByChainId = (chainId, theGraphApiKey) => {
17
21
  try {
18
- const protocolConfig = getAmmConfig(theGraphApiKey);
22
+ const protocolConfig = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey);
19
23
  const supportedProtocols = Object.keys(protocolConfig);
20
24
  const protocolsForChain = [];
21
25
  supportedProtocols.forEach((protocolName) => {
22
26
  const protocolData = protocolConfig[protocolName];
23
- const chainName = chainIdToName(chainId);
27
+ const chainName = (0, network_js_1.chainIdToName)(chainId);
24
28
  if (chainName && protocolData && protocolData.subgraph[chainName]) {
25
29
  protocolsForChain.push({
26
30
  name: protocolName,
@@ -35,6 +39,7 @@ export const getProtocolInfoByChainId = (chainId, theGraphApiKey) => {
35
39
  return [];
36
40
  }
37
41
  };
42
+ exports.getProtocolInfoByChainId = getProtocolInfoByChainId;
38
43
  /**
39
44
  * Gets a list of supported protocols for a specific blockchain network.
40
45
  *
@@ -47,14 +52,14 @@ export const getProtocolInfoByChainId = (chainId, theGraphApiKey) => {
47
52
  * // Returns ['Uniswap', 'Sushi', ...] for Ethereum mainnet
48
53
  * ```
49
54
  */
50
- export const getProtocolsForChainId = (chainId, theGraphApiKey) => {
55
+ const getProtocolsForChainId = (chainId, theGraphApiKey) => {
51
56
  try {
52
- const protocolConfig = getAmmConfig(theGraphApiKey);
57
+ const protocolConfig = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey);
53
58
  const supportedProtocols = Object.keys(protocolConfig);
54
59
  const protocolsForChain = [];
55
60
  supportedProtocols.forEach((protocolName) => {
56
61
  const protocolData = protocolConfig[protocolName];
57
- const chainName = chainIdToName(chainId);
62
+ const chainName = (0, network_js_1.chainIdToName)(chainId);
58
63
  if (chainName && protocolData && protocolData.subgraph[chainName]) {
59
64
  protocolsForChain.push({
60
65
  name: protocolName,
@@ -69,6 +74,7 @@ export const getProtocolsForChainId = (chainId, theGraphApiKey) => {
69
74
  return [];
70
75
  }
71
76
  };
77
+ exports.getProtocolsForChainId = getProtocolsForChainId;
72
78
  /**
73
79
  * Retrieves protocol information for a specific protocol by its name.
74
80
  *
@@ -80,9 +86,10 @@ export const getProtocolsForChainId = (chainId, theGraphApiKey) => {
80
86
  * const info = getProtocolInfoByName('Uniswap', 'api-key');
81
87
  * ```
82
88
  */
83
- export const getProtocolInfoByName = (protocolName, theGraphApiKey) => {
84
- return getAmmConfig(theGraphApiKey)[protocolName];
89
+ const getProtocolInfoByName = (protocolName, theGraphApiKey) => {
90
+ return (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey)[protocolName];
85
91
  };
92
+ exports.getProtocolInfoByName = getProtocolInfoByName;
86
93
  /**
87
94
  * Finds a protocol by its subgraph URL.
88
95
  *
@@ -94,9 +101,9 @@ export const getProtocolInfoByName = (protocolName, theGraphApiKey) => {
94
101
  * const protocol = getProtocolBySubgraph('https://api.thegraph.com/...', 'api-key');
95
102
  * ```
96
103
  */
97
- export const getProtocolBySubgraph = (subgraphUrl, theGraphApiKey) => {
104
+ const getProtocolBySubgraph = (subgraphUrl, theGraphApiKey) => {
98
105
  try {
99
- const protocolConfig = getAmmConfig(theGraphApiKey);
106
+ const protocolConfig = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey);
100
107
  const supportedProtocols = Object.keys(protocolConfig);
101
108
  const protocol = supportedProtocols.find((protocolName) => {
102
109
  const protocolData = protocolConfig[protocolName];
@@ -112,6 +119,7 @@ export const getProtocolBySubgraph = (subgraphUrl, theGraphApiKey) => {
112
119
  return undefined;
113
120
  }
114
121
  };
122
+ exports.getProtocolBySubgraph = getProtocolBySubgraph;
115
123
  /**
116
124
  * Checks if a protocol is an Algebra protocol based on its subgraph URL.
117
125
  *
@@ -123,9 +131,9 @@ export const getProtocolBySubgraph = (subgraphUrl, theGraphApiKey) => {
123
131
  * const isAlgebra = isAlgebraProtocolBySubgraph('https://api.thegraph.com/...', 'api-key');
124
132
  * ```
125
133
  */
126
- export function isAlgebraProtocolBySubgraph(subgraphUrl, theGraphApiKey) {
127
- const protocolConfig = getAmmConfig(theGraphApiKey);
128
- const algebraSubgraphUrls = ALGEBRA_PROTOCOLS.flatMap((protocol) => Object.values(protocolConfig[protocol]?.subgraph || {}));
134
+ function isAlgebraProtocolBySubgraph(subgraphUrl, theGraphApiKey) {
135
+ const protocolConfig = (0, ammConfig_js_1.getAmmConfig)(theGraphApiKey);
136
+ const algebraSubgraphUrls = protocol_js_1.ALGEBRA_PROTOCOLS.flatMap((protocol) => Object.values(protocolConfig[protocol]?.subgraph || {}));
129
137
  return algebraSubgraphUrls.includes(subgraphUrl);
130
138
  }
131
139
  //# sourceMappingURL=protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../../../src/const/amm/utils/protocol.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAYvD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,OAAe,EACf,cAAsB,EACH,EAAE;IACrB,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;QACpD,MAAM,kBAAkB,GAAwB,MAAM,CAAC,IAAI,CACzD,cAAc,CACQ,CAAC;QAEzB,MAAM,iBAAiB,GAAsB,EAAE,CAAC;QAChD,kBAAkB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YAC1C,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;YAClD,MAAM,SAAS,GAAG,aAAa,CAAC,OAAO,CAAC,CAAC;YAEzC,IAAI,SAAS,IAAI,YAAY,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAkB,CAAC,EAAE,CAAC;gBAC3E,iBAAiB,CAAC,IAAI,CAAC;oBACrB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,YAAY;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,cAAsB,EACD,EAAE;IACvB,IAAI,C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zB,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE;YACxD,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;YAClD,IAAI,CAAC,YAAY;gBAAE,OAAO,KAAK,CAAC;YAChC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvD,OAAO,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAA;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,2BAA2B,CAAC,WAAmB,EAAE,cAAsB;IACrF,MAAM,cAAc,GAAG,YAAY,CAAC,cAAc,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC,QAA2B,EAAE,EAAE,CACpF,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CACxD,CAAC;IACF,OAAO,mBAAmB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { ProtocolInfo, SupportedProtocol } from '../../../types.js';\nimport { Chain, Protocol } from '../../chain.js';\nimport { chainIdToName } from '../../network.js';\nimport { ALGEBRA_PROTOCOLS } from '../../protocol.js';\nimport { getAmmConfig } from '../configs/ammConfig.js';\n\n/**\n` * Interface representing detailed protocol information including name and associated data\n */\nexport type ProtocolDetails = {\n /** The protocol identifier */\n name: SupportedProtocol;\n /** Protocol-specific configuration and information */\n data: ProtocolInfo;\n}\n\n/**\n * Retrieves detailed protocol information for a specific blockchain network.\n * \n * @param chainId - The numeric identifier of the blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns Array of protocol details supported on the specified chain\n * @example\n * ```typescript\n * const protocols = getProtocolInfoByChainId(1, 'api-key');\n * // Returns array of protocol details for Ethereum mainnet\n * ```\n */\nexport const getProtocolInfoByChainId = (\n chainId: number,\n theGraphApiKey: string\n): ProtocolDetails[] => {\n try {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const supportedProtocols: SupportedProtocol[] = Object.keys(\n protocolConfig\n ) as SupportedProtocol[];\n\n const protocolsForChain: ProtocolDetails[] = [];\n supportedProtocols.forEach((protocolName) => {\n const protocolData = protocolConfig[protocolName];\n const chainName = chainIdToName(chainId);\n\n if (chainName && protocolData && protocolData.subgraph[chainName as Chain]) {\n protocolsForChain.push({\n name: protocolName,\n data: protocolData,\n });\n }\n });\n\n return protocolsForChain;\n } catch (error) {\n console.error(\"Error fetching protocol info:\", error);\n return [];\n }\n}\n\n/**\n * Gets a list of supported protocols for a specific blockchain network.\n * \n * @param chainId - The numeric identifier of the blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns Array of protocol names supported on the specified chain\n * @example\n * ```typescript\n * const protocols = getProtocolsForChainId(1, 'api-key');\n * // Returns ['Uniswap', 'Sushi', ...] for Ethereum mainnet\n * ```\n */\nexport const getProtocolsForChainId = (\n chainId: number,\n theGraphApiKey: string\n): SupportedProtocol[] => {\n try {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const supportedProtocols: SupportedProtocol[] = Object.keys(\n protocolConfig\n ) as SupportedProtocol[];\n\n const protocolsForChain: ProtocolDetails[] = [];\n supportedProtocols.forEach((protocolName) => {\n const protocolData = protocolConfig[protocolName];\n const chainName = chainIdToName(chainId);\n\n if (chainName && protocolData && protocolData.subgraph[chainName as Chain]) {\n protocolsForChain.push({\n name: protocolName,\n data: protocolData,\n });\n }\n });\n\n return protocolsForChain.map(({ name }) => name);\n } catch (error) {\n console.error(\"Error fetching protocol info:\", error);\n return [];\n }\n}\n\n/**\n * Retrieves protocol information for a specific protocol by its name.\n * \n * @param protocolName - The name of the protocol to get information for\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns Protocol configuration and information\n * @example\n * ```typescript\n * const info = getProtocolInfoByName('Uniswap', 'api-key');\n * ```\n */\nexport const getProtocolInfoByName = (\n protocolName: Protocol,\n theGraphApiKey: string\n): ProtocolInfo | undefined => {\n return getAmmConfig(theGraphApiKey)[protocolName];\n}\n\n/**\n * Finds a protocol by its subgraph URL.\n * \n * @param subgraphUrl - The subgraph URL to search for\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The protocol name if found, undefined otherwise\n * @example\n * ```typescript\n * const protocol = getProtocolBySubgraph('https://api.thegraph.com/...', 'api-key');\n * ```\n */\nexport const getProtocolBySubgraph = (\n subgraphUrl: string,\n theGraphApiKey: string\n): SupportedProtocol | undefined => {\n try {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const supportedProtocols: SupportedProtocol[] = Object.keys(\n protocolConfig\n ) as SupportedProtocol[];\n\n const protocol = supportedProtocols.find((protocolName) => {\n const protocolData = protocolConfig[protocolName];\n if (!protocolData) return false;\n const subgraphs = Object.values(protocolData.subgraph);\n return subgraphs.includes(subgraphUrl);\n });\n\n return protocol;\n } catch (error) {\n console.error(\"Error fetching protocol info:\", error);\n return undefined;\n }\n}\n\n/**\n * Checks if a protocol is an Algebra protocol based on its subgraph URL.\n * \n * @param subgraphUrl - The subgraph URL to check\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns True if the protocol is an Algebra protocol, false otherwise\n * @example\n * ```typescript\n * const isAlgebra = isAlgebraProtocolBySubgraph('https://api.thegraph.com/...', 'api-key');\n * ```\n */\nexport function isAlgebraProtocolBySubgraph(subgraphUrl: string, theGraphApiKey: string): boolean {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const algebraSubgraphUrls = ALGEBRA_PROTOCOLS.flatMap((protocol: SupportedProtocol) =>\n Object.values(protocolConfig[protocol]?.subgraph || {})\n );\n return algebraSubgraphUrls.includes(subgraphUrl);\n} \n"]}
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../../../src/const/amm/utils/protocol.ts"],"names":[],"mappings":";;;AAoKA,kEAMC;AAxKD,iDAAiD;AACjD,mDAAsD;AACtD,0DAAuD;AAYvD;;;;;;;;;;;GAWG;AACI,MAAM,wBAAwB,GAAG,CACtC,OAAe,EACf,cAAsB,EACH,EAAE;IACrB,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,IAAA,2BAAY,EAAC,cAAc,CAAC,CAAC;QACpD,MAAM,kBAAkB,GAAwB,MAAM,CAAC,IAAI,CACzD,cAAc,CACQ,CAAC;QAEzB,MAAM,iBAAiB,GAAsB,EAAE,CAAC;QAChD,kBAAkB,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;YAC1C,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;YAClD,MAAM,SAAS,GAAG,IAAA,0BAAa,EAAC,OAAO,CAAC,CAAC;YAEzC,IAAI,SAAS,IAAI,YAAY,IAAI,YAAY,CAAC,QAAQ,CAAC,SAAkB,CAAC,EAAE,CAAC;gBAC3E,iBAAiB,CAAC,IAAI,CAAC;oBACrB,IAAI,EAAE,YAAY;oBAClB,IAAI,EAAE,YAAY;iBACnB,CAAC,CAAC;YACL,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC,CAAA;AA5BY,QAAA,wBAAwB,4BA4BpC;AAED;;;;;;;;;;;GAWG;AACI,MAAM,sBAAsB,GAAG,CACpC,OAAe,EACf,cAAsB,EACD,EAAE;IACvB,IAAI,CAAC;QACH,MAAM,cAAc,GAAG,IAAA,2BAAY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D,cAAc,CACQ,CAAC;QAEzB,MAAM,QAAQ,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC,YAAY,EAAE,EAAE;YACxD,MAAM,YAAY,GAAG,cAAc,CAAC,YAAY,CAAC,CAAC;YAClD,IAAI,CAAC,YAAY;gBAAE,OAAO,KAAK,CAAC;YAChC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;YACvD,OAAO,SAAS,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;QAEH,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;QACtD,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC,CAAA;AAtBY,QAAA,qBAAqB,yBAsBjC;AAED;;;;;;;;;;GAUG;AACH,SAAgB,2BAA2B,CAAC,WAAmB,EAAE,cAAsB;IACrF,MAAM,cAAc,GAAG,IAAA,2BAAY,EAAC,cAAc,CAAC,CAAC;IACpD,MAAM,mBAAmB,GAAG,+BAAiB,CAAC,OAAO,CAAC,CAAC,QAA2B,EAAE,EAAE,CACpF,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE,QAAQ,IAAI,EAAE,CAAC,CACxD,CAAC;IACF,OAAO,mBAAmB,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AACnD,CAAC","sourcesContent":["import { ProtocolInfo, SupportedProtocol } from '../../../types.js';\nimport { Chain, Protocol } from '../../chain.js';\nimport { chainIdToName } from '../../network.js';\nimport { ALGEBRA_PROTOCOLS } from '../../protocol.js';\nimport { getAmmConfig } from '../configs/ammConfig.js';\n\n/**\n` * Interface representing detailed protocol information including name and associated data\n */\nexport type ProtocolDetails = {\n /** The protocol identifier */\n name: SupportedProtocol;\n /** Protocol-specific configuration and information */\n data: ProtocolInfo;\n}\n\n/**\n * Retrieves detailed protocol information for a specific blockchain network.\n * \n * @param chainId - The numeric identifier of the blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns Array of protocol details supported on the specified chain\n * @example\n * ```typescript\n * const protocols = getProtocolInfoByChainId(1, 'api-key');\n * // Returns array of protocol details for Ethereum mainnet\n * ```\n */\nexport const getProtocolInfoByChainId = (\n chainId: number,\n theGraphApiKey: string\n): ProtocolDetails[] => {\n try {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const supportedProtocols: SupportedProtocol[] = Object.keys(\n protocolConfig\n ) as SupportedProtocol[];\n\n const protocolsForChain: ProtocolDetails[] = [];\n supportedProtocols.forEach((protocolName) => {\n const protocolData = protocolConfig[protocolName];\n const chainName = chainIdToName(chainId);\n\n if (chainName && protocolData && protocolData.subgraph[chainName as Chain]) {\n protocolsForChain.push({\n name: protocolName,\n data: protocolData,\n });\n }\n });\n\n return protocolsForChain;\n } catch (error) {\n console.error(\"Error fetching protocol info:\", error);\n return [];\n }\n}\n\n/**\n * Gets a list of supported protocols for a specific blockchain network.\n * \n * @param chainId - The numeric identifier of the blockchain network\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns Array of protocol names supported on the specified chain\n * @example\n * ```typescript\n * const protocols = getProtocolsForChainId(1, 'api-key');\n * // Returns ['Uniswap', 'Sushi', ...] for Ethereum mainnet\n * ```\n */\nexport const getProtocolsForChainId = (\n chainId: number,\n theGraphApiKey: string\n): SupportedProtocol[] => {\n try {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const supportedProtocols: SupportedProtocol[] = Object.keys(\n protocolConfig\n ) as SupportedProtocol[];\n\n const protocolsForChain: ProtocolDetails[] = [];\n supportedProtocols.forEach((protocolName) => {\n const protocolData = protocolConfig[protocolName];\n const chainName = chainIdToName(chainId);\n\n if (chainName && protocolData && protocolData.subgraph[chainName as Chain]) {\n protocolsForChain.push({\n name: protocolName,\n data: protocolData,\n });\n }\n });\n\n return protocolsForChain.map(({ name }) => name);\n } catch (error) {\n console.error(\"Error fetching protocol info:\", error);\n return [];\n }\n}\n\n/**\n * Retrieves protocol information for a specific protocol by its name.\n * \n * @param protocolName - The name of the protocol to get information for\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns Protocol configuration and information\n * @example\n * ```typescript\n * const info = getProtocolInfoByName('Uniswap', 'api-key');\n * ```\n */\nexport const getProtocolInfoByName = (\n protocolName: Protocol,\n theGraphApiKey: string\n): ProtocolInfo | undefined => {\n return getAmmConfig(theGraphApiKey)[protocolName];\n}\n\n/**\n * Finds a protocol by its subgraph URL.\n * \n * @param subgraphUrl - The subgraph URL to search for\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns The protocol name if found, undefined otherwise\n * @example\n * ```typescript\n * const protocol = getProtocolBySubgraph('https://api.thegraph.com/...', 'api-key');\n * ```\n */\nexport const getProtocolBySubgraph = (\n subgraphUrl: string,\n theGraphApiKey: string\n): SupportedProtocol | undefined => {\n try {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const supportedProtocols: SupportedProtocol[] = Object.keys(\n protocolConfig\n ) as SupportedProtocol[];\n\n const protocol = supportedProtocols.find((protocolName) => {\n const protocolData = protocolConfig[protocolName];\n if (!protocolData) return false;\n const subgraphs = Object.values(protocolData.subgraph);\n return subgraphs.includes(subgraphUrl);\n });\n\n return protocol;\n } catch (error) {\n console.error(\"Error fetching protocol info:\", error);\n return undefined;\n }\n}\n\n/**\n * Checks if a protocol is an Algebra protocol based on its subgraph URL.\n * \n * @param subgraphUrl - The subgraph URL to check\n * @param theGraphApiKey - The Graph API key for accessing protocol data\n * @returns True if the protocol is an Algebra protocol, false otherwise\n * @example\n * ```typescript\n * const isAlgebra = isAlgebraProtocolBySubgraph('https://api.thegraph.com/...', 'api-key');\n * ```\n */\nexport function isAlgebraProtocolBySubgraph(subgraphUrl: string, theGraphApiKey: string): boolean {\n const protocolConfig = getAmmConfig(theGraphApiKey);\n const algebraSubgraphUrls = ALGEBRA_PROTOCOLS.flatMap((protocol: SupportedProtocol) =>\n Object.values(protocolConfig[protocol]?.subgraph || {})\n );\n return algebraSubgraphUrls.includes(subgraphUrl);\n} \n"]}
@@ -1,7 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.API_URLS = void 0;
4
+ exports.getApiUrl = getApiUrl;
1
5
  /**
2
6
  * API URLs for different environments and versions
3
7
  */
4
- export const API_URLS = {
8
+ exports.API_URLS = {
5
9
  v1: {
6
10
  production: 'https://s55qpiwei1.execute-api.us-east-1.amazonaws.com',
7
11
  development: 'https://s55qpiwei1.execute-api.us-east-1.amazonaws.com', // Currently same as production
@@ -18,7 +22,7 @@ export const API_URLS = {
18
22
  * @param version - The API version to use (defaults to v1)
19
23
  * @returns The API URL for the specified environment and version
20
24
  */
21
- export function getApiUrl(environment, version = 'v1') {
22
- return API_URLS[version][environment];
25
+ function getApiUrl(environment, version = 'v1') {
26
+ return exports.API_URLS[version][environment];
23
27
  }
24
28
  //# sourceMappingURL=api.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/const/api.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,EAAE,EAAE;QACF,UAAU,EAAE,wDAAwD;QACpE,WAAW,EAAE,wDAAwD,EAAE,+BAA+B;KACvG;IACD,2BAA2B;IAC3B,QAAQ;IACR,qDAAqD;IACrD,qDAAqD;IACrD,KAAK;CACG,CAAC;AAEX;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CACvB,WAAyC,EACzC,UAAiC,IAAI;IAErC,OAAO,QAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/**\n * API URLs for different environments and versions\n */\nexport const API_URLS = {\n v1: {\n production: 'https://s55qpiwei1.execute-api.us-east-1.amazonaws.com',\n development: 'https://s55qpiwei1.execute-api.us-east-1.amazonaws.com', // Currently same as production\n },\n // Add future versions here\n // v2: {\n // production: 'https://v2-prod.api.steer.finance',\n // development: 'https://v2-dev.api.steer.finance',\n // },\n} as const;\n\n/**\n * Get the API URL for a specific environment and version\n * @param environment - The environment to get the URL for\n * @param version - The API version to use (defaults to v1)\n * @returns The API URL for the specified environment and version\n */\nexport function getApiUrl(\n environment: 'production' | 'development', \n version: keyof typeof API_URLS = 'v1'\n): string {\n return API_URLS[version][environment];\n} "]}
1
+ {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../src/const/api.ts"],"names":[],"mappings":";;;AAqBA,8BAKC;AA1BD;;GAEG;AACU,QAAA,QAAQ,GAAG;IACtB,EAAE,EAAE;QACF,UAAU,EAAE,wDAAwD;QACpE,WAAW,EAAE,wDAAwD,EAAE,+BAA+B;KACvG;IACD,2BAA2B;IAC3B,QAAQ;IACR,qDAAqD;IACrD,qDAAqD;IACrD,KAAK;CACG,CAAC;AAEX;;;;;GAKG;AACH,SAAgB,SAAS,CACvB,WAAyC,EACzC,UAAiC,IAAI;IAErC,OAAO,gBAAQ,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,CAAC;AACxC,CAAC","sourcesContent":["/**\n * API URLs for different environments and versions\n */\nexport const API_URLS = {\n v1: {\n production: 'https://s55qpiwei1.execute-api.us-east-1.amazonaws.com',\n development: 'https://s55qpiwei1.execute-api.us-east-1.amazonaws.com', // Currently same as production\n },\n // Add future versions here\n // v2: {\n // production: 'https://v2-prod.api.steer.finance',\n // development: 'https://v2-dev.api.steer.finance',\n // },\n} as const;\n\n/**\n * Get the API URL for a specific environment and version\n * @param environment - The environment to get the URL for\n * @param version - The API version to use (defaults to v1)\n * @returns The API URL for the specified environment and version\n */\nexport function getApiUrl(\n environment: 'production' | 'development', \n version: keyof typeof API_URLS = 'v1'\n): string {\n return API_URLS[version][environment];\n} "]}
@@ -1,9 +1,14 @@
1
- import { Chain, ChainId } from './chain.js';
2
- import { getSubgraphUrlByChainId, steerSubgraphConfig } from './subgraph.js';
3
- import { isSingleAssetDepositSupported, networks } from './network.js';
4
- import { getProtocolInfoByChainId } from './amm/utils/protocol.js';
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getSupportedChains = getSupportedChains;
4
+ exports.getSupportedChainIds = getSupportedChainIds;
5
+ exports.getSupportedChainByChainId = getSupportedChainByChainId;
6
+ const chain_js_1 = require("./chain.js");
7
+ const subgraph_js_1 = require("./subgraph.js");
8
+ const network_js_1 = require("./network.js");
9
+ const protocol_js_1 = require("./amm/utils/protocol.js");
5
10
  function getChainId(chain) {
6
- return ChainId[chain];
11
+ return chain_js_1.ChainId[chain];
7
12
  }
8
13
  function defaultInclude(include) {
9
14
  return {
@@ -13,19 +18,19 @@ function defaultInclude(include) {
13
18
  singleAssetDeposit: include?.singleAssetDeposit ?? false,
14
19
  };
15
20
  }
16
- export function getSupportedChains(options = {}) {
21
+ function getSupportedChains(options = {}) {
17
22
  const include = defaultInclude(options.include);
18
- const chains = Object.values(Chain)
19
- .filter((chain) => Boolean(steerSubgraphConfig[chain]))
23
+ const chains = Object.values(chain_js_1.Chain)
24
+ .filter((chain) => Boolean(subgraph_js_1.steerSubgraphConfig[chain]))
20
25
  .map((chain) => {
21
26
  const chainId = getChainId(chain);
22
- const subgraphUrl = include.subgraph ? getSubgraphUrlByChainId(chainId) : undefined;
23
- const deployments = include.deployments ? networks[chain] : undefined;
27
+ const subgraphUrl = include.subgraph ? (0, subgraph_js_1.getSubgraphUrlByChainId)(chainId) : undefined;
28
+ const deployments = include.deployments ? network_js_1.networks[chain] : undefined;
24
29
  const protocols = include.protocols
25
- ? getProtocolInfoByChainId(chainId, options.theGraphApiKey ?? '')
30
+ ? (0, protocol_js_1.getProtocolInfoByChainId)(chainId, options.theGraphApiKey ?? '')
26
31
  : undefined;
27
32
  const singleAssetDeposit = include.singleAssetDeposit
28
- ? isSingleAssetDepositSupported(chainId)
33
+ ? (0, network_js_1.isSingleAssetDepositSupported)(chainId)
29
34
  : false;
30
35
  const features = {
31
36
  subgraph: Boolean(subgraphUrl),
@@ -52,11 +57,11 @@ export function getSupportedChains(options = {}) {
52
57
  return chains;
53
58
  return chains.filter((c) => c.features[featureFilter]);
54
59
  }
55
- export function getSupportedChainIds(options = {}) {
60
+ function getSupportedChainIds(options = {}) {
56
61
  return getSupportedChains(options).map((c) => c.chainId);
57
62
  }
58
- export function getSupportedChainByChainId(chainId, options = {}) {
59
- const chainName = Object.values(Chain).find((chain) => getChainId(chain) === chainId);
63
+ function getSupportedChainByChainId(chainId, options = {}) {
64
+ const chainName = Object.values(chain_js_1.Chain).find((chain) => getChainId(chain) === chainId);
60
65
  if (!chainName)
61
66
  return undefined;
62
67
  return getSupportedChains({ ...options }).find((c) => c.chainId === chainId);
@@ -1 +1 @@
1
- {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/const/capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,6BAA6B,EAAE,QAAQ,EAAsB,MAAM,cAAc,CAAC;AAC3F,OAAO,EAAE,wBAAwB,EAAwB,MAAM,yBAAyB,CAAC;AAwCzF,SAAS,UAAU,CAAC,KAAY;IAC9B,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,cAAc,CAAC,OAAgC;IACtD,OAAO;QACL,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,IAAI;QACnC,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,KAAK;QAC1C,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,KAAK;QACtC,kBAAkB,EAAE,OAAO,EAAE,kBAAkB,IAAI,KAAK;KACzD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,UAAqC,EAAE;IACxE,MAAM,OAAO,GAAG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cAAc,CAAC,WAAW,GAAG,WAAW,CAAC;QAClE,IAAI,OAAO,CAAC,SAAS;YAAE,cAAc,CAAC,SAAS,GAAG,SAAS,CAAC;QAE5D,OAAO,cAAc,CAAC;IACxB,CAAC,CAAC,CAAC;IAEL,MAAM,aAAa,GAAG,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;IAC9C,IAAI,CAAC,aAAa;QAAE,OAAO,MAAM,CAAC;IAElC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,UAAqC,EAAE;IAC1E,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,OAAe,EACf,UAAqD,EAAE;IAEvD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,CAAC;IACtF,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IAEjC,OAAO,kBAAkB,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { Chain, ChainId } from './chain.js';\nimport { getSubgraphUrlByChainId, steerSubgraphConfig } from './subgraph.js';\nimport { isSingleAssetDepositSupported, networks, type NetworkConfig } from './network.js';\nimport { getProtocolInfoByChainId, type ProtocolDetails } from './amm/utils/protocol.js';\n\nexport type SupportedChainsFeature =\n | 'subgraph'\n | 'deployments'\n | 'protocols'\n | 'singleAssetDeposit';\n\nexport type SupportedChainsInclude = {\n subgraph?: boolean;\n deployments?: boolean;\n protocols?: boolean;\n singleAssetDeposit?: boolean;\n};\n\nexport type GetSupportedChainsOptions = {\n theGraphApiKey?: string;\n include?: SupportedChainsInclude;\n filter?: {\n feature?: SupportedChainsFeature;\n };\n};\n\nexport type SupportedChainFeatures = {\n subgraph: boolean;\n deployments: boolean;\n protocols: boolean;\n singleAssetDeposit: boolean;\n};\n\nexport type SupportedChain = {\n schemaVersion: 1;\n chain: Chain;\n chainId: number;\n features: SupportedChainFeatures;\n subgraphUrl?: string;\n deployments?: NetworkConfig;\n protocols?: ProtocolDetails[];\n};\n\nfunction getChainId(chain: Chain): number {\n return ChainId[chain];\n}\n\nfunction defaultInclude(include?: SupportedChainsInclude): Required<SupportedChainsInclude> {\n return {\n subgraph: include?.subgraph ?? true,\n deployments: include?.deployments ?? false,\n protocols: include?.protocols ?? false,\n singleAssetDeposit: include?.singleAssetDeposit ?? false,\n };\n}\n\nexport function getSupportedChains(options: GetSupportedChainsOptions = {}): SupportedChain[] {\n const include = defaultInclude(options.include);\n\n const chains: SupportedChain[] = Object.values(Chain)\n .filter((chain) => Boolean(steerSubgraphConfig[chain]))\n .map((chain) => {\n const chainId = getChainId(chain);\n\n const subgraphUrl = include.subgraph ? getSubgraphUrlByChainId(chainId) : undefined;\n const deployments = include.deployments ? networks[chain] : undefined;\n\n const protocols = include.protocols\n ? getProtocolInfoByChainId(chainId, options.theGraphApiKey ?? '')\n : undefined;\n\n const singleAssetDeposit = include.singleAssetDeposit\n ? isSingleAssetDepositSupported(chainId)\n : false;\n\n const features: SupportedChainFeatures = {\n subgraph: Boolean(subgraphUrl),\n deployments: Boolean(deployments),\n protocols: Boolean(protocols && protocols.length > 0),\n singleAssetDeposit,\n };\n\n const supportedChain: SupportedChain = {\n schemaVersion: 1 as const,\n chain,\n chainId,\n features,\n };\n\n if (include.subgraph) supportedChain.subgraphUrl = subgraphUrl;\n if (include.deployments) supportedChain.deployments = deployments;\n if (include.protocols) supportedChain.protocols = protocols;\n\n return supportedChain;\n });\n\n const featureFilter = options.filter?.feature;\n if (!featureFilter) return chains;\n\n return chains.filter((c) => c.features[featureFilter]);\n}\n\nexport function getSupportedChainIds(options: GetSupportedChainsOptions = {}): number[] {\n return getSupportedChains(options).map((c) => c.chainId);\n}\n\nexport function getSupportedChainByChainId(\n chainId: number,\n options: Omit<GetSupportedChainsOptions, 'filter'> = {}\n): SupportedChain | undefined {\n const chainName = Object.values(Chain).find((chain) => getChainId(chain) === chainId);\n if (!chainName) return undefined;\n\n return getSupportedChains({ ...options }).find((c) => c.chainId === chainId);\n}\n"]}
1
+ {"version":3,"file":"capabilities.js","sourceRoot":"","sources":["../../../src/const/capabilities.ts"],"names":[],"mappings":";;AAwDA,gDA4CC;AAED,oDAEC;AAED,gEAQC;AAlHD,yCAA4C;AAC5C,+CAA6E;AAC7E,6CAA2F;AAC3F,yDAAyF;AAwCzF,SAAS,UAAU,CAAC,KAAY;IAC9B,OAAO,kBAAO,CAAC,KAAK,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,cAAc,CAAC,OAAgC;IACtD,OAAO;QACL,QAAQ,EAAE,OAAO,EAAE,QAAQ,IAAI,IAAI;QACnC,WAAW,EAAE,OAAO,EAAE,WAAW,IAAI,KAAK;QAC1C,SAAS,EAAE,OAAO,EAAE,SAAS,IAAI,KAAK;QACtC,kBAAkB,EAAE,OAAO,EAAE,kBAAkB,IAAI,KAAK;KACzD,CAAC;AACJ,CAAC;AAED,SAAgB,kBAAkB,CAAC,UAAqC,EAAE;IACxE,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IAEhD,MAAM,MAAM,GAAqB,MAAM,CAAC,MAAM,CAAC,gBAAK,CAAC;SAClD,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,iCAAmB,CAAC,KAAK,CAAC,CAAC,CAAC;SACtD,GAAG,CAAC,CAAC,KAAK,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C;IAC9C,IAAI,CAAC,aAAa;QAAE,OAAO,MAAM,CAAC;IAElC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AACzD,CAAC;AAED,SAAgB,oBAAoB,CAAC,UAAqC,EAAE;IAC1E,OAAO,kBAAkB,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,SAAgB,0BAA0B,CACxC,OAAe,EACf,UAAqD,EAAE;IAEvD,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAK,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,OAAO,CAAC,CAAC;IACtF,IAAI,CAAC,SAAS;QAAE,OAAO,SAAS,CAAC;IAEjC,OAAO,kBAAkB,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,OAAO,CAAC,CAAC;AAC/E,CAAC","sourcesContent":["import { Chain, ChainId } from './chain.js';\nimport { getSubgraphUrlByChainId, steerSubgraphConfig } from './subgraph.js';\nimport { isSingleAssetDepositSupported, networks, type NetworkConfig } from './network.js';\nimport { getProtocolInfoByChainId, type ProtocolDetails } from './amm/utils/protocol.js';\n\nexport type SupportedChainsFeature =\n | 'subgraph'\n | 'deployments'\n | 'protocols'\n | 'singleAssetDeposit';\n\nexport type SupportedChainsInclude = {\n subgraph?: boolean;\n deployments?: boolean;\n protocols?: boolean;\n singleAssetDeposit?: boolean;\n};\n\nexport type GetSupportedChainsOptions = {\n theGraphApiKey?: string;\n include?: SupportedChainsInclude;\n filter?: {\n feature?: SupportedChainsFeature;\n };\n};\n\nexport type SupportedChainFeatures = {\n subgraph: boolean;\n deployments: boolean;\n protocols: boolean;\n singleAssetDeposit: boolean;\n};\n\nexport type SupportedChain = {\n schemaVersion: 1;\n chain: Chain;\n chainId: number;\n features: SupportedChainFeatures;\n subgraphUrl?: string;\n deployments?: NetworkConfig;\n protocols?: ProtocolDetails[];\n};\n\nfunction getChainId(chain: Chain): number {\n return ChainId[chain];\n}\n\nfunction defaultInclude(include?: SupportedChainsInclude): Required<SupportedChainsInclude> {\n return {\n subgraph: include?.subgraph ?? true,\n deployments: include?.deployments ?? false,\n protocols: include?.protocols ?? false,\n singleAssetDeposit: include?.singleAssetDeposit ?? false,\n };\n}\n\nexport function getSupportedChains(options: GetSupportedChainsOptions = {}): SupportedChain[] {\n const include = defaultInclude(options.include);\n\n const chains: SupportedChain[] = Object.values(Chain)\n .filter((chain) => Boolean(steerSubgraphConfig[chain]))\n .map((chain) => {\n const chainId = getChainId(chain);\n\n const subgraphUrl = include.subgraph ? getSubgraphUrlByChainId(chainId) : undefined;\n const deployments = include.deployments ? networks[chain] : undefined;\n\n const protocols = include.protocols\n ? getProtocolInfoByChainId(chainId, options.theGraphApiKey ?? '')\n : undefined;\n\n const singleAssetDeposit = include.singleAssetDeposit\n ? isSingleAssetDepositSupported(chainId)\n : false;\n\n const features: SupportedChainFeatures = {\n subgraph: Boolean(subgraphUrl),\n deployments: Boolean(deployments),\n protocols: Boolean(protocols && protocols.length > 0),\n singleAssetDeposit,\n };\n\n const supportedChain: SupportedChain = {\n schemaVersion: 1 as const,\n chain,\n chainId,\n features,\n };\n\n if (include.subgraph) supportedChain.subgraphUrl = subgraphUrl;\n if (include.deployments) supportedChain.deployments = deployments;\n if (include.protocols) supportedChain.protocols = protocols;\n\n return supportedChain;\n });\n\n const featureFilter = options.filter?.feature;\n if (!featureFilter) return chains;\n\n return chains.filter((c) => c.features[featureFilter]);\n}\n\nexport function getSupportedChainIds(options: GetSupportedChainsOptions = {}): number[] {\n return getSupportedChains(options).map((c) => c.chainId);\n}\n\nexport function getSupportedChainByChainId(\n chainId: number,\n options: Omit<GetSupportedChainsOptions, 'filter'> = {}\n): SupportedChain | undefined {\n const chainName = Object.values(Chain).find((chain) => getChainId(chain) === chainId);\n if (!chainName) return undefined;\n\n return getSupportedChains({ ...options }).find((c) => c.chainId === chainId);\n}\n"]}
@@ -1,5 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MultiPositionManagers = exports.StrykePositionManagers = exports.Protocol = exports.ChainId = exports.Chain = void 0;
1
4
  // Chain types
2
- export var Chain;
5
+ var Chain;
3
6
  (function (Chain) {
4
7
  // Mainnet = 'Mainnet',
5
8
  Chain["Polygon"] = "Polygon";
@@ -51,8 +54,8 @@ export var Chain;
51
54
  Chain["Saga"] = "Saga";
52
55
  Chain["Nibiru"] = "Nibiru";
53
56
  Chain["Hyperevm"] = "Hyperevm";
54
- })(Chain || (Chain = {}));
55
- export const ChainId = {
57
+ })(Chain || (exports.Chain = Chain = {}));
58
+ exports.ChainId = {
56
59
  Polygon: 137,
57
60
  Arbitrum: 42161,
58
61
  Optimism: 10,
@@ -104,7 +107,7 @@ export const ChainId = {
104
107
  Hyperevm: 999
105
108
  };
106
109
  // Protocol types
107
- export var Protocol;
110
+ var Protocol;
108
111
  (function (Protocol) {
109
112
  Protocol["QuickSwap"] = "QuickSwap";
110
113
  Protocol["Uniswap"] = "Uniswap";
@@ -167,13 +170,13 @@ export var Protocol;
167
170
  Protocol["Nest"] = "Nest";
168
171
  Protocol["Cypher"] = "Cypher";
169
172
  Protocol["SparkIntegral"] = "SparkIntegral";
170
- })(Protocol || (Protocol = {}));
171
- export var StrykePositionManagers;
173
+ })(Protocol || (exports.Protocol = Protocol = {}));
174
+ var StrykePositionManagers;
172
175
  (function (StrykePositionManagers) {
173
176
  StrykePositionManagers["StrykeEqualizerManager"] = "StrykeEqualizerPositionManager";
174
177
  StrykePositionManagers["StrykeShadowManager"] = "StrykeShadowManager";
175
- })(StrykePositionManagers || (StrykePositionManagers = {}));
176
- export var MultiPositionManagers;
178
+ })(StrykePositionManagers || (exports.StrykePositionManagers = StrykePositionManagers = {}));
179
+ var MultiPositionManagers;
177
180
  (function (MultiPositionManagers) {
178
181
  MultiPositionManagers["MultiPositionUniswapV3"] = "MultiPositionUniswapV3";
179
182
  MultiPositionManagers["MultiPositionSushi"] = "MultiPositionSushi";
@@ -239,5 +242,5 @@ export var MultiPositionManagers;
239
242
  MultiPositionManagers["MultiPositionCypher"] = "MultiPositionCypher";
240
243
  MultiPositionManagers["MultiPositionSushiManaged"] = "MultiPositionSushiManaged";
241
244
  MultiPositionManagers["MultiPositionSparkIntegral"] = "MultiPositionSparkIntegral";
242
- })(MultiPositionManagers || (MultiPositionManagers = {}));
245
+ })(MultiPositionManagers || (exports.MultiPositionManagers = MultiPositionManagers = {}));
243
246
  //# sourceMappingURL=chain.js.map