@mento-protocol/mento-sdk 3.2.6 → 3.2.7

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 (302) hide show
  1. package/package.json +7 -1
  2. package/dist/cache/routes.d.ts +0 -13
  3. package/dist/cache/routes.js +0 -14649
  4. package/dist/cache/tokens.d.ts +0 -68
  5. package/dist/cache/tokens.js +0 -488
  6. package/dist/core/abis/activePool.d.ts +0 -2
  7. package/dist/core/abis/activePool.js +0 -14
  8. package/dist/core/abis/addressesRegistry.d.ts +0 -2
  9. package/dist/core/abis/addressesRegistry.js +0 -26
  10. package/dist/core/abis/bipoolmanager.d.ts +0 -34
  11. package/dist/core/abis/bipoolmanager.js +0 -72
  12. package/dist/core/abis/borrowerOperations.d.ts +0 -9
  13. package/dist/core/abis/borrowerOperations.js +0 -89
  14. package/dist/core/abis/breakerbox.d.ts +0 -13
  15. package/dist/core/abis/breakerbox.js +0 -8
  16. package/dist/core/abis/broker.d.ts +0 -2
  17. package/dist/core/abis/broker.js +0 -9
  18. package/dist/core/abis/erc20.d.ts +0 -9
  19. package/dist/core/abis/erc20.js +0 -21
  20. package/dist/core/abis/fpmm.d.ts +0 -270
  21. package/dist/core/abis/fpmm.js +0 -49
  22. package/dist/core/abis/fpmmFactory.d.ts +0 -85
  23. package/dist/core/abis/fpmmFactory.js +0 -26
  24. package/dist/core/abis/hintHelpers.d.ts +0 -2
  25. package/dist/core/abis/hintHelpers.js +0 -14
  26. package/dist/core/abis/index.d.ts +0 -22
  27. package/dist/core/abis/index.js +0 -38
  28. package/dist/core/abis/liquidityStrategy.d.ts +0 -132
  29. package/dist/core/abis/liquidityStrategy.js +0 -10
  30. package/dist/core/abis/multiTroveGetter.d.ts +0 -8
  31. package/dist/core/abis/multiTroveGetter.js +0 -15
  32. package/dist/core/abis/priceFeed.d.ts +0 -7
  33. package/dist/core/abis/priceFeed.js +0 -16
  34. package/dist/core/abis/pricingmodule.d.ts +0 -2
  35. package/dist/core/abis/pricingmodule.js +0 -6
  36. package/dist/core/abis/reserve.d.ts +0 -3
  37. package/dist/core/abis/reserve.js +0 -18
  38. package/dist/core/abis/router.d.ts +0 -521
  39. package/dist/core/abis/router.js +0 -45
  40. package/dist/core/abis/sortedTroves.d.ts +0 -2
  41. package/dist/core/abis/sortedTroves.js +0 -15
  42. package/dist/core/abis/systemParams.d.ts +0 -2
  43. package/dist/core/abis/systemParams.js +0 -14
  44. package/dist/core/abis/troveManager.d.ts +0 -2
  45. package/dist/core/abis/troveManager.js +0 -27
  46. package/dist/core/abis/troveNFT.d.ts +0 -2
  47. package/dist/core/abis/troveNFT.js +0 -9
  48. package/dist/core/abis/virtualPool.d.ts +0 -50
  49. package/dist/core/abis/virtualPool.js +0 -11
  50. package/dist/core/abis/virtualPoolFactory.d.ts +0 -59
  51. package/dist/core/abis/virtualPoolFactory.js +0 -17
  52. package/dist/core/constants/addresses.d.ts +0 -18
  53. package/dist/core/constants/addresses.js +0 -113
  54. package/dist/core/constants/borrowConstants.d.ts +0 -10
  55. package/dist/core/constants/borrowConstants.js +0 -16
  56. package/dist/core/constants/borrowRegistries.d.ts +0 -7
  57. package/dist/core/constants/borrowRegistries.js +0 -34
  58. package/dist/core/constants/chainId.d.ts +0 -7
  59. package/dist/core/constants/chainId.js +0 -11
  60. package/dist/core/constants/contractNames.d.ts +0 -21
  61. package/dist/core/constants/contractNames.js +0 -24
  62. package/dist/core/constants/index.d.ts +0 -6
  63. package/dist/core/constants/index.js +0 -22
  64. package/dist/core/errors/base.d.ts +0 -8
  65. package/dist/core/errors/base.js +0 -17
  66. package/dist/core/errors/index.d.ts +0 -4
  67. package/dist/core/errors/index.js +0 -20
  68. package/dist/core/errors/oracle.d.ts +0 -9
  69. package/dist/core/errors/oracle.js +0 -15
  70. package/dist/core/errors/router.d.ts +0 -14
  71. package/dist/core/errors/router.js +0 -24
  72. package/dist/core/types/borrow.d.ts +0 -87
  73. package/dist/core/types/borrow.js +0 -3
  74. package/dist/core/types/contractAddresses.d.ts +0 -42
  75. package/dist/core/types/contractAddresses.js +0 -3
  76. package/dist/core/types/index.d.ts +0 -10
  77. package/dist/core/types/index.js +0 -26
  78. package/dist/core/types/liquidity.d.ts +0 -194
  79. package/dist/core/types/liquidity.js +0 -3
  80. package/dist/core/types/pool.d.ts +0 -208
  81. package/dist/core/types/pool.js +0 -14
  82. package/dist/core/types/provider.d.ts +0 -45
  83. package/dist/core/types/provider.js +0 -3
  84. package/dist/core/types/route.d.ts +0 -62
  85. package/dist/core/types/route.js +0 -3
  86. package/dist/core/types/token.d.ts +0 -21
  87. package/dist/core/types/token.js +0 -3
  88. package/dist/core/types/tradingLimits.d.ts +0 -91
  89. package/dist/core/types/tradingLimits.js +0 -3
  90. package/dist/core/types/tradingMode.d.ts +0 -24
  91. package/dist/core/types/tradingMode.js +0 -31
  92. package/dist/core/types/transaction.d.ts +0 -45
  93. package/dist/core/types/transaction.js +0 -3
  94. package/dist/esm/cache/routes.js +0 -14644
  95. package/dist/esm/cache/tokens.js +0 -480
  96. package/dist/esm/core/abis/activePool.js +0 -10
  97. package/dist/esm/core/abis/addressesRegistry.js +0 -22
  98. package/dist/esm/core/abis/bipoolmanager.js +0 -68
  99. package/dist/esm/core/abis/borrowerOperations.js +0 -85
  100. package/dist/esm/core/abis/breakerbox.js +0 -4
  101. package/dist/esm/core/abis/broker.js +0 -5
  102. package/dist/esm/core/abis/erc20.js +0 -17
  103. package/dist/esm/core/abis/fpmm.js +0 -45
  104. package/dist/esm/core/abis/fpmmFactory.js +0 -22
  105. package/dist/esm/core/abis/hintHelpers.js +0 -10
  106. package/dist/esm/core/abis/index.js +0 -21
  107. package/dist/esm/core/abis/liquidityStrategy.js +0 -6
  108. package/dist/esm/core/abis/multiTroveGetter.js +0 -11
  109. package/dist/esm/core/abis/priceFeed.js +0 -12
  110. package/dist/esm/core/abis/pricingmodule.js +0 -2
  111. package/dist/esm/core/abis/reserve.js +0 -14
  112. package/dist/esm/core/abis/router.js +0 -41
  113. package/dist/esm/core/abis/sortedTroves.js +0 -11
  114. package/dist/esm/core/abis/systemParams.js +0 -10
  115. package/dist/esm/core/abis/troveManager.js +0 -23
  116. package/dist/esm/core/abis/troveNFT.js +0 -5
  117. package/dist/esm/core/abis/virtualPool.js +0 -7
  118. package/dist/esm/core/abis/virtualPoolFactory.js +0 -13
  119. package/dist/esm/core/constants/addresses.js +0 -107
  120. package/dist/esm/core/constants/borrowConstants.js +0 -12
  121. package/dist/esm/core/constants/borrowRegistries.js +0 -29
  122. package/dist/esm/core/constants/chainId.js +0 -7
  123. package/dist/esm/core/constants/contractNames.js +0 -20
  124. package/dist/esm/core/constants/index.js +0 -5
  125. package/dist/esm/core/errors/base.js +0 -12
  126. package/dist/esm/core/errors/index.js +0 -3
  127. package/dist/esm/core/errors/oracle.js +0 -10
  128. package/dist/esm/core/errors/router.js +0 -18
  129. package/dist/esm/core/types/borrow.js +0 -1
  130. package/dist/esm/core/types/contractAddresses.js +0 -1
  131. package/dist/esm/core/types/index.js +0 -9
  132. package/dist/esm/core/types/liquidity.js +0 -1
  133. package/dist/esm/core/types/pool.js +0 -10
  134. package/dist/esm/core/types/provider.js +0 -1
  135. package/dist/esm/core/types/route.js +0 -1
  136. package/dist/esm/core/types/token.js +0 -1
  137. package/dist/esm/core/types/tradingLimits.js +0 -1
  138. package/dist/esm/core/types/tradingMode.js +0 -26
  139. package/dist/esm/core/types/transaction.js +0 -1
  140. package/dist/esm/index.js +0 -139
  141. package/dist/esm/package.json +0 -1
  142. package/dist/esm/services/borrow/BorrowService.js +0 -455
  143. package/dist/esm/services/borrow/borrowHelpers.js +0 -3
  144. package/dist/esm/services/borrow/borrowMath.js +0 -127
  145. package/dist/esm/services/borrow/index.js +0 -3
  146. package/dist/esm/services/borrow/internal/borrowApprovalService.js +0 -48
  147. package/dist/esm/services/borrow/internal/borrowContextStore.js +0 -35
  148. package/dist/esm/services/borrow/internal/borrowErc20.js +0 -38
  149. package/dist/esm/services/borrow/internal/borrowHints.js +0 -27
  150. package/dist/esm/services/borrow/internal/borrowPositionParser.js +0 -82
  151. package/dist/esm/services/borrow/internal/borrowReadService.js +0 -271
  152. package/dist/esm/services/borrow/internal/borrowRegistryReader.js +0 -108
  153. package/dist/esm/services/borrow/internal/borrowTransactionService.js +0 -271
  154. package/dist/esm/services/borrow/internal/borrowTypes.js +0 -1
  155. package/dist/esm/services/borrow/internal/borrowValidation.js +0 -89
  156. package/dist/esm/services/index.js +0 -8
  157. package/dist/esm/services/liquidity/LiquidityService.js +0 -163
  158. package/dist/esm/services/liquidity/basicLiquidity.js +0 -162
  159. package/dist/esm/services/liquidity/index.js +0 -1
  160. package/dist/esm/services/liquidity/liquidityHelpers.js +0 -95
  161. package/dist/esm/services/liquidity/rebalance.js +0 -59
  162. package/dist/esm/services/liquidity/zapHelpers.js +0 -120
  163. package/dist/esm/services/liquidity/zapIn.js +0 -112
  164. package/dist/esm/services/liquidity/zapOut.js +0 -248
  165. package/dist/esm/services/pools/PoolService.js +0 -204
  166. package/dist/esm/services/pools/index.js +0 -1
  167. package/dist/esm/services/pools/poolDetails.js +0 -209
  168. package/dist/esm/services/pools/poolDiscovery.js +0 -112
  169. package/dist/esm/services/pools/rebalancePreview.js +0 -181
  170. package/dist/esm/services/quotes/QuoteService.js +0 -85
  171. package/dist/esm/services/quotes/index.js +0 -1
  172. package/dist/esm/services/routes/RouteService.js +0 -268
  173. package/dist/esm/services/routes/index.js +0 -1
  174. package/dist/esm/services/swap/SwapService.js +0 -247
  175. package/dist/esm/services/swap/index.js +0 -1
  176. package/dist/esm/services/tokens/index.js +0 -1
  177. package/dist/esm/services/tokens/tokenService.js +0 -285
  178. package/dist/esm/services/trading/TradingLimitsService.js +0 -154
  179. package/dist/esm/services/trading/TradingService.js +0 -222
  180. package/dist/esm/services/trading/index.js +0 -2
  181. package/dist/esm/utils/chainConfig.js +0 -118
  182. package/dist/esm/utils/costUtils.js +0 -56
  183. package/dist/esm/utils/deadline.js +0 -22
  184. package/dist/esm/utils/index.js +0 -9
  185. package/dist/esm/utils/multicall.js +0 -47
  186. package/dist/esm/utils/pathEncoder.js +0 -69
  187. package/dist/esm/utils/rateFeed.js +0 -23
  188. package/dist/esm/utils/retry.js +0 -24
  189. package/dist/esm/utils/routeUtils.js +0 -361
  190. package/dist/esm/utils/routes.js +0 -2
  191. package/dist/esm/utils/sortUtils.js +0 -33
  192. package/dist/esm/utils/tokens.js +0 -2
  193. package/dist/esm/utils/tradingLimits.js +0 -163
  194. package/dist/esm/utils/validation.js +0 -30
  195. package/dist/index.d.ts +0 -101
  196. package/dist/index.js +0 -158
  197. package/dist/services/borrow/BorrowService.d.ts +0 -381
  198. package/dist/services/borrow/BorrowService.js +0 -460
  199. package/dist/services/borrow/borrowHelpers.d.ts +0 -4
  200. package/dist/services/borrow/borrowHelpers.js +0 -13
  201. package/dist/services/borrow/borrowMath.d.ts +0 -21
  202. package/dist/services/borrow/borrowMath.js +0 -137
  203. package/dist/services/borrow/index.d.ts +0 -4
  204. package/dist/services/borrow/index.js +0 -20
  205. package/dist/services/borrow/internal/borrowApprovalService.d.ts +0 -14
  206. package/dist/services/borrow/internal/borrowApprovalService.js +0 -53
  207. package/dist/services/borrow/internal/borrowContextStore.d.ts +0 -11
  208. package/dist/services/borrow/internal/borrowContextStore.js +0 -40
  209. package/dist/services/borrow/internal/borrowErc20.d.ts +0 -5
  210. package/dist/services/borrow/internal/borrowErc20.js +0 -43
  211. package/dist/services/borrow/internal/borrowHints.d.ts +0 -7
  212. package/dist/services/borrow/internal/borrowHints.js +0 -31
  213. package/dist/services/borrow/internal/borrowPositionParser.d.ts +0 -4
  214. package/dist/services/borrow/internal/borrowPositionParser.js +0 -87
  215. package/dist/services/borrow/internal/borrowReadService.d.ts +0 -31
  216. package/dist/services/borrow/internal/borrowReadService.js +0 -276
  217. package/dist/services/borrow/internal/borrowRegistryReader.d.ts +0 -5
  218. package/dist/services/borrow/internal/borrowRegistryReader.js +0 -113
  219. package/dist/services/borrow/internal/borrowTransactionService.d.ts +0 -23
  220. package/dist/services/borrow/internal/borrowTransactionService.js +0 -276
  221. package/dist/services/borrow/internal/borrowTypes.d.ts +0 -15
  222. package/dist/services/borrow/internal/borrowTypes.js +0 -3
  223. package/dist/services/borrow/internal/borrowValidation.d.ts +0 -14
  224. package/dist/services/borrow/internal/borrowValidation.js +0 -104
  225. package/dist/services/index.d.ts +0 -9
  226. package/dist/services/index.js +0 -25
  227. package/dist/services/liquidity/LiquidityService.d.ts +0 -139
  228. package/dist/services/liquidity/LiquidityService.js +0 -168
  229. package/dist/services/liquidity/basicLiquidity.d.ts +0 -11
  230. package/dist/services/liquidity/basicLiquidity.js +0 -172
  231. package/dist/services/liquidity/index.d.ts +0 -2
  232. package/dist/services/liquidity/index.js +0 -18
  233. package/dist/services/liquidity/liquidityHelpers.d.ts +0 -19
  234. package/dist/services/liquidity/liquidityHelpers.js +0 -104
  235. package/dist/services/liquidity/rebalance.d.ts +0 -6
  236. package/dist/services/liquidity/rebalance.js +0 -64
  237. package/dist/services/liquidity/zapHelpers.d.ts +0 -66
  238. package/dist/services/liquidity/zapHelpers.js +0 -129
  239. package/dist/services/liquidity/zapIn.d.ts +0 -18
  240. package/dist/services/liquidity/zapIn.js +0 -119
  241. package/dist/services/liquidity/zapOut.d.ts +0 -9
  242. package/dist/services/liquidity/zapOut.js +0 -255
  243. package/dist/services/pools/PoolService.d.ts +0 -69
  244. package/dist/services/pools/PoolService.js +0 -209
  245. package/dist/services/pools/index.d.ts +0 -2
  246. package/dist/services/pools/index.js +0 -18
  247. package/dist/services/pools/poolDetails.d.ts +0 -13
  248. package/dist/services/pools/poolDetails.js +0 -216
  249. package/dist/services/pools/poolDiscovery.d.ts +0 -12
  250. package/dist/services/pools/poolDiscovery.js +0 -117
  251. package/dist/services/pools/rebalancePreview.d.ts +0 -5
  252. package/dist/services/pools/rebalancePreview.js +0 -186
  253. package/dist/services/quotes/QuoteService.d.ts +0 -51
  254. package/dist/services/quotes/QuoteService.js +0 -91
  255. package/dist/services/quotes/index.d.ts +0 -2
  256. package/dist/services/quotes/index.js +0 -18
  257. package/dist/services/routes/RouteService.d.ts +0 -117
  258. package/dist/services/routes/RouteService.js +0 -306
  259. package/dist/services/routes/index.d.ts +0 -2
  260. package/dist/services/routes/index.js +0 -18
  261. package/dist/services/swap/SwapService.d.ts +0 -198
  262. package/dist/services/swap/SwapService.js +0 -252
  263. package/dist/services/swap/index.d.ts +0 -2
  264. package/dist/services/swap/index.js +0 -18
  265. package/dist/services/tokens/index.d.ts +0 -2
  266. package/dist/services/tokens/index.js +0 -18
  267. package/dist/services/tokens/tokenService.d.ts +0 -55
  268. package/dist/services/tokens/tokenService.js +0 -290
  269. package/dist/services/trading/TradingLimitsService.d.ts +0 -38
  270. package/dist/services/trading/TradingLimitsService.js +0 -159
  271. package/dist/services/trading/TradingService.d.ts +0 -115
  272. package/dist/services/trading/TradingService.js +0 -227
  273. package/dist/services/trading/index.d.ts +0 -3
  274. package/dist/services/trading/index.js +0 -19
  275. package/dist/utils/chainConfig.d.ts +0 -16
  276. package/dist/utils/chainConfig.js +0 -123
  277. package/dist/utils/costUtils.d.ts +0 -12
  278. package/dist/utils/costUtils.js +0 -60
  279. package/dist/utils/deadline.d.ts +0 -21
  280. package/dist/utils/deadline.js +0 -26
  281. package/dist/utils/index.d.ts +0 -10
  282. package/dist/utils/index.js +0 -26
  283. package/dist/utils/multicall.d.ts +0 -30
  284. package/dist/utils/multicall.js +0 -52
  285. package/dist/utils/pathEncoder.d.ts +0 -34
  286. package/dist/utils/pathEncoder.js +0 -73
  287. package/dist/utils/rateFeed.d.ts +0 -18
  288. package/dist/utils/rateFeed.js +0 -27
  289. package/dist/utils/retry.d.ts +0 -12
  290. package/dist/utils/retry.js +0 -28
  291. package/dist/utils/routeUtils.d.ts +0 -295
  292. package/dist/utils/routeUtils.js +0 -371
  293. package/dist/utils/routes.d.ts +0 -3
  294. package/dist/utils/routes.js +0 -8
  295. package/dist/utils/sortUtils.d.ts +0 -24
  296. package/dist/utils/sortUtils.js +0 -39
  297. package/dist/utils/tokens.d.ts +0 -2
  298. package/dist/utils/tokens.js +0 -13
  299. package/dist/utils/tradingLimits.d.ts +0 -41
  300. package/dist/utils/tradingLimits.js +0 -171
  301. package/dist/utils/validation.d.ts +0 -19
  302. package/dist/utils/validation.js +0 -34
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=borrow.js.map
@@ -1,42 +0,0 @@
1
- import type { ChainId } from '../constants/chainId';
2
- /**
3
- * All possible contract identifiers across all chains.
4
- * Not all chains have all contracts deployed.
5
- */
6
- export type ContractAddresses = {
7
- FPMMFactory?: string;
8
- VirtualPoolFactory?: string;
9
- BreakerBox?: string;
10
- MedianDeltaBreaker?: string;
11
- SortedOracles?: string;
12
- ValueDeltaBreaker?: string;
13
- BiPoolManager?: string;
14
- Broker?: string;
15
- ConstantProductPricingModule?: string;
16
- ConstantSumPricingModule?: string;
17
- MentoRouter?: string;
18
- Reserve?: string;
19
- Airgrab?: string;
20
- Emission?: string;
21
- GovernanceFactory?: string;
22
- Locking?: string;
23
- MentoGovernor?: string;
24
- MentoToken?: string;
25
- TimelockController?: string;
26
- StableToken?: string;
27
- StableTokenEUR?: string;
28
- StableTokenBRL?: string;
29
- StableTokenXOF?: string;
30
- Router?: string;
31
- ReserveLiquidityStrategy?: string;
32
- CDPLiquidityStrategy?: string;
33
- OpenLiquidityStrategy?: string;
34
- };
35
- /**
36
- * Map of chain IDs to their contract addresses.
37
- * Each chain may have a different subset of contracts deployed.
38
- */
39
- export type ContractAddressMap = {
40
- [key in ChainId]: ContractAddresses;
41
- };
42
- //# sourceMappingURL=contractAddresses.d.ts.map
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=contractAddresses.js.map
@@ -1,10 +0,0 @@
1
- export * from './contractAddresses';
2
- export * from './transaction';
3
- export * from './token';
4
- export * from './route';
5
- export * from './pool';
6
- export * from './tradingMode';
7
- export * from './tradingLimits';
8
- export * from './liquidity';
9
- export * from './borrow';
10
- //# sourceMappingURL=index.d.ts.map
@@ -1,26 +0,0 @@
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("./contractAddresses"), exports);
18
- __exportStar(require("./transaction"), exports);
19
- __exportStar(require("./token"), exports);
20
- __exportStar(require("./route"), exports);
21
- __exportStar(require("./pool"), exports);
22
- __exportStar(require("./tradingMode"), exports);
23
- __exportStar(require("./tradingLimits"), exports);
24
- __exportStar(require("./liquidity"), exports);
25
- __exportStar(require("./borrow"), exports);
26
- //# sourceMappingURL=index.js.map
@@ -1,194 +0,0 @@
1
- import { CallParams } from './transaction';
2
- import { LiquidityStrategyDirection } from './pool';
3
- import { RouterRoute } from '../../utils/pathEncoder';
4
- export interface LiquidityOptions {
5
- slippageTolerance: number;
6
- deadline: bigint;
7
- }
8
- export interface AddLiquidityQuote {
9
- amountA: bigint;
10
- amountB: bigint;
11
- liquidity: bigint;
12
- }
13
- export interface RemoveLiquidityQuote {
14
- amount0: bigint;
15
- amount1: bigint;
16
- }
17
- export interface AddLiquidityDetails {
18
- params: CallParams;
19
- poolAddress: string;
20
- token0: string;
21
- token1: string;
22
- tokenA: string;
23
- tokenB: string;
24
- amountADesired: bigint;
25
- amountBDesired: bigint;
26
- amountAMin: bigint;
27
- amountBMin: bigint;
28
- estimatedMinLiquidity: bigint;
29
- deadline: bigint;
30
- }
31
- export interface RemoveLiquidityDetails {
32
- params: CallParams;
33
- poolAddress: string;
34
- token0: string;
35
- token1: string;
36
- liquidity: bigint;
37
- amount0Min: bigint;
38
- amount1Min: bigint;
39
- expectedAmount0: bigint;
40
- expectedAmount1: bigint;
41
- deadline: bigint;
42
- }
43
- export interface TokenApproval {
44
- token: string;
45
- amount: bigint;
46
- params: CallParams;
47
- }
48
- export interface AddLiquidityTransaction {
49
- approvalA: TokenApproval | null;
50
- approvalB: TokenApproval | null;
51
- addLiquidity: AddLiquidityDetails;
52
- }
53
- export interface RemoveLiquidityTransaction {
54
- approval: TokenApproval | null;
55
- removeLiquidity: RemoveLiquidityDetails;
56
- }
57
- export interface LPTokenBalance {
58
- poolAddress: string;
59
- balance: bigint;
60
- token0: string;
61
- token1: string;
62
- totalSupply: bigint;
63
- sharePercent: number;
64
- }
65
- export interface ZapParams {
66
- tokenA: string;
67
- tokenB: string;
68
- factory: string;
69
- amountOutMinA: bigint;
70
- amountOutMinB: bigint;
71
- amountAMin: bigint;
72
- amountBMin: bigint;
73
- }
74
- export interface ZapInQuote {
75
- amountOutFromA: bigint;
76
- amountOutFromB: bigint;
77
- amountAMin: bigint;
78
- amountBMin: bigint;
79
- estimatedMinLiquidity: bigint;
80
- }
81
- export interface ZapOutQuote {
82
- amountOutFromA: bigint;
83
- amountOutFromB: bigint;
84
- amountAMin: bigint;
85
- amountBMin: bigint;
86
- estimatedMinTokenOut: bigint;
87
- }
88
- export interface ZapInDetails {
89
- params: CallParams;
90
- poolAddress: string;
91
- tokenIn: string;
92
- amountIn: bigint;
93
- amountInA: bigint;
94
- amountInB: bigint;
95
- routesA: RouterRoute[];
96
- routesB: RouterRoute[];
97
- zapParams: ZapParams;
98
- estimatedMinLiquidity: bigint;
99
- }
100
- export interface ZapOutDetails {
101
- params: CallParams;
102
- poolAddress: string;
103
- tokenOut: string;
104
- liquidity: bigint;
105
- routesA: RouterRoute[];
106
- routesB: RouterRoute[];
107
- zapParams: ZapParams;
108
- estimatedMinTokenOut: bigint;
109
- }
110
- export interface ZapInTransaction {
111
- approval: TokenApproval | null;
112
- zapIn: ZapInDetails;
113
- }
114
- export interface ZapOutTransaction {
115
- approval: TokenApproval | null;
116
- zapOut: ZapOutDetails;
117
- }
118
- export interface RebalanceDetails {
119
- params: CallParams;
120
- poolAddress: string;
121
- strategyAddress: string;
122
- inputToken: string;
123
- outputToken: string;
124
- amountRequired: bigint;
125
- expectedAmountTransferred: bigint;
126
- expectedProtocolIncentive: bigint;
127
- expectedLiquiditySourceIncentive: bigint;
128
- approvalToken: string;
129
- approvalSpender: string;
130
- approvalAmount: bigint;
131
- direction: LiquidityStrategyDirection;
132
- }
133
- export interface RebalanceTransaction {
134
- approval: TokenApproval | null;
135
- rebalance: RebalanceDetails;
136
- }
137
- export interface PreparedZapIn {
138
- routesA: RouterRoute[];
139
- routesB: RouterRoute[];
140
- quote: ZapInQuote;
141
- approval?: TokenApproval | null;
142
- details: ZapInDetails;
143
- }
144
- export interface PreparedZapOut {
145
- routesA: RouterRoute[];
146
- routesB: RouterRoute[];
147
- quote: ZapOutQuote;
148
- approval?: TokenApproval | null;
149
- details: ZapOutDetails;
150
- }
151
- /** Input for adding liquidity (without approval handling) */
152
- export interface AddLiquidityInput {
153
- poolAddress: string;
154
- tokenA: string;
155
- amountA: bigint;
156
- tokenB: string;
157
- amountB: bigint;
158
- recipient: string;
159
- options: LiquidityOptions;
160
- }
161
- /** Input for removing liquidity (without approval handling) */
162
- export interface RemoveLiquidityInput {
163
- poolAddress: string;
164
- liquidity: bigint;
165
- recipient: string;
166
- options: LiquidityOptions;
167
- }
168
- /** Input for zap in (without approval handling) */
169
- export interface ZapInInput {
170
- poolAddress: string;
171
- tokenIn: string;
172
- amountIn: bigint;
173
- amountInSplit: number;
174
- recipient: string;
175
- options: LiquidityOptions;
176
- }
177
- export interface PrepareZapInInput extends ZapInInput {
178
- owner?: string;
179
- }
180
- /** Input for zap out (without approval handling) */
181
- export interface ZapOutInput {
182
- poolAddress: string;
183
- tokenOut: string;
184
- liquidity: bigint;
185
- recipient: string;
186
- options: LiquidityOptions;
187
- }
188
- export interface PrepareZapOutInput extends ZapOutInput {
189
- owner?: string;
190
- }
191
- export interface RebalanceInput {
192
- poolAddress: string;
193
- }
194
- //# sourceMappingURL=liquidity.d.ts.map
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=liquidity.js.map
@@ -1,208 +0,0 @@
1
- /**
2
- * Types of liquidity pools supported in the Mento protocol
3
- */
4
- export declare enum PoolType {
5
- /** FPMM (Fixed Product Market Maker) pools - v3 native pools */
6
- FPMM = "FPMM",
7
- /** Virtual pools - wrapper around v2 BiPoolManager exchanges */
8
- Virtual = "Virtual"
9
- }
10
- /**
11
- * Represents a liquidity pool between two tokens in the Mento protocol
12
- */
13
- export interface Pool {
14
- /**
15
- * The address of the factory contract that was used to deploy this pool
16
- */
17
- factoryAddr: string;
18
- /**
19
- * The deployed pool contract address (serves as unique identifier)
20
- */
21
- poolAddr: string;
22
- /**
23
- * The address of the first token in the pool
24
- */
25
- token0: string;
26
- /**
27
- * The address of the second token in the pool
28
- */
29
- token1: string;
30
- /**
31
- * The type of pool (FPMM or Virtual)
32
- */
33
- poolType: `${PoolType}`;
34
- /**
35
- * The exchange ID from BiPoolManager (Virtual pools only).
36
- */
37
- exchangeId?: string;
38
- }
39
- /**
40
- * Pricing and oracle data for an FPMM pool
41
- */
42
- export interface FPMMPricing {
43
- /** Raw oracle price numerator from contract */
44
- oraclePriceNum: bigint;
45
- /** Raw oracle price denominator from contract */
46
- oraclePriceDen: bigint;
47
- /** Oracle price as a decimal number (num / den) */
48
- oraclePrice: number;
49
- /** Raw reserve/pool price numerator from contract */
50
- reservePriceNum: bigint;
51
- /** Raw reserve/pool price denominator from contract */
52
- reservePriceDen: bigint;
53
- /** Reserve/pool price as a decimal number (num / den) */
54
- reservePrice: number;
55
- /** Price difference in basis points (raw from contract) */
56
- priceDifferenceBps: bigint;
57
- /** Price difference as a percentage (bps / 100, e.g. 12 bps → 0.12%) */
58
- priceDifferencePercent: number;
59
- /** Whether the reserve/pool price is above the oracle price */
60
- reservePriceAboveOraclePrice: boolean;
61
- }
62
- /**
63
- * Fee configuration for an FPMM pool
64
- */
65
- export interface FPMMFees {
66
- /** LP fee in basis points (raw) */
67
- lpFeeBps: bigint;
68
- /** LP fee as a percentage (e.g. 0.25 = 0.25%) */
69
- lpFeePercent: number;
70
- /** Protocol fee in basis points (raw) */
71
- protocolFeeBps: bigint;
72
- /** Protocol fee as a percentage */
73
- protocolFeePercent: number;
74
- /** Total fee (lpFee + protocolFee) as a percentage */
75
- totalFeePercent: number;
76
- }
77
- /**
78
- * Rebalancing state and configuration for an FPMM pool
79
- */
80
- export interface FPMMRebalancing {
81
- /** Rebalance incentive in basis points (raw) */
82
- rebalanceIncentiveBps: bigint;
83
- /** Rebalance incentive as a percentage */
84
- rebalanceIncentivePercent: number;
85
- /** Threshold above oracle price in basis points (raw) */
86
- rebalanceThresholdAboveBps: bigint;
87
- /** Threshold above as a percentage */
88
- rebalanceThresholdAbovePercent: number;
89
- /** Threshold below oracle price in basis points (raw) */
90
- rebalanceThresholdBelowBps: bigint;
91
- /** Threshold below as a percentage */
92
- rebalanceThresholdBelowPercent: number;
93
- /** Whether the current price is within rebalancing thresholds (null when pricing unavailable) */
94
- inBand: boolean | null;
95
- /** The registered Open Liquidity Strategy address for this pool, or null if none */
96
- liquidityStrategy: string | null;
97
- }
98
- export type LiquidityStrategyDirection = 'Expand' | 'Contract';
99
- export interface LiquidityStrategyRebalanceIncentives {
100
- liquiditySourceIncentiveExpansion: bigint;
101
- protocolIncentiveExpansion: bigint;
102
- liquiditySourceIncentiveContraction: bigint;
103
- protocolIncentiveContraction: bigint;
104
- }
105
- export interface LiquidityStrategyPoolConfig {
106
- isToken0Debt: boolean;
107
- lastRebalance: number;
108
- rebalanceCooldown: number;
109
- protocolFeeRecipient: string;
110
- liquiditySourceIncentiveExpansion: bigint;
111
- protocolIncentiveExpansion: bigint;
112
- liquiditySourceIncentiveContraction: bigint;
113
- protocolIncentiveContraction: bigint;
114
- }
115
- export interface LiquidityStrategyContext {
116
- pool: string;
117
- reserves: {
118
- reserveNum: bigint;
119
- reserveDen: bigint;
120
- };
121
- prices: {
122
- oracleNum: bigint;
123
- oracleDen: bigint;
124
- poolPriceAbove: boolean;
125
- rebalanceThreshold: number;
126
- };
127
- token0: string;
128
- token1: string;
129
- token0Dec: bigint;
130
- token1Dec: bigint;
131
- isToken0Debt: boolean;
132
- incentives: LiquidityStrategyRebalanceIncentives;
133
- }
134
- export interface LiquidityStrategyAction {
135
- dir: LiquidityStrategyDirection;
136
- amount0Out: bigint;
137
- amount1Out: bigint;
138
- amountOwedToPool: bigint;
139
- }
140
- export interface PoolRebalanceTokenAmount {
141
- token: string;
142
- amount: bigint;
143
- }
144
- export interface PoolRebalancePreview {
145
- poolAddress: string;
146
- strategyAddress: string;
147
- direction: LiquidityStrategyDirection;
148
- config: LiquidityStrategyPoolConfig;
149
- context: LiquidityStrategyContext;
150
- action: LiquidityStrategyAction;
151
- inputToken: string;
152
- outputToken: string;
153
- amountRequired: PoolRebalanceTokenAmount;
154
- amountTransferred: PoolRebalanceTokenAmount;
155
- protocolIncentive: PoolRebalanceTokenAmount;
156
- liquiditySourceIncentive: PoolRebalanceTokenAmount;
157
- approvalToken: string;
158
- approvalSpender: string;
159
- approvalAmount: bigint;
160
- }
161
- /**
162
- * Enriched details for an FPMM pool including pricing, fees, and rebalancing state
163
- */
164
- export interface FPMMPoolDetails extends Pool {
165
- poolType: 'FPMM';
166
- /** Scaling factor for token0 (10^tokenDecimals) */
167
- scalingFactor0: bigint;
168
- /** Scaling factor for token1 (10^tokenDecimals) */
169
- scalingFactor1: bigint;
170
- /** Reserve of token0 (raw) */
171
- reserve0: bigint;
172
- /** Reserve of token1 (raw) */
173
- reserve1: bigint;
174
- /** Block timestamp of last reserve update */
175
- blockTimestampLast: bigint;
176
- /** Pricing and oracle data (null when FX market is closed) */
177
- pricing: FPMMPricing | null;
178
- /** Fee configuration */
179
- fees: FPMMFees;
180
- /** Rebalancing state */
181
- rebalancing: FPMMRebalancing;
182
- }
183
- /**
184
- * Enriched details for a Virtual pool including reserves and spread
185
- */
186
- export interface VirtualPoolDetails extends Pool {
187
- poolType: 'Virtual';
188
- /** Scaling factor for token0 (10^tokenDecimals) */
189
- scalingFactor0: bigint;
190
- /** Scaling factor for token1 (10^tokenDecimals) */
191
- scalingFactor1: bigint;
192
- /** Reserve (bucket) of token0 (raw) */
193
- reserve0: bigint;
194
- /** Reserve (bucket) of token1 (raw) */
195
- reserve1: bigint;
196
- /** Block timestamp of last reserve update */
197
- blockTimestampLast: bigint;
198
- /** Spread/fee in basis points (raw) */
199
- spreadBps: bigint;
200
- /** Spread as a percentage (e.g. 0.5 = 0.5%) */
201
- spreadPercent: number;
202
- }
203
- /**
204
- * Discriminated union of enriched pool details.
205
- * Use `poolType` to narrow the type.
206
- */
207
- export type PoolDetails = FPMMPoolDetails | VirtualPoolDetails;
208
- //# sourceMappingURL=pool.d.ts.map
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PoolType = void 0;
4
- /**
5
- * Types of liquidity pools supported in the Mento protocol
6
- */
7
- var PoolType;
8
- (function (PoolType) {
9
- /** FPMM (Fixed Product Market Maker) pools - v3 native pools */
10
- PoolType["FPMM"] = "FPMM";
11
- /** Virtual pools - wrapper around v2 BiPoolManager exchanges */
12
- PoolType["Virtual"] = "Virtual";
13
- })(PoolType || (exports.PoolType = PoolType = {}));
14
- //# sourceMappingURL=pool.js.map
@@ -1,45 +0,0 @@
1
- export interface ContractCallOptions {
2
- address: string;
3
- abi: string[] | unknown[];
4
- functionName: string;
5
- args?: unknown[];
6
- }
7
- /**
8
- * Contract write options for building call parameters
9
- *
10
- * Configuration for building transaction call parameters for write operations.
11
- * These parameters can be used by consumers to execute transactions themselves.
12
- */
13
- export interface ContractWriteOptions extends ContractCallOptions {
14
- /**
15
- * Optional gas limit override
16
- * If not provided, will be estimated automatically
17
- */
18
- gasLimit?: bigint;
19
- /**
20
- * Transaction value in wei
21
- * For payable functions only
22
- */
23
- value?: bigint;
24
- }
25
- /**
26
- * Call parameters for executing a contract transaction
27
- *
28
- * Contains all the data needed to execute a contract call.
29
- * Consumers can use these parameters with their own wallet/signer to execute transactions.
30
- */
31
- export interface CallParams {
32
- /**
33
- * Contract address to call
34
- */
35
- to: string;
36
- /**
37
- * Encoded function call data (hex string)
38
- */
39
- data: string;
40
- /**
41
- * Transaction value in wei (hex string with 0x prefix)
42
- */
43
- value: string;
44
- }
45
- //# sourceMappingURL=provider.d.ts.map
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=provider.js.map
@@ -1,62 +0,0 @@
1
- import { Pool } from './pool';
2
- import { RouteToken } from './token';
3
- /**
4
- * Route identifier: sorted symbols joined with hyphen
5
- * Represents the two endpoint tokens regardless of the path taken
6
- */
7
- export type RouteID = `${string}-${string}`;
8
- /**
9
- * Represents a tradable route between two tokens, including the pool path needed to execute the trade
10
- */
11
- export interface Route {
12
- /**
13
- * Canonical identifier: sorted symbols joined with hyphen
14
- * Always uses alphabetical order (e.g., 'EURm-USDm' not 'USDm-EURm')
15
- * Ensures consistent identification regardless of query direction
16
- */
17
- id: RouteID;
18
- /**
19
- * The two tokens being traded, in alphabetical order by symbol
20
- * Always [symbolA, symbolB] where symbolA < symbolB alphabetically
21
- */
22
- tokens: [RouteToken, RouteToken];
23
- /**
24
- * Array of exchange hops needed to execute the trade
25
- * Length 1: Direct route (single pool)
26
- * Length 2: Two-hop route via intermediate token through two pools
27
- * Order matters for execution
28
- */
29
- path: Array<Pool>;
30
- }
31
- /**
32
- * Extended route with cost data for route optimization
33
- */
34
- export interface RouteWithCost extends Route {
35
- /**
36
- * Cost data for this route
37
- * Used to select optimal route when multiple options exist
38
- */
39
- costData: {
40
- /**
41
- * Total cost percentage for this route
42
- * Lower is better (more cost-efficient)
43
- * Example: 0.3 means 0.3% cost
44
- */
45
- totalCostPercent: number;
46
- /**
47
- * Per-hop cost breakdown
48
- * Used for detailed cost analysis and debugging
49
- */
50
- hops: Array<{
51
- /**
52
- * Pool Address for this hop
53
- */
54
- poolAddress: string;
55
- /**
56
- * Cost percentage for this specific hop
57
- */
58
- costPercent: number;
59
- }>;
60
- };
61
- }
62
- //# sourceMappingURL=route.d.ts.map
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=route.js.map
@@ -1,21 +0,0 @@
1
- /**
2
- * Minimal token info for routing purposes.
3
- * Contains only the fields needed to identify and route between tokens.
4
- */
5
- export interface RouteToken {
6
- address: string;
7
- symbol: string;
8
- }
9
- /**
10
- * Full token info for consumer-facing operations.
11
- * Extends RouteToken with display and transaction fields.
12
- */
13
- export interface Token extends RouteToken {
14
- name: string;
15
- decimals: number;
16
- }
17
- export interface StableToken extends Token {
18
- totalSupply: string;
19
- }
20
- export type CollateralAsset = Token;
21
- //# sourceMappingURL=token.d.ts.map
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=token.js.map