keyring-agent-core 0.2.1 → 0.2.3

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 (417) hide show
  1. package/dist/index.d.ts +6692 -27
  2. package/dist/index.js +877 -70
  3. package/package.json +6 -4
  4. package/dist/agent/AgentCore.d.ts +0 -256
  5. package/dist/agent/AgentCore.d.ts.map +0 -1
  6. package/dist/agent/AgentCore.js +0 -1093
  7. package/dist/agent/AgentCore.js.map +0 -1
  8. package/dist/agent/QueryRewriter.d.ts +0 -84
  9. package/dist/agent/QueryRewriter.d.ts.map +0 -1
  10. package/dist/agent/QueryRewriter.js +0 -306
  11. package/dist/agent/QueryRewriter.js.map +0 -1
  12. package/dist/agent/Router.d.ts +0 -33
  13. package/dist/agent/Router.d.ts.map +0 -1
  14. package/dist/agent/Router.js +0 -229
  15. package/dist/agent/Router.js.map +0 -1
  16. package/dist/agent/Subagent.d.ts +0 -80
  17. package/dist/agent/Subagent.d.ts.map +0 -1
  18. package/dist/agent/Subagent.js +0 -272
  19. package/dist/agent/Subagent.js.map +0 -1
  20. package/dist/agent/Synthesizer.d.ts +0 -11
  21. package/dist/agent/Synthesizer.d.ts.map +0 -1
  22. package/dist/agent/Synthesizer.js +0 -86
  23. package/dist/agent/Synthesizer.js.map +0 -1
  24. package/dist/agent/chatGraph.d.ts +0 -364
  25. package/dist/agent/chatGraph.d.ts.map +0 -1
  26. package/dist/agent/chatGraph.js +0 -184
  27. package/dist/agent/chatGraph.js.map +0 -1
  28. package/dist/agent/index.d.ts +0 -10
  29. package/dist/agent/index.d.ts.map +0 -1
  30. package/dist/agent/index.js +0 -24
  31. package/dist/agent/index.js.map +0 -1
  32. package/dist/agent/subagents/AiAgent.d.ts +0 -6
  33. package/dist/agent/subagents/AiAgent.d.ts.map +0 -1
  34. package/dist/agent/subagents/AiAgent.js +0 -52
  35. package/dist/agent/subagents/AiAgent.js.map +0 -1
  36. package/dist/agent/subagents/NftAgent.d.ts +0 -6
  37. package/dist/agent/subagents/NftAgent.d.ts.map +0 -1
  38. package/dist/agent/subagents/NftAgent.js +0 -79
  39. package/dist/agent/subagents/NftAgent.js.map +0 -1
  40. package/dist/agent/subagents/PoolAgent.d.ts +0 -6
  41. package/dist/agent/subagents/PoolAgent.d.ts.map +0 -1
  42. package/dist/agent/subagents/PoolAgent.js +0 -184
  43. package/dist/agent/subagents/PoolAgent.js.map +0 -1
  44. package/dist/agent/subagents/PoolSubgraphAgent.d.ts +0 -6
  45. package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +0 -1
  46. package/dist/agent/subagents/PoolSubgraphAgent.js +0 -117
  47. package/dist/agent/subagents/PoolSubgraphAgent.js.map +0 -1
  48. package/dist/agent/subagents/TokenAgent.d.ts +0 -6
  49. package/dist/agent/subagents/TokenAgent.d.ts.map +0 -1
  50. package/dist/agent/subagents/TokenAgent.js +0 -76
  51. package/dist/agent/subagents/TokenAgent.js.map +0 -1
  52. package/dist/agent/subagents/WalletActionAgent.d.ts +0 -6
  53. package/dist/agent/subagents/WalletActionAgent.d.ts.map +0 -1
  54. package/dist/agent/subagents/WalletActionAgent.js +0 -55
  55. package/dist/agent/subagents/WalletActionAgent.js.map +0 -1
  56. package/dist/agent/subagents/WalletAgent.d.ts +0 -6
  57. package/dist/agent/subagents/WalletAgent.d.ts.map +0 -1
  58. package/dist/agent/subagents/WalletAgent.js +0 -93
  59. package/dist/agent/subagents/WalletAgent.js.map +0 -1
  60. package/dist/agent/subagents/index.d.ts +0 -34
  61. package/dist/agent/subagents/index.d.ts.map +0 -1
  62. package/dist/agent/subagents/index.js +0 -69
  63. package/dist/agent/subagents/index.js.map +0 -1
  64. package/dist/constants/abi.d.ts +0 -551
  65. package/dist/constants/abi.d.ts.map +0 -1
  66. package/dist/constants/abi.js +0 -690
  67. package/dist/constants/abi.js.map +0 -1
  68. package/dist/functions/pool.d.ts +0 -25
  69. package/dist/functions/pool.d.ts.map +0 -1
  70. package/dist/functions/pool.js +0 -151
  71. package/dist/functions/pool.js.map +0 -1
  72. package/dist/functions/web3.d.ts +0 -31
  73. package/dist/functions/web3.d.ts.map +0 -1
  74. package/dist/functions/web3.js +0 -232
  75. package/dist/functions/web3.js.map +0 -1
  76. package/dist/index.d.ts.map +0 -1
  77. package/dist/index.js.map +0 -1
  78. package/dist/llm/GeminiProvider.d.ts +0 -16
  79. package/dist/llm/GeminiProvider.d.ts.map +0 -1
  80. package/dist/llm/GeminiProvider.js +0 -329
  81. package/dist/llm/GeminiProvider.js.map +0 -1
  82. package/dist/llm/index.d.ts +0 -2
  83. package/dist/llm/index.d.ts.map +0 -1
  84. package/dist/llm/index.js +0 -6
  85. package/dist/llm/index.js.map +0 -1
  86. package/dist/memory/ChatHistory.d.ts +0 -83
  87. package/dist/memory/ChatHistory.d.ts.map +0 -1
  88. package/dist/memory/ChatHistory.js +0 -143
  89. package/dist/memory/ChatHistory.js.map +0 -1
  90. package/dist/memory/KnowledgeBase.d.ts +0 -38
  91. package/dist/memory/KnowledgeBase.d.ts.map +0 -1
  92. package/dist/memory/KnowledgeBase.js +0 -139
  93. package/dist/memory/KnowledgeBase.js.map +0 -1
  94. package/dist/memory/Summarizer.d.ts +0 -12
  95. package/dist/memory/Summarizer.d.ts.map +0 -1
  96. package/dist/memory/Summarizer.js +0 -39
  97. package/dist/memory/Summarizer.js.map +0 -1
  98. package/dist/memory/UpstashKnowledgeBase.d.ts +0 -124
  99. package/dist/memory/UpstashKnowledgeBase.d.ts.map +0 -1
  100. package/dist/memory/UpstashKnowledgeBase.js +0 -152
  101. package/dist/memory/UpstashKnowledgeBase.js.map +0 -1
  102. package/dist/memory/historyUtils.d.ts +0 -58
  103. package/dist/memory/historyUtils.d.ts.map +0 -1
  104. package/dist/memory/historyUtils.js +0 -190
  105. package/dist/memory/historyUtils.js.map +0 -1
  106. package/dist/memory/index.d.ts +0 -7
  107. package/dist/memory/index.d.ts.map +0 -1
  108. package/dist/memory/index.js +0 -12
  109. package/dist/memory/index.js.map +0 -1
  110. package/dist/memory/ingestKnowledgeBase.d.ts +0 -17
  111. package/dist/memory/ingestKnowledgeBase.d.ts.map +0 -1
  112. package/dist/memory/ingestKnowledgeBase.js +0 -35
  113. package/dist/memory/ingestKnowledgeBase.js.map +0 -1
  114. package/dist/services/MoralisService.d.ts +0 -1328
  115. package/dist/services/MoralisService.d.ts.map +0 -1
  116. package/dist/services/MoralisService.js +0 -1239
  117. package/dist/services/MoralisService.js.map +0 -1
  118. package/dist/services/PantographService.d.ts +0 -98
  119. package/dist/services/PantographService.d.ts.map +0 -1
  120. package/dist/services/PantographService.js +0 -451
  121. package/dist/services/PantographService.js.map +0 -1
  122. package/dist/services/PoolService.d.ts +0 -238
  123. package/dist/services/PoolService.d.ts.map +0 -1
  124. package/dist/services/PoolService.js +0 -485
  125. package/dist/services/PoolService.js.map +0 -1
  126. package/dist/services/UniswapService.d.ts +0 -289
  127. package/dist/services/UniswapService.d.ts.map +0 -1
  128. package/dist/services/UniswapService.js +0 -585
  129. package/dist/services/UniswapService.js.map +0 -1
  130. package/dist/services/UniswapSubgraphService.d.ts +0 -144
  131. package/dist/services/UniswapSubgraphService.d.ts.map +0 -1
  132. package/dist/services/UniswapSubgraphService.js +0 -606
  133. package/dist/services/UniswapSubgraphService.js.map +0 -1
  134. package/dist/services/rpc.d.ts +0 -35
  135. package/dist/services/rpc.d.ts.map +0 -1
  136. package/dist/services/rpc.js +0 -110
  137. package/dist/services/rpc.js.map +0 -1
  138. package/dist/services/swap/BaseSwapService.d.ts +0 -17
  139. package/dist/services/swap/BaseSwapService.d.ts.map +0 -1
  140. package/dist/services/swap/BaseSwapService.js +0 -19
  141. package/dist/services/swap/BaseSwapService.js.map +0 -1
  142. package/dist/services/swap/DebridgeAdapter.d.ts +0 -37
  143. package/dist/services/swap/DebridgeAdapter.d.ts.map +0 -1
  144. package/dist/services/swap/DebridgeAdapter.js +0 -243
  145. package/dist/services/swap/DebridgeAdapter.js.map +0 -1
  146. package/dist/services/swap/RelayAdapter.d.ts +0 -19
  147. package/dist/services/swap/RelayAdapter.d.ts.map +0 -1
  148. package/dist/services/swap/RelayAdapter.js +0 -189
  149. package/dist/services/swap/RelayAdapter.js.map +0 -1
  150. package/dist/services/swap/SwapServiceFactory.d.ts +0 -25
  151. package/dist/services/swap/SwapServiceFactory.d.ts.map +0 -1
  152. package/dist/services/swap/SwapServiceFactory.js +0 -79
  153. package/dist/services/swap/SwapServiceFactory.js.map +0 -1
  154. package/dist/services/swap/addresses.d.ts +0 -3
  155. package/dist/services/swap/addresses.d.ts.map +0 -1
  156. package/dist/services/swap/addresses.js +0 -68
  157. package/dist/services/swap/addresses.js.map +0 -1
  158. package/dist/services/swap/affiliate.d.ts +0 -17
  159. package/dist/services/swap/affiliate.d.ts.map +0 -1
  160. package/dist/services/swap/affiliate.js +0 -126
  161. package/dist/services/swap/affiliate.js.map +0 -1
  162. package/dist/services/swap/config.d.ts +0 -9
  163. package/dist/services/swap/config.d.ts.map +0 -1
  164. package/dist/services/swap/config.js +0 -19
  165. package/dist/services/swap/config.js.map +0 -1
  166. package/dist/services/swap/index.d.ts +0 -10
  167. package/dist/services/swap/index.d.ts.map +0 -1
  168. package/dist/services/swap/index.js +0 -22
  169. package/dist/services/swap/index.js.map +0 -1
  170. package/dist/services/swap/types.d.ts +0 -89
  171. package/dist/services/swap/types.d.ts.map +0 -1
  172. package/dist/services/swap/types.js +0 -6
  173. package/dist/services/swap/types.js.map +0 -1
  174. package/dist/tools/BaseTool.d.ts +0 -15
  175. package/dist/tools/BaseTool.d.ts.map +0 -1
  176. package/dist/tools/BaseTool.js +0 -35
  177. package/dist/tools/BaseTool.js.map +0 -1
  178. package/dist/tools/ToolRegistry.d.ts +0 -27
  179. package/dist/tools/ToolRegistry.d.ts.map +0 -1
  180. package/dist/tools/ToolRegistry.js +0 -80
  181. package/dist/tools/ToolRegistry.js.map +0 -1
  182. package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +0 -36
  183. package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +0 -1
  184. package/dist/tools/builtin/ai/GeminiSearchAiTool.js +0 -91
  185. package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +0 -1
  186. package/dist/tools/builtin/ai/index.d.ts +0 -3
  187. package/dist/tools/builtin/ai/index.d.ts.map +0 -1
  188. package/dist/tools/builtin/ai/index.js +0 -6
  189. package/dist/tools/builtin/ai/index.js.map +0 -1
  190. package/dist/tools/builtin/index.d.ts +0 -8
  191. package/dist/tools/builtin/index.d.ts.map +0 -1
  192. package/dist/tools/builtin/index.js +0 -24
  193. package/dist/tools/builtin/index.js.map +0 -1
  194. package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +0 -35
  195. package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +0 -1
  196. package/dist/tools/builtin/nft/BaseNftMessageTool.js +0 -45
  197. package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +0 -1
  198. package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +0 -15
  199. package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +0 -1
  200. package/dist/tools/builtin/nft/NFTContractInfoTool.js +0 -19
  201. package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +0 -1
  202. package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +0 -15
  203. package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +0 -1
  204. package/dist/tools/builtin/nft/NFTMetadataTool.js +0 -20
  205. package/dist/tools/builtin/nft/NFTMetadataTool.js.map +0 -1
  206. package/dist/tools/builtin/nft/SendNftTool.d.ts +0 -14
  207. package/dist/tools/builtin/nft/SendNftTool.d.ts.map +0 -1
  208. package/dist/tools/builtin/nft/SendNftTool.js +0 -20
  209. package/dist/tools/builtin/nft/SendNftTool.js.map +0 -1
  210. package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +0 -15
  211. package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +0 -1
  212. package/dist/tools/builtin/nft/WalletNFTsTool.js +0 -20
  213. package/dist/tools/builtin/nft/WalletNFTsTool.js.map +0 -1
  214. package/dist/tools/builtin/nft/index.d.ts +0 -7
  215. package/dist/tools/builtin/nft/index.d.ts.map +0 -1
  216. package/dist/tools/builtin/nft/index.js +0 -10
  217. package/dist/tools/builtin/nft/index.js.map +0 -1
  218. package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts +0 -124
  219. package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +0 -1
  220. package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +0 -236
  221. package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +0 -1
  222. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +0 -128
  223. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +0 -1
  224. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +0 -520
  225. package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +0 -1
  226. package/dist/tools/builtin/pool/PoolByAddressTool.d.ts +0 -127
  227. package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +0 -1
  228. package/dist/tools/builtin/pool/PoolByAddressTool.js +0 -238
  229. package/dist/tools/builtin/pool/PoolByAddressTool.js.map +0 -1
  230. package/dist/tools/builtin/pool/PoolDetailTool.d.ts +0 -127
  231. package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +0 -1
  232. package/dist/tools/builtin/pool/PoolDetailTool.js +0 -273
  233. package/dist/tools/builtin/pool/PoolDetailTool.js.map +0 -1
  234. package/dist/tools/builtin/pool/PoolSearchTool.d.ts +0 -50
  235. package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +0 -1
  236. package/dist/tools/builtin/pool/PoolSearchTool.js +0 -160
  237. package/dist/tools/builtin/pool/PoolSearchTool.js.map +0 -1
  238. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +0 -124
  239. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +0 -1
  240. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +0 -382
  241. package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +0 -1
  242. package/dist/tools/builtin/pool/TopPoolsTool.d.ts +0 -68
  243. package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +0 -1
  244. package/dist/tools/builtin/pool/TopPoolsTool.js +0 -159
  245. package/dist/tools/builtin/pool/TopPoolsTool.js.map +0 -1
  246. package/dist/tools/builtin/pool/index.d.ts +0 -15
  247. package/dist/tools/builtin/pool/index.d.ts.map +0 -1
  248. package/dist/tools/builtin/pool/index.js +0 -18
  249. package/dist/tools/builtin/pool/index.js.map +0 -1
  250. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +0 -54
  251. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +0 -1
  252. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +0 -98
  253. package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +0 -1
  254. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +0 -63
  255. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +0 -1
  256. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +0 -82
  257. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +0 -1
  258. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +0 -79
  259. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +0 -1
  260. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +0 -97
  261. package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +0 -1
  262. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +0 -77
  263. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +0 -1
  264. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +0 -190
  265. package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +0 -1
  266. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +0 -107
  267. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +0 -1
  268. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +0 -92
  269. package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +0 -1
  270. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +0 -56
  271. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +0 -1
  272. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +0 -94
  273. package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +0 -1
  274. package/dist/tools/builtin/pool-subgraph/index.d.ts +0 -13
  275. package/dist/tools/builtin/pool-subgraph/index.d.ts.map +0 -1
  276. package/dist/tools/builtin/pool-subgraph/index.js +0 -18
  277. package/dist/tools/builtin/pool-subgraph/index.js.map +0 -1
  278. package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts +0 -71
  279. package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +0 -1
  280. package/dist/tools/builtin/token/TokenAnalyticsTool.js +0 -147
  281. package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +0 -1
  282. package/dist/tools/builtin/token/TokenHoldersTool.d.ts +0 -81
  283. package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +0 -1
  284. package/dist/tools/builtin/token/TokenHoldersTool.js +0 -139
  285. package/dist/tools/builtin/token/TokenHoldersTool.js.map +0 -1
  286. package/dist/tools/builtin/token/TokenInfoTool.d.ts +0 -40
  287. package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +0 -1
  288. package/dist/tools/builtin/token/TokenInfoTool.js +0 -221
  289. package/dist/tools/builtin/token/TokenInfoTool.js.map +0 -1
  290. package/dist/tools/builtin/token/TokenScoreTool.d.ts +0 -63
  291. package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +0 -1
  292. package/dist/tools/builtin/token/TokenScoreTool.js +0 -148
  293. package/dist/tools/builtin/token/TokenScoreTool.js.map +0 -1
  294. package/dist/tools/builtin/token/TopGainersTool.d.ts +0 -37
  295. package/dist/tools/builtin/token/TopGainersTool.d.ts.map +0 -1
  296. package/dist/tools/builtin/token/TopGainersTool.js +0 -100
  297. package/dist/tools/builtin/token/TopGainersTool.js.map +0 -1
  298. package/dist/tools/builtin/token/TopLosersTool.d.ts +0 -66
  299. package/dist/tools/builtin/token/TopLosersTool.d.ts.map +0 -1
  300. package/dist/tools/builtin/token/TopLosersTool.js +0 -129
  301. package/dist/tools/builtin/token/TopLosersTool.js.map +0 -1
  302. package/dist/tools/builtin/token/TrendingTokensTool.d.ts +0 -39
  303. package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +0 -1
  304. package/dist/tools/builtin/token/TrendingTokensTool.js +0 -83
  305. package/dist/tools/builtin/token/TrendingTokensTool.js.map +0 -1
  306. package/dist/tools/builtin/token/index.d.ts +0 -13
  307. package/dist/tools/builtin/token/index.d.ts.map +0 -1
  308. package/dist/tools/builtin/token/index.js +0 -16
  309. package/dist/tools/builtin/token/index.js.map +0 -1
  310. package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts +0 -70
  311. package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +0 -1
  312. package/dist/tools/builtin/wallet/TransactionByHashTool.js +0 -111
  313. package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +0 -1
  314. package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts +0 -107
  315. package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +0 -1
  316. package/dist/tools/builtin/wallet/WalletApprovalsTool.js +0 -164
  317. package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +0 -1
  318. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts +0 -61
  319. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +0 -1
  320. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +0 -100
  321. package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +0 -1
  322. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts +0 -68
  323. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +0 -1
  324. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +0 -115
  325. package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +0 -1
  326. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts +0 -50
  327. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +0 -1
  328. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +0 -80
  329. package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +0 -1
  330. package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts +0 -31
  331. package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +0 -1
  332. package/dist/tools/builtin/wallet/WalletHistoryTool.js +0 -154
  333. package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +0 -1
  334. package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts +0 -44
  335. package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts.map +0 -1
  336. package/dist/tools/builtin/wallet/WalletNetWorthTool.js +0 -122
  337. package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +0 -1
  338. package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts +0 -86
  339. package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +0 -1
  340. package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +0 -265
  341. package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +0 -1
  342. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts +0 -43
  343. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +0 -1
  344. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +0 -89
  345. package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +0 -1
  346. package/dist/tools/builtin/wallet/WalletPnlTool.d.ts +0 -43
  347. package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +0 -1
  348. package/dist/tools/builtin/wallet/WalletPnlTool.js +0 -175
  349. package/dist/tools/builtin/wallet/WalletPnlTool.js.map +0 -1
  350. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts +0 -35
  351. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +0 -1
  352. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +0 -68
  353. package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +0 -1
  354. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts +0 -109
  355. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +0 -1
  356. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +0 -354
  357. package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +0 -1
  358. package/dist/tools/builtin/wallet/index.d.ts +0 -28
  359. package/dist/tools/builtin/wallet/index.d.ts.map +0 -1
  360. package/dist/tools/builtin/wallet/index.js +0 -32
  361. package/dist/tools/builtin/wallet/index.js.map +0 -1
  362. package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +0 -25
  363. package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +0 -1
  364. package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +0 -98
  365. package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +0 -1
  366. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +0 -211
  367. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +0 -1
  368. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +0 -499
  369. package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +0 -1
  370. package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +0 -240
  371. package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +0 -1
  372. package/dist/tools/builtin/wallet-action/BuyTokenTool.js +0 -1257
  373. package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +0 -1
  374. package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +0 -41
  375. package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +0 -1
  376. package/dist/tools/builtin/wallet-action/SendNativeTool.js +0 -127
  377. package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +0 -1
  378. package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +0 -63
  379. package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +0 -1
  380. package/dist/tools/builtin/wallet-action/SendTokenTool.js +0 -294
  381. package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +0 -1
  382. package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +0 -247
  383. package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +0 -1
  384. package/dist/tools/builtin/wallet-action/SwapTokenTool.js +0 -1258
  385. package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +0 -1
  386. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +0 -20
  387. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +0 -1
  388. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +0 -36
  389. package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +0 -1
  390. package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +0 -23
  391. package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +0 -1
  392. package/dist/tools/builtin/wallet-action/WrapNativeTool.js +0 -54
  393. package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +0 -1
  394. package/dist/tools/builtin/wallet-action/amountSpec.d.ts +0 -62
  395. package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +0 -1
  396. package/dist/tools/builtin/wallet-action/amountSpec.js +0 -93
  397. package/dist/tools/builtin/wallet-action/amountSpec.js.map +0 -1
  398. package/dist/tools/builtin/wallet-action/gasReserve.d.ts +0 -42
  399. package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +0 -1
  400. package/dist/tools/builtin/wallet-action/gasReserve.js +0 -103
  401. package/dist/tools/builtin/wallet-action/gasReserve.js.map +0 -1
  402. package/dist/tools/builtin/wallet-action/index.d.ts +0 -9
  403. package/dist/tools/builtin/wallet-action/index.d.ts.map +0 -1
  404. package/dist/tools/builtin/wallet-action/index.js +0 -20
  405. package/dist/tools/builtin/wallet-action/index.js.map +0 -1
  406. package/dist/tools/chainResolver.d.ts +0 -98
  407. package/dist/tools/chainResolver.d.ts.map +0 -1
  408. package/dist/tools/chainResolver.js +0 -302
  409. package/dist/tools/chainResolver.js.map +0 -1
  410. package/dist/tools/index.d.ts +0 -4
  411. package/dist/tools/index.d.ts.map +0 -1
  412. package/dist/tools/index.js +0 -23
  413. package/dist/tools/index.js.map +0 -1
  414. package/dist/types/index.d.ts +0 -777
  415. package/dist/types/index.d.ts.map +0 -1
  416. package/dist/types/index.js +0 -6
  417. package/dist/types/index.js.map +0 -1
