@elizaos/plugin-wallet 2.0.0-beta.1 → 2.0.3-beta.6

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 (356) hide show
  1. package/README.md +70 -45
  2. package/auto-enable.ts +1 -1
  3. package/dist/actions/failure-codes.d.ts +12 -0
  4. package/dist/actions/index.d.ts +1 -0
  5. package/dist/analytics/birdeye/actions/wallet-search-address.d.ts +7 -0
  6. package/dist/analytics/birdeye/birdeye-task.d.ts +27 -0
  7. package/dist/analytics/birdeye/birdeye.d.ts +140 -0
  8. package/dist/analytics/birdeye/constants.d.ts +68 -0
  9. package/dist/analytics/birdeye/providers/agent-portfolio-provider.d.ts +8 -0
  10. package/dist/analytics/birdeye/providers/market.d.ts +18 -0
  11. package/dist/analytics/birdeye/providers/portfolio-factory.d.ts +10 -0
  12. package/dist/analytics/birdeye/providers/trending.d.ts +19 -0
  13. package/dist/analytics/birdeye/providers/wallet.d.ts +5 -0
  14. package/dist/analytics/birdeye/search-category.d.ts +52 -0
  15. package/dist/analytics/birdeye/service.d.ts +94 -0
  16. package/dist/analytics/birdeye/types/api/common.d.ts +199 -0
  17. package/dist/analytics/birdeye/types/api/defi.d.ts +187 -0
  18. package/dist/analytics/birdeye/types/api/pair.d.ts +182 -0
  19. package/dist/analytics/birdeye/types/api/search.d.ts +64 -0
  20. package/dist/analytics/birdeye/types/api/token.d.ts +580 -0
  21. package/dist/analytics/birdeye/types/api/trader.d.ts +70 -0
  22. package/dist/analytics/birdeye/types/api/wallet.d.ts +161 -0
  23. package/dist/analytics/birdeye/types/shared.d.ts +83 -0
  24. package/dist/analytics/birdeye/utils.d.ts +74 -0
  25. package/dist/analytics/dexscreener/errors.d.ts +2 -0
  26. package/dist/analytics/dexscreener/index.d.ts +3 -0
  27. package/dist/analytics/dexscreener/search-category.d.ts +3 -0
  28. package/dist/analytics/dexscreener/service.d.ts +34 -0
  29. package/dist/analytics/dexscreener/types.d.ts +131 -0
  30. package/dist/analytics/lpinfo/index.d.ts +31 -0
  31. package/dist/analytics/lpinfo/kamino/index.d.ts +7 -0
  32. package/dist/analytics/lpinfo/kamino/providers/kaminoLiquidityProvider.d.ts +6 -0
  33. package/dist/analytics/lpinfo/kamino/providers/kaminoPoolProvider.d.ts +6 -0
  34. package/dist/analytics/lpinfo/kamino/providers/kaminoProvider.d.ts +6 -0
  35. package/dist/analytics/lpinfo/kamino/services/kaminoLiquidityService.d.ts +203 -0
  36. package/dist/analytics/lpinfo/kamino/services/kaminoService.d.ts +171 -0
  37. package/dist/analytics/lpinfo/steer/index.d.ts +7 -0
  38. package/dist/analytics/lpinfo/steer/providers/steerLiquidityProvider.d.ts +6 -0
  39. package/dist/analytics/lpinfo/steer/services/steerLiquidityService.d.ts +208 -0
  40. package/dist/analytics/lpinfo/steer/steer-display-types.d.ts +97 -0
  41. package/dist/analytics/news/index.d.ts +32 -0
  42. package/dist/analytics/news/interfaces/types.d.ts +177 -0
  43. package/dist/analytics/news/providers/defiNewsProvider.d.ts +106 -0
  44. package/dist/analytics/news/services/newsDataService.d.ts +72 -0
  45. package/dist/analytics/news/utils/formatters.d.ts +54 -0
  46. package/dist/analytics/token-info/action.d.ts +6 -0
  47. package/dist/analytics/token-info/index.d.ts +3 -0
  48. package/dist/analytics/token-info/params.d.ts +10 -0
  49. package/dist/analytics/token-info/providers.d.ts +4 -0
  50. package/dist/analytics/token-info/service.d.ts +19 -0
  51. package/dist/analytics/token-info/types.d.ts +45 -0
  52. package/dist/api/wallet-routes.d.ts +100 -0
  53. package/dist/audit/audit-log.d.ts +29 -0
  54. package/dist/browser-shim/build-shim.d.ts +31 -0
  55. package/dist/browser-shim/index.d.ts +1 -0
  56. package/dist/chains/evm/actions/helpers.d.ts +31 -0
  57. package/dist/chains/evm/actions/swap.d.ts +53 -0
  58. package/dist/chains/evm/actions/transfer.d.ts +10 -0
  59. package/dist/chains/evm/bridge-router.d.ts +44 -0
  60. package/dist/chains/evm/build.d.ts +2 -0
  61. package/dist/chains/evm/chain-handler.d.ts +37 -0
  62. package/dist/chains/evm/constants.d.ts +16 -0
  63. package/dist/chains/evm/dex/aerodrome/index.d.ts +6 -0
  64. package/dist/chains/evm/dex/aerodrome/services/AerodromeLpService.d.ts +27 -0
  65. package/dist/chains/evm/dex/aerodrome/types.d.ts +435 -0
  66. package/dist/chains/evm/dex/pancakeswp/index.d.ts +6 -0
  67. package/dist/chains/evm/dex/pancakeswp/services/PancakeSwapV3LpService.d.ts +28 -0
  68. package/dist/chains/evm/dex/pancakeswp/types.d.ts +19 -0
  69. package/dist/chains/evm/dex/uniswap/index.d.ts +6 -0
  70. package/dist/chains/evm/dex/uniswap/services/UniswapV3LpService.d.ts +28 -0
  71. package/dist/chains/evm/dex/uniswap/types.d.ts +458 -0
  72. package/dist/chains/evm/generated/specs/spec-helpers.d.ts +35 -0
  73. package/dist/chains/evm/generated/specs/specs.d.ts +99 -0
  74. package/dist/chains/evm/gov-router.d.ts +6 -0
  75. package/dist/chains/evm/index.browser.d.ts +3 -0
  76. package/dist/chains/evm/index.d.ts +6 -0
  77. package/dist/chains/evm/prompts.d.ts +24 -0
  78. package/dist/chains/evm/providers/get-balance.d.ts +2 -0
  79. package/dist/chains/evm/providers/wallet.d.ts +35 -0
  80. package/dist/chains/evm/routes/sign.d.ts +13 -0
  81. package/dist/chains/evm/rpc-providers.d.ts +26 -0
  82. package/dist/chains/evm/service.d.ts +26 -0
  83. package/dist/chains/evm/templates/index.d.ts +1 -0
  84. package/dist/chains/evm/types/index.d.ts +296 -0
  85. package/dist/chains/evm/vitest.config.d.ts +2 -0
  86. package/dist/chains/registry.d.ts +3 -0
  87. package/dist/chains/solana/actions/confirmation.d.ts +9 -0
  88. package/dist/chains/solana/bn.d.ts +6 -0
  89. package/dist/chains/solana/build.d.ts +2 -0
  90. package/dist/chains/solana/constants.d.ts +2 -0
  91. package/dist/chains/solana/dex/meteora/e2e/scenarios.d.ts +10 -0
  92. package/dist/chains/solana/dex/meteora/e2e/test-utils.d.ts +28 -0
  93. package/dist/chains/solana/dex/meteora/index.d.ts +3 -0
  94. package/dist/chains/solana/dex/meteora/providers/positionProvider.d.ts +9 -0
  95. package/dist/chains/solana/dex/meteora/services/MeteoraLpService.d.ts +37 -0
  96. package/dist/chains/solana/dex/meteora/utils/dlmm.d.ts +6 -0
  97. package/dist/chains/solana/dex/meteora/utils/loadWallet.d.ts +14 -0
  98. package/dist/chains/solana/dex/meteora/utils/sendTransaction.d.ts +2 -0
  99. package/dist/chains/solana/dex/orca/index.d.ts +6 -0
  100. package/dist/chains/solana/dex/orca/providers/positionProvider.d.ts +10 -0
  101. package/dist/chains/solana/dex/orca/services/srv_orca.d.ts +10 -0
  102. package/dist/chains/solana/dex/orca/types.d.ts +61 -0
  103. package/dist/chains/solana/dex/orca/utils/loadWallet.d.ts +1 -0
  104. package/dist/chains/solana/dex/orca/utils/sendTransaction.d.ts +2 -0
  105. package/dist/chains/solana/dex/raydium/index.d.ts +6 -0
  106. package/dist/chains/solana/dex/raydium/providers/positionProvider.d.ts +10 -0
  107. package/dist/chains/solana/dex/raydium/services/srv_raydium.d.ts +104 -0
  108. package/dist/chains/solana/dex/raydium/types.d.ts +42 -0
  109. package/dist/chains/solana/environment.d.ts +15 -0
  110. package/dist/chains/solana/generated/specs/spec-helpers.d.ts +35 -0
  111. package/dist/chains/solana/generated/specs/specs.d.ts +73 -0
  112. package/dist/chains/solana/index.browser.d.ts +3 -0
  113. package/dist/chains/solana/index.d.ts +7 -0
  114. package/dist/chains/solana/keypairUtils.d.ts +7 -0
  115. package/dist/chains/solana/prompts.d.ts +12 -0
  116. package/dist/chains/solana/providers/wallet.d.ts +2 -0
  117. package/dist/chains/solana/routes/index.d.ts +2 -0
  118. package/dist/chains/solana/routes/sign.d.ts +16 -0
  119. package/dist/chains/solana/service.d.ts +237 -0
  120. package/dist/chains/solana/types.d.ts +377 -0
  121. package/dist/chains/solana/vitest.config.d.ts +2 -0
  122. package/dist/chains/wallet-action.d.ts +3 -0
  123. package/dist/contracts.d.ts +58 -0
  124. package/dist/core-augmentation.d.ts +9 -0
  125. package/dist/index.d.mts +27 -34727
  126. package/dist/index.d.ts +27 -0
  127. package/dist/index.mjs +28246 -21186
  128. package/dist/index.mjs.map +153 -0
  129. package/dist/lib/server-wallet-trade.d.ts +22 -0
  130. package/dist/lib/server-wallet-trade.js +333 -0
  131. package/dist/lib/server-wallet-trade.js.map +11 -0
  132. package/dist/lib/wallet-export-guard.d.ts +45 -0
  133. package/dist/lp/actions/liquidity.d.ts +2 -0
  134. package/dist/lp/e2e/real-token-tests.d.ts +6 -0
  135. package/dist/lp/e2e/scenarios.d.ts +9 -0
  136. package/dist/lp/e2e/test-utils.d.ts +28 -0
  137. package/dist/lp/lp-manager-entry.d.ts +18 -0
  138. package/dist/lp/services/ConcentratedLiquidityService.d.ts +32 -0
  139. package/dist/lp/services/DexInteractionService.d.ts +34 -0
  140. package/dist/lp/services/LpManagementService.d.ts +116 -0
  141. package/dist/lp/services/UserLpProfileService.d.ts +18 -0
  142. package/dist/lp/services/VaultService.d.ts +21 -0
  143. package/dist/lp/services/YieldOptimizationService.d.ts +59 -0
  144. package/dist/lp/services/__tests__/MockLpService.d.ts +17 -0
  145. package/dist/lp/types.d.ts +439 -0
  146. package/dist/lp/utils/solanaClient.d.ts +26 -0
  147. package/dist/plugin.d.ts +7 -0
  148. package/dist/policy/policy.d.ts +14 -0
  149. package/dist/providers/canonical-provider.d.ts +19 -0
  150. package/dist/providers/wallet-provider.d.ts +5 -0
  151. package/dist/register-routes.d.ts +1 -0
  152. package/dist/routes/plugin.d.ts +14 -0
  153. package/dist/routes/wallet-market-overview-route.d.ts +7 -0
  154. package/dist/sdk/abi.d.ts +396 -0
  155. package/dist/sdk/bridge/abis.d.ts +63 -0
  156. package/dist/sdk/bridge/client.d.ts +48 -0
  157. package/dist/sdk/bridge/index.d.ts +14 -0
  158. package/dist/sdk/bridge/solana.d.ts +131 -0
  159. package/dist/sdk/bridge/types.d.ts +92 -0
  160. package/dist/sdk/convenience.d.ts +104 -0
  161. package/dist/sdk/escrow/MutualStakeEscrow.d.ts +75 -0
  162. package/dist/sdk/escrow/types.d.ts +58 -0
  163. package/dist/sdk/escrow/verifiers.d.ts +25 -0
  164. package/dist/sdk/identity/erc8004.d.ts +304 -0
  165. package/dist/sdk/identity/reputation.d.ts +317 -0
  166. package/dist/sdk/identity/uaid.d.ts +192 -0
  167. package/dist/sdk/identity/validation.d.ts +282 -0
  168. package/dist/sdk/index.d.ts +133 -0
  169. package/dist/sdk/index.js +5284 -0
  170. package/dist/sdk/index.js.map +40 -0
  171. package/dist/sdk/policy/SpendingPolicy.d.ts +105 -0
  172. package/dist/sdk/policy/UptoBillingPolicy.d.ts +87 -0
  173. package/dist/sdk/router/PaymentRouter.d.ts +77 -0
  174. package/dist/sdk/router/index.d.ts +2 -0
  175. package/dist/sdk/swap/SwapModule.d.ts +47 -0
  176. package/dist/sdk/swap/abi.d.ts +50 -0
  177. package/dist/sdk/swap/index.d.ts +11 -0
  178. package/dist/sdk/swap/types.d.ts +101 -0
  179. package/dist/sdk/tokens/decimals.d.ts +64 -0
  180. package/dist/sdk/tokens/registry.d.ts +81 -0
  181. package/dist/sdk/tokens/solana.d.ts +107 -0
  182. package/dist/sdk/tokens/transfers.d.ts +94 -0
  183. package/dist/sdk/types.d.ts +129 -0
  184. package/dist/sdk/wallet-core.d.ts +29450 -0
  185. package/dist/sdk/x402/budget.d.ts +51 -0
  186. package/dist/sdk/x402/chains/abstract/index.d.ts +134 -0
  187. package/dist/sdk/x402/client.d.ts +66 -0
  188. package/dist/sdk/x402/index.d.ts +8 -0
  189. package/dist/sdk/x402/middleware.d.ts +37 -0
  190. package/dist/sdk/x402/multi-asset.d.ts +53 -0
  191. package/dist/sdk/x402/types.d.ts +109 -0
  192. package/dist/security/wallet-context-safety.d.ts +7 -0
  193. package/dist/security/wallet-financial-confirmation.d.ts +23 -0
  194. package/dist/services/wallet-backend-service.d.ts +39 -0
  195. package/dist/types/wallet-router.d.ts +130 -0
  196. package/dist/utils/intent-trajectory.d.ts +34 -0
  197. package/dist/wallet/backend.d.ts +41 -0
  198. package/dist/wallet/errors.d.ts +17 -0
  199. package/dist/wallet/index.d.ts +6 -0
  200. package/dist/wallet/local-eoa-backend.d.ts +37 -0
  201. package/dist/wallet/pending.d.ts +47 -0
  202. package/dist/wallet/select-backend.d.ts +11 -0
  203. package/dist/wallet/steward-backend.d.ts +22 -0
  204. package/dist/wallet-action.d.ts +1 -0
  205. package/dist/wallet-action.js +6292 -0
  206. package/dist/wallet-action.js.map +44 -0
  207. package/package.json +35 -21
  208. package/registry-entry.json +134 -0
  209. package/src/analytics/birdeye/actions/wallet-search-address.ts +85 -5
  210. package/src/analytics/birdeye/birdeye-task.ts +25 -9
  211. package/src/analytics/birdeye/birdeye.ts +6 -7
  212. package/src/analytics/birdeye/constants.ts +0 -1
  213. package/src/analytics/birdeye/providers/agent-portfolio-provider.ts +0 -1
  214. package/src/analytics/birdeye/providers/market.ts +51 -45
  215. package/src/analytics/birdeye/providers/portfolio-factory.ts +79 -38
  216. package/src/analytics/birdeye/providers/trending.ts +43 -46
  217. package/src/analytics/birdeye/providers/wallet.ts +0 -1
  218. package/src/analytics/birdeye/search-category.test.ts +1 -1
  219. package/src/analytics/birdeye/search-category.ts +77 -12
  220. package/src/analytics/birdeye/service.test.ts +146 -0
  221. package/src/analytics/birdeye/service.ts +220 -105
  222. package/src/analytics/birdeye/types/api/common.ts +0 -1
  223. package/src/analytics/birdeye/types/api/defi.ts +0 -1
  224. package/src/analytics/birdeye/types/api/pair.ts +0 -1
  225. package/src/analytics/birdeye/types/api/search.ts +0 -1
  226. package/src/analytics/birdeye/types/api/token.ts +0 -1
  227. package/src/analytics/birdeye/types/api/trader.ts +0 -1
  228. package/src/analytics/birdeye/types/api/wallet.ts +0 -1
  229. package/src/analytics/birdeye/types/shared.ts +0 -11
  230. package/src/analytics/birdeye/utils.test.ts +69 -0
  231. package/src/analytics/birdeye/utils.ts +11 -8
  232. package/src/analytics/dexscreener/search-category.ts +0 -1
  233. package/src/analytics/dexscreener/service.ts +7 -12
  234. package/src/analytics/dexscreener/types.ts +0 -1
  235. package/src/analytics/lpinfo/index.ts +5 -2
  236. package/src/analytics/lpinfo/kamino/README.md +2 -2
  237. package/src/analytics/lpinfo/kamino/index.ts +9 -2
  238. package/src/analytics/lpinfo/kamino/providers/kaminoLiquidityProvider.ts +6 -26
  239. package/src/analytics/lpinfo/kamino/providers/kaminoPoolProvider.ts +11 -12
  240. package/src/analytics/lpinfo/kamino/providers/kaminoProvider.ts +76 -32
  241. package/src/analytics/lpinfo/kamino/services/kaminoLiquidityService.ts +78 -38
  242. package/src/analytics/lpinfo/kamino/services/kaminoService.ts +71 -31
  243. package/src/analytics/lpinfo/steer/index.ts +7 -2
  244. package/src/analytics/lpinfo/steer/providers/steerLiquidityProvider.ts +25 -26
  245. package/src/analytics/lpinfo/steer/services/steerLiquidityService.ts +367 -149
  246. package/src/analytics/news/index.ts +7 -2
  247. package/src/analytics/news/interfaces/types.ts +0 -1
  248. package/src/analytics/news/providers/defiNewsProvider.ts +17 -44
  249. package/src/analytics/news/services/newsDataService.ts +1 -22
  250. package/src/analytics/news/utils/formatters.test.ts +60 -0
  251. package/src/analytics/news/utils/formatters.ts +0 -1
  252. package/src/analytics/token-info/action.ts +52 -212
  253. package/src/analytics/token-info/index.ts +1 -1
  254. package/src/analytics/token-info/params.test.ts +69 -0
  255. package/src/analytics/token-info/params.ts +13 -11
  256. package/src/analytics/token-info/providers.ts +46 -17
  257. package/src/analytics/token-info/service.ts +3 -3
  258. package/src/analytics/token-info/types.ts +2 -2
  259. package/src/api/wallet-routes.test.ts +56 -0
  260. package/src/api/wallet-routes.ts +1728 -0
  261. package/src/audit/audit-log.ts +57 -2
  262. package/src/browser-shim/build-shim.ts +1 -1
  263. package/src/browser-shim/shim.template.js +107 -117
  264. package/src/chains/{wallet-router.test.ts → __tests__/wallet-router.test.ts} +57 -10
  265. package/src/chains/evm/actions/helpers.ts +9 -7
  266. package/src/chains/evm/actions/swap.ts +176 -22
  267. package/src/chains/evm/actions/transfer.ts +29 -22
  268. package/src/chains/evm/biome.json +1 -1
  269. package/src/chains/evm/build.ts +6 -1
  270. package/src/chains/evm/constants.ts +19 -0
  271. package/src/chains/evm/contracts/artifacts/OZGovernor.json +25 -1682
  272. package/src/chains/evm/dex/aerodrome/index.ts +6 -1
  273. package/src/chains/evm/dex/aerodrome/services/AerodromeLpService.ts +41 -15
  274. package/src/chains/evm/dex/aerodrome/types.ts +1 -2
  275. package/src/chains/evm/dex/pancakeswp/index.ts +6 -1
  276. package/src/chains/evm/dex/pancakeswp/services/PancakeSwapV3LpService.ts +54 -17
  277. package/src/chains/evm/dex/pancakeswp/types.ts +1 -2
  278. package/src/chains/evm/dex/uniswap/index.ts +6 -1
  279. package/src/chains/evm/dex/uniswap/services/UniswapV3LpService.ts +20 -9
  280. package/src/chains/evm/dex/uniswap/types.ts +1 -2
  281. package/src/chains/evm/gov-router.ts +3 -1
  282. package/src/chains/evm/index.browser.ts +1 -1
  283. package/src/chains/evm/index.ts +5 -1
  284. package/src/chains/evm/prompts.ts +5 -0
  285. package/src/chains/evm/providers/get-balance.ts +1 -1
  286. package/src/chains/evm/providers/wallet.ts +80 -9
  287. package/src/chains/evm/routes/sign.ts +35 -26
  288. package/src/chains/evm/rpc-providers.ts +1 -1
  289. package/src/chains/evm/types/index.ts +22 -2
  290. package/src/chains/registry.ts +1 -1
  291. package/src/chains/wallet-action.ts +301 -91
  292. package/src/index.ts +9 -5
  293. package/src/lib/wallet-export-guard.test.ts +233 -0
  294. package/src/lib/wallet-export-guard.ts +1 -1
  295. package/src/lp/actions/liquidity.ts +53 -26
  296. package/src/lp/e2e/real-token-tests.ts +0 -1
  297. package/src/lp/e2e/scenarios.ts +1 -2
  298. package/src/lp/e2e/test-utils.ts +20 -7
  299. package/src/lp/lp-manager-entry.ts +2 -5
  300. package/src/lp/services/ConcentratedLiquidityService.ts +3 -10
  301. package/src/lp/services/DexInteractionService.ts +1 -2
  302. package/src/lp/services/LpManagementService.test.ts +0 -1
  303. package/src/lp/services/LpManagementService.ts +75 -35
  304. package/src/lp/services/UserLpProfileService.ts +2 -3
  305. package/src/lp/services/VaultService.ts +10 -4
  306. package/src/lp/services/YieldOptimizationService.ts +29 -13
  307. package/src/lp/services/__tests__/MockLpService.ts +1 -2
  308. package/src/lp/types.ts +9 -13
  309. package/src/lp/utils/solanaClient.ts +4 -2
  310. package/src/plugin.routes.test.ts +24 -0
  311. package/src/plugin.ts +30 -13
  312. package/src/providers/canonical-provider.ts +1 -1
  313. package/src/providers/{unified-wallet-provider.ts → wallet-provider.ts} +3 -3
  314. package/src/routes/__fixtures__/coingecko-markets.recorded.json +97 -0
  315. package/src/routes/wallet-market-overview-route.ts +1 -1
  316. package/src/routes/wallet-market-overview.contract.test.ts +139 -0
  317. package/src/routes/wallet-market-overview.real.test.ts +83 -0
  318. package/src/sdk/escrow/MutualStakeEscrow.ts +1 -2
  319. package/src/sdk/identity/erc8004.ts +1 -1
  320. package/src/sdk/identity/validation.ts +3 -4
  321. package/src/sdk/index.ts +2 -2
  322. package/src/sdk/policy/SpendingPolicy.ts +1 -1
  323. package/src/sdk/router/PaymentRouter.ts +8 -11
  324. package/src/sdk/swap/SwapModule.ts +1 -1
  325. package/src/sdk/tokens/registry.ts +1 -1
  326. package/src/sdk/x402/middleware.ts +2 -8
  327. package/src/security/__tests__/wallet-context-safety.test.ts +79 -0
  328. package/src/security/__tests__/wallet-financial-confirmation.test.ts +88 -0
  329. package/src/security/wallet-context-safety.ts +128 -0
  330. package/src/security/wallet-financial-confirmation.ts +150 -0
  331. package/src/services/wallet-backend-service.ts +15 -1
  332. package/src/utils/intent-trajectory.ts +2 -2
  333. package/src/wallet/steward-backend.ts +4 -4
  334. package/dist/LpManagementService-BWrQ5-cO.mjs +0 -353
  335. package/dist/MockLpService-D_Apn4Fd.mjs +0 -99
  336. package/dist/aerodrome-CfnESC32.mjs +0 -890
  337. package/dist/chunk-hT5z_Zn9.mjs +0 -35
  338. package/dist/lib/server-wallet-trade.d.mts +0 -34
  339. package/dist/lib/server-wallet-trade.mjs +0 -306
  340. package/dist/meteora-BPX39hZo.mjs +0 -22640
  341. package/dist/orca-Bybp1HXO.mjs +0 -249
  342. package/dist/pancakeswp-CkEXlXti.mjs +0 -604
  343. package/dist/plugin-ZO_MTyd0.mjs +0 -529
  344. package/dist/raydium-rfaM9yEf.mjs +0 -539
  345. package/dist/sdk/index.d.mts +0 -32492
  346. package/dist/sdk/index.mjs +0 -6415
  347. package/dist/types-D5252NZk.mjs +0 -487
  348. package/dist/uniswap-CReXgXVN.mjs +0 -573
  349. package/dist/wallet-action.d.mts +0 -6
  350. package/dist/wallet-action.mjs +0 -820
  351. package/src/analytics/birdeye/tasks/birdeye.ts +0 -232
  352. package/src/analytics/lpinfo/index.d.ts +0 -7
  353. package/src/chains/evm/contracts/artifacts/TimelockController.json +0 -1007
  354. package/src/chains/evm/contracts/artifacts/VoteToken.json +0 -895
  355. package/src/lp/tasks/LpAutoRebalanceTask.ts +0 -117
  356. package/src/lp/tasks/__tests__/LpAutoRebalanceTask.test.ts +0 -370
