@mento-protocol/mento-sdk 2.0.0-beta.9 → 3.0.0-beta.2

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 (365) hide show
  1. package/README.md +170 -132
  2. package/dist/cache/routes.11142220.js +1 -0
  3. package/dist/cache/routes.42220.d.ts +3 -0
  4. package/dist/cache/routes.42220.d.ts.map +1 -0
  5. package/dist/cache/routes.42220.js +112 -0
  6. package/dist/cache/routes.42220.js.map +1 -0
  7. package/dist/cache/tokens.11142220.d.ts +3 -0
  8. package/dist/cache/tokens.11142220.d.ts.map +1 -0
  9. package/dist/cache/tokens.11142220.js +129 -0
  10. package/dist/cache/tokens.11142220.js.map +1 -0
  11. package/dist/cache/tokens.42220.d.ts +3 -0
  12. package/dist/cache/tokens.42220.d.ts.map +1 -0
  13. package/dist/cache/tokens.42220.js +129 -0
  14. package/dist/cache/tokens.42220.js.map +1 -0
  15. package/dist/core/abis/bipoolmanager.d.ts +34 -0
  16. package/dist/core/abis/bipoolmanager.d.ts.map +1 -0
  17. package/dist/core/abis/bipoolmanager.js +72 -0
  18. package/dist/core/abis/bipoolmanager.js.map +1 -0
  19. package/dist/core/abis/broker.d.ts +2 -0
  20. package/dist/core/abis/broker.d.ts.map +1 -0
  21. package/dist/core/abis/broker.js +9 -0
  22. package/dist/core/abis/broker.js.map +1 -0
  23. package/dist/core/abis/erc20.d.ts +2 -0
  24. package/dist/core/abis/erc20.d.ts.map +1 -0
  25. package/dist/{abis → core/abis}/erc20.js +5 -2
  26. package/dist/core/abis/erc20.js.map +1 -0
  27. package/dist/core/abis/fpmm.d.ts +34 -0
  28. package/dist/core/abis/fpmm.d.ts.map +1 -0
  29. package/dist/core/abis/fpmm.js +11 -0
  30. package/dist/core/abis/fpmm.js.map +1 -0
  31. package/dist/core/abis/fpmmFactory.d.ts +21 -0
  32. package/dist/core/abis/fpmmFactory.d.ts.map +1 -0
  33. package/dist/core/abis/fpmmFactory.js +9 -0
  34. package/dist/core/abis/fpmmFactory.js.map +1 -0
  35. package/dist/core/abis/index.d.ts +10 -0
  36. package/dist/core/abis/index.d.ts.map +1 -0
  37. package/dist/{abis → core/abis}/index.js +4 -0
  38. package/dist/core/abis/index.js.map +1 -0
  39. package/dist/core/abis/pricingmodule.d.ts +2 -0
  40. package/dist/core/abis/pricingmodule.d.ts.map +1 -0
  41. package/dist/core/abis/pricingmodule.js +6 -0
  42. package/dist/core/abis/pricingmodule.js.map +1 -0
  43. package/dist/core/abis/reserve.d.ts +2 -0
  44. package/dist/core/abis/reserve.d.ts.map +1 -0
  45. package/dist/core/abis/reserve.js +10 -0
  46. package/dist/core/abis/reserve.js.map +1 -0
  47. package/dist/core/abis/router.d.ts +2 -0
  48. package/dist/core/abis/router.d.ts.map +1 -0
  49. package/dist/core/abis/router.js +10 -0
  50. package/dist/core/abis/router.js.map +1 -0
  51. package/dist/core/abis/uniswapV3.d.ts +4 -0
  52. package/dist/core/abis/uniswapV3.d.ts.map +1 -0
  53. package/dist/{abis → core/abis}/uniswapV3.js +7 -6
  54. package/dist/core/abis/uniswapV3.js.map +1 -0
  55. package/dist/core/abis/virtualPool.d.ts +10 -0
  56. package/dist/core/abis/virtualPool.d.ts.map +1 -0
  57. package/dist/core/abis/virtualPool.js +6 -0
  58. package/dist/core/abis/virtualPool.js.map +1 -0
  59. package/dist/core/abis/virtualPoolFactory.d.ts +27 -0
  60. package/dist/core/abis/virtualPoolFactory.d.ts.map +1 -0
  61. package/dist/core/abis/virtualPoolFactory.js +9 -0
  62. package/dist/core/abis/virtualPoolFactory.js.map +1 -0
  63. package/dist/core/constants/aaveConfig.d.ts.map +1 -0
  64. package/dist/core/constants/aaveConfig.js.map +1 -0
  65. package/dist/{constants → core/constants}/addresses.d.ts +4 -5
  66. package/dist/core/constants/addresses.d.ts.map +1 -0
  67. package/dist/core/constants/addresses.js +73 -0
  68. package/dist/core/constants/addresses.js.map +1 -0
  69. package/dist/core/constants/chainId.d.ts +5 -0
  70. package/dist/core/constants/chainId.d.ts.map +1 -0
  71. package/dist/{constants → core/constants}/chainId.js +1 -1
  72. package/dist/core/constants/chainId.js.map +1 -0
  73. package/dist/core/constants/contractNames.d.ts.map +1 -0
  74. package/dist/core/constants/contractNames.js.map +1 -0
  75. package/dist/{constants → core/constants}/index.d.ts +0 -2
  76. package/dist/core/constants/index.d.ts.map +1 -0
  77. package/dist/{constants → core/constants}/index.js +0 -2
  78. package/dist/core/constants/index.js.map +1 -0
  79. package/dist/{constants → core/constants}/mentoAddresses.d.ts +2 -0
  80. package/dist/core/constants/mentoAddresses.d.ts.map +1 -0
  81. package/dist/{constants → core/constants}/mentoAddresses.js +2 -0
  82. package/dist/core/constants/mentoAddresses.js.map +1 -0
  83. package/dist/core/constants/protocolAddresses.d.ts.map +1 -0
  84. package/dist/core/constants/protocolAddresses.js.map +1 -0
  85. package/dist/core/errors/base.d.ts +8 -0
  86. package/dist/core/errors/base.d.ts.map +1 -0
  87. package/dist/core/errors/base.js +17 -0
  88. package/dist/core/errors/base.js.map +1 -0
  89. package/dist/core/errors/index.d.ts +3 -0
  90. package/dist/core/errors/index.d.ts.map +1 -0
  91. package/dist/core/errors/index.js +19 -0
  92. package/dist/core/errors/index.js.map +1 -0
  93. package/dist/core/errors/router.d.ts +8 -0
  94. package/dist/core/errors/router.d.ts.map +1 -0
  95. package/dist/core/errors/router.js +14 -0
  96. package/dist/core/errors/router.js.map +1 -0
  97. package/dist/core/types/contractAddresses.d.ts +39 -0
  98. package/dist/core/types/contractAddresses.d.ts.map +1 -0
  99. package/dist/core/types/contractAddresses.js.map +1 -0
  100. package/dist/{types → core/types}/index.d.ts +2 -1
  101. package/dist/core/types/index.d.ts.map +1 -0
  102. package/dist/{types → core/types}/index.js +2 -1
  103. package/dist/core/types/index.js.map +1 -0
  104. package/dist/core/types/pool.d.ts +35 -0
  105. package/dist/core/types/pool.d.ts.map +1 -0
  106. package/dist/core/types/pool.js +14 -0
  107. package/dist/core/types/pool.js.map +1 -0
  108. package/dist/core/types/provider.d.ts +45 -0
  109. package/dist/core/types/provider.d.ts.map +1 -0
  110. package/dist/core/types/provider.js +4 -0
  111. package/dist/core/types/provider.js.map +1 -0
  112. package/dist/core/types/route.d.ts +62 -0
  113. package/dist/core/types/route.d.ts.map +1 -0
  114. package/dist/{types/provider.js → core/types/route.js} +1 -1
  115. package/dist/core/types/route.js.map +1 -0
  116. package/dist/{types → core/types}/token.d.ts +7 -7
  117. package/dist/core/types/token.d.ts.map +1 -0
  118. package/dist/{types → core/types}/token.js.map +1 -1
  119. package/dist/index.d.ts +39 -109
  120. package/dist/index.d.ts.map +1 -1
  121. package/dist/index.js +57 -152
  122. package/dist/index.js.map +1 -1
  123. package/dist/services/index.d.ts +6 -6
  124. package/dist/services/index.d.ts.map +1 -1
  125. package/dist/services/index.js +6 -6
  126. package/dist/services/index.js.map +1 -1
  127. package/dist/services/pools/PoolService.d.ts +37 -0
  128. package/dist/services/pools/PoolService.d.ts.map +1 -0
  129. package/dist/services/pools/PoolService.js +158 -0
  130. package/dist/services/pools/PoolService.js.map +1 -0
  131. package/dist/services/pools/index.d.ts +2 -0
  132. package/dist/services/pools/index.d.ts.map +1 -0
  133. package/dist/services/pools/index.js +18 -0
  134. package/dist/services/pools/index.js.map +1 -0
  135. package/dist/services/quotes/QuoteService.d.ts +41 -0
  136. package/dist/services/quotes/QuoteService.d.ts.map +1 -0
  137. package/dist/services/quotes/QuoteService.js +61 -0
  138. package/dist/services/quotes/QuoteService.js.map +1 -0
  139. package/dist/services/quotes/index.d.ts +2 -0
  140. package/dist/services/quotes/index.d.ts.map +1 -0
  141. package/dist/services/quotes/index.js +18 -0
  142. package/dist/services/quotes/index.js.map +1 -0
  143. package/dist/services/routes/RouteService.d.ts +109 -0
  144. package/dist/services/routes/RouteService.d.ts.map +1 -0
  145. package/dist/services/routes/RouteService.js +241 -0
  146. package/dist/services/routes/RouteService.js.map +1 -0
  147. package/dist/services/routes/index.d.ts +2 -0
  148. package/dist/services/routes/index.d.ts.map +1 -0
  149. package/dist/services/routes/index.js +18 -0
  150. package/dist/services/routes/index.js.map +1 -0
  151. package/dist/services/swap/SwapService.d.ts +158 -0
  152. package/dist/services/swap/SwapService.d.ts.map +1 -0
  153. package/dist/services/swap/SwapService.js +160 -0
  154. package/dist/services/swap/SwapService.js.map +1 -0
  155. package/dist/services/swap/index.d.ts +2 -0
  156. package/dist/services/swap/index.d.ts.map +1 -0
  157. package/dist/services/swap/index.js +18 -0
  158. package/dist/services/swap/index.js.map +1 -0
  159. package/dist/services/tokens/index.d.ts +2 -0
  160. package/dist/services/tokens/index.d.ts.map +1 -0
  161. package/dist/services/tokens/index.js +18 -0
  162. package/dist/services/tokens/index.js.map +1 -0
  163. package/dist/services/tokens/supply/ISupplyCalculator.d.ts.map +1 -0
  164. package/dist/services/tokens/supply/ISupplyCalculator.js.map +1 -0
  165. package/dist/services/{supply → tokens/supply}/aaveSupplyCalculator.d.ts +4 -3
  166. package/dist/services/tokens/supply/aaveSupplyCalculator.d.ts.map +1 -0
  167. package/dist/services/{supply → tokens/supply}/aaveSupplyCalculator.js +7 -7
  168. package/dist/services/tokens/supply/aaveSupplyCalculator.js.map +1 -0
  169. package/dist/services/tokens/supply/calculatorFactory.d.ts +8 -0
  170. package/dist/services/tokens/supply/calculatorFactory.d.ts.map +1 -0
  171. package/dist/services/tokens/supply/calculatorFactory.js.map +1 -0
  172. package/dist/services/tokens/supply/defaultCalculatorFactory.d.ts +9 -0
  173. package/dist/services/tokens/supply/defaultCalculatorFactory.d.ts.map +1 -0
  174. package/dist/services/{supply → tokens/supply}/defaultCalculatorFactory.js +12 -7
  175. package/dist/services/tokens/supply/defaultCalculatorFactory.js.map +1 -0
  176. package/dist/services/tokens/supply/index.d.ts.map +1 -0
  177. package/dist/services/tokens/supply/index.js.map +1 -0
  178. package/dist/services/tokens/supply/multisigSupplyCalculator.d.ts +9 -0
  179. package/dist/services/tokens/supply/multisigSupplyCalculator.d.ts.map +1 -0
  180. package/dist/services/tokens/supply/multisigSupplyCalculator.js +33 -0
  181. package/dist/services/tokens/supply/multisigSupplyCalculator.js.map +1 -0
  182. package/dist/services/{supply → tokens/supply}/uniV3SupplyCalculator.d.ts +3 -3
  183. package/dist/services/tokens/supply/uniV3SupplyCalculator.d.ts.map +1 -0
  184. package/dist/services/{supply → tokens/supply}/uniV3SupplyCalculator.js +11 -6
  185. package/dist/services/tokens/supply/uniV3SupplyCalculator.js.map +1 -0
  186. package/dist/services/{supplyAdjustmentService.d.ts → tokens/supplyAdjustmentService.d.ts} +7 -2
  187. package/dist/services/tokens/supplyAdjustmentService.d.ts.map +1 -0
  188. package/dist/services/{supplyAdjustmentService.js → tokens/supplyAdjustmentService.js} +14 -11
  189. package/dist/services/tokens/supplyAdjustmentService.js.map +1 -0
  190. package/dist/services/tokens/tokenService.d.ts +33 -0
  191. package/dist/services/tokens/tokenService.d.ts.map +1 -0
  192. package/dist/services/tokens/tokenService.js +136 -0
  193. package/dist/services/tokens/tokenService.js.map +1 -0
  194. package/dist/utils/chainConfig.d.ts +16 -0
  195. package/dist/utils/chainConfig.d.ts.map +1 -0
  196. package/dist/utils/chainConfig.js +62 -0
  197. package/dist/utils/chainConfig.js.map +1 -0
  198. package/dist/utils/costUtils.d.ts +12 -0
  199. package/dist/utils/costUtils.d.ts.map +1 -0
  200. package/dist/utils/costUtils.js +59 -0
  201. package/dist/utils/costUtils.js.map +1 -0
  202. package/dist/utils/index.d.ts +5 -0
  203. package/dist/utils/index.d.ts.map +1 -1
  204. package/dist/utils/index.js +5 -0
  205. package/dist/utils/index.js.map +1 -1
  206. package/dist/utils/pathEncoder.d.ts +28 -0
  207. package/dist/utils/pathEncoder.d.ts.map +1 -0
  208. package/dist/utils/pathEncoder.js +57 -0
  209. package/dist/utils/pathEncoder.js.map +1 -0
  210. package/dist/utils/routeUtils.d.ts +295 -0
  211. package/dist/utils/routeUtils.d.ts.map +1 -0
  212. package/dist/utils/routeUtils.js +371 -0
  213. package/dist/utils/routeUtils.js.map +1 -0
  214. package/dist/utils/routes.d.ts +9 -0
  215. package/dist/utils/routes.d.ts.map +1 -0
  216. package/dist/utils/routes.js +49 -0
  217. package/dist/utils/routes.js.map +1 -0
  218. package/dist/utils/sortUtils.d.ts +24 -0
  219. package/dist/utils/sortUtils.d.ts.map +1 -0
  220. package/dist/utils/sortUtils.js +39 -0
  221. package/dist/utils/sortUtils.js.map +1 -0
  222. package/dist/utils/tokens.d.ts +78 -0
  223. package/dist/utils/tokens.d.ts.map +1 -0
  224. package/dist/utils/tokens.js +181 -0
  225. package/dist/utils/tokens.js.map +1 -0
  226. package/package.json +10 -23
  227. package/dist/abis/bipoolmanager.d.ts +0 -15
  228. package/dist/abis/bipoolmanager.d.ts.map +0 -1
  229. package/dist/abis/bipoolmanager.js +0 -26
  230. package/dist/abis/bipoolmanager.js.map +0 -1
  231. package/dist/abis/broker.d.ts +0 -2
  232. package/dist/abis/broker.d.ts.map +0 -1
  233. package/dist/abis/broker.js +0 -15
  234. package/dist/abis/broker.js.map +0 -1
  235. package/dist/abis/erc20.d.ts +0 -2
  236. package/dist/abis/erc20.d.ts.map +0 -1
  237. package/dist/abis/erc20.js.map +0 -1
  238. package/dist/abis/index.d.ts +0 -6
  239. package/dist/abis/index.d.ts.map +0 -1
  240. package/dist/abis/index.js.map +0 -1
  241. package/dist/abis/pricingmodule.d.ts +0 -2
  242. package/dist/abis/pricingmodule.d.ts.map +0 -1
  243. package/dist/abis/pricingmodule.js +0 -5
  244. package/dist/abis/pricingmodule.js.map +0 -1
  245. package/dist/abis/reserve.d.ts +0 -2
  246. package/dist/abis/reserve.d.ts.map +0 -1
  247. package/dist/abis/reserve.js +0 -9
  248. package/dist/abis/reserve.js.map +0 -1
  249. package/dist/abis/uniswapV3.d.ts +0 -4
  250. package/dist/abis/uniswapV3.d.ts.map +0 -1
  251. package/dist/abis/uniswapV3.js.map +0 -1
  252. package/dist/adapters/implementations/ethersAdapter.d.ts +0 -13
  253. package/dist/adapters/implementations/ethersAdapter.d.ts.map +0 -1
  254. package/dist/adapters/implementations/ethersAdapter.js +0 -92
  255. package/dist/adapters/implementations/ethersAdapter.js.map +0 -1
  256. package/dist/adapters/implementations/ethersV5Adapter.d.ts +0 -13
  257. package/dist/adapters/implementations/ethersV5Adapter.d.ts.map +0 -1
  258. package/dist/adapters/implementations/ethersV5Adapter.js +0 -92
  259. package/dist/adapters/implementations/ethersV5Adapter.js.map +0 -1
  260. package/dist/adapters/implementations/viemAdapter.d.ts +0 -18
  261. package/dist/adapters/implementations/viemAdapter.d.ts.map +0 -1
  262. package/dist/adapters/implementations/viemAdapter.js +0 -126
  263. package/dist/adapters/implementations/viemAdapter.js.map +0 -1
  264. package/dist/adapters/index.d.ts +0 -5
  265. package/dist/adapters/index.d.ts.map +0 -1
  266. package/dist/adapters/index.js +0 -10
  267. package/dist/adapters/index.js.map +0 -1
  268. package/dist/adapters/proxies/ethersAdapterProxy.d.ts +0 -26
  269. package/dist/adapters/proxies/ethersAdapterProxy.d.ts.map +0 -1
  270. package/dist/adapters/proxies/ethersAdapterProxy.js +0 -78
  271. package/dist/adapters/proxies/ethersAdapterProxy.js.map +0 -1
  272. package/dist/adapters/proxies/ethersV5AdapterProxy.d.ts +0 -26
  273. package/dist/adapters/proxies/ethersV5AdapterProxy.d.ts.map +0 -1
  274. package/dist/adapters/proxies/ethersV5AdapterProxy.js +0 -78
  275. package/dist/adapters/proxies/ethersV5AdapterProxy.js.map +0 -1
  276. package/dist/adapters/proxies/viemAdapterProxy.d.ts +0 -29
  277. package/dist/adapters/proxies/viemAdapterProxy.d.ts.map +0 -1
  278. package/dist/adapters/proxies/viemAdapterProxy.js +0 -78
  279. package/dist/adapters/proxies/viemAdapterProxy.js.map +0 -1
  280. package/dist/constants/aaveConfig.d.ts.map +0 -1
  281. package/dist/constants/aaveConfig.js.map +0 -1
  282. package/dist/constants/addresses.d.ts.map +0 -1
  283. package/dist/constants/addresses.js +0 -61
  284. package/dist/constants/addresses.js.map +0 -1
  285. package/dist/constants/chainId.d.ts +0 -5
  286. package/dist/constants/chainId.d.ts.map +0 -1
  287. package/dist/constants/chainId.js.map +0 -1
  288. package/dist/constants/contractNames.d.ts.map +0 -1
  289. package/dist/constants/contractNames.js.map +0 -1
  290. package/dist/constants/index.d.ts.map +0 -1
  291. package/dist/constants/index.js.map +0 -1
  292. package/dist/constants/mentoAddresses.d.ts.map +0 -1
  293. package/dist/constants/mentoAddresses.js.map +0 -1
  294. package/dist/constants/proposalState.d.ts +0 -11
  295. package/dist/constants/proposalState.d.ts.map +0 -1
  296. package/dist/constants/proposalState.js +0 -15
  297. package/dist/constants/proposalState.js.map +0 -1
  298. package/dist/constants/protocolAddresses.d.ts.map +0 -1
  299. package/dist/constants/protocolAddresses.js.map +0 -1
  300. package/dist/constants/stableTokenMetadata.d.ts +0 -12
  301. package/dist/constants/stableTokenMetadata.d.ts.map +0 -1
  302. package/dist/constants/stableTokenMetadata.js +0 -14
  303. package/dist/constants/stableTokenMetadata.js.map +0 -1
  304. package/dist/services/collateralAssetService.d.ts +0 -8
  305. package/dist/services/collateralAssetService.d.ts.map +0 -1
  306. package/dist/services/collateralAssetService.js +0 -47
  307. package/dist/services/collateralAssetService.js.map +0 -1
  308. package/dist/services/stableTokenService.d.ts +0 -9
  309. package/dist/services/stableTokenService.d.ts.map +0 -1
  310. package/dist/services/stableTokenService.js +0 -40
  311. package/dist/services/stableTokenService.js.map +0 -1
  312. package/dist/services/supply/ISupplyCalculator.d.ts.map +0 -1
  313. package/dist/services/supply/ISupplyCalculator.js.map +0 -1
  314. package/dist/services/supply/aaveSupplyCalculator.d.ts.map +0 -1
  315. package/dist/services/supply/aaveSupplyCalculator.js.map +0 -1
  316. package/dist/services/supply/calculatorFactory.d.ts +0 -8
  317. package/dist/services/supply/calculatorFactory.d.ts.map +0 -1
  318. package/dist/services/supply/calculatorFactory.js.map +0 -1
  319. package/dist/services/supply/defaultCalculatorFactory.d.ts +0 -9
  320. package/dist/services/supply/defaultCalculatorFactory.d.ts.map +0 -1
  321. package/dist/services/supply/defaultCalculatorFactory.js.map +0 -1
  322. package/dist/services/supply/index.d.ts.map +0 -1
  323. package/dist/services/supply/index.js.map +0 -1
  324. package/dist/services/supply/multisigSupplyCalculator.d.ts +0 -9
  325. package/dist/services/supply/multisigSupplyCalculator.d.ts.map +0 -1
  326. package/dist/services/supply/multisigSupplyCalculator.js +0 -21
  327. package/dist/services/supply/multisigSupplyCalculator.js.map +0 -1
  328. package/dist/services/supply/uniV3SupplyCalculator.d.ts.map +0 -1
  329. package/dist/services/supply/uniV3SupplyCalculator.js.map +0 -1
  330. package/dist/services/supplyAdjustmentService.d.ts.map +0 -1
  331. package/dist/services/supplyAdjustmentService.js.map +0 -1
  332. package/dist/services/swapService.d.ts +0 -70
  333. package/dist/services/swapService.d.ts.map +0 -1
  334. package/dist/services/swapService.js +0 -134
  335. package/dist/services/swapService.js.map +0 -1
  336. package/dist/services/tokenMetadataService.d.ts +0 -8
  337. package/dist/services/tokenMetadataService.d.ts.map +0 -1
  338. package/dist/services/tokenMetadataService.js +0 -44
  339. package/dist/services/tokenMetadataService.js.map +0 -1
  340. package/dist/types/contractAddresses.d.ts +0 -23
  341. package/dist/types/contractAddresses.d.ts.map +0 -1
  342. package/dist/types/contractAddresses.js.map +0 -1
  343. package/dist/types/exchange.d.ts +0 -6
  344. package/dist/types/exchange.d.ts.map +0 -1
  345. package/dist/types/exchange.js +0 -3
  346. package/dist/types/exchange.js.map +0 -1
  347. package/dist/types/index.d.ts.map +0 -1
  348. package/dist/types/index.js.map +0 -1
  349. package/dist/types/provider.d.ts +0 -29
  350. package/dist/types/provider.d.ts.map +0 -1
  351. package/dist/types/provider.js.map +0 -1
  352. package/dist/types/token.d.ts.map +0 -1
  353. /package/dist/{constants → core/constants}/aaveConfig.d.ts +0 -0
  354. /package/dist/{constants → core/constants}/aaveConfig.js +0 -0
  355. /package/dist/{constants → core/constants}/contractNames.d.ts +0 -0
  356. /package/dist/{constants → core/constants}/contractNames.js +0 -0
  357. /package/dist/{constants → core/constants}/protocolAddresses.d.ts +0 -0
  358. /package/dist/{constants → core/constants}/protocolAddresses.js +0 -0
  359. /package/dist/{types → core/types}/contractAddresses.js +0 -0
  360. /package/dist/{types → core/types}/token.js +0 -0
  361. /package/dist/services/{supply → tokens/supply}/ISupplyCalculator.d.ts +0 -0
  362. /package/dist/services/{supply → tokens/supply}/ISupplyCalculator.js +0 -0
  363. /package/dist/services/{supply → tokens/supply}/calculatorFactory.js +0 -0
  364. /package/dist/services/{supply → tokens/supply}/index.d.ts +0 -0
  365. /package/dist/services/{supply → tokens/supply}/index.js +0 -0