@@ -1,107 +0,0 @@
1
- import { BaseTool } from '../../BaseTool';
2
- import type { ToolParameter, UserContext } from '../../../types';
3
- import { type MoralisServiceConfig } from '../../../services/MoralisService';
4
- export type WalletApprovalsToolConfig = MoralisServiceConfig;
5
- /**
6
- * Tool: get-wallet-approvals
7
- *
8
- * Queries `GET /wallets/{address}/approvals` — every active ERC-20 token
9
- * approval the wallet currently has outstanding. This is the primary
10
- * security-surface tool: surfacing unlimited approvals, high USD-at-risk
11
- * approvals, and approvals to spam / unverified contracts.
12
- *
13
- * Moralis docs: https://docs.moralis.com/data-api/evm/wallet/approvals
14
- */
15
- export declare class WalletApprovalsTool extends BaseTool {
16
- name: string;
17
- description: string;
18
- category: string;
19
- parameters: ToolParameter[];
20
- private service;
21
- constructor(config?: WalletApprovalsToolConfig);
22
- protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
23
- error: string;
24
- walletAddress?: undefined;
25
- chain?: undefined;
26
- filters?: undefined;
27
- pagination?: undefined;
28
- summary?: undefined;
29
- approvals?: undefined;
30
- riskyApprovals?: undefined;
31
- } | {
32
- walletAddress: string;
33
- chain: string;
34
- filters: {
35
- limit: number;
36
- cursor: string | null;
37
- };
38
- pagination: {
39
- cursor: string | null;
40
- pageSize: number;
41
- page: number | null;
42
- hasMore: boolean;
43
- };
44
- summary: {
45
- totalApprovals: number;
46
- unlimitedApprovals: number;
47
- totalUsdAtRisk: number;
48
- riskyApprovalCount: number;
49
- };
50
- approvals: {
51
- blockNumber: string;
52
- blockTimestamp: string | null;
53
- transactionHash: string | null;
54
- value: string;
55
- valueFormatted: string | null;
56
- isUnlimited: boolean;
57
- token: {
58
- address: string;
59
- addressLabel: string | null;
60
- name: string | null;
61
- symbol: string | null;
62
- logo: string | null;
63
- possibleSpam: boolean;
64
- verifiedContract: boolean | null;
65
- currentBalance: string | null;
66
- currentBalanceFormatted: string | null;
67
- usdPrice: string | null;
68
- usdAtRisk: string | null;
69
- };
70
- spender: {
71
- address: string;
72
- label: string | null;
73
- entity: string | null;
74
- entityLogo: string | null;
75
- };
76
- }[];
77
- riskyApprovals: {
78
- blockNumber: string;
79
- blockTimestamp: string | null;
80
- transactionHash: string | null;
81
- value: string;
82
- valueFormatted: string | null;
83
- isUnlimited: boolean;
84
- token: {
85
- address: string;
86
- addressLabel: string | null;
87
- name: string | null;
88
- symbol: string | null;
89
- logo: string | null;
90
- possibleSpam: boolean;
91
- verifiedContract: boolean | null;
92
- currentBalance: string | null;
93
- currentBalanceFormatted: string | null;
94
- usdPrice: string | null;
95
- usdAtRisk: string | null;
96
- };
97
- spender: {
98
- address: string;
99
- label: string | null;
100
- entity: string | null;
101
- entityLogo: string | null;
102
- };
103
- }[];
104
- error?: undefined;
105
- }>;
106
- }
107
- //# sourceMappingURL=WalletApprovalsTool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WalletApprovalsTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletApprovalsTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAkB,KAAK,oBAAoB,EAAsB,MAAM,kCAAkC,CAAC;AAEjH,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAU7D;;;;;;;;;GASG;AACH,qBAAa,mBAAoB,SAAQ,QAAQ;IAC/C,IAAI,SAA0B;IAC9B,WAAW,SAYyC;IACpD,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CA4BzB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,yBAAyB;cAK9B,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwD7E"}
@@ -1,164 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletApprovalsTool = void 0;
4
- const BaseTool_1 = require("../../BaseTool");
5
- const chainResolver_1 = require("../../chainResolver");
6
- const MoralisService_1 = require("../../../services/MoralisService");
7
- /**
8
- * Anything above 2^255 (≈ 5.79e76) is effectively unlimited for practical
9
- * purposes. Strict-max (2^256-1) is the canonical `type(uint256).max`
10
- * allowance, but some contracts round down when decrementing — so we treat
11
- * "half of max" as the unlimited threshold.
12
- */
13
- const UNLIMITED_ALLOWANCE_THRESHOLD = BigInt(2) ** BigInt(255);
14
- /**
15
- * Tool: get-wallet-approvals
16
- *
17
- * Queries `GET /wallets/{address}/approvals` — every active ERC-20 token
18
- * approval the wallet currently has outstanding. This is the primary
19
- * security-surface tool: surfacing unlimited approvals, high USD-at-risk
20
- * approvals, and approvals to spam / unverified contracts.
21
- *
22
- * Moralis docs: https://docs.moralis.com/data-api/evm/wallet/approvals
23
- */
24
- class WalletApprovalsTool extends BaseTool_1.BaseTool {
25
- name = 'get-wallet-approvals';
26
- description = "List every active ERC-20 token approval granted by a wallet — i.e. which contracts can still spend the wallet's tokens. " +
27
- 'For each approval, returns: the token (address, name, symbol, logo, current balance, USD price, ' +
28
- 'USD at risk, possible_spam, verified_contract), the spender (address, label, entity — e.g. ' +
29
- '"Uniswap V3 Router", "Permit2"), the approved amount (value / value_formatted / isUnlimited flag), ' +
30
- 'and when the approval was granted (block number, timestamp, transaction hash). ' +
31
- 'Also returns aggregates: total approvals, unlimited-approval count, total USD at risk, ' +
32
- 'and approvals flagged as risky (spam tokens, unverified contracts, or unlimited allowance to unlabeled spenders). ' +
33
- 'Use for questions like: "What approvals do I have?", "Show my token approvals", ' +
34
- '"Am I exposed to any risky approvals?", "Which contracts can drain my wallet?", ' +
35
- '"Do I have any unlimited approvals?", "Revoke approvals / token allowances". ' +
36
- 'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea (EVM mainnets only). ' +
37
- 'Paginated — pass cursor to fetch the next page.';
38
- category = 'blockchain-data';
39
- parameters = [
40
- {
41
- name: 'address',
42
- type: 'string',
43
- description: 'EVM wallet address (0x…). If omitted, uses the connected wallet from user context.',
44
- required: false,
45
- },
46
- {
47
- name: 'chain',
48
- type: 'string',
49
- description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
50
- '"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea. ONLY set this when the user EXPLICITLY names a chain; otherwise OMIT it so the connected wallet chain is used.',
51
- required: false,
52
- },
53
- {
54
- name: 'limit',
55
- type: 'number',
56
- description: 'Page size (1-100, default 100).',
57
- required: false,
58
- default: 100,
59
- },
60
- {
61
- name: 'cursor',
62
- type: 'string',
63
- description: 'Pagination cursor from a previous response.',
64
- required: false,
65
- },
66
- ];
67
- service;
68
- constructor(config) {
69
- super();
70
- this.service = new MoralisService_1.MoralisService(config);
71
- }
72
- async run(args, userContext) {
73
- const address = args.address || userContext?.walletAddress || undefined;
74
- const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
75
- if (!address) {
76
- return { error: 'No wallet address available. Please connect a wallet or pass "address".' };
77
- }
78
- const rawLimit = typeof args.limit === 'number' ? args.limit : Number(args.limit);
79
- const limit = Number.isFinite(rawLimit) && rawLimit > 0 ? Math.min(100, Math.floor(rawLimit)) : 100;
80
- const cursor = typeof args.cursor === 'string' && args.cursor ? args.cursor : undefined;
81
- const result = await this.service.getWalletApprovals({ address, chain, limit, cursor });
82
- if (!result.success) {
83
- return { error: result.error || 'Failed to fetch wallet approvals' };
84
- }
85
- const data = result.data;
86
- const rows = data.result || [];
87
- const enriched = rows.map((a) => enrich(a));
88
- let totalUsdAtRisk = 0;
89
- let unlimitedCount = 0;
90
- const risky = [];
91
- for (const a of enriched) {
92
- if (a.isUnlimited)
93
- unlimitedCount += 1;
94
- const atRisk = parseFloat(a.token.usdAtRisk ?? '');
95
- if (Number.isFinite(atRisk))
96
- totalUsdAtRisk += atRisk;
97
- const tokenRisky = a.token.possibleSpam || a.token.verifiedContract === false;
98
- const spenderRisky = !a.spender.label && !a.spender.entity;
99
- if (tokenRisky || (a.isUnlimited && spenderRisky))
100
- risky.push(a);
101
- }
102
- return {
103
- walletAddress: address,
104
- chain: chain || 'default',
105
- filters: { limit, cursor: cursor ?? null },
106
- pagination: {
107
- cursor: data.cursor ?? null,
108
- pageSize: data.page_size ?? limit,
109
- page: data.page ?? null,
110
- hasMore: !!data.cursor,
111
- },
112
- summary: {
113
- totalApprovals: enriched.length,
114
- unlimitedApprovals: unlimitedCount,
115
- totalUsdAtRisk,
116
- riskyApprovalCount: risky.length,
117
- },
118
- approvals: enriched,
119
- riskyApprovals: risky,
120
- };
121
- }
122
- }
123
- exports.WalletApprovalsTool = WalletApprovalsTool;
124
- function enrich(a) {
125
- const isUnlimited = isUnlimitedValue(a.value);
126
- return {
127
- blockNumber: a.block_number,
128
- blockTimestamp: a.block_timestamp ?? null,
129
- transactionHash: a.transaction_hash ?? null,
130
- value: a.value,
131
- valueFormatted: a.value_formatted ?? null,
132
- isUnlimited,
133
- token: {
134
- address: a.token.address,
135
- addressLabel: a.token.address_label ?? null,
136
- name: a.token.name ?? null,
137
- symbol: a.token.symbol ?? null,
138
- logo: a.token.logo ?? null,
139
- possibleSpam: !!a.token.possible_spam,
140
- verifiedContract: a.token.verified_contract ?? null,
141
- currentBalance: a.token.current_balance ?? null,
142
- currentBalanceFormatted: a.token.current_balance_formatted ?? null,
143
- usdPrice: a.token.usd_price ?? null,
144
- usdAtRisk: a.token.usd_at_risk ?? null,
145
- },
146
- spender: {
147
- address: a.spender.address,
148
- label: a.spender.address_label ?? null,
149
- entity: a.spender.entity ?? null,
150
- entityLogo: a.spender.entity_logo ?? null,
151
- },
152
- };
153
- }
154
- function isUnlimitedValue(raw) {
155
- if (!raw)
156
- return false;
157
- try {
158
- return BigInt(raw) >= UNLIMITED_ALLOWANCE_THRESHOLD;
159
- }
160
- catch {
161
- return false;
162
- }
163
- }
164
- //# sourceMappingURL=WalletApprovalsTool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WalletApprovalsTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletApprovalsTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAAiH;AAIjH;;;;;GAKG;AACH,MAAM,6BAA6B,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AAE/D;;;;;;;;;GASG;AACH,MAAa,mBAAoB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AS,gBAAgB,CAAC,GAA8B;IACtD,IAAI,CAAC,GAAG;QAAE,OAAO,KAAK,CAAC;IACvB,IAAI,CAAC;QACH,OAAO,MAAM,CAAC,GAAG,CAAC,IAAI,6BAA6B,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
@@ -1,61 +0,0 @@
1
- import { BaseTool } from '../../BaseTool';
2
- import type { ToolParameter, UserContext } from '../../../types';
3
- import { type MoralisServiceConfig } from '../../../services/MoralisService';
4
- export type WalletDefiPositionsToolConfig = MoralisServiceConfig;
5
- /**
6
- * Tool: get-wallet-defi-positions
7
- *
8
- * Queries `GET /wallets/{address}/defi/positions` — every DeFi position a
9
- * wallet holds across all supported protocols, each enriched with tokens,
10
- * balances, unclaimed rewards, and position-specific details.
11
- *
12
- * Moralis docs: https://docs.moralis.com/data-api/evm/wallet/wallet-positions
13
- */
14
- export declare class WalletDefiPositionsTool extends BaseTool {
15
- name: string;
16
- description: string;
17
- category: string;
18
- parameters: ToolParameter[];
19
- private service;
20
- constructor(config?: WalletDefiPositionsToolConfig);
21
- protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
22
- error: string;
23
- walletAddress?: undefined;
24
- chain?: undefined;
25
- positionCount?: undefined;
26
- positions?: undefined;
27
- } | {
28
- walletAddress: string;
29
- chain: string;
30
- positionCount: number;
31
- positions: {
32
- protocolName: string;
33
- protocolId: string;
34
- protocolUrl: string;
35
- protocolLogo: string;
36
- accountHealthFactor: number | null;
37
- position: {
38
- label: string;
39
- address: string | undefined;
40
- balanceUsd: number;
41
- totalUnclaimedUsdValue: number;
42
- tokens: {
43
- tokenType: string;
44
- name: string;
45
- symbol: string;
46
- contractAddress: string;
47
- decimals: number;
48
- logo: string | undefined;
49
- thumbnail: string | undefined;
50
- balance: string;
51
- balanceFormatted: string;
52
- usdPrice: number | undefined;
53
- usdValue: number | undefined;
54
- }[];
55
- details: import("../../../services/MoralisService").DefiPositionDetails | null;
56
- };
57
- }[];
58
- error?: undefined;
59
- }>;
60
- }
61
- //# sourceMappingURL=WalletDefiPositionsTool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WalletDefiPositionsTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletDefiPositionsTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAGL,KAAK,oBAAoB,EAE1B,MAAM,kCAAkC,CAAC;AAE1C,MAAM,MAAM,6BAA6B,GAAG,oBAAoB,CAAC;AAEjE;;;;;;;;GAQG;AACH,qBAAa,uBAAwB,SAAQ,QAAQ;IACnD,IAAI,SAA+B;IACnC,WAAW,SASuE;IAClF,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CAezB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,6BAA6B;cAKlC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuB7E"}
@@ -1,100 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletDefiPositionsTool = void 0;
4
- const BaseTool_1 = require("../../BaseTool");
5
- const chainResolver_1 = require("../../chainResolver");
6
- const MoralisService_1 = require("../../../services/MoralisService");
7
- /**
8
- * Tool: get-wallet-defi-positions
9
- *
10
- * Queries `GET /wallets/{address}/defi/positions` — every DeFi position a
11
- * wallet holds across all supported protocols, each enriched with tokens,
12
- * balances, unclaimed rewards, and position-specific details.
13
- *
14
- * Moralis docs: https://docs.moralis.com/data-api/evm/wallet/wallet-positions
15
- */
16
- class WalletDefiPositionsTool extends BaseTool_1.BaseTool {
17
- name = 'get-wallet-defi-positions';
18
- description = 'Get every DeFi position a wallet holds across all supported protocols, with full detail: ' +
19
- 'protocol identity, position label (e.g. "Liquidity Provision", "Supply", "Borrow", "Staking"), ' +
20
- 'tokens involved (with balances and USD values), balance_usd, total_unclaimed_usd_value, and ' +
21
- 'position_details (fee tier, liquidity, APY, price range, health factor, etc.). ' +
22
- 'Use for questions like: "Show my DeFi positions", "What LP positions do I have?", ' +
23
- '"What am I staking?", "Do I have any borrows?", "List all my DeFi holdings with details". ' +
24
- 'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea. ' +
25
- 'Do NOT use for: aggregate totals → get-wallet-defi-summary; ' +
26
- 'positions filtered to a single protocol → get-wallet-defi-protocol-positions.';
27
- category = 'blockchain-data';
28
- parameters = [
29
- {
30
- name: 'address',
31
- type: 'string',
32
- description: 'EVM wallet address (0x…). If omitted, uses the connected wallet from user context.',
33
- required: false,
34
- },
35
- {
36
- name: 'chain',
37
- type: 'string',
38
- description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
39
- '"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea. ONLY set this when the user EXPLICITLY names a chain; otherwise OMIT it so the connected wallet chain is used.',
40
- required: false,
41
- },
42
- ];
43
- service;
44
- constructor(config) {
45
- super();
46
- this.service = new MoralisService_1.MoralisService(config);
47
- }
48
- async run(args, userContext) {
49
- const address = args.address || userContext?.walletAddress || undefined;
50
- const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
51
- if (!address) {
52
- return { error: 'No wallet address available. Please connect a wallet or pass "address".' };
53
- }
54
- const result = await this.service.getWalletDefiPositions({ address, chain });
55
- if (!result.success) {
56
- return { error: result.error || 'Failed to fetch wallet DeFi positions' };
57
- }
58
- const rows = result.data || [];
59
- return {
60
- walletAddress: address,
61
- chain: chain || 'default',
62
- positionCount: rows.length,
63
- positions: rows.map((row) => mapRow(row)),
64
- };
65
- }
66
- }
67
- exports.WalletDefiPositionsTool = WalletDefiPositionsTool;
68
- function mapRow(row) {
69
- return {
70
- protocolName: row.protocol_name,
71
- protocolId: row.protocol_id,
72
- protocolUrl: row.protocol_url,
73
- protocolLogo: row.protocol_logo,
74
- accountHealthFactor: row.account_data?.health_factor ?? null,
75
- position: mapPosition(row.position),
76
- };
77
- }
78
- function mapPosition(position) {
79
- return {
80
- label: position.label,
81
- address: position.address,
82
- balanceUsd: position.balance_usd,
83
- totalUnclaimedUsdValue: position.total_unclaimed_usd_value,
84
- tokens: (position.tokens || []).map((t) => ({
85
- tokenType: t.token_type,
86
- name: t.name,
87
- symbol: t.symbol,
88
- contractAddress: t.contract_address,
89
- decimals: t.decimals,
90
- logo: t.logo,
91
- thumbnail: t.thumbnail,
92
- balance: t.balance,
93
- balanceFormatted: t.balance_formatted,
94
- usdPrice: t.usd_price,
95
- usdValue: t.usd_value,
96
- })),
97
- details: position.position_details ?? null,
98
- };
99
- }
100
- //# sourceMappingURL=WalletDefiPositionsTool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WalletDefiPositionsTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletDefiPositionsTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAK0C;AAI1C;;;;;;;;GAQG;AACH,MAAa,uBAAwB,SAAQ,mBAAQ;IACnD,IAAI,GAAG,2BAA2B,CAAC;IACnC,WAAW,GACT,2FAA2F;QAC3F,iGAAiG;QACjG,8FAA8F;QAC9F,iFAAiF;QACjF,oFAAoF;QACpF,4FAA4F;QAC5F,gFAAgF;QAChF,8DAA8D;QAC9D,+EAA+E,CAAC;IAClF,QAAQ,GAAG,iBAAiB,CAAC;IAC7B,UAAU,GAAoB;QAC5B;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oFAAoF;YACjG,QAAQ,EAAE,KAAK;SAChB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AC,aAAa;QAC/B,UAAU,EAAE,GAAG,CAAC,WAAW;QAC3B,WAAW,EAAE,GAAG,CAAC,YAAY;QAC7B,YAAY,EAAE,GAAG,CAAC,aAAa;QAC/B,mBAAmB,EAAE,GAAG,CAAC,YAAY,EAAE,aAAa,IAAI,IAAI;QAC5D,QAAQ,EAAE,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC;KACpC,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,QAAsB;IACzC,OAAO;QACL,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,UAAU,EAAE,QAAQ,CAAC,WAAW;QAChC,sBAAsB,EAAE,QAAQ,CAAC,yBAAyB;QAC1D,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1C,SAAS,EAAE,CAAC,CAAC,UAAU;YACvB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,eAAe,EAAE,CAAC,CAAC,gBAAgB;YACnC,QAAQ,EAAE,CAAC,CAAC,QAAQ;YACpB,IAAI,EAAE,CAAC,CAAC,IAAI;YACZ,SAAS,EAAE,CAAC,CAAC,SAAS;YACtB,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,gBAAgB,EAAE,CAAC,CAAC,iBAAiB;YACrC,QAAQ,EAAE,CAAC,CAAC,SAAS;YACrB,QAAQ,EAAE,CAAC,CAAC,SAAS;SACtB,CAAC,CAAC;QACH,OAAO,EAAE,QAAQ,CAAC,gBAAgB,IAAI,IAAI;KAC3C,CAAC;AACJ,CAAC"}
@@ -1,68 +0,0 @@
1
- import { BaseTool } from '../../BaseTool';
2
- import type { ToolParameter, UserContext } from '../../../types';
3
- import { type MoralisServiceConfig } from '../../../services/MoralisService';
4
- export type WalletDefiProtocolPositionsToolConfig = MoralisServiceConfig;
5
- /**
6
- * Tool: get-wallet-defi-protocol-positions
7
- *
8
- * Queries `GET /wallets/{address}/defi/{protocol}/positions` — all positions
9
- * a wallet holds inside a single, named DeFi protocol, with totals and full
10
- * per-position details.
11
- *
12
- * Moralis docs: https://docs.moralis.com/data-api/evm/wallet/detailed-positions
13
- */
14
- export declare class WalletDefiProtocolPositionsTool extends BaseTool {
15
- name: string;
16
- description: string;
17
- category: string;
18
- parameters: ToolParameter[];
19
- private service;
20
- constructor(config?: WalletDefiProtocolPositionsToolConfig);
21
- protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
22
- error: string;
23
- walletAddress?: undefined;
24
- chain?: undefined;
25
- protocolName?: undefined;
26
- protocolId?: undefined;
27
- protocolUrl?: undefined;
28
- protocolLogo?: undefined;
29
- totalUsdValue?: undefined;
30
- totalUnclaimedUsdValue?: undefined;
31
- accountHealthFactor?: undefined;
32
- positionCount?: undefined;
33
- positions?: undefined;
34
- } | {
35
- walletAddress: string;
36
- chain: string;
37
- protocolName: string;
38
- protocolId: string;
39
- protocolUrl: string;
40
- protocolLogo: string;
41
- totalUsdValue: number;
42
- totalUnclaimedUsdValue: number | null;
43
- accountHealthFactor: number | null;
44
- positionCount: number;
45
- positions: {
46
- label: string;
47
- address: string | undefined;
48
- balanceUsd: number;
49
- totalUnclaimedUsdValue: number;
50
- tokens: {
51
- tokenType: string;
52
- name: string;
53
- symbol: string;
54
- contractAddress: string;
55
- decimals: number;
56
- logo: string | undefined;
57
- thumbnail: string | undefined;
58
- balance: string;
59
- balanceFormatted: string;
60
- usdPrice: number | undefined;
61
- usdValue: number | undefined;
62
- }[];
63
- details: import("../../../services/MoralisService").DefiPositionDetails | null;
64
- }[];
65
- error?: undefined;
66
- }>;
67
- }
68
- //# sourceMappingURL=WalletDefiProtocolPositionsTool.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WalletDefiProtocolPositionsTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletDefiProtocolPositionsTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAqC,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAEhH,MAAM,MAAM,qCAAqC,GAAG,oBAAoB,CAAC;AAEzE;;;;;;;;GAQG;AACH,qBAAa,+BAAgC,SAAQ,QAAQ;IAC3D,IAAI,SAAwC;IAC5C,WAAW,SASiG;IAC5G,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CAuBzB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,qCAAqC;cAK1C,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyC7E"}
@@ -1,115 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.WalletDefiProtocolPositionsTool = void 0;
4
- const BaseTool_1 = require("../../BaseTool");
5
- const chainResolver_1 = require("../../chainResolver");
6
- const MoralisService_1 = require("../../../services/MoralisService");
7
- /**
8
- * Tool: get-wallet-defi-protocol-positions
9
- *
10
- * Queries `GET /wallets/{address}/defi/{protocol}/positions` — all positions
11
- * a wallet holds inside a single, named DeFi protocol, with totals and full
12
- * per-position details.
13
- *
14
- * Moralis docs: https://docs.moralis.com/data-api/evm/wallet/detailed-positions
15
- */
16
- class WalletDefiProtocolPositionsTool extends BaseTool_1.BaseTool {
17
- name = 'get-wallet-defi-protocol-positions';
18
- description = 'Get every position a wallet holds inside a specific DeFi protocol, with full detail. ' +
19
- 'Returns the protocol identity, totals (total_usd_value, total_unclaimed_usd_value), ' +
20
- 'and an array of positions (label, tokens, balance_usd, unclaimed, fee tier, APY, health factor, etc.). ' +
21
- 'Use when the user names a specific protocol, e.g. "my Uniswap v3 positions", "what do I have on Aave v3", ' +
22
- '"show my Lido staking", "my Curve pools", "Pendle positions". ' +
23
- 'The "protocol" argument is the Moralis protocol id (kebab-case), e.g. uniswap-v2, uniswap-v3, ' +
24
- 'pancakeswap-v2, pancakeswap-v3, quickswap-v2, quickswap-v3, sushiswap-v2, aave-v2, aave-v3, aave-lido, fraxswap-v1, fraxswap-v2, lido, makerdao, eigenlayer, pendle, etherfi, rocketpool, sparkfi, takara-lend, neverland, kintsu. ' +
25
- 'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea (EVM mainnets only). ' +
26
- 'Do NOT use for: cross-protocol view → get-wallet-defi-positions; totals only → get-wallet-defi-summary.';
27
- category = 'blockchain-data';
28
- parameters = [
29
- {
30
- name: 'address',
31
- type: 'string',
32
- description: 'EVM wallet address (0x…). If omitted, uses the connected wallet from user context.',
33
- required: false,
34
- },
35
- {
36
- name: 'protocol',
37
- type: 'string',
38
- description: 'Moralis protocol identifier in kebab-case. Examples: "uniswap-v2", "uniswap-v3", "pancakeswap-v2", "pancakeswap-v3", "quickswap-v2", "quickswap-v3", "sushiswap-v2", "aave-v2", "aave-v3", "aave-lido", "fraxswap-v1", "fraxswap-v2", "lido", "makerdao", "eigenlayer", "pendle", "etherfi", "rocketpool", "sparkfi", "takara-lend", "neverland", "kintsu"' +
39
- 'Use get-wallet-defi-summary to discover which protocols a wallet uses.',
40
- required: true,
41
- },
42
- {
43
- name: 'chain',
44
- type: 'string',
45
- description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
46
- '"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea. ONLY set this when the user EXPLICITLY names a chain; otherwise OMIT it so the connected wallet chain is used.',
47
- required: false,
48
- },
49
- ];
50
- service;
51
- constructor(config) {
52
- super();
53
- this.service = new MoralisService_1.MoralisService(config);
54
- }
55
- async run(args, userContext) {
56
- const address = args.address || userContext?.walletAddress || undefined;
57
- const protocol = args.protocol?.trim();
58
- const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
59
- if (!address) {
60
- return { error: 'No wallet address available. Please connect a wallet or pass "address".' };
61
- }
62
- if (!protocol) {
63
- return { error: 'Protocol identifier is required (e.g. "uniswap-v3", "aave-v3").' };
64
- }
65
- const result = await this.service.getWalletDefiProtocolPositions({
66
- address,
67
- protocol,
68
- chain,
69
- });
70
- if (!result.success) {
71
- return { error: result.error || 'Failed to fetch wallet DeFi protocol positions' };
72
- }
73
- const data = result.data;
74
- if (!data) {
75
- return { error: 'No data returned for this protocol' };
76
- }
77
- return {
78
- walletAddress: address,
79
- chain: chain || 'default',
80
- protocolName: data.protocol_name,
81
- protocolId: data.protocol_id,
82
- protocolUrl: data.protocol_url,
83
- protocolLogo: data.protocol_logo,
84
- totalUsdValue: data.total_usd_value,
85
- totalUnclaimedUsdValue: data.total_unclaimed_usd_value,
86
- accountHealthFactor: data.account_data?.health_factor ?? null,
87
- positionCount: (data.positions || []).length,
88
- positions: (data.positions || []).map(mapPosition),
89
- };
90
- }
91
- }
92
- exports.WalletDefiProtocolPositionsTool = WalletDefiProtocolPositionsTool;
93
- function mapPosition(position) {
94
- return {
95
- label: position.label,
96
- address: position.address,
97
- balanceUsd: position.balance_usd,
98
- totalUnclaimedUsdValue: position.total_unclaimed_usd_value,
99
- tokens: (position.tokens || []).map((t) => ({
100
- tokenType: t.token_type,
101
- name: t.name,
102
- symbol: t.symbol,
103
- contractAddress: t.contract_address,
104
- decimals: t.decimals,
105
- logo: t.logo,
106
- thumbnail: t.thumbnail,
107
- balance: t.balance,
108
- balanceFormatted: t.balance_formatted,
109
- usdPrice: t.usd_price,
110
- usdValue: t.usd_value,
111
- })),
112
- details: position.position_details ?? null,
113
- };
114
- }
115
- //# sourceMappingURL=WalletDefiProtocolPositionsTool.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WalletDefiProtocolPositionsTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletDefiProtocolPositionsTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAAgH;AAIhH;;;;;;;;GAQG;AACH,MAAa,+BAAgC,SAAQ,mBAAQ;IAC3D,IAAI,GAAG,oCAAoC,CAAC;IAC5C,WAAW,GACT,uFAAuF;QACvF,sFAAsF;QACtF,yGAAyG;QACzG,4GAA4G;QAC5G,gEAAgE;QAChE,gGAAgG;QAChG,qOAAqO;QACrO,oGAAoG;QACpG,yGAAyG,CAAC;IAC5G,QAAQ,GAAG,iBAAiB,CAAC;IAC7B,UAAU,GAAoB;QAC5B;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oFAAoF;YACjG,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,UAAU;YAChB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,6VAA6V;gBAC7V,wEAAwE;YAC1E,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2FAA2F;gBAC3F,uKAAuK;YACzK,QAAQ,EAAE,KAAK;SAChB;KACF,CAAC;IAEM,OAAO,CAAiB;IAEhC,YAAY,MAA8C;QACxD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,+BAAc,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAES,KAAK,CAAC,GAAG,CAAC,IAA6B,EAAE,WAAyB;QAC1E,MAAM,OAAO,GAAI,IAAI,CAAC,OAAkB,IAAI,WAAW,EAAE,aAAa,IAAI,SAAS,CAAC;QACpF,MAAM,QAAQ,GAAI,IAAI,CAAC,QAAmB,EAAE,IAAI,EAAE,CAAC;QACnD,MAAM,KAAK,GAAG,IAAA,4BAAY,EAAC,IAAI,CAAC,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