@@ -0,0 +1,233 @@
1
+ import type http from "node:http";
2
+ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
3
+ import {
4
+ _resetForTesting,
5
+ createHardenedExportGuard,
6
+ getWalletExportAuditLog,
7
+ } from "./wallet-export-guard";
8
+
9
+ function request(
10
+ remoteAddress: string | null = "127.0.0.1",
11
+ userAgent = "wallet-test",
12
+ ): http.IncomingMessage {
13
+ return {
14
+ headers: { "user-agent": userAgent },
15
+ socket: { remoteAddress },
16
+ } as unknown as http.IncomingMessage;
17
+ }
18
+
19
+ function parseNonce(reason: string): string {
20
+ const parsed = JSON.parse(reason) as { nonce?: unknown };
21
+ if (typeof parsed.nonce !== "string") {
22
+ throw new Error(`missing nonce in ${reason}`);
23
+ }
24
+ return parsed.nonce;
25
+ }
26
+
27
+ describe("wallet export guard", () => {
28
+ const upstream = vi.fn(() => null);
29
+
30
+ beforeEach(() => {
31
+ vi.useFakeTimers();
32
+ vi.setSystemTime(new Date("2026-01-01T00:00:00.000Z"));
33
+ upstream.mockReset();
34
+ upstream.mockReturnValue(null);
35
+ _resetForTesting();
36
+ vi.spyOn(console, "warn").mockImplementation(() => undefined);
37
+ });
38
+
39
+ afterEach(() => {
40
+ vi.restoreAllMocks();
41
+ vi.useRealTimers();
42
+ _resetForTesting();
43
+ });
44
+
45
+ it("issues a nonce, enforces the confirmation delay, then allows exactly one export", () => {
46
+ const guard = createHardenedExportGuard(upstream);
47
+ const req = request();
48
+ const nonceResponse = guard(req, {
49
+ confirm: true,
50
+ exportToken: "valid",
51
+ requestNonce: true,
52
+ });
53
+
54
+ expect(nonceResponse?.status).toBe(403);
55
+ const nonce = parseNonce(nonceResponse?.reason ?? "");
56
+ expect(nonce).toMatch(/^wxn_[a-f0-9]{32}$/);
57
+
58
+ const tooEarly = guard(req, {
59
+ confirm: true,
60
+ exportToken: "valid",
61
+ exportNonce: nonce,
62
+ });
63
+ expect(tooEarly).toMatchObject({
64
+ status: 403,
65
+ reason: expect.stringContaining("Wait 10 more seconds"),
66
+ });
67
+
68
+ vi.advanceTimersByTime(10_000);
69
+ expect(
70
+ guard(req, {
71
+ confirm: true,
72
+ exportToken: "valid",
73
+ exportNonce: nonce,
74
+ }),
75
+ ).toBeNull();
76
+
77
+ const replay = guard(req, {
78
+ confirm: true,
79
+ exportToken: "valid",
80
+ exportNonce: nonce,
81
+ });
82
+ expect(replay).toMatchObject({
83
+ status: 403,
84
+ reason: "Invalid or expired export nonce.",
85
+ });
86
+ expect(getWalletExportAuditLog().at(-2)?.outcome).toBe("allowed");
87
+ });
88
+
89
+ it("binds nonces to the socket IP and rejects requests without an IP", () => {
90
+ const guard = createHardenedExportGuard(upstream);
91
+ const nonceResponse = guard(request("127.0.0.1"), {
92
+ confirm: true,
93
+ exportToken: "valid",
94
+ requestNonce: true,
95
+ });
96
+ const nonce = parseNonce(nonceResponse?.reason ?? "");
97
+ vi.advanceTimersByTime(10_000);
98
+
99
+ expect(
100
+ guard(request("127.0.0.2"), {
101
+ confirm: true,
102
+ exportToken: "valid",
103
+ exportNonce: nonce,
104
+ }),
105
+ ).toMatchObject({
106
+ status: 403,
107
+ reason: "Export nonce was issued to a different client.",
108
+ });
109
+ expect(
110
+ guard(request(null), {
111
+ confirm: true,
112
+ exportToken: "valid",
113
+ requestNonce: true,
114
+ }),
115
+ ).toMatchObject({
116
+ status: 400,
117
+ reason: "Unable to determine client IP; request rejected.",
118
+ });
119
+ });
120
+
121
+ it("caps pending nonces per IP and trims the audit log", () => {
122
+ const guard = createHardenedExportGuard(upstream);
123
+ const req = request("10.0.0.1");
124
+
125
+ for (let i = 0; i < 3; i += 1) {
126
+ expect(
127
+ guard(req, {
128
+ confirm: true,
129
+ exportToken: "valid",
130
+ requestNonce: true,
131
+ })?.status,
132
+ ).toBe(403);
133
+ }
134
+ expect(
135
+ guard(req, {
136
+ confirm: true,
137
+ exportToken: "valid",
138
+ requestNonce: true,
139
+ }),
140
+ ).toMatchObject({
141
+ status: 429,
142
+ reason: expect.stringContaining("Too many pending export requests"),
143
+ });
144
+
145
+ for (let i = 0; i < 120; i += 1) {
146
+ guard(request(`10.0.1.${i}`), {
147
+ confirm: true,
148
+ exportToken: "valid",
149
+ requestNonce: true,
150
+ });
151
+ }
152
+ expect(getWalletExportAuditLog()).toHaveLength(100);
153
+ });
154
+
155
+ it("rate limits successful exports per IP after nonce validation", () => {
156
+ const guard = createHardenedExportGuard(upstream);
157
+ const req = request("127.0.0.9");
158
+ const firstNonce = parseNonce(
159
+ guard(req, {
160
+ confirm: true,
161
+ exportToken: "valid",
162
+ requestNonce: true,
163
+ })?.reason ?? "",
164
+ );
165
+ vi.advanceTimersByTime(10_000);
166
+ expect(
167
+ guard(req, {
168
+ confirm: true,
169
+ exportToken: "valid",
170
+ exportNonce: firstNonce,
171
+ }),
172
+ ).toBeNull();
173
+
174
+ const secondNonce = parseNonce(
175
+ guard(req, {
176
+ confirm: true,
177
+ exportToken: "valid",
178
+ requestNonce: true,
179
+ })?.reason ?? "",
180
+ );
181
+ vi.advanceTimersByTime(10_000);
182
+ expect(
183
+ guard(req, {
184
+ confirm: true,
185
+ exportToken: "valid",
186
+ exportNonce: secondNonce,
187
+ }),
188
+ ).toMatchObject({
189
+ status: 429,
190
+ reason: expect.stringContaining("Rate limit exceeded"),
191
+ });
192
+
193
+ vi.advanceTimersByTime(10 * 60 * 1000);
194
+ const thirdNonce = parseNonce(
195
+ guard(req, {
196
+ confirm: true,
197
+ exportToken: "valid",
198
+ requestNonce: true,
199
+ })?.reason ?? "",
200
+ );
201
+ vi.advanceTimersByTime(10_000);
202
+ expect(
203
+ guard(req, {
204
+ confirm: true,
205
+ exportToken: "valid",
206
+ exportNonce: thirdNonce,
207
+ }),
208
+ ).toBeNull();
209
+ });
210
+
211
+ it("runs upstream validation before issuing nonces or rate-limit checks", () => {
212
+ upstream.mockReturnValueOnce({
213
+ status: 403,
214
+ reason: "bad export token",
215
+ });
216
+ const guard = createHardenedExportGuard(upstream);
217
+
218
+ expect(
219
+ guard(request(), {
220
+ confirm: true,
221
+ exportToken: "invalid",
222
+ requestNonce: true,
223
+ }),
224
+ ).toEqual({
225
+ status: 403,
226
+ reason: "bad export token",
227
+ });
228
+ expect(getWalletExportAuditLog().at(-1)).toMatchObject({
229
+ outcome: "rejected",
230
+ reason: "bad export token",
231
+ });
232
+ });
233
+ });
@@ -61,7 +61,7 @@ if (typeof sweepTimer === "object" && "unref" in sweepTimer) {
61
61
  * IPs to bypass rate limits and nonce IP binding.
62
62
  */
63
63
  function getClientIp(req: http.IncomingMessage): string | null {
64
- return req.socket?.remoteAddress ?? null;
64
+ return req.socket.remoteAddress ?? null;
65
65
  }
66
66
 
67
67
  function getUserAgent(req: http.IncomingMessage): string {
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import type {
3
2
  Action,
4
3
  ActionExample,
@@ -27,6 +26,24 @@ import { getChainConfig } from "../types.ts";
27
26
  const SOLANA_DEXES = new Set(["raydium", "orca", "meteora"]);
28
27
  const EVM_DEXES = new Set(["uniswap", "aerodrome", "pancakeswap"]);
29
28
 
29
+ type PoolTokenWithAddress = PoolInfo["tokenA"] & { address?: string };
30
+ type TransactionWithHash = { transactionId?: string; hash?: string };
31
+
32
+ function tokenLabel(token: PoolInfo["tokenA"]): string | undefined {
33
+ const withAddress = token as PoolTokenWithAddress;
34
+ return token.symbol || token.mint || withAddress.address;
35
+ }
36
+
37
+ function transactionLabel(result: TransactionWithHash): string {
38
+ return result.transactionId || result.hash || "submitted";
39
+ }
40
+
41
+ function isLpPosition(
42
+ position: LpPositionDetails | null,
43
+ ): position is LpPositionDetails {
44
+ return position !== null;
45
+ }
46
+
30
47
  function selectedContextMatches(
31
48
  state: State | undefined,
32
49
  contexts: readonly string[],
@@ -73,7 +90,7 @@ const formatPositions = (positions: LpPositionDetails[]): string => {
73
90
  `\n${index + 1}. ${pos.poolId} on ${pos.dex}\n` +
74
91
  ` Value: $${pos.valueUsd?.toFixed(2) || "N/A"}\n` +
75
92
  ` Tokens: ${underlying || "N/A"}\n` +
76
- ` LP balance: ${pos.lpTokenBalance?.uiAmount?.toFixed(6) || pos.lpTokenBalance?.balance || "N/A"} ${pos.lpTokenBalance?.symbol || ""}\n`;
93
+ ` LP balance: ${pos.lpTokenBalance.uiAmount?.toFixed(6) || pos.lpTokenBalance.balance || "N/A"} ${pos.lpTokenBalance.symbol || ""}\n`;
77
94
  });
78
95
  return response;
79
96
  };
@@ -85,16 +102,8 @@ const formatPools = (pools: PoolInfo[]): string => {
85
102
 
86
103
  let response = "LP pools:\n";
87
104
  pools.slice(0, 10).forEach((pool, index) => {
88
- const tokenA =
89
- pool.tokenA?.symbol ||
90
- pool.tokenA?.mint ||
91
- pool.tokenA?.address ||
92
- "tokenA";
93
- const tokenB =
94
- pool.tokenB?.symbol ||
95
- pool.tokenB?.mint ||
96
- pool.tokenB?.address ||
97
- "tokenB";
105
+ const tokenA = tokenLabel(pool.tokenA) || "tokenA";
106
+ const tokenB = tokenLabel(pool.tokenB) || "tokenB";
98
107
  response +=
99
108
  `\n${index + 1}. ${pool.displayName || pool.id} on ${pool.dex}\n` +
100
109
  ` Pair: ${tokenA}/${tokenB}\n` +
@@ -204,7 +213,7 @@ function normalizeParams(
204
213
  message: Memory,
205
214
  handlerParams?: Record<string, unknown>,
206
215
  ): LpActionParams | null {
207
- const contentParams = (message?.content || {}) as Record<string, unknown>;
216
+ const contentParams = (message.content || {}) as Record<string, unknown>;
208
217
  const params = {
209
218
  ...contentParams,
210
219
  ...(handlerParams || {}),
@@ -242,7 +251,12 @@ function resolveChain(params: LpActionParams): {
242
251
  let chainId = params.chainId;
243
252
 
244
253
  const numericChain = chain && /^\d+$/.test(chain) ? Number(chain) : undefined;
245
- const evmChain = getChainConfig(numericChain ?? chain);
254
+ const evmChain =
255
+ numericChain !== undefined
256
+ ? getChainConfig(numericChain)
257
+ : chain
258
+ ? getChainConfig(chain)
259
+ : undefined;
246
260
  if (evmChain) {
247
261
  chain = "evm";
248
262
  chainId = evmChain.chainId;
@@ -404,8 +418,9 @@ async function handlePreferences(
404
418
  newConfig.minGainThresholdPercent = params.minGainThresholdPercent;
405
419
  updates.push(`minGainThresholdPercent=${params.minGainThresholdPercent}`);
406
420
  }
407
- if (params.maxSlippageBps !== undefined || params.slippageBps !== undefined) {
408
- newConfig.maxSlippageBps = params.maxSlippageBps ?? params.slippageBps;
421
+ const maxSlippageBps = params.maxSlippageBps ?? params.slippageBps;
422
+ if (maxSlippageBps !== undefined) {
423
+ newConfig.maxSlippageBps = maxSlippageBps;
409
424
  updates.push(`maxSlippageBps=${newConfig.maxSlippageBps}`);
410
425
  }
411
426
  if (params.preferredDexes) {
@@ -482,7 +497,7 @@ async function handleLpOperation(
482
497
  .catch(() => null),
483
498
  ),
484
499
  )
485
- ).filter(Boolean);
500
+ ).filter(isLpPosition);
486
501
  }
487
502
  return {
488
503
  success: true,
@@ -528,7 +543,7 @@ async function handleLpOperation(
528
543
  return {
529
544
  success: result.success,
530
545
  text: result.success
531
- ? `LP position opened on ${route.dex || "registered protocol"}. Transaction: ${result.transactionId || result.hash || "submitted"}`
546
+ ? `LP position opened on ${route.dex || "registered protocol"}. Transaction: ${transactionLabel(result)}`
532
547
  : `LP open failed: ${result.error || "unknown error"}`,
533
548
  data: result,
534
549
  };
@@ -552,7 +567,7 @@ async function handleLpOperation(
552
567
  return {
553
568
  success: result.success,
554
569
  text: result.success
555
- ? `LP position closed on ${route.dex || "registered protocol"}. Transaction: ${result.transactionId || result.hash || "submitted"}`
570
+ ? `LP position closed on ${route.dex || "registered protocol"}. Transaction: ${transactionLabel(result)}`
556
571
  : `LP close failed: ${result.error || "unknown error"}`,
557
572
  data: result,
558
573
  };
@@ -577,7 +592,7 @@ async function handleLpOperation(
577
592
  return {
578
593
  success: result.success,
579
594
  text: result.success
580
- ? `LP position repositioned on ${route.dex || "registered protocol"}. Transaction: ${result.transactionId || result.hash || "submitted"}`
595
+ ? `LP position repositioned on ${route.dex || "registered protocol"}. Transaction: ${transactionLabel(result)}`
581
596
  : `LP reposition failed: ${result.error || "unknown error"}`,
582
597
  data: result,
583
598
  };
@@ -656,7 +671,10 @@ export const liquidityAction: Action = {
656
671
  description:
657
672
  "Liquidity amount for open, close, or reposition operations.",
658
673
  required: false,
659
- schema: { type: ["string", "number"] },
674
+ schema: {
675
+ type: "string",
676
+ anyOf: [{ type: "string" }, { type: "number" }],
677
+ },
660
678
  },
661
679
  {
662
680
  name: "range",
@@ -712,7 +730,10 @@ export const liquidityAction: Action = {
712
730
  [
713
731
  {
714
732
  name: "{{name1}}",
715
- content: { text: "Open a Raydium LP position with 100 USDC paired against SOL.", source: "chat" },
733
+ content: {
734
+ text: "Open a Raydium LP position with 100 USDC paired against SOL.",
735
+ source: "chat",
736
+ },
716
737
  },
717
738
  {
718
739
  name: "{{agentName}}",
@@ -727,7 +748,10 @@ export const liquidityAction: Action = {
727
748
  [
728
749
  {
729
750
  name: "{{name1}}",
730
- content: { text: "Show my current liquidity positions.", source: "chat" },
751
+ content: {
752
+ text: "Show my current liquidity positions.",
753
+ source: "chat",
754
+ },
731
755
  },
732
756
  {
733
757
  name: "{{agentName}}",
@@ -742,7 +766,10 @@ export const liquidityAction: Action = {
742
766
  [
743
767
  {
744
768
  name: "{{name1}}",
745
- content: { text: "Close my SOL/USDC liquidity position.", source: "chat" },
769
+ content: {
770
+ text: "Close my SOL/USDC liquidity position.",
771
+ source: "chat",
772
+ },
746
773
  },
747
774
  {
748
775
  name: "{{agentName}}",
@@ -761,7 +788,7 @@ export const liquidityAction: Action = {
761
788
  message: Memory,
762
789
  state?: State,
763
790
  ): Promise<boolean> => {
764
- if (!message?.content) return false;
791
+ if (!message.content) return false;
765
792
  if ((message.content as LpActionParams & { action?: string }).action)
766
793
  return true;
767
794
  if ((message.content as LpActionParams).subaction) return true;
@@ -789,7 +816,7 @@ export const liquidityAction: Action = {
789
816
  };
790
817
  }
791
818
 
792
- const userId = message.entityId || message.userId || "unknown-user";
819
+ const userId = message.entityId || "unknown-user";
793
820
 
794
821
  try {
795
822
  if (params.subaction === "onboard") {
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import { strict as assert } from "node:assert";
3
2
  import type { IAgentRuntime, TestSuite } from "@elizaos/core";
4
3
  import type { DexInteractionService } from "../services/DexInteractionService.ts";
@@ -1,9 +1,8 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import { strict as assert } from "node:assert";
3
2
  import type { IAgentRuntime, TestSuite } from "@elizaos/core";
4
3
  import { sendMessageAndWaitForResponse, setupScenario } from "./test-utils.ts";
5
4
 
6
- // Mock services are registered in setupScenario; this stub is called for backward compatibility.
5
+ // Mock services are registered in setupScenario; this hook is called for backward compatibility.
7
6
  async function setupMockLpData(_runtime: IAgentRuntime) {}
8
7
 
9
8
  /**
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import { strict as assert } from "node:assert";
3
2
  import {
4
3
  asUUID,
@@ -10,10 +9,24 @@ import {
10
9
  type IAgentRuntime,
11
10
  type Memory,
12
11
  type Room,
12
+ type Setting,
13
13
  type World,
14
14
  } from "@elizaos/core";
15
15
  import { v4 as uuid } from "uuid";
16
16
 
17
+ const E2E_TEST_SERVER_ID = "e2e-test-server";
18
+
19
+ function testSetting(name: string, value: string | boolean | null): Setting {
20
+ return {
21
+ name,
22
+ description: `E2E ${name}`,
23
+ usageDescription: `E2E ${name}`,
24
+ required: false,
25
+ value,
26
+ dependsOn: [],
27
+ };
28
+ }
29
+
17
30
  /**
18
31
  * Sets up a standard scenario environment for an E2E test.
19
32
  *
@@ -51,16 +64,15 @@ export async function setupScenario(
51
64
  id: asUUID(uuid()),
52
65
  agentId: runtime.agentId,
53
66
  name: "E2E Test World",
54
- serverId: "e2e-test-server",
55
67
  metadata: {
56
68
  ownership: {
57
69
  ownerId: user.id,
58
70
  },
59
71
  settings: {
60
72
  lp_manager: {
61
- onboarding_enabled: true,
62
- auto_rebalance_enabled: true,
63
- default_slippage_bps: 50,
73
+ onboarding_enabled: testSetting("onboarding_enabled", true),
74
+ auto_rebalance_enabled: testSetting("auto_rebalance_enabled", true),
75
+ default_slippage_bps: testSetting("default_slippage_bps", "50"),
64
76
  },
65
77
  },
66
78
  },
@@ -74,7 +86,7 @@ export async function setupScenario(
74
86
  type: ChannelType.DM,
75
87
  source: "e2e-test",
76
88
  worldId: world.id,
77
- serverId: world.serverId,
89
+ serverId: E2E_TEST_SERVER_ID,
78
90
  };
79
91
  await runtime.createRoom(room);
80
92
 
@@ -131,8 +143,9 @@ export function sendMessageAndWaitForResponse(
131
143
 
132
144
  // The callback function that the message handler will invoke with the agent's final response.
133
145
  // We use this callback to resolve our promise.
134
- const callback = (responseContent: Content) => {
146
+ const callback = async (responseContent: Content): Promise<Memory[]> => {
135
147
  resolve(responseContent);
148
+ return [];
136
149
  };
137
150
 
138
151
  // Emit the event to trigger the agent's message processing logic.
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import {
3
2
  type IAgentRuntime,
4
3
  logger,
@@ -144,7 +143,7 @@ async function loadSolanaDexes(
144
143
  const meteoraPlugin = await import(
145
144
  "../chains/solana/dex/meteora/index.ts"
146
145
  );
147
- if (meteoraPlugin.default?.init) {
146
+ if (meteoraPlugin.default.init) {
148
147
  await meteoraPlugin.default.init(config, runtime);
149
148
  }
150
149
  logger.info(`[LP Manager] Loaded Meteora DEX`);
@@ -214,7 +213,7 @@ async function loadEvmDexes(
214
213
  const lpManagerPlugin: Plugin = {
215
214
  name: LP_MANAGER_PLUGIN_NAME,
216
215
  description:
217
- "Unified Liquidity Pool manager for Solana DEXs (Raydium, Orca, Meteora) and EVM DEXs (Uniswap, PancakeSwap, Aerodrome).",
216
+ "Liquidity Pool manager for Solana DEXs (Raydium, Orca, Meteora) and EVM DEXs (Uniswap, PancakeSwap, Aerodrome).",
218
217
  actions: [...promoteSubactionsToActions(liquidityAction)],
219
218
  services: [
220
219
  LpManagementService,
@@ -290,13 +289,11 @@ export { raydiumPlugin } from "../chains/solana/dex/raydium/index.ts";
290
289
  // Export types
291
290
  export * from "./types.ts";
292
291
  // Export all services and utilities
293
- // Back-compat alias for older imports.
294
292
  export {
295
293
  ConcentratedLiquidityService,
296
294
  DexInteractionService,
297
295
  LpManagementService,
298
296
  liquidityAction,
299
- liquidityAction as LpManagementAgentAction,
300
297
  UserLpProfileService,
301
298
  VaultService,
302
299
  YieldOptimizationService,
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import { type IAgentRuntime, Service } from "@elizaos/core";
3
2
  import type {
4
3
  IConcentratedLiquidityService,
@@ -7,8 +6,8 @@ import type {
7
6
  } from "../types";
8
7
 
9
8
  /**
10
- * ConcentratedLiquidityService provides foundation support for concentrated liquidity positions.
11
- * This is a placeholder implementation that will be expanded when DEX plugins add concentrated liquidity support.
9
+ * ConcentratedLiquidityService exposes the concentrated-liquidity surface while
10
+ * DEX-specific providers add position creation and rebalancing support.
12
11
  */
13
12
  export class ConcentratedLiquidityService
14
13
  extends Service
@@ -32,21 +31,17 @@ export class ConcentratedLiquidityService
32
31
 
33
32
  async start(_runtime: IAgentRuntime): Promise<void> {
34
33
  // Service initialization
35
- this.isInitialized = true;
36
34
  console.info(
37
35
  "ConcentratedLiquidityService started - awaiting DEX integration",
38
36
  );
39
37
  }
40
38
 
41
- async stop(): Promise<void> {
42
- this.isInitialized = false;
43
- }
39
+ async stop(): Promise<void> {}
44
40
 
45
41
  async createConcentratedPosition(
46
42
  _userId: string,
47
43
  _params: IRangeParams,
48
44
  ): Promise<IConcentratedPosition> {
49
- // Placeholder implementation
50
45
  throw new Error(
51
46
  "Concentrated liquidity positions are coming soon! This feature requires DEX integration.",
52
47
  );
@@ -55,7 +50,6 @@ export class ConcentratedLiquidityService
55
50
  async getConcentratedPositions(
56
51
  userId: string,
57
52
  ): Promise<IConcentratedPosition[]> {
58
- // Placeholder implementation
59
53
  console.info(`Getting concentrated positions for user ${userId}`);
60
54
  return [];
61
55
  }
@@ -65,7 +59,6 @@ export class ConcentratedLiquidityService
65
59
  _positionId: string,
66
60
  _newRangeParams?: Partial<IRangeParams>,
67
61
  ): Promise<IConcentratedPosition> {
68
- // Placeholder implementation
69
62
  throw new Error("Concentrated position rebalancing is coming soon!");
70
63
  }
71
64
 
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — legacy code from absorbed plugins (lp-manager, lpinfo, dexscreener, defi-news, birdeye); strict types pending cleanup
2
1
  import { type IAgentRuntime, logger, Service } from "@elizaos/core";
3
2
  import type {
4
3
  AddLiquidityConfig,
@@ -79,7 +78,7 @@ export class DexInteractionService
79
78
  }
80
79
 
81
80
  async stop(): Promise<void> {
82
- // No-op; protocol providers are owned by LpManagementService.
81
+ // Protocol providers are owned by LpManagementService.
83
82
  }
84
83
 
85
84
  rediscoverServices(): void {
@@ -1,4 +1,3 @@
1
- // @ts-nocheck — tests use plain objects instead of generated proto message instances
2
1
  import { describe, expect, it, vi } from "vitest";
3
2
  import {
4
3
  LpManagementService,