@@ -0,0 +1,241 @@
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.RouteService = void 0;
27
+ const abis_1 = require("../../core/abis");
28
+ const errors_1 = require("../../core/errors");
29
+ const routeUtils_1 = require("../../utils/routeUtils");
30
+ const sortUtils_1 = require("../../utils/sortUtils");
31
+ /**
32
+ * Service for discovering and managing trading routes in the Mento protocol.
33
+ * Handles route discovery for both direct (single-hop) and multi-hop trading paths.
34
+ *
35
+ * Routes are identified by their token pair and include the path of pools
36
+ * needed to execute the trade. Multi-hop routes (up to 2 hops) are automatically
37
+ * discovered when no direct route exists between two tokens.
38
+ */
39
+ class RouteService {
40
+ constructor(publicClient, chainId, poolService) {
41
+ this.publicClient = publicClient;
42
+ this.chainId = chainId;
43
+ this.poolService = poolService;
44
+ this.symbolCache = new Map();
45
+ }
46
+ /**
47
+ * Generates all direct (single-hop) routes from available pools
48
+ * Routes are deduplicated and assets are sorted alphabetically by symbol
49
+ *
50
+ * @returns Array of direct routes with single-hop paths
51
+ * @throws {Error} If RPC calls fail
52
+ *
53
+ * @example
54
+ * ```typescript
55
+ * const directRoutes = await routeService.getDirectRoutes()
56
+ * console.log(`Found ${directRoutes.length} direct routes`)
57
+ * ```
58
+ */
59
+ async getDirectRoutes() {
60
+ const pools = await this.poolService.getPools();
61
+ if (pools.length === 0) {
62
+ return [];
63
+ }
64
+ // Fetch all unique token addresses
65
+ const uniqueTokens = new Set();
66
+ pools.forEach((pool) => {
67
+ uniqueTokens.add(pool.token0);
68
+ uniqueTokens.add(pool.token1);
69
+ });
70
+ // Fetch symbols for all tokens in parallel. Used for the route ids
71
+ const tokenAddresses = Array.from(uniqueTokens);
72
+ await Promise.all(tokenAddresses.map((addr) => this.fetchTokenSymbol(addr)));
73
+ const routes = [];
74
+ // Loop all pools
75
+ for (const pool of pools) {
76
+ const symbol0 = this.symbolCache.get(pool.token0);
77
+ const symbol1 = this.symbolCache.get(pool.token1);
78
+ if (!symbol0 || !symbol1) {
79
+ // TODO: Consider error handling across the codebase for better consumer experience.
80
+ throw new Error(`Symbol not found for token ${pool.token0} or ${pool.token1}`);
81
+ }
82
+ // Create canonical route ID (alphabetically sorted symbols)
83
+ const routeId = (0, sortUtils_1.canonicalSymbolKey)(symbol0, symbol1);
84
+ // Sort tokens to match the canonical route ID order (alphabetical by symbol)
85
+ const sortedTokens = symbol0 < symbol1
86
+ ? [
87
+ { address: pool.token0, symbol: symbol0 },
88
+ { address: pool.token1, symbol: symbol1 },
89
+ ]
90
+ : [
91
+ { address: pool.token1, symbol: symbol1 },
92
+ { address: pool.token0, symbol: symbol0 },
93
+ ];
94
+ routes.push({
95
+ id: routeId,
96
+ tokens: sortedTokens,
97
+ path: [pool],
98
+ });
99
+ }
100
+ return routes;
101
+ }
102
+ /**
103
+ * Discovers all tradable routes including multi-hop routes (up to 2 hops)
104
+ * Uses cached data by default for instant results, or generates fresh from blockchain
105
+ *
106
+ * @param options - Configuration options
107
+ * @param options.cached - Whether to use pre-generated cached routes (default: true)
108
+ * @param options.returnAllRoutes - Whether to return all possible routes or just the optimal one per pair (default: false)
109
+ * @returns Array of all tradable routes (direct + multi-hop routes)
110
+ *
111
+ * @example
112
+ * ```typescript
113
+ * // Fast: use pre-generated cache
114
+ * const cachedRoutes = await routeService.getRoutes({ cached: true })
115
+ *
116
+ * // Slower but fresh: generate from blockchain
117
+ * const freshRoutes = await routeService.getRoutes({ cached: false })
118
+ *
119
+ * // Get all route variants (useful for cache generation)
120
+ * const allRoutes = await routeService.getRoutes({ cached: false, returnAllRoutes: true })
121
+ * ```
122
+ */
123
+ async getRoutes(options) {
124
+ const cached = options?.cached ?? true;
125
+ const returnAllRoutes = options?.returnAllRoutes ?? false;
126
+ if (cached) {
127
+ // Try to load from static cache
128
+ try {
129
+ const cachedRoutes = await this.loadCachedRoutes();
130
+ if (cachedRoutes.length > 0) {
131
+ return cachedRoutes;
132
+ }
133
+ }
134
+ catch {
135
+ console.warn('Failed to load cached routes, falling back to fresh generation');
136
+ }
137
+ }
138
+ // Generate fresh routes from blockchain
139
+ return this.generateFreshRoutes(returnAllRoutes);
140
+ }
141
+ /**
142
+ * Looks up the tradable route between two tokens (direct or multi-hop)
143
+ *
144
+ * @param tokenIn - Input token address (direction matters for routing)
145
+ * @param tokenOut - Output token address (direction matters for routing)
146
+ * @param options - Optional configuration (e.g., cached)
147
+ * @returns The optimal tradable route connecting the two tokens
148
+ * @throws {RouteNotFoundError} If no route exists between the token pair
149
+ *
150
+ * @example
151
+ * ```typescript
152
+ * const cUSD = '0x765DE816845861e75A25fCA122bb6898B8B1282a'
153
+ * const cBRL = '0xE4D5...'
154
+ * const route = await routeService.findRoute(cUSD, cBRL)
155
+ *
156
+ * if (route.path.length === 1) {
157
+ * console.log('Direct route available')
158
+ * } else {
159
+ * console.log('Two-hop route:', route.path)
160
+ * }
161
+ * ```
162
+ */
163
+ async findRoute(tokenIn, tokenOut, options) {
164
+ // Get all tradable routes
165
+ const allRoutes = await this.getRoutes(options);
166
+ const t0 = tokenIn.toLowerCase();
167
+ const t1 = tokenOut.toLowerCase();
168
+ // Search for matching route (bidirectional)
169
+ const matchingRoute = allRoutes.find((route) => {
170
+ const a0 = route.tokens[0].address.toLowerCase();
171
+ const a1 = route.tokens[1].address.toLowerCase();
172
+ // Match either direction: (t0,t1) or (t1,t0)
173
+ return (a0 === t0 && a1 === t1) || (a0 === t1 && a1 === t0);
174
+ });
175
+ if (!matchingRoute) {
176
+ throw new errors_1.RouteNotFoundError(tokenIn, tokenOut);
177
+ }
178
+ return matchingRoute;
179
+ }
180
+ /**
181
+ * Generate fresh tradable routes from blockchain data
182
+ * @param returnAllRoutes - Whether to return all routes or just optimal ones per pair
183
+ * @private
184
+ */
185
+ async generateFreshRoutes(returnAllRoutes = false) {
186
+ // Get direct routes
187
+ const directRoutes = await this.getDirectRoutes();
188
+ if (directRoutes.length === 0) {
189
+ return [];
190
+ }
191
+ // Build connectivity structures for route finding
192
+ const connectivity = (0, routeUtils_1.buildConnectivityStructures)(directRoutes);
193
+ // Generate all possible routes (direct + 2-hop)
194
+ const allRoutes = (0, routeUtils_1.generateAllRoutes)(connectivity);
195
+ // Select routes based on returnAllRoutes flag
196
+ const selectedRoutes = (0, routeUtils_1.selectOptimalRoutes)(allRoutes, returnAllRoutes, connectivity.addrToSymbol);
197
+ return selectedRoutes;
198
+ }
199
+ /**
200
+ * Load cached tradable routes for current chain
201
+ * @private
202
+ */
203
+ async loadCachedRoutes() {
204
+ const { getCachedRoutes } = await Promise.resolve().then(() => __importStar(require('../../utils/routes')));
205
+ const cachedRoutes = await getCachedRoutes(this.chainId);
206
+ return cachedRoutes || [];
207
+ }
208
+ /**
209
+ * Helper: Fetch token symbol from on-chain
210
+ * Results are cached to avoid redundant RPC calls
211
+ * Falls back to address if symbol fetch fails
212
+ *
213
+ * @private
214
+ */
215
+ async fetchTokenSymbol(address) {
216
+ // Return cached symbol if available
217
+ if (this.symbolCache.has(address)) {
218
+ return this.symbolCache.get(address);
219
+ }
220
+ try {
221
+ const symbol = (await this.publicClient.readContract({
222
+ // TODO: Consider using Address type from viem. Keep this consistent across the codebase
223
+ address: address,
224
+ abi: abis_1.ERC20_ABI,
225
+ functionName: 'symbol',
226
+ args: [],
227
+ }));
228
+ // Cache the symbol
229
+ this.symbolCache.set(address, symbol);
230
+ return symbol;
231
+ }
232
+ catch {
233
+ // Fallback to address if symbol fetch fails
234
+ console.warn(`Failed to fetch symbol for token ${address}, using address as fallback`);
235
+ this.symbolCache.set(address, address);
236
+ return address;
237
+ }
238
+ }
239
+ }
240
+ exports.RouteService = RouteService;
241
+ //# sourceMappingURL=RouteService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RouteService.js","sourceRoot":"","sources":["../../../src/services/routes/RouteService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,0CAA2C;AAC3C,8CAAsD;AAEtD,uDAA4G;AAC5G,qDAA0D;AAc1D;;;;;;;GAOG;AACH,MAAa,YAAY;IAGvB,YAAoB,YAA0B,EAAU,OAAe,EAAU,WAAwB;QAArF,iBAAY,GAAZ,YAAY,CAAc;QAAU,YAAO,GAAP,OAAO,CAAQ;QAAU,gBAAW,GAAX,WAAW,CAAa;QAFjG,gBAAW,GAAwB,IAAI,GAAG,EAAE,CAAA;IAEwD,CAAC;IAE7G;;;;;;;;;;;;OAYG;I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+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/routes/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,18 @@
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
+ __exportStar(require("./RouteService"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/routes/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B"}
@@ -0,0 +1,158 @@
1
+ import { Address, PublicClient } from 'viem';
2
+ import { RouteService } from '../routes';
3
+ import { QuoteService } from '../quotes';
4
+ import { Route, CallParams } from '../../core/types';
5
+ import { RouterRoute } from '../../utils/pathEncoder';
6
+ /**
7
+ * Options for configuring a swap transaction
8
+ */
9
+ export interface SwapOptions {
10
+ /**
11
+ * Maximum acceptable slippage as a percentage (e.g., 0.5 for 0.5%)
12
+ */
13
+ slippageTolerance: number;
14
+ /**
15
+ * Unix timestamp after which the transaction will revert
16
+ * Defaults to 20 minutes from now if not provided
17
+ */
18
+ deadline?: bigint;
19
+ }
20
+ /**
21
+ * Detailed swap parameters including decoded values for transparency
22
+ */
23
+ export interface SwapDetails {
24
+ /**
25
+ * Transaction parameters ready to send
26
+ */
27
+ params: CallParams;
28
+ /**
29
+ * The route being used for the swap
30
+ */
31
+ route: Route;
32
+ /**
33
+ * Encoded route for the Router contract
34
+ */
35
+ routerRoutes: RouterRoute[];
36
+ /**
37
+ * Input amount in wei
38
+ */
39
+ amountIn: bigint;
40
+ /**
41
+ * Minimum output amount after slippage
42
+ */
43
+ amountOutMin: bigint;
44
+ /**
45
+ * Expected output amount (before slippage)
46
+ */
47
+ expectedAmountOut: bigint;
48
+ /**
49
+ * Transaction deadline
50
+ */
51
+ deadline: bigint;
52
+ }
53
+ /**
54
+ * Combined swap transaction with optional approval
55
+ */
56
+ export interface SwapTransaction {
57
+ /**
58
+ * Approval transaction params - null if approval not needed
59
+ */
60
+ approval: CallParams | null;
61
+ /**
62
+ * Swap details including transaction params
63
+ */
64
+ swap: SwapDetails;
65
+ }
66
+ /**
67
+ * Service for building token swap transactions on the Mento protocol.
68
+ * Returns transaction parameters that can be executed by any wallet.
69
+ */
70
+ export declare class SwapService {
71
+ private publicClient;
72
+ private chainId;
73
+ private routeService;
74
+ private quoteService;
75
+ constructor(publicClient: PublicClient, chainId: number, routeService: RouteService, quoteService: QuoteService);
76
+ /**
77
+ * Builds a complete swap transaction including approval if needed.
78
+ * This is the recommended method for most use cases.
79
+ *
80
+ * @param tokenIn - The address of the input token
81
+ * @param tokenOut - The address of the output token
82
+ * @param amountIn - The amount of input tokens (in wei/smallest unit)
83
+ * @param recipient - The address to receive the output tokens
84
+ * @param owner - The address that owns the input tokens (needed to check allowance)
85
+ * @param options - Swap configuration options (slippage, deadline)
86
+ * @param route - Optional pre-fetched route for better performance
87
+ * @returns Combined transaction with approval (if needed) and swap params
88
+ *
89
+ * @example
90
+ * ```typescript
91
+ * const { approval, swap } = await mento.swap.buildSwapTransaction(
92
+ * cUSD,
93
+ * CELO,
94
+ * parseUnits('100', 18),
95
+ * recipientAddress,
96
+ * ownerAddress,
97
+ * { slippageTolerance: 0.5 }
98
+ * )
99
+ *
100
+ * // Execute approval if needed
101
+ * if (approval) {
102
+ * await walletClient.sendTransaction(approval)
103
+ * }
104
+ *
105
+ * // Execute swap
106
+ * await walletClient.sendTransaction(swap.params)
107
+ * ```
108
+ */
109
+ buildSwapTransaction(tokenIn: Address, tokenOut: Address, amountIn: bigint, recipient: Address, owner: Address, options: SwapOptions, route?: Route): Promise<SwapTransaction>;
110
+ /**
111
+ * Builds swap transaction parameters without executing the transaction.
112
+ * Does NOT check or handle token approval - use buildSwapTransaction for that.
113
+ *
114
+ * @param tokenIn - The address of the input token
115
+ * @param tokenOut - The address of the output token
116
+ * @param amountIn - The amount of input tokens (in wei/smallest unit)
117
+ * @param recipient - The address to receive the output tokens
118
+ * @param options - Swap configuration options (slippage, deadline)
119
+ * @param route - Optional pre-fetched route for better performance
120
+ * @returns Detailed swap parameters including transaction data
121
+ *
122
+ * @example
123
+ * ```typescript
124
+ * const swapDetails = await mento.swap.buildSwapParams(
125
+ * cUSD,
126
+ * CELO,
127
+ * parseUnits('100', 18),
128
+ * recipientAddress,
129
+ * { slippageTolerance: 0.5 }
130
+ * )
131
+ *
132
+ * // Execute with any wallet (assumes approval already granted)
133
+ * await walletClient.sendTransaction(swapDetails.params)
134
+ * ```
135
+ */
136
+ buildSwapParams(tokenIn: Address, tokenOut: Address, amountIn: bigint, recipient: Address, options: SwapOptions, route?: Route): Promise<SwapDetails>;
137
+ /**
138
+ * Builds approval transaction params for the Router to spend tokenIn
139
+ * @private
140
+ */
141
+ private buildApprovalParams;
142
+ /**
143
+ * Gets current allowance for the Router contract
144
+ * @private
145
+ */
146
+ private getAllowance;
147
+ /**
148
+ * Calculates minimum output amount after applying slippage tolerance
149
+ * @private
150
+ */
151
+ private calculateMinAmountOut;
152
+ /**
153
+ * Encodes the swapExactTokensForTokens function call
154
+ * @private
155
+ */
156
+ private encodeSwapCall;
157
+ }
158
+ //# sourceMappingURL=SwapService.d.ts.map
@@ -0,0 +1 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;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,oBAAoB,CACxB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,EAClB,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,WAAW,EACpB,KAAK,CAAC,EAAE,KAAK,GACZ,OAAO,CAAC,eAAe,CAAC;IAW3B;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,eAAe,CACnB,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,EAClB,OAAO,EAAE,WAAW,EACpB,KAAK,CAAC,EAAE,KAAK,GACZ,OAAO,CAAC,WAAW,CAAC;IA+BvB;;;OAGG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;;OAGG;YACW,YAAY;IAU1B;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAM7B;;;OAGG;IACH,OAAO,CAAC,cAAc;CAavB"}
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SwapService = void 0;
4
+ const viem_1 = require("viem");
5
+ const abis_1 = require("../../core/abis");
6
+ const constants_1 = require("../../core/constants");
7
+ const pathEncoder_1 = require("../../utils/pathEncoder");
8
+ /**
9
+ * Service for building token swap transactions on the Mento protocol.
10
+ * Returns transaction parameters that can be executed by any wallet.
11
+ */
12
+ class SwapService {
13
+ constructor(publicClient, chainId, routeService, quoteService) {
14
+ this.publicClient = publicClient;
15
+ this.chainId = chainId;
16
+ this.routeService = routeService;
17
+ this.quoteService = quoteService;
18
+ }
19
+ /**
20
+ * Builds a complete swap transaction including approval if needed.
21
+ * This is the recommended method for most use cases.
22
+ *
23
+ * @param tokenIn - The address of the input token
24
+ * @param tokenOut - The address of the output token
25
+ * @param amountIn - The amount of input tokens (in wei/smallest unit)
26
+ * @param recipient - The address to receive the output tokens
27
+ * @param owner - The address that owns the input tokens (needed to check allowance)
28
+ * @param options - Swap configuration options (slippage, deadline)
29
+ * @param route - Optional pre-fetched route for better performance
30
+ * @returns Combined transaction with approval (if needed) and swap params
31
+ *
32
+ * @example
33
+ * ```typescript
34
+ * const { approval, swap } = await mento.swap.buildSwapTransaction(
35
+ * cUSD,
36
+ * CELO,
37
+ * parseUnits('100', 18),
38
+ * recipientAddress,
39
+ * ownerAddress,
40
+ * { slippageTolerance: 0.5 }
41
+ * )
42
+ *
43
+ * // Execute approval if needed
44
+ * if (approval) {
45
+ * await walletClient.sendTransaction(approval)
46
+ * }
47
+ *
48
+ * // Execute swap
49
+ * await walletClient.sendTransaction(swap.params)
50
+ * ```
51
+ */
52
+ async buildSwapTransaction(tokenIn, tokenOut, amountIn, recipient, owner, options, route) {
53
+ // Build swap params first
54
+ const swap = await this.buildSwapParams(tokenIn, tokenOut, amountIn, recipient, options, route);
55
+ // Check if approval is needed
56
+ const currentAllowance = await this.getAllowance(tokenIn, owner);
57
+ const approval = currentAllowance < amountIn ? this.buildApprovalParams(tokenIn, amountIn) : null;
58
+ return { approval, swap };
59
+ }
60
+ /**
61
+ * Builds swap transaction parameters without executing the transaction.
62
+ * Does NOT check or handle token approval - use buildSwapTransaction for that.
63
+ *
64
+ * @param tokenIn - The address of the input token
65
+ * @param tokenOut - The address of the output token
66
+ * @param amountIn - The amount of input tokens (in wei/smallest unit)
67
+ * @param recipient - The address to receive the output tokens
68
+ * @param options - Swap configuration options (slippage, deadline)
69
+ * @param route - Optional pre-fetched route for better performance
70
+ * @returns Detailed swap parameters including transaction data
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * const swapDetails = await mento.swap.buildSwapParams(
75
+ * cUSD,
76
+ * CELO,
77
+ * parseUnits('100', 18),
78
+ * recipientAddress,
79
+ * { slippageTolerance: 0.5 }
80
+ * )
81
+ *
82
+ * // Execute with any wallet (assumes approval already granted)
83
+ * await walletClient.sendTransaction(swapDetails.params)
84
+ * ```
85
+ */
86
+ async buildSwapParams(tokenIn, tokenOut, amountIn, recipient, options, route) {
87
+ // Find route if not provided
88
+ if (!route) {
89
+ route = await this.routeService.findRoute(tokenIn, tokenOut);
90
+ }
91
+ const expectedAmountOut = await this.quoteService.getAmountOut(tokenIn, tokenOut, amountIn, route);
92
+ const amountOutMin = this.calculateMinAmountOut(expectedAmountOut, options.slippageTolerance);
93
+ // Set deadline (default: 20 minutes from now)
94
+ const deadline = options.deadline ?? BigInt(Math.floor(Date.now() / 1000) + 20 * 60);
95
+ const routerRoutes = (0, pathEncoder_1.encodeRoutePath)(route.path, tokenIn, tokenOut);
96
+ const routerAddress = (0, constants_1.getContractAddress)(this.chainId, 'Router');
97
+ const data = this.encodeSwapCall(amountIn, amountOutMin, routerRoutes, recipient, deadline);
98
+ return {
99
+ params: {
100
+ to: routerAddress,
101
+ data,
102
+ value: '0',
103
+ },
104
+ route,
105
+ routerRoutes,
106
+ amountIn,
107
+ amountOutMin,
108
+ expectedAmountOut,
109
+ deadline,
110
+ };
111
+ }
112
+ /**
113
+ * Builds approval transaction params for the Router to spend tokenIn
114
+ * @private
115
+ */
116
+ buildApprovalParams(tokenIn, amount) {
117
+ const routerAddress = (0, constants_1.getContractAddress)(this.chainId, 'Router');
118
+ const data = (0, viem_1.encodeFunctionData)({
119
+ abi: abis_1.ERC20_ABI,
120
+ functionName: 'approve',
121
+ args: [routerAddress, amount],
122
+ });
123
+ return { to: tokenIn, data, value: '0' };
124
+ }
125
+ /**
126
+ * Gets current allowance for the Router contract
127
+ * @private
128
+ */
129
+ async getAllowance(tokenIn, owner) {
130
+ const routerAddress = (0, constants_1.getContractAddress)(this.chainId, 'Router');
131
+ return this.publicClient.readContract({
132
+ address: tokenIn,
133
+ abi: abis_1.ERC20_ABI,
134
+ functionName: 'allowance',
135
+ args: [owner, routerAddress],
136
+ });
137
+ }
138
+ /**
139
+ * Calculates minimum output amount after applying slippage tolerance
140
+ * @private
141
+ */
142
+ calculateMinAmountOut(amountOut, slippageTolerance) {
143
+ const basisPoints = BigInt(Math.floor(slippageTolerance * 100));
144
+ const slippageMultiplier = 10000n - basisPoints;
145
+ return (amountOut * slippageMultiplier) / 10000n;
146
+ }
147
+ /**
148
+ * Encodes the swapExactTokensForTokens function call
149
+ * @private
150
+ */
151
+ encodeSwapCall(amountIn, amountOutMin, routes, recipient, deadline) {
152
+ return (0, viem_1.encodeFunctionData)({
153
+ abi: abis_1.ROUTER_ABI,
154
+ functionName: 'swapExactTokensForTokens',
155
+ args: [amountIn, amountOutMin, routes, recipient, deadline],
156
+ });
157
+ }
158
+ }
159
+ exports.SwapService = SwapService;
160
+ //# sourceMappingURL=SwapService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwapService.js","sourceRoot":"","sources":["../../../src/services/swap/SwapService.ts"],"names":[],"mappings":";;;AAAA,+BAAgE;AAIhE,0CAAuD;AACvD,oDAAkE;AAClE,yDAAsE;AAiEtE;;;GAGG;AACH,MAAa,WAAW;IACtB,YACU,YAA0B,EAC1B,OAAe,EACf,YAA0B,EAC1B,YAA0B;QAH1B,iBAAY,GAAZ,YAAY,CAAc;QAC1B,YAAO,GAAP,OAAO,CAAQ;QACf,iBAAY,GAAZ,YAAY,CAAc;QAC1B,iBAAY,GAAZ,YAAY,CAAc;IACjC,CAAC;IAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACH,KAAK,CAAC,oBAAoB,CACxB,OAAgB,EAChB,QAAiB,EACjB,QAAgB,EAChB,SAAkB,EAClB,KAAc,EACd,OAAoB,EACpB,KAAa;QAEb,0BAA0B;QAC1B,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,CAAC,CAAA;QAE/F,8BAA8B;QAC9B,MAAM,gBAAgB,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;QAChE,MAAM,Q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gB,EAChB,YAAoB,EACpB,MAAqB,EACrB,SAAkB,EAClB,QAAgB;QAEhB,OAAO,IAAA,yBAAkB,EAAC;YACxB,GAAG,EAAE,iBAAU;YACf,YAAY,EAAE,0BAA0B;YACxC,IAAI,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,CAAC;SAC5D,CAAC,CAAA;IACJ,CAAC;CACF;AAnLD,kCAmLC"}
@@ -0,0 +1,2 @@
1
+ export * from './SwapService';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/swap/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
@@ -0,0 +1,18 @@
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
+ __exportStar(require("./SwapService"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/swap/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B"}
@@ -0,0 +1,2 @@
1
+ export * from './tokenService';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/services/tokens/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA"}
@@ -0,0 +1,18 @@
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
+ __exportStar(require("./tokenService"), exports);
18
+ //# sourceMappingURL=index.js.map