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.
- package/dist/index.d.ts +6692 -27
- package/dist/index.js +877 -70
- package/package.json +6 -4
- package/dist/agent/AgentCore.d.ts +0 -256
- package/dist/agent/AgentCore.d.ts.map +0 -1
- package/dist/agent/AgentCore.js +0 -1093
- package/dist/agent/AgentCore.js.map +0 -1
- package/dist/agent/QueryRewriter.d.ts +0 -84
- package/dist/agent/QueryRewriter.d.ts.map +0 -1
- package/dist/agent/QueryRewriter.js +0 -306
- package/dist/agent/QueryRewriter.js.map +0 -1
- package/dist/agent/Router.d.ts +0 -33
- package/dist/agent/Router.d.ts.map +0 -1
- package/dist/agent/Router.js +0 -229
- package/dist/agent/Router.js.map +0 -1
- package/dist/agent/Subagent.d.ts +0 -80
- package/dist/agent/Subagent.d.ts.map +0 -1
- package/dist/agent/Subagent.js +0 -272
- package/dist/agent/Subagent.js.map +0 -1
- package/dist/agent/Synthesizer.d.ts +0 -11
- package/dist/agent/Synthesizer.d.ts.map +0 -1
- package/dist/agent/Synthesizer.js +0 -86
- package/dist/agent/Synthesizer.js.map +0 -1
- package/dist/agent/chatGraph.d.ts +0 -364
- package/dist/agent/chatGraph.d.ts.map +0 -1
- package/dist/agent/chatGraph.js +0 -184
- package/dist/agent/chatGraph.js.map +0 -1
- package/dist/agent/index.d.ts +0 -10
- package/dist/agent/index.d.ts.map +0 -1
- package/dist/agent/index.js +0 -24
- package/dist/agent/index.js.map +0 -1
- package/dist/agent/subagents/AiAgent.d.ts +0 -6
- package/dist/agent/subagents/AiAgent.d.ts.map +0 -1
- package/dist/agent/subagents/AiAgent.js +0 -52
- package/dist/agent/subagents/AiAgent.js.map +0 -1
- package/dist/agent/subagents/NftAgent.d.ts +0 -6
- package/dist/agent/subagents/NftAgent.d.ts.map +0 -1
- package/dist/agent/subagents/NftAgent.js +0 -79
- package/dist/agent/subagents/NftAgent.js.map +0 -1
- package/dist/agent/subagents/PoolAgent.d.ts +0 -6
- package/dist/agent/subagents/PoolAgent.d.ts.map +0 -1
- package/dist/agent/subagents/PoolAgent.js +0 -184
- package/dist/agent/subagents/PoolAgent.js.map +0 -1
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts +0 -6
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +0 -1
- package/dist/agent/subagents/PoolSubgraphAgent.js +0 -117
- package/dist/agent/subagents/PoolSubgraphAgent.js.map +0 -1
- package/dist/agent/subagents/TokenAgent.d.ts +0 -6
- package/dist/agent/subagents/TokenAgent.d.ts.map +0 -1
- package/dist/agent/subagents/TokenAgent.js +0 -76
- package/dist/agent/subagents/TokenAgent.js.map +0 -1
- package/dist/agent/subagents/WalletActionAgent.d.ts +0 -6
- package/dist/agent/subagents/WalletActionAgent.d.ts.map +0 -1
- package/dist/agent/subagents/WalletActionAgent.js +0 -55
- package/dist/agent/subagents/WalletActionAgent.js.map +0 -1
- package/dist/agent/subagents/WalletAgent.d.ts +0 -6
- package/dist/agent/subagents/WalletAgent.d.ts.map +0 -1
- package/dist/agent/subagents/WalletAgent.js +0 -93
- package/dist/agent/subagents/WalletAgent.js.map +0 -1
- package/dist/agent/subagents/index.d.ts +0 -34
- package/dist/agent/subagents/index.d.ts.map +0 -1
- package/dist/agent/subagents/index.js +0 -69
- package/dist/agent/subagents/index.js.map +0 -1
- package/dist/constants/abi.d.ts +0 -551
- package/dist/constants/abi.d.ts.map +0 -1
- package/dist/constants/abi.js +0 -690
- package/dist/constants/abi.js.map +0 -1
- package/dist/functions/pool.d.ts +0 -25
- package/dist/functions/pool.d.ts.map +0 -1
- package/dist/functions/pool.js +0 -151
- package/dist/functions/pool.js.map +0 -1
- package/dist/functions/web3.d.ts +0 -31
- package/dist/functions/web3.d.ts.map +0 -1
- package/dist/functions/web3.js +0 -232
- package/dist/functions/web3.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/llm/GeminiProvider.d.ts +0 -16
- package/dist/llm/GeminiProvider.d.ts.map +0 -1
- package/dist/llm/GeminiProvider.js +0 -329
- package/dist/llm/GeminiProvider.js.map +0 -1
- package/dist/llm/index.d.ts +0 -2
- package/dist/llm/index.d.ts.map +0 -1
- package/dist/llm/index.js +0 -6
- package/dist/llm/index.js.map +0 -1
- package/dist/memory/ChatHistory.d.ts +0 -83
- package/dist/memory/ChatHistory.d.ts.map +0 -1
- package/dist/memory/ChatHistory.js +0 -143
- package/dist/memory/ChatHistory.js.map +0 -1
- package/dist/memory/KnowledgeBase.d.ts +0 -38
- package/dist/memory/KnowledgeBase.d.ts.map +0 -1
- package/dist/memory/KnowledgeBase.js +0 -139
- package/dist/memory/KnowledgeBase.js.map +0 -1
- package/dist/memory/Summarizer.d.ts +0 -12
- package/dist/memory/Summarizer.d.ts.map +0 -1
- package/dist/memory/Summarizer.js +0 -39
- package/dist/memory/Summarizer.js.map +0 -1
- package/dist/memory/UpstashKnowledgeBase.d.ts +0 -124
- package/dist/memory/UpstashKnowledgeBase.d.ts.map +0 -1
- package/dist/memory/UpstashKnowledgeBase.js +0 -152
- package/dist/memory/UpstashKnowledgeBase.js.map +0 -1
- package/dist/memory/historyUtils.d.ts +0 -58
- package/dist/memory/historyUtils.d.ts.map +0 -1
- package/dist/memory/historyUtils.js +0 -190
- package/dist/memory/historyUtils.js.map +0 -1
- package/dist/memory/index.d.ts +0 -7
- package/dist/memory/index.d.ts.map +0 -1
- package/dist/memory/index.js +0 -12
- package/dist/memory/index.js.map +0 -1
- package/dist/memory/ingestKnowledgeBase.d.ts +0 -17
- package/dist/memory/ingestKnowledgeBase.d.ts.map +0 -1
- package/dist/memory/ingestKnowledgeBase.js +0 -35
- package/dist/memory/ingestKnowledgeBase.js.map +0 -1
- package/dist/services/MoralisService.d.ts +0 -1328
- package/dist/services/MoralisService.d.ts.map +0 -1
- package/dist/services/MoralisService.js +0 -1239
- package/dist/services/MoralisService.js.map +0 -1
- package/dist/services/PantographService.d.ts +0 -98
- package/dist/services/PantographService.d.ts.map +0 -1
- package/dist/services/PantographService.js +0 -451
- package/dist/services/PantographService.js.map +0 -1
- package/dist/services/PoolService.d.ts +0 -238
- package/dist/services/PoolService.d.ts.map +0 -1
- package/dist/services/PoolService.js +0 -485
- package/dist/services/PoolService.js.map +0 -1
- package/dist/services/UniswapService.d.ts +0 -289
- package/dist/services/UniswapService.d.ts.map +0 -1
- package/dist/services/UniswapService.js +0 -585
- package/dist/services/UniswapService.js.map +0 -1
- package/dist/services/UniswapSubgraphService.d.ts +0 -144
- package/dist/services/UniswapSubgraphService.d.ts.map +0 -1
- package/dist/services/UniswapSubgraphService.js +0 -606
- package/dist/services/UniswapSubgraphService.js.map +0 -1
- package/dist/services/rpc.d.ts +0 -35
- package/dist/services/rpc.d.ts.map +0 -1
- package/dist/services/rpc.js +0 -110
- package/dist/services/rpc.js.map +0 -1
- package/dist/services/swap/BaseSwapService.d.ts +0 -17
- package/dist/services/swap/BaseSwapService.d.ts.map +0 -1
- package/dist/services/swap/BaseSwapService.js +0 -19
- package/dist/services/swap/BaseSwapService.js.map +0 -1
- package/dist/services/swap/DebridgeAdapter.d.ts +0 -37
- package/dist/services/swap/DebridgeAdapter.d.ts.map +0 -1
- package/dist/services/swap/DebridgeAdapter.js +0 -243
- package/dist/services/swap/DebridgeAdapter.js.map +0 -1
- package/dist/services/swap/RelayAdapter.d.ts +0 -19
- package/dist/services/swap/RelayAdapter.d.ts.map +0 -1
- package/dist/services/swap/RelayAdapter.js +0 -189
- package/dist/services/swap/RelayAdapter.js.map +0 -1
- package/dist/services/swap/SwapServiceFactory.d.ts +0 -25
- package/dist/services/swap/SwapServiceFactory.d.ts.map +0 -1
- package/dist/services/swap/SwapServiceFactory.js +0 -79
- package/dist/services/swap/SwapServiceFactory.js.map +0 -1
- package/dist/services/swap/addresses.d.ts +0 -3
- package/dist/services/swap/addresses.d.ts.map +0 -1
- package/dist/services/swap/addresses.js +0 -68
- package/dist/services/swap/addresses.js.map +0 -1
- package/dist/services/swap/affiliate.d.ts +0 -17
- package/dist/services/swap/affiliate.d.ts.map +0 -1
- package/dist/services/swap/affiliate.js +0 -126
- package/dist/services/swap/affiliate.js.map +0 -1
- package/dist/services/swap/config.d.ts +0 -9
- package/dist/services/swap/config.d.ts.map +0 -1
- package/dist/services/swap/config.js +0 -19
- package/dist/services/swap/config.js.map +0 -1
- package/dist/services/swap/index.d.ts +0 -10
- package/dist/services/swap/index.d.ts.map +0 -1
- package/dist/services/swap/index.js +0 -22
- package/dist/services/swap/index.js.map +0 -1
- package/dist/services/swap/types.d.ts +0 -89
- package/dist/services/swap/types.d.ts.map +0 -1
- package/dist/services/swap/types.js +0 -6
- package/dist/services/swap/types.js.map +0 -1
- package/dist/tools/BaseTool.d.ts +0 -15
- package/dist/tools/BaseTool.d.ts.map +0 -1
- package/dist/tools/BaseTool.js +0 -35
- package/dist/tools/BaseTool.js.map +0 -1
- package/dist/tools/ToolRegistry.d.ts +0 -27
- package/dist/tools/ToolRegistry.d.ts.map +0 -1
- package/dist/tools/ToolRegistry.js +0 -80
- package/dist/tools/ToolRegistry.js.map +0 -1
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +0 -36
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +0 -1
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js +0 -91
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +0 -1
- package/dist/tools/builtin/ai/index.d.ts +0 -3
- package/dist/tools/builtin/ai/index.d.ts.map +0 -1
- package/dist/tools/builtin/ai/index.js +0 -6
- package/dist/tools/builtin/ai/index.js.map +0 -1
- package/dist/tools/builtin/index.d.ts +0 -8
- package/dist/tools/builtin/index.d.ts.map +0 -1
- package/dist/tools/builtin/index.js +0 -24
- package/dist/tools/builtin/index.js.map +0 -1
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +0 -35
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/BaseNftMessageTool.js +0 -45
- package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +0 -1
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +0 -15
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/NFTContractInfoTool.js +0 -19
- package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +0 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +0 -15
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.js +0 -20
- package/dist/tools/builtin/nft/NFTMetadataTool.js.map +0 -1
- package/dist/tools/builtin/nft/SendNftTool.d.ts +0 -14
- package/dist/tools/builtin/nft/SendNftTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/SendNftTool.js +0 -20
- package/dist/tools/builtin/nft/SendNftTool.js.map +0 -1
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +0 -15
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +0 -1
- package/dist/tools/builtin/nft/WalletNFTsTool.js +0 -20
- package/dist/tools/builtin/nft/WalletNFTsTool.js.map +0 -1
- package/dist/tools/builtin/nft/index.d.ts +0 -7
- package/dist/tools/builtin/nft/index.d.ts.map +0 -1
- package/dist/tools/builtin/nft/index.js +0 -10
- package/dist/tools/builtin/nft/index.js.map +0 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts +0 -124
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +0 -236
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +0 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +0 -128
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +0 -520
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +0 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.d.ts +0 -127
- package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.js +0 -238
- package/dist/tools/builtin/pool/PoolByAddressTool.js.map +0 -1
- package/dist/tools/builtin/pool/PoolDetailTool.d.ts +0 -127
- package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PoolDetailTool.js +0 -273
- package/dist/tools/builtin/pool/PoolDetailTool.js.map +0 -1
- package/dist/tools/builtin/pool/PoolSearchTool.d.ts +0 -50
- package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PoolSearchTool.js +0 -160
- package/dist/tools/builtin/pool/PoolSearchTool.js.map +0 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +0 -124
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +0 -382
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +0 -1
- package/dist/tools/builtin/pool/TopPoolsTool.d.ts +0 -68
- package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool/TopPoolsTool.js +0 -159
- package/dist/tools/builtin/pool/TopPoolsTool.js.map +0 -1
- package/dist/tools/builtin/pool/index.d.ts +0 -15
- package/dist/tools/builtin/pool/index.d.ts.map +0 -1
- package/dist/tools/builtin/pool/index.js +0 -18
- package/dist/tools/builtin/pool/index.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +0 -54
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +0 -98
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +0 -63
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +0 -82
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +0 -79
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +0 -97
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +0 -77
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +0 -190
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +0 -107
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +0 -92
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +0 -56
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +0 -94
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +0 -1
- package/dist/tools/builtin/pool-subgraph/index.d.ts +0 -13
- package/dist/tools/builtin/pool-subgraph/index.d.ts.map +0 -1
- package/dist/tools/builtin/pool-subgraph/index.js +0 -18
- package/dist/tools/builtin/pool-subgraph/index.js.map +0 -1
- package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts +0 -71
- package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenAnalyticsTool.js +0 -147
- package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +0 -1
- package/dist/tools/builtin/token/TokenHoldersTool.d.ts +0 -81
- package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenHoldersTool.js +0 -139
- package/dist/tools/builtin/token/TokenHoldersTool.js.map +0 -1
- package/dist/tools/builtin/token/TokenInfoTool.d.ts +0 -40
- package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenInfoTool.js +0 -221
- package/dist/tools/builtin/token/TokenInfoTool.js.map +0 -1
- package/dist/tools/builtin/token/TokenScoreTool.d.ts +0 -63
- package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TokenScoreTool.js +0 -148
- package/dist/tools/builtin/token/TokenScoreTool.js.map +0 -1
- package/dist/tools/builtin/token/TopGainersTool.d.ts +0 -37
- package/dist/tools/builtin/token/TopGainersTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TopGainersTool.js +0 -100
- package/dist/tools/builtin/token/TopGainersTool.js.map +0 -1
- package/dist/tools/builtin/token/TopLosersTool.d.ts +0 -66
- package/dist/tools/builtin/token/TopLosersTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TopLosersTool.js +0 -129
- package/dist/tools/builtin/token/TopLosersTool.js.map +0 -1
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts +0 -39
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +0 -1
- package/dist/tools/builtin/token/TrendingTokensTool.js +0 -83
- package/dist/tools/builtin/token/TrendingTokensTool.js.map +0 -1
- package/dist/tools/builtin/token/index.d.ts +0 -13
- package/dist/tools/builtin/token/index.d.ts.map +0 -1
- package/dist/tools/builtin/token/index.js +0 -16
- package/dist/tools/builtin/token/index.js.map +0 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts +0 -70
- package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.js +0 -111
- package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts +0 -107
- package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js +0 -164
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts +0 -61
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +0 -100
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts +0 -68
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +0 -115
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts +0 -50
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +0 -80
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts +0 -31
- package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.js +0 -154
- package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts +0 -44
- package/dist/tools/builtin/wallet/WalletNetWorthTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js +0 -122
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts +0 -86
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +0 -265
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts +0 -43
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +0 -89
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.d.ts +0 -43
- package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.js +0 -175
- package/dist/tools/builtin/wallet/WalletPnlTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts +0 -35
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +0 -68
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts +0 -109
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +0 -354
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +0 -1
- package/dist/tools/builtin/wallet/index.d.ts +0 -28
- package/dist/tools/builtin/wallet/index.d.ts.map +0 -1
- package/dist/tools/builtin/wallet/index.js +0 -32
- package/dist/tools/builtin/wallet/index.js.map +0 -1
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +0 -25
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +0 -98
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +0 -211
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +0 -499
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +0 -240
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js +0 -1257
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +0 -41
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/SendNativeTool.js +0 -127
- package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +0 -63
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/SendTokenTool.js +0 -294
- package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +0 -247
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js +0 -1258
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +0 -20
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +0 -36
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +0 -23
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js +0 -54
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +0 -1
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts +0 -62
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/amountSpec.js +0 -93
- package/dist/tools/builtin/wallet-action/amountSpec.js.map +0 -1
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts +0 -42
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/gasReserve.js +0 -103
- package/dist/tools/builtin/wallet-action/gasReserve.js.map +0 -1
- package/dist/tools/builtin/wallet-action/index.d.ts +0 -9
- package/dist/tools/builtin/wallet-action/index.d.ts.map +0 -1
- package/dist/tools/builtin/wallet-action/index.js +0 -20
- package/dist/tools/builtin/wallet-action/index.js.map +0 -1
- package/dist/tools/chainResolver.d.ts +0 -98
- package/dist/tools/chainResolver.d.ts.map +0 -1
- package/dist/tools/chainResolver.js +0 -302
- package/dist/tools/chainResolver.js.map +0 -1
- package/dist/tools/index.d.ts +0 -4
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -23
- package/dist/tools/index.js.map +0 -1
- package/dist/types/index.d.ts +0 -777
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -6
- package/dist/types/index.js.map +0 -1
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PoolDetailTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const chainResolver_1 = require("../../chainResolver");
|
|
6
|
-
const UniswapService_1 = require("../../../services/UniswapService");
|
|
7
|
-
const DAYS_PER_YEAR = 365;
|
|
8
|
-
const EVM_ADDRESS_RE = /^0x[a-fA-F0-9]{40}$/;
|
|
9
|
-
/**
|
|
10
|
-
* Tool: get-pool-detail
|
|
11
|
-
*
|
|
12
|
-
* Always-search-then-detail flow for a single Uniswap V3 pool:
|
|
13
|
-
* 1) call SearchTokens upstream to enumerate pools matching the user's input,
|
|
14
|
-
* 2) filter the search result by token symbols and (optionally) fee tier,
|
|
15
|
-
* 3) if the filter narrows to exactly one pool, fetch its full detail via
|
|
16
|
-
* the V3Pool GraphQL operation,
|
|
17
|
-
* 4) otherwise return the candidates so the LLM can ask the user to pick one.
|
|
18
|
-
*
|
|
19
|
-
* The LLM never passes pool addresses — every address that reaches the detail
|
|
20
|
-
* call is one we observed upstream this turn, which makes pool-address
|
|
21
|
-
* hallucinations structurally impossible.
|
|
22
|
-
*/
|
|
23
|
-
class PoolDetailTool extends BaseTool_1.BaseTool {
|
|
24
|
-
name = 'get-pool-detail';
|
|
25
|
-
description = 'Get detailed stats for a single Uniswap V3 pool, identified by token pair (and optional fee tier). ' +
|
|
26
|
-
'Always runs a search first, filters by the provided symbols + fee tier, and only fetches detail when ' +
|
|
27
|
-
'the filter resolves to exactly one pool. Otherwise returns a `candidates` list — show that to the user, ' +
|
|
28
|
-
'ask which pool they want, then re-call this tool with the missing info. ' +
|
|
29
|
-
'Detail response includes: pool address, fee tier (bps and %), both tokens (symbol, name, address, decimals, USD price), ' +
|
|
30
|
-
'token0/token1 reserves, total TVL with 24h % change, 24h volume, weekly historical volume series, ' +
|
|
31
|
-
'total tx count, and a derived APR estimate (fees ÷ TVL × 365). ' +
|
|
32
|
-
'NEVER pass a pool address — the tool resolves the address itself by searching. ' +
|
|
33
|
-
'Token contract addresses are NOT pool addresses. ' +
|
|
34
|
-
'Source: https://app.uniswap.org. ' +
|
|
35
|
-
'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea';
|
|
36
|
-
category = 'blockchain-data';
|
|
37
|
-
parameters = [
|
|
38
|
-
{
|
|
39
|
-
name: 'token0Symbol',
|
|
40
|
-
type: 'string',
|
|
41
|
-
description: 'Symbol of one of the pool\'s tokens (e.g. "USDC"). ' +
|
|
42
|
-
'Pair order does not matter — USDC/WETH and WETH/USDC resolve to the same pool. ' +
|
|
43
|
-
'When both token0Symbol and token1Symbol are provided the search is filtered to that exact pair.',
|
|
44
|
-
required: true,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: 'token1Symbol',
|
|
48
|
-
type: 'string',
|
|
49
|
-
description: 'Symbol of the other pool token (e.g. "WETH"). ' +
|
|
50
|
-
'Optional — when omitted the tool returns all pools containing token0Symbol so the user can pick.',
|
|
51
|
-
required: false,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'feeTier',
|
|
55
|
-
type: 'number',
|
|
56
|
-
description: 'Fee tier in basis points (bps): 100 = 0.01%, 500 = 0.05%, 3000 = 0.30%, 10000 = 1.00%. ' +
|
|
57
|
-
'Optional — when omitted the tool returns all fee tiers for the pair so the user can pick.',
|
|
58
|
-
required: false,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'chain',
|
|
62
|
-
type: 'string',
|
|
63
|
-
description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
64
|
-
'"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.',
|
|
65
|
-
required: false,
|
|
66
|
-
},
|
|
67
|
-
];
|
|
68
|
-
service;
|
|
69
|
-
constructor(config) {
|
|
70
|
-
super();
|
|
71
|
-
this.service = new UniswapService_1.UniswapService(config);
|
|
72
|
-
}
|
|
73
|
-
async run(args, userContext) {
|
|
74
|
-
const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
|
|
75
|
-
const token0Symbol = typeof args.token0Symbol === 'string' ? args.token0Symbol.trim() : '';
|
|
76
|
-
const token1Symbol = typeof args.token1Symbol === 'string' ? args.token1Symbol.trim() : '';
|
|
77
|
-
const feeTier = typeof args.feeTier === 'number' && Number.isFinite(args.feeTier) ? Math.floor(args.feeTier) : undefined;
|
|
78
|
-
if (!token0Symbol) {
|
|
79
|
-
return {
|
|
80
|
-
error: 'token0Symbol is required. Provide at least one token symbol; add token1Symbol and feeTier to narrow the result.',
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
// Step 1: always search upstream first.
|
|
84
|
-
const searchQuery = token1Symbol ? `${token0Symbol} ${token1Symbol}` : token0Symbol;
|
|
85
|
-
const search = await this.service.searchPools({
|
|
86
|
-
query: searchQuery,
|
|
87
|
-
chain,
|
|
88
|
-
page: 1,
|
|
89
|
-
size: 100,
|
|
90
|
-
protocolVersion: 'V3',
|
|
91
|
-
});
|
|
92
|
-
if (!search.success) {
|
|
93
|
-
return { error: search.error || 'Pool search failed' };
|
|
94
|
-
}
|
|
95
|
-
// Step 2: filter by user-provided order first (sym0 → token0, sym1 → token1).
|
|
96
|
-
// Only fall back to the reversed match if the ordered match returns nothing —
|
|
97
|
-
// this respects how the user phrased the pair (e.g. "USDC/ETH 0.3%" should
|
|
98
|
-
// prefer pools where token0=USDC, not return the WETH/USDC pool unless the
|
|
99
|
-
// forward direction has no result).
|
|
100
|
-
const all = search.data ?? [];
|
|
101
|
-
const ordered = all.filter((p) => this.matchesFilter(p, token0Symbol, token1Symbol, feeTier, 'ordered'));
|
|
102
|
-
let filtered = ordered;
|
|
103
|
-
let usedReversedFallback = false;
|
|
104
|
-
if (filtered.length === 0 && token1Symbol) {
|
|
105
|
-
const reversed = all.filter((p) => this.matchesFilter(p, token0Symbol, token1Symbol, feeTier, 'reversed'));
|
|
106
|
-
if (reversed.length > 0) {
|
|
107
|
-
filtered = reversed;
|
|
108
|
-
usedReversedFallback = true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
if (filtered.length === 0) {
|
|
112
|
-
return {
|
|
113
|
-
error: `No V3 pool matched ${this.describeQuery(token0Symbol, token1Symbol, feeTier)} on chain ${chain}. ` +
|
|
114
|
-
'Verify the symbols and fee tier with the user.',
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
// Step 3: exactly one match → fetch detail.
|
|
118
|
-
if (filtered.length === 1) {
|
|
119
|
-
const only = filtered[0];
|
|
120
|
-
if (!only.id || !EVM_ADDRESS_RE.test(only.id)) {
|
|
121
|
-
return { error: 'Resolved pool has no valid address' };
|
|
122
|
-
}
|
|
123
|
-
const result = await this.service.getV3PoolDetail({ address: only.id, chain });
|
|
124
|
-
if (!result.success || !result.data) {
|
|
125
|
-
return { error: result.error || 'Failed to fetch pool detail' };
|
|
126
|
-
}
|
|
127
|
-
return {
|
|
128
|
-
_instructions: 'Present pool details in a compact summary. Lead with the pair (token0/token1 symbols), fee tier (%), ' +
|
|
129
|
-
'and chain. Then show: TVL (USD) with 24h % change, 24h volume (USD), 24h fees (USD), estimated APR (%), ' +
|
|
130
|
-
'token0 reserve + USD price, token1 reserve + USD price, and total tx count. ' +
|
|
131
|
-
'Optionally include the weekly historical volume as a sparkline-style bullet list. ' +
|
|
132
|
-
'Format numbers human-readably (e.g. $12.5M, +1.23%, 0.05%). Omit null fields. Do NOT mention tool/API names.',
|
|
133
|
-
pairOrderMatched: usedReversedFallback ? 'reversed' : 'ordered',
|
|
134
|
-
pool: this.formatPool(result.data),
|
|
135
|
-
};
|
|
136
|
-
}
|
|
137
|
-
// Step 4: multiple matches → return candidates for the user to disambiguate.
|
|
138
|
-
return {
|
|
139
|
-
_instructions: 'The filter matched multiple pools. Render them as a numbered list (pair, fee tier %, 24h volume, address) ' +
|
|
140
|
-
'and ask the user which one they want to see. When they answer, re-call this tool with their selection — ' +
|
|
141
|
-
'pass token0Symbol + token1Symbol + feeTier (use the exact feeTier in bps from the chosen candidate). ' +
|
|
142
|
-
'Format numbers human-readably (e.g. $12.5M, 0.05%). Do NOT mention tool/API names.',
|
|
143
|
-
chain,
|
|
144
|
-
pairOrderMatched: usedReversedFallback ? 'reversed' : 'ordered',
|
|
145
|
-
reason: this.candidateReason(token0Symbol, token1Symbol, feeTier),
|
|
146
|
-
missing: this.missingFields(token1Symbol, feeTier),
|
|
147
|
-
candidates: this.rankCandidates(filtered)
|
|
148
|
-
.slice(0, 10)
|
|
149
|
-
.map((c) => this.formatCandidate(c)),
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Filter predicate. `mode` controls pair-order matching when both symbols
|
|
154
|
-
* are given:
|
|
155
|
-
* - "ordered" → pool.token0 must match sym0 AND pool.token1 must match sym1
|
|
156
|
-
* - "reversed" → pool.token0 must match sym1 AND pool.token1 must match sym0
|
|
157
|
-
* When sym1 is empty, mode is ignored (single-token contains check).
|
|
158
|
-
*/
|
|
159
|
-
matchesFilter(p, sym0, sym1, fee, mode) {
|
|
160
|
-
if (fee != null && p.feeTier !== fee)
|
|
161
|
-
return false;
|
|
162
|
-
const a = (p.token0?.symbol ?? '').toLowerCase();
|
|
163
|
-
const b = (p.token1?.symbol ?? '').toLowerCase();
|
|
164
|
-
const x = sym0.toLowerCase();
|
|
165
|
-
if (sym1) {
|
|
166
|
-
const y = sym1.toLowerCase();
|
|
167
|
-
if (mode === 'reversed') {
|
|
168
|
-
return this.symbolIncludes(a, y) && this.symbolIncludes(b, x);
|
|
169
|
-
}
|
|
170
|
-
return this.symbolIncludes(a, x) && this.symbolIncludes(b, y);
|
|
171
|
-
}
|
|
172
|
-
return this.symbolIncludes(a, x) || this.symbolIncludes(b, x);
|
|
173
|
-
}
|
|
174
|
-
/** Bidirectional substring match — handles "ETH" vs "WETH", "USDC" vs "USDC.e", etc. */
|
|
175
|
-
symbolIncludes(poolSym, userSym) {
|
|
176
|
-
if (!poolSym || !userSym)
|
|
177
|
-
return false;
|
|
178
|
-
return poolSym.includes(userSym) || userSym.includes(poolSym);
|
|
179
|
-
}
|
|
180
|
-
describeQuery(sym0, sym1, fee) {
|
|
181
|
-
const pair = sym1 ? `${sym0}/${sym1}` : sym0;
|
|
182
|
-
return fee != null ? `${pair} at fee tier ${fee} bps` : pair;
|
|
183
|
-
}
|
|
184
|
-
candidateReason(sym0, sym1, fee) {
|
|
185
|
-
if (!sym1)
|
|
186
|
-
return `Multiple pools contain ${sym0}. Ask the user for the other token (and fee tier).`;
|
|
187
|
-
if (fee == null)
|
|
188
|
-
return `Multiple fee tiers exist for ${sym0}/${sym1}. Ask the user which fee tier they want.`;
|
|
189
|
-
return `Multiple ${sym0}/${sym1} pools share fee tier ${fee} bps. Ask the user which one they meant.`;
|
|
190
|
-
}
|
|
191
|
-
missingFields(sym1, fee) {
|
|
192
|
-
const missing = [];
|
|
193
|
-
if (!sym1)
|
|
194
|
-
missing.push('token1Symbol');
|
|
195
|
-
if (fee == null)
|
|
196
|
-
missing.push('feeTier');
|
|
197
|
-
return missing;
|
|
198
|
-
}
|
|
199
|
-
/** Sort candidates by 24h volume desc — the most-traded pool surfaces first. */
|
|
200
|
-
rankCandidates(pools) {
|
|
201
|
-
return [...pools].sort((a, b) => (b.volumeUsd24hr ?? 0) - (a.volumeUsd24hr ?? 0));
|
|
202
|
-
}
|
|
203
|
-
/** Compact view of a search candidate for the LLM to render as a picker. */
|
|
204
|
-
formatCandidate(p) {
|
|
205
|
-
return {
|
|
206
|
-
address: p.id,
|
|
207
|
-
protocolVersion: p.protocolVersion,
|
|
208
|
-
feeTierBps: p.feeTier,
|
|
209
|
-
feeTierPercent: typeof p.feeTier === 'number' ? p.feeTier / 10_000 : undefined,
|
|
210
|
-
volume24hUsd: p.volumeUsd24hr,
|
|
211
|
-
pair: p.token0?.symbol && p.token1?.symbol ? `${p.token0.symbol}/${p.token1.symbol}` : undefined,
|
|
212
|
-
token0: p.token0 ? { symbol: p.token0.symbol, name: p.token0.name, address: p.token0.address } : undefined,
|
|
213
|
-
token1: p.token1 ? { symbol: p.token1.symbol, name: p.token1.name, address: p.token1.address } : undefined,
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
|
-
/** Trim and enrich the GraphQL payload with derived metrics. */
|
|
217
|
-
formatPool(p) {
|
|
218
|
-
const tvlUsd = p.totalLiquidity?.value;
|
|
219
|
-
const volume24hUsd = p.volume24h?.value;
|
|
220
|
-
const feeTierBps = p.feeTier;
|
|
221
|
-
const feeTierPercent = typeof feeTierBps === 'number' ? feeTierBps / 10_000 : undefined;
|
|
222
|
-
const fees24hUsd = typeof volume24hUsd === 'number' && typeof feeTierPercent === 'number'
|
|
223
|
-
? (volume24hUsd * feeTierPercent) / 100
|
|
224
|
-
: undefined;
|
|
225
|
-
const aprPercent = typeof fees24hUsd === 'number' && typeof tvlUsd === 'number' && tvlUsd > 0
|
|
226
|
-
? (fees24hUsd / tvlUsd) * DAYS_PER_YEAR * 100
|
|
227
|
-
: undefined;
|
|
228
|
-
return {
|
|
229
|
-
address: p.address,
|
|
230
|
-
protocolVersion: p.protocolVersion,
|
|
231
|
-
feeTierBps,
|
|
232
|
-
feeTierPercent,
|
|
233
|
-
tvlUsd,
|
|
234
|
-
tvlChange24hPercent: p.totalLiquidityPercentChange24h?.value,
|
|
235
|
-
volume24hUsd,
|
|
236
|
-
fees24hUsd,
|
|
237
|
-
aprPercent,
|
|
238
|
-
txCount: p.txCount,
|
|
239
|
-
historicalVolumeWeek: this.formatHistorical(p.historicalVolume),
|
|
240
|
-
token0: p.token0
|
|
241
|
-
? {
|
|
242
|
-
address: p.token0.address,
|
|
243
|
-
symbol: p.token0.symbol,
|
|
244
|
-
name: p.token0.name,
|
|
245
|
-
decimals: p.token0.decimals,
|
|
246
|
-
priceUsd: p.token0.market?.price?.value ?? p.token0.price?.value,
|
|
247
|
-
reserve: p.token0Supply,
|
|
248
|
-
isSpam: p.token0.project?.isSpam,
|
|
249
|
-
safetyLevel: p.token0.project?.safetyLevel,
|
|
250
|
-
}
|
|
251
|
-
: undefined,
|
|
252
|
-
token1: p.token1
|
|
253
|
-
? {
|
|
254
|
-
address: p.token1.address,
|
|
255
|
-
symbol: p.token1.symbol,
|
|
256
|
-
name: p.token1.name,
|
|
257
|
-
decimals: p.token1.decimals,
|
|
258
|
-
priceUsd: p.token1.market?.price?.value ?? p.token1.price?.value,
|
|
259
|
-
reserve: p.token1Supply,
|
|
260
|
-
isSpam: p.token1.project?.isSpam,
|
|
261
|
-
safetyLevel: p.token1.project?.safetyLevel,
|
|
262
|
-
}
|
|
263
|
-
: undefined,
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
formatHistorical(points) {
|
|
267
|
-
if (!points || points.length === 0)
|
|
268
|
-
return undefined;
|
|
269
|
-
return points.map((p) => ({ timestamp: p.timestamp, volumeUsd: p.value }));
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
exports.PoolDetailTool = PoolDetailTool;
|
|
273
|
-
//# sourceMappingURL=PoolDetailTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PoolDetailTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/PoolDetailTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAM0C;AAI1C,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,cAAc,GAAG,qBAAqB,CAAC;AAE7C;;;;;;;;;;;;;GAaG;AACH,MAAa,cAAe,SAAQ,mBAAQ;IAC1C,IAAI,GAAG,iBAAiB,CAAC;IACzB,WAAW,GACT,qGAAqG;QACrG,uGAAuG;QACvG,0GAA0G;QAC1G,0EAA0E;QAC1E,0HAA0H;QAC1H,oGAAoG;QACpG,iEAAiE;QACjE,iFAAiF;QACjF,mDAAmD;QACnD,mCAAmC;QACnC,8EAA8E,CAAC;IACjF,QAAQ,GAAG,iBAAiB,CAAC;IAC7B,UAAU,GAAoB;QAC5B;YACE,IAAI,EAAE,cAAc;YACpB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,qDAAqD;gBACrD,iFAAiF;gBACj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,KAAK,EAAE,CAAC,CAAC,CAAC;IAC7E,CAAC;CACF;AAtRD,wCAsRC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from '../../BaseTool';
|
|
2
|
-
import type { ToolParameter, UserContext } from '../../../types';
|
|
3
|
-
import { type UniswapServiceConfig, type UniswapProtocolVersion } from '../../../services/UniswapService';
|
|
4
|
-
export type PoolSearchToolConfig = UniswapServiceConfig;
|
|
5
|
-
type ProtocolVersionFilter = UniswapProtocolVersion | 'ALL';
|
|
6
|
-
/**
|
|
7
|
-
* Tool: search-pools
|
|
8
|
-
*
|
|
9
|
-
* Wraps the Uniswap `Search.v1.SearchService/SearchTokens` endpoint with
|
|
10
|
-
* `searchType: "POOL"`. Lets users discover pools by free-text query
|
|
11
|
-
* (token symbol like "WBTC" or "USDC", token name, or pool address) on a
|
|
12
|
-
* specific chain. Paginated.
|
|
13
|
-
*/
|
|
14
|
-
export declare class PoolSearchTool extends BaseTool {
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
category: string;
|
|
18
|
-
parameters: ToolParameter[];
|
|
19
|
-
private service;
|
|
20
|
-
constructor(config?: PoolSearchToolConfig);
|
|
21
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
22
|
-
error: string;
|
|
23
|
-
_instructions?: undefined;
|
|
24
|
-
query?: undefined;
|
|
25
|
-
chain?: undefined;
|
|
26
|
-
protocolVersion?: undefined;
|
|
27
|
-
feeTierBps?: undefined;
|
|
28
|
-
feeTierPercent?: undefined;
|
|
29
|
-
page?: undefined;
|
|
30
|
-
size?: undefined;
|
|
31
|
-
count?: undefined;
|
|
32
|
-
pools?: undefined;
|
|
33
|
-
} | {
|
|
34
|
-
_instructions: string;
|
|
35
|
-
query: string;
|
|
36
|
-
chain: string;
|
|
37
|
-
protocolVersion: ProtocolVersionFilter;
|
|
38
|
-
feeTierBps: number | undefined;
|
|
39
|
-
feeTierPercent: number | undefined;
|
|
40
|
-
page: number;
|
|
41
|
-
size: number;
|
|
42
|
-
count: number;
|
|
43
|
-
pools: Record<string, unknown>[];
|
|
44
|
-
error?: undefined;
|
|
45
|
-
}>;
|
|
46
|
-
private parseProtocolFilter;
|
|
47
|
-
private formatPool;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
50
|
-
//# sourceMappingURL=PoolSearchTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PoolSearchTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/PoolSearchTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAEL,KAAK,oBAAoB,EAEzB,KAAK,sBAAsB,EAC5B,MAAM,kCAAkC,CAAC;AAE1C,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAGxD,KAAK,qBAAqB,GAAG,sBAAsB,GAAG,KAAK,CAAC;AAE5D;;;;;;;GAOG;AACH,qBAAa,cAAe,SAAQ,QAAQ;IAC1C,IAAI,SAAkB;IACtB,WAAW,SAWuE;IAClF,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CAkDzB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,oBAAoB;cAKzB,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;IAiD5E,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,UAAU;CAwBnB"}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PoolSearchTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const chainResolver_1 = require("../../chainResolver");
|
|
6
|
-
const UniswapService_1 = require("../../../services/UniswapService");
|
|
7
|
-
const SUPPORTED_VERSION_FILTERS = ['V2', 'V3', 'V4', 'ALL'];
|
|
8
|
-
/**
|
|
9
|
-
* Tool: search-pools
|
|
10
|
-
*
|
|
11
|
-
* Wraps the Uniswap `Search.v1.SearchService/SearchTokens` endpoint with
|
|
12
|
-
* `searchType: "POOL"`. Lets users discover pools by free-text query
|
|
13
|
-
* (token symbol like "WBTC" or "USDC", token name, or pool address) on a
|
|
14
|
-
* specific chain. Paginated.
|
|
15
|
-
*/
|
|
16
|
-
class PoolSearchTool extends BaseTool_1.BaseTool {
|
|
17
|
-
name = 'search-pools';
|
|
18
|
-
description = 'Search Uniswap liquidity pools on a given chain by free-text query — a SINGLE token symbol or token name. ' +
|
|
19
|
-
'Returns matching pools with: pool address, fee tier (bps + %), protocol version, both tokens ' +
|
|
20
|
-
'(symbol, name, address, decimals, logo), and short-window USD volume buckets (6h / 12h / 24h). ' +
|
|
21
|
-
'Use this tool when the user names ONE token and wants pools related to it: ' +
|
|
22
|
-
'"find WBTC pools on Optimism", "pools containing PEPE on Ethereum", "show USDC pools". ' +
|
|
23
|
-
'Do NOT use for: ' +
|
|
24
|
-
'(a) two-symbol pair lookups like "USDC/WETH 0.05%" — use get-pool-detail; ' +
|
|
25
|
-
'(b) raw 0x addresses (token or pool) — use lookup-pool-by-address; ' +
|
|
26
|
-
'(c) chain-wide rankings with no token mentioned — use get-top-pools. ' +
|
|
27
|
-
'Source: https://app.uniswap.org search. ' +
|
|
28
|
-
'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea.';
|
|
29
|
-
category = 'blockchain-data';
|
|
30
|
-
parameters = [
|
|
31
|
-
{
|
|
32
|
-
name: 'query',
|
|
33
|
-
type: 'string',
|
|
34
|
-
description: 'Single token symbol or name to search pools by (e.g. "WBTC", "USDC", "pepe"). ' +
|
|
35
|
-
'Do NOT pass a 0x address (use lookup-pool-by-address) or a two-symbol pair (use get-pool-detail).',
|
|
36
|
-
required: true,
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'chain',
|
|
40
|
-
type: 'string',
|
|
41
|
-
description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
42
|
-
'"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.',
|
|
43
|
-
required: false,
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'protocolVersion',
|
|
47
|
-
type: 'string',
|
|
48
|
-
description: 'Filter results by Uniswap protocol version: "V2", "V3", "V4", or "ALL" to include every version. ' +
|
|
49
|
-
'Default is "V3" — only switch when the user explicitly asks for V2, V4, or all versions.',
|
|
50
|
-
required: false,
|
|
51
|
-
default: 'V3',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'page',
|
|
55
|
-
type: 'number',
|
|
56
|
-
description: '1-based page index. Defaults to 1.',
|
|
57
|
-
required: false,
|
|
58
|
-
default: 1,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'size',
|
|
62
|
-
type: 'number',
|
|
63
|
-
description: 'Page size (max 50). Defaults to 15.',
|
|
64
|
-
required: false,
|
|
65
|
-
default: 15,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
name: 'feeTier',
|
|
69
|
-
type: 'number',
|
|
70
|
-
description: 'Optional fee tier filter in basis points (bps): 100 = 0.01%, 500 = 0.05%, 3000 = 0.30%, 10000 = 1.00%. ' +
|
|
71
|
-
'When provided, only pools with this exact fee tier are returned. ' +
|
|
72
|
-
'Pass it whenever the user mentions a fee tier in the current message OR earlier in the conversation ' +
|
|
73
|
-
'(e.g. "USDC/WETH 0.05% pool on Base" → feeTier=500). Omit otherwise.',
|
|
74
|
-
required: false,
|
|
75
|
-
},
|
|
76
|
-
];
|
|
77
|
-
service;
|
|
78
|
-
constructor(config) {
|
|
79
|
-
super();
|
|
80
|
-
this.service = new UniswapService_1.UniswapService(config);
|
|
81
|
-
}
|
|
82
|
-
async run(args, userContext) {
|
|
83
|
-
const query = typeof args.query === 'string' ? args.query.trim() : '';
|
|
84
|
-
if (!query) {
|
|
85
|
-
return { error: 'Search query is required' };
|
|
86
|
-
}
|
|
87
|
-
const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
|
|
88
|
-
const page = typeof args.page === 'number' && Number.isFinite(args.page) && args.page > 0 ? Math.floor(args.page) : 1;
|
|
89
|
-
const size = typeof args.size === 'number' && Number.isFinite(args.size) && args.size > 0
|
|
90
|
-
? Math.min(Math.floor(args.size), 50)
|
|
91
|
-
: 15;
|
|
92
|
-
const protocolVersion = this.parseProtocolFilter(args.protocolVersion);
|
|
93
|
-
const feeTier = typeof args.feeTier === 'number' && Number.isFinite(args.feeTier) && args.feeTier > 0
|
|
94
|
-
? Math.floor(args.feeTier)
|
|
95
|
-
: undefined;
|
|
96
|
-
// searchPools internally calls ExploreStats in parallel, applies
|
|
97
|
-
// protocol version + fee tier filters, and enriches with apr/tvl/txCount.
|
|
98
|
-
const result = await this.service.searchPools({ query, chain, page, size, protocolVersion, feeTier });
|
|
99
|
-
if (!result.success) {
|
|
100
|
-
return { error: result.error || 'Failed to search pools' };
|
|
101
|
-
}
|
|
102
|
-
const pools = (result.data ?? []).map((p) => this.formatPool(p));
|
|
103
|
-
return {
|
|
104
|
-
_instructions: 'Present the matching pools as a list. For each pool show: pair (token0/token1 symbols), fee tier (%), ' +
|
|
105
|
-
'protocol version, and only the fields that have actual data — apr (%), TVL (USD), 24h volume (USD), tx count. ' +
|
|
106
|
-
'Skip any field that is null/undefined — do not show zeros or dashes. ' +
|
|
107
|
-
'Format numbers human-readably (e.g. $12.5M, 0.30%, 4.2%). ' +
|
|
108
|
-
'Mention the search query and chain in the intro. Do NOT mention tool or API names.',
|
|
109
|
-
query,
|
|
110
|
-
chain,
|
|
111
|
-
protocolVersion,
|
|
112
|
-
feeTierBps: feeTier,
|
|
113
|
-
feeTierPercent: feeTier != null ? feeTier / 10_000 : undefined,
|
|
114
|
-
page,
|
|
115
|
-
size,
|
|
116
|
-
count: pools.length,
|
|
117
|
-
pools,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
parseProtocolFilter(value) {
|
|
121
|
-
if (typeof value === 'string') {
|
|
122
|
-
const upper = value.trim().toUpperCase();
|
|
123
|
-
if (SUPPORTED_VERSION_FILTERS.includes(upper)) {
|
|
124
|
-
return upper;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return 'V3';
|
|
128
|
-
}
|
|
129
|
-
formatPool(p) {
|
|
130
|
-
const out = {
|
|
131
|
-
address: p.id,
|
|
132
|
-
chainId: p.chainId,
|
|
133
|
-
protocolVersion: p.protocolVersion,
|
|
134
|
-
feeTierBps: p.feeTier,
|
|
135
|
-
feeTierPercent: typeof p.feeTier === 'number' ? p.feeTier / 10_000 : undefined,
|
|
136
|
-
};
|
|
137
|
-
if (p.apr != null)
|
|
138
|
-
out.apr = p.apr;
|
|
139
|
-
if (p.tvlUsd != null)
|
|
140
|
-
out.tvlUsd = p.tvlUsd;
|
|
141
|
-
const vol24h = p.volume1DayUsd ?? p.volumeUsd24hr;
|
|
142
|
-
if (vol24h != null)
|
|
143
|
-
out.volume24hUsd = vol24h;
|
|
144
|
-
if (p.volumeUsd6hr != null)
|
|
145
|
-
out.volume6hUsd = p.volumeUsd6hr;
|
|
146
|
-
if (p.volumeUsd12hr != null)
|
|
147
|
-
out.volume12hUsd = p.volumeUsd12hr;
|
|
148
|
-
if (p.txCount != null)
|
|
149
|
-
out.txCount = p.txCount;
|
|
150
|
-
const t0 = p.token0;
|
|
151
|
-
const t1 = p.token1;
|
|
152
|
-
if (t0)
|
|
153
|
-
out.token0 = { address: t0.address, symbol: t0.symbol, name: t0.name, decimals: t0.decimals };
|
|
154
|
-
if (t1)
|
|
155
|
-
out.token1 = { address: t1.address, symbol: t1.symbol, name: t1.name, decimals: t1.decimals };
|
|
156
|
-
return out;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.PoolSearchTool = PoolSearchTool;
|
|
160
|
-
//# sourceMappingURL=PoolSearchTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PoolSearchTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/PoolSearchTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAK0C;AAI1C,MAAM,yBAAyB,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAU,CAAC;AAGrE;;;;;;;GAOG;AACH,MAAa,cAAe,SAAQ,mBAAQ;IAC1C,IAAI,GAAG,cAAc,CAAC;IACtB,WAAW,GACT,4GAA4G;QAC5G,+FAA+F;QAC/F,iGAAiG;QACjG,6EAA6E;QAC7E,yFAAyF;QACzF,kBAAkB;QAClB,4EAA4E;QAC5E,qEAAqE;QACrE,uEAAuE;QACvE,0CAA0C;QAC1C,+EAA+E,CAAC;IAClF,QAAQ,GAAG,iBAAiB,CAAC;IAC7B,UAAU,GAAoB;QAC5B;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,gFAAgF;gBAChF,mGAAmG;YACrG,QAAQ,EAAE,IAAI;SACf;QACD;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2FAA2F;gBAC3F,wKAAwK;YAC1K,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mGAAmG;gBACnG,0FAA0F;YAC5F,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,IAAI;SACd;QACD;YACE,IAAI,EAAE,MAAM;YACZ,IAAI,EA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AC,CAAC,aAAa,IAAI,IAAI;YAAE,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,aAAa,CAAC;QAChE,IAAI,CAAC,CAAC,OAAO,IAAI,IAAI;YAAE,GAAG,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC;QAE/C,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;QACpB,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;QACpB,IAAI,EAAE;YAAE,GAAG,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC;QACtG,IAAI,EAAE;YAAE,GAAG,CAAC,MAAM,GAAG,EAAE,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC;QAEtG,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AA7JD,wCA6JC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from '../../BaseTool';
|
|
2
|
-
import type { ConfirmAddLiquidityTxProps, ToolKind, ToolParameter, ToolResult, UIPayload, UserContext } from '../../../types';
|
|
3
|
-
import { type PoolServiceConfig } from '../../../services/PoolService';
|
|
4
|
-
export interface PreviewAddLiquidityToolConfig {
|
|
5
|
-
pool?: PoolServiceConfig;
|
|
6
|
-
/** Default slippage in bps (100 = 1%). Default 100. */
|
|
7
|
-
defaultSlippageBps?: number;
|
|
8
|
-
/** Floor for amount0Min/amount1Min as % of swap min-out. Default 80. */
|
|
9
|
-
mintMinPercent?: number;
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Tool: preview-add-liquidity
|
|
13
|
-
*
|
|
14
|
-
* Called when the user has filled the AddLiquidityForm with:
|
|
15
|
-
* - native amount (in wei)
|
|
16
|
-
* - minPrice + maxPrice (token1 per token0, decimal-adjusted — the same unit
|
|
17
|
-
* as `pool.currentPrice` returned by open-add-liquidity-form)
|
|
18
|
-
*
|
|
19
|
-
* The tool converts those prices into ticks (rounded to tickSpacing), fetches
|
|
20
|
-
* deBridge swap quotes for both legs, encodes the gateway.mint calldata, and
|
|
21
|
-
* returns:
|
|
22
|
-
* - a UI payload (`ConfirmAddLiquidityTx`) the FE renders as a confirmation
|
|
23
|
-
* panel showing expected token0/token1 amounts and the unsigned tx,
|
|
24
|
-
* - the unsigned tx itself in `props.unsignedTx`, which the FE will pass to
|
|
25
|
-
* a wallet-side execute function (e.g. wagmi.sendTransactionAsync).
|
|
26
|
-
*
|
|
27
|
-
* The user reviews the panel and either confirms (FE signs + broadcasts) or
|
|
28
|
-
* cancels. Native-only input — no approvals needed.
|
|
29
|
-
*/
|
|
30
|
-
export declare class PreviewAddLiquidityTool extends BaseTool {
|
|
31
|
-
name: string;
|
|
32
|
-
kind: ToolKind;
|
|
33
|
-
category: string;
|
|
34
|
-
noSuggestions: boolean;
|
|
35
|
-
description: string;
|
|
36
|
-
parameters: ToolParameter[];
|
|
37
|
-
private pool;
|
|
38
|
-
private defaultSlippageBps;
|
|
39
|
-
private mintMinPercent;
|
|
40
|
-
private pantograph;
|
|
41
|
-
constructor(config?: PreviewAddLiquidityToolConfig);
|
|
42
|
-
/** Forward `ui` from run() into the ToolResult envelope. */
|
|
43
|
-
execute(args: Record<string, unknown>, userContext?: UserContext): Promise<ToolResult>;
|
|
44
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
45
|
-
error: string;
|
|
46
|
-
_instructions: string;
|
|
47
|
-
chain?: undefined;
|
|
48
|
-
rawTickLower?: undefined;
|
|
49
|
-
rawTickUpper?: undefined;
|
|
50
|
-
tickLower?: undefined;
|
|
51
|
-
tickUpper?: undefined;
|
|
52
|
-
balanceWei?: undefined;
|
|
53
|
-
requiredWei?: undefined;
|
|
54
|
-
gasReserveWei?: undefined;
|
|
55
|
-
ui?: undefined;
|
|
56
|
-
summary?: undefined;
|
|
57
|
-
} | {
|
|
58
|
-
error: string;
|
|
59
|
-
chain: string;
|
|
60
|
-
_instructions?: undefined;
|
|
61
|
-
rawTickLower?: undefined;
|
|
62
|
-
rawTickUpper?: undefined;
|
|
63
|
-
tickLower?: undefined;
|
|
64
|
-
tickUpper?: undefined;
|
|
65
|
-
balanceWei?: undefined;
|
|
66
|
-
requiredWei?: undefined;
|
|
67
|
-
gasReserveWei?: undefined;
|
|
68
|
-
ui?: undefined;
|
|
69
|
-
summary?: undefined;
|
|
70
|
-
} | {
|
|
71
|
-
error: string;
|
|
72
|
-
_instructions?: undefined;
|
|
73
|
-
chain?: undefined;
|
|
74
|
-
rawTickLower?: undefined;
|
|
75
|
-
rawTickUpper?: undefined;
|
|
76
|
-
tickLower?: undefined;
|
|
77
|
-
tickUpper?: undefined;
|
|
78
|
-
balanceWei?: undefined;
|
|
79
|
-
requiredWei?: undefined;
|
|
80
|
-
gasReserveWei?: undefined;
|
|
81
|
-
ui?: undefined;
|
|
82
|
-
summary?: undefined;
|
|
83
|
-
} | {
|
|
84
|
-
error: string;
|
|
85
|
-
_instructions: string;
|
|
86
|
-
rawTickLower: number;
|
|
87
|
-
rawTickUpper: number;
|
|
88
|
-
tickLower: number;
|
|
89
|
-
tickUpper: number;
|
|
90
|
-
chain?: undefined;
|
|
91
|
-
balanceWei?: undefined;
|
|
92
|
-
requiredWei?: undefined;
|
|
93
|
-
gasReserveWei?: undefined;
|
|
94
|
-
ui?: undefined;
|
|
95
|
-
summary?: undefined;
|
|
96
|
-
} | {
|
|
97
|
-
error: string;
|
|
98
|
-
_instructions: string;
|
|
99
|
-
balanceWei: string;
|
|
100
|
-
requiredWei: string;
|
|
101
|
-
gasReserveWei: string;
|
|
102
|
-
chain?: undefined;
|
|
103
|
-
rawTickLower?: undefined;
|
|
104
|
-
rawTickUpper?: undefined;
|
|
105
|
-
tickLower?: undefined;
|
|
106
|
-
tickUpper?: undefined;
|
|
107
|
-
ui?: undefined;
|
|
108
|
-
summary?: undefined;
|
|
109
|
-
} | {
|
|
110
|
-
ui: UIPayload<ConfirmAddLiquidityTxProps>;
|
|
111
|
-
summary: string;
|
|
112
|
-
_instructions: string;
|
|
113
|
-
error?: undefined;
|
|
114
|
-
chain?: undefined;
|
|
115
|
-
rawTickLower?: undefined;
|
|
116
|
-
rawTickUpper?: undefined;
|
|
117
|
-
tickLower?: undefined;
|
|
118
|
-
tickUpper?: undefined;
|
|
119
|
-
balanceWei?: undefined;
|
|
120
|
-
requiredWei?: undefined;
|
|
121
|
-
gasReserveWei?: undefined;
|
|
122
|
-
}>;
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=PreviewAddLiquidityTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewAddLiquidityTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/PreviewAddLiquidityTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAEV,0BAA0B,EAE1B,QAAQ,EACR,aAAa,EACb,UAAU,EACV,SAAS,EAET,WAAW,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EASL,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AAMvC,MAAM,WAAW,6BAA6B;IAC5C,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,uDAAuD;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,uBAAwB,SAAQ,QAAQ;IACnD,IAAI,SAA2B;IAC/B,IAAI,EAAE,QAAQ,CAAY;IAC1B,QAAQ,SAAiB;I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