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,382 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PreviewAddLiquidityTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const chainResolver_1 = require("../../chainResolver");
|
|
6
|
-
const PoolService_1 = require("../../../services/PoolService");
|
|
7
|
-
const pool_1 = require("../../../functions/pool");
|
|
8
|
-
const PantographService_1 = require("../../../services/PantographService");
|
|
9
|
-
const web3_1 = require("../../../functions/web3");
|
|
10
|
-
const abi_1 = require("../../../constants/abi");
|
|
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
|
-
class PreviewAddLiquidityTool extends BaseTool_1.BaseTool {
|
|
31
|
-
name = 'preview-add-liquidity';
|
|
32
|
-
kind = 'action';
|
|
33
|
-
category = 'pool-action';
|
|
34
|
-
noSuggestions = true;
|
|
35
|
-
description = 'Preview the add-liquidity transaction once the user has filled the AddLiquidityForm with a native amount ' +
|
|
36
|
-
'and a price range (min/max price in token1 per token0). The tool converts prices → ticks (rounded to ' +
|
|
37
|
-
'tickSpacing), fetches deBridge swap quotes for both legs, encodes the gateway.mint call, and returns an ' +
|
|
38
|
-
'unsigned tx the FE will sign. Do NOT call this until the user has filled both prices and an amount.';
|
|
39
|
-
parameters = [
|
|
40
|
-
{
|
|
41
|
-
name: 'poolAddress',
|
|
42
|
-
type: 'string',
|
|
43
|
-
description: 'V3 pool contract address (returned by open-add-liquidity-form in props.pool.address).',
|
|
44
|
-
required: true,
|
|
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 .Must match the pool\'s chain. 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: 'minPrice',
|
|
55
|
-
type: 'number',
|
|
56
|
-
description: 'Lower bound of the position price range, in token1-per-token0 units (decimal-adjusted — the SAME unit ' +
|
|
57
|
-
'as pool.currentPrice from open-add-liquidity-form). Example: if currentPrice is 1800 (USDC per WETH), ' +
|
|
58
|
-
'minPrice 900 means "the position is in-range while WETH ≥ 900 USDC". Must be > 0 and < maxPrice.',
|
|
59
|
-
required: true,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'maxPrice',
|
|
63
|
-
type: 'number',
|
|
64
|
-
description: 'Upper bound of the position price range, in the same units as minPrice. Must be > minPrice. ' +
|
|
65
|
-
'Pass a very large number (or props.priceBounds.max) for a "full range upper" position.',
|
|
66
|
-
required: true,
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: 'nativeAmount',
|
|
70
|
-
type: 'number',
|
|
71
|
-
description: 'Native amount the user wants to spend, as a human-readable decimal number ' +
|
|
72
|
-
'(e.g. 0.1 for 0.1 ETH). The tool converts to wei internally.',
|
|
73
|
-
required: true,
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
name: 'slippageBps',
|
|
77
|
-
type: 'number',
|
|
78
|
-
description: 'Slippage tolerance in basis points (100 = 1%). Optional — defaults to 100.',
|
|
79
|
-
required: false,
|
|
80
|
-
},
|
|
81
|
-
];
|
|
82
|
-
pool;
|
|
83
|
-
defaultSlippageBps;
|
|
84
|
-
mintMinPercent;
|
|
85
|
-
pantograph;
|
|
86
|
-
constructor(config) {
|
|
87
|
-
super();
|
|
88
|
-
this.pool = new PoolService_1.PoolService(config?.pool);
|
|
89
|
-
this.defaultSlippageBps = config?.defaultSlippageBps ?? 'auto';
|
|
90
|
-
this.mintMinPercent = config?.mintMinPercent ?? 80;
|
|
91
|
-
this.pantograph = new PantographService_1.PantographService();
|
|
92
|
-
}
|
|
93
|
-
/** Forward `ui` from run() into the ToolResult envelope. */
|
|
94
|
-
async execute(args, userContext) {
|
|
95
|
-
const callId = `call_${Date.now()}_${Math.random().toString(36).slice(2, 8)}`;
|
|
96
|
-
const start = Date.now();
|
|
97
|
-
try {
|
|
98
|
-
const out = (await this.run(args, userContext));
|
|
99
|
-
const result = {
|
|
100
|
-
toolName: this.name,
|
|
101
|
-
callId,
|
|
102
|
-
success: true,
|
|
103
|
-
data: out,
|
|
104
|
-
duration: Date.now() - start,
|
|
105
|
-
};
|
|
106
|
-
if (out && typeof out === 'object' && out.ui) {
|
|
107
|
-
result.ui = out.ui;
|
|
108
|
-
}
|
|
109
|
-
return result;
|
|
110
|
-
}
|
|
111
|
-
catch (err) {
|
|
112
|
-
return {
|
|
113
|
-
toolName: this.name,
|
|
114
|
-
callId,
|
|
115
|
-
success: false,
|
|
116
|
-
error: err instanceof Error ? err.message : String(err),
|
|
117
|
-
duration: Date.now() - start,
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
async run(args, userContext) {
|
|
122
|
-
const poolAddress = typeof args.poolAddress === 'string' ? args.poolAddress.trim() : '';
|
|
123
|
-
const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext, '');
|
|
124
|
-
const minPrice = Number(args.minPrice);
|
|
125
|
-
const maxPrice = Number(args.maxPrice);
|
|
126
|
-
const nativeAmountHuman = typeof args.nativeAmount === 'number' && Number.isFinite(args.nativeAmount) ? args.nativeAmount : NaN;
|
|
127
|
-
const slippageBps = typeof args.slippageBps === 'number' && Number.isFinite(args.slippageBps) && String(args.slippageBps) !== 'auto'
|
|
128
|
-
? Math.floor(args.slippageBps) / 100
|
|
129
|
-
: String(this.defaultSlippageBps);
|
|
130
|
-
if (!poolAddress ||
|
|
131
|
-
!chain ||
|
|
132
|
-
!Number.isFinite(nativeAmountHuman) ||
|
|
133
|
-
!Number.isFinite(minPrice) ||
|
|
134
|
-
!Number.isFinite(maxPrice)) {
|
|
135
|
-
return {
|
|
136
|
-
error: 'missing_inputs',
|
|
137
|
-
_instructions: 'poolAddress, chain, minPrice, maxPrice, nativeAmount are all required.',
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
if (minPrice <= 0 || maxPrice <= 0 || minPrice >= maxPrice) {
|
|
141
|
-
return {
|
|
142
|
-
error: 'invalid_price_range',
|
|
143
|
-
_instructions: 'minPrice and maxPrice must both be > 0 and minPrice must be strictly less than maxPrice.',
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
if (nativeAmountHuman <= 0) {
|
|
147
|
-
return { error: 'invalid_native_amount', _instructions: 'nativeAmount must be > 0.' };
|
|
148
|
-
}
|
|
149
|
-
const meta = (0, PoolService_1.getChainMeta)(chain);
|
|
150
|
-
if (!meta)
|
|
151
|
-
return { error: 'unsupported_chain', chain };
|
|
152
|
-
const gateway = await this.pool.getGatewayAddress(chain);
|
|
153
|
-
if (!gateway)
|
|
154
|
-
return { error: 'no_gateway_configured', chain };
|
|
155
|
-
const walletAddress = userContext?.walletAddress;
|
|
156
|
-
if (!walletAddress)
|
|
157
|
-
return { error: 'wallet_not_connected' };
|
|
158
|
-
// Convert human-readable native amount to wei bigint
|
|
159
|
-
const native = (0, PoolService_1.getNativeTokenInfo)(chain);
|
|
160
|
-
const nativeAmount = BigInt(Math.floor(nativeAmountHuman * 10 ** native.decimals));
|
|
161
|
-
if (nativeAmount <= 0n) {
|
|
162
|
-
return { error: 'invalid_native_amount', _instructions: 'nativeAmount must be > 0.' };
|
|
163
|
-
}
|
|
164
|
-
// ---- Read pool to get tickSpacing + token decimals ----
|
|
165
|
-
const onchain = await this.pool.readPoolOnchain(chain, poolAddress);
|
|
166
|
-
const [token0Decimals, token1Decimals] = await Promise.all([
|
|
167
|
-
this.pool.readErc20Decimals(chain, onchain.token0),
|
|
168
|
-
this.pool.readErc20Decimals(chain, onchain.token1),
|
|
169
|
-
]);
|
|
170
|
-
// ---- Convert prices → ticks → align to tickSpacing ----
|
|
171
|
-
// Floor the lower tick (round down → wider range), ceil the upper tick
|
|
172
|
-
// (round up → wider range). Both are clamped to V3's protocol bounds.
|
|
173
|
-
const rawTickLower = (0, PoolService_1.priceToTick)(minPrice, token0Decimals, token1Decimals);
|
|
174
|
-
const rawTickUpper = (0, PoolService_1.priceToTick)(maxPrice, token0Decimals, token1Decimals);
|
|
175
|
-
const tickLower = (0, PoolService_1.clampTick)((0, PoolService_1.roundTickToSpacing)(rawTickLower, onchain.tickSpacing, 'down'));
|
|
176
|
-
const tickUpper = (0, PoolService_1.clampTick)((0, PoolService_1.roundTickToSpacing)(rawTickUpper, onchain.tickSpacing, 'up'));
|
|
177
|
-
if (tickLower >= tickUpper || tickLower < pool_1.MIN_TICK || tickUpper > pool_1.MAX_TICK) {
|
|
178
|
-
return {
|
|
179
|
-
error: 'invalid_range_after_alignment',
|
|
180
|
-
_instructions: 'After aligning to tickSpacing the range collapsed. Ask the user for a wider price range.',
|
|
181
|
-
rawTickLower,
|
|
182
|
-
rawTickUpper,
|
|
183
|
-
tickLower,
|
|
184
|
-
tickUpper,
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
// Re-derive the actual range prices from the aligned ticks so the FE
|
|
188
|
-
// can display what was really used (may differ slightly from user input).
|
|
189
|
-
const resolvedRange = {
|
|
190
|
-
tickLower,
|
|
191
|
-
tickUpper,
|
|
192
|
-
minPrice: (0, PoolService_1.tickToPrice)(tickLower, token0Decimals, token1Decimals),
|
|
193
|
-
maxPrice: (0, PoolService_1.tickToPrice)(tickUpper, token0Decimals, token1Decimals),
|
|
194
|
-
};
|
|
195
|
-
// ---- Re-check balance ----
|
|
196
|
-
const [balanceWei, gasReserveWei, nativePriceUsd] = await Promise.all([
|
|
197
|
-
this.pool.getNativeBalance(chain, walletAddress),
|
|
198
|
-
this.pool.estimateGasReserveWei(chain),
|
|
199
|
-
this.pool.getNativePriceUsd(chain),
|
|
200
|
-
]);
|
|
201
|
-
const required = nativeAmount + gasReserveWei;
|
|
202
|
-
if (balanceWei < required) {
|
|
203
|
-
return {
|
|
204
|
-
error: 'insufficient_balance',
|
|
205
|
-
_instructions: 'User does not have enough native coin (amount + gas reserve). ' +
|
|
206
|
-
'Tell them the shortfall in their language.',
|
|
207
|
-
balanceWei: balanceWei.toString(),
|
|
208
|
-
requiredWei: required.toString(),
|
|
209
|
-
gasReserveWei: gasReserveWei.toString(),
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
// ---- Split native amount across the two pool tokens ----
|
|
213
|
-
const split = this.pool.splitNativeAmountForRange({
|
|
214
|
-
nativeAmountWei: nativeAmount,
|
|
215
|
-
pool: onchain,
|
|
216
|
-
tickLower,
|
|
217
|
-
tickUpper,
|
|
218
|
-
token0Decimals,
|
|
219
|
-
token1Decimals,
|
|
220
|
-
});
|
|
221
|
-
// ---- Build swap legs (skip when native == pool token) ----
|
|
222
|
-
const t0IsNative = onchain.token0.toLowerCase() === PoolService_1.ZERO_ADDRESS;
|
|
223
|
-
const t1IsNative = onchain.token1.toLowerCase() === PoolService_1.ZERO_ADDRESS;
|
|
224
|
-
const legs = [];
|
|
225
|
-
if (t0IsNative || split.amountInFor0Wei === 0n) {
|
|
226
|
-
legs.push({
|
|
227
|
-
tokenIn: PoolService_1.ZERO_ADDRESS,
|
|
228
|
-
tokenOut: onchain.token0,
|
|
229
|
-
amountIn: split.amountInFor0Wei,
|
|
230
|
-
tx: { to: PoolService_1.ZERO_ADDRESS, data: '0x', value: '0' },
|
|
231
|
-
minAmountOut: t0IsNative ? split.amountInFor0Wei : 0n,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
const swap = await this.pool.fetchSwapLeg({
|
|
236
|
-
senderAddress: walletAddress,
|
|
237
|
-
chainId: chain,
|
|
238
|
-
tokenIn: PoolService_1.ZERO_ADDRESS,
|
|
239
|
-
tokenInAmount: split.amountInFor0Wei.toString(),
|
|
240
|
-
tokenOut: onchain.token0,
|
|
241
|
-
tokenOutRecipient: gateway,
|
|
242
|
-
slippage: typeof slippageBps === 'number' ? slippageBps : 'auto',
|
|
243
|
-
});
|
|
244
|
-
legs.push({
|
|
245
|
-
tokenIn: PoolService_1.ZERO_ADDRESS,
|
|
246
|
-
tokenOut: onchain.token0,
|
|
247
|
-
amountIn: split.amountInFor0Wei,
|
|
248
|
-
tx: { to: swap.to, data: swap.data, value: swap.value },
|
|
249
|
-
minAmountOut: BigInt(swap.minAmountOut || '0'),
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
if (t1IsNative || split.amountInFor1Wei === 0n) {
|
|
253
|
-
legs.push({
|
|
254
|
-
tokenIn: PoolService_1.ZERO_ADDRESS,
|
|
255
|
-
tokenOut: onchain.token1,
|
|
256
|
-
amountIn: split.amountInFor1Wei,
|
|
257
|
-
tx: { to: PoolService_1.ZERO_ADDRESS, data: '0x', value: '0' },
|
|
258
|
-
minAmountOut: t1IsNative ? split.amountInFor1Wei : 0n,
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
const swap = await this.pool.fetchSwapLeg({
|
|
263
|
-
senderAddress: walletAddress,
|
|
264
|
-
chainId: chain,
|
|
265
|
-
tokenIn: PoolService_1.ZERO_ADDRESS,
|
|
266
|
-
tokenInAmount: split.amountInFor1Wei.toString(),
|
|
267
|
-
tokenOut: onchain.token1,
|
|
268
|
-
tokenOutRecipient: gateway,
|
|
269
|
-
slippage: typeof slippageBps === 'number' ? slippageBps : 'auto',
|
|
270
|
-
});
|
|
271
|
-
legs.push({
|
|
272
|
-
tokenIn: PoolService_1.ZERO_ADDRESS,
|
|
273
|
-
tokenOut: onchain.token1,
|
|
274
|
-
amountIn: split.amountInFor1Wei,
|
|
275
|
-
tx: { to: swap.to, data: swap.data, value: swap.value },
|
|
276
|
-
minAmountOut: BigInt(swap.minAmountOut || '0'),
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
// ---- amount0Min/amount1Min: floor at mintMinPercent of swap minOut ----
|
|
280
|
-
const floorMin = (n) => (n * BigInt(this.mintMinPercent)) / 100n;
|
|
281
|
-
const amount0Min = floorMin(legs[0].minAmountOut);
|
|
282
|
-
const amount1Min = floorMin(legs[1].minAmountOut);
|
|
283
|
-
const paymentInfo = legs.map((l) => ({
|
|
284
|
-
tokenIn: l.tokenIn,
|
|
285
|
-
tokenInAmount: BigInt(l.amountIn),
|
|
286
|
-
tokenOut: l.tokenOut,
|
|
287
|
-
tokenOutAmount: BigInt(l.minAmountOut),
|
|
288
|
-
}));
|
|
289
|
-
const exchangesInfo = legs.map((l) => ({
|
|
290
|
-
to: l.tx.to,
|
|
291
|
-
data: l.tx.data,
|
|
292
|
-
value: BigInt(l.tx.value || '0'),
|
|
293
|
-
}));
|
|
294
|
-
console.log('🚀 ~ PreviewAddLiquidityTool ~ run ~ paymentInfo:', paymentInfo);
|
|
295
|
-
console.log('🚀 ~ PreviewAddLiquidityTool ~ run ~ exchangesInfo:', exchangesInfo);
|
|
296
|
-
console.log('🚀 ~ PreviewAddLiquidityTool ~ run ~ args:', {
|
|
297
|
-
args: [
|
|
298
|
-
paymentInfo,
|
|
299
|
-
exchangesInfo,
|
|
300
|
-
{
|
|
301
|
-
fee: Number(onchain.fee),
|
|
302
|
-
amount0Min: BigInt(amount0Min),
|
|
303
|
-
amount1Min: BigInt(amount1Min),
|
|
304
|
-
tickLower,
|
|
305
|
-
tickUpper,
|
|
306
|
-
},
|
|
307
|
-
],
|
|
308
|
-
});
|
|
309
|
-
const calldata = (0, web3_1.encodeFunctionData)({
|
|
310
|
-
abi: abi_1.GatewayAbi,
|
|
311
|
-
functionName: 'mint',
|
|
312
|
-
args: [
|
|
313
|
-
paymentInfo,
|
|
314
|
-
exchangesInfo,
|
|
315
|
-
{
|
|
316
|
-
fee: Number(onchain.fee),
|
|
317
|
-
amount0Min: BigInt(amount0Min),
|
|
318
|
-
amount1Min: BigInt(amount1Min),
|
|
319
|
-
tickLower,
|
|
320
|
-
tickUpper,
|
|
321
|
-
},
|
|
322
|
-
],
|
|
323
|
-
});
|
|
324
|
-
const humanAmountIn = nativeAmountHuman;
|
|
325
|
-
const unsignedTx = {
|
|
326
|
-
chainId: chain,
|
|
327
|
-
to: gateway,
|
|
328
|
-
data: calldata,
|
|
329
|
-
value: nativeAmount.toString(),
|
|
330
|
-
from: walletAddress,
|
|
331
|
-
};
|
|
332
|
-
const txSummary = {
|
|
333
|
-
nativeIn: humanAmountIn,
|
|
334
|
-
nativeInUsd: nativePriceUsd != null ? humanAmountIn * nativePriceUsd : null,
|
|
335
|
-
ratio: { token0Percent: split.ratio0, token1Percent: split.ratio1 },
|
|
336
|
-
expectedToken0: Number(legs[0].minAmountOut) / 10 ** token0Decimals,
|
|
337
|
-
expectedToken1: Number(legs[1].minAmountOut) / 10 ** token1Decimals,
|
|
338
|
-
amount0Min: amount0Min.toString(),
|
|
339
|
-
amount1Min: amount1Min.toString(),
|
|
340
|
-
slippageBps,
|
|
341
|
-
};
|
|
342
|
-
const dataTokens = await this.pantograph.getTokensMetadata([onchain.token0, onchain.token1], chain);
|
|
343
|
-
const token0Info = dataTokens[onchain.token0];
|
|
344
|
-
const token1Info = dataTokens[onchain.token1];
|
|
345
|
-
const props = {
|
|
346
|
-
chain: { hexId: chain, name: meta.name },
|
|
347
|
-
unsignedTx,
|
|
348
|
-
summary: txSummary,
|
|
349
|
-
pool: {
|
|
350
|
-
...onchain,
|
|
351
|
-
feePercent: onchain.fee / 10_000,
|
|
352
|
-
token0: {
|
|
353
|
-
address: onchain.token0,
|
|
354
|
-
symbol: token0Info.symbol,
|
|
355
|
-
name: token0Info.name,
|
|
356
|
-
decimals: token0Info.decimals,
|
|
357
|
-
logo: token0Info.icon_image,
|
|
358
|
-
},
|
|
359
|
-
token1: {
|
|
360
|
-
address: onchain.token1,
|
|
361
|
-
symbol: token1Info.symbol,
|
|
362
|
-
name: token1Info.name,
|
|
363
|
-
decimals: token1Info.decimals,
|
|
364
|
-
logo: token1Info.icon_image,
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
range: resolvedRange,
|
|
368
|
-
gatewayAddress: gateway,
|
|
369
|
-
};
|
|
370
|
-
const ui = { component: 'ConfirmAddLiquidityTx', props };
|
|
371
|
-
return {
|
|
372
|
-
ui,
|
|
373
|
-
summary: `Ready to add ${humanAmountIn} ${native.symbol} to pool ${onchain.token0}/${onchain.token1} ` +
|
|
374
|
-
`${onchain.fee / 10_000}% on ${meta.name}, range [${resolvedRange.minPrice}, ${resolvedRange.maxPrice}].`,
|
|
375
|
-
_instructions: 'A confirmation panel has been opened on the FE; the user will sign and broadcast the unsigned tx with their wallet. ' +
|
|
376
|
-
'Briefly tell them (in their language) what is about to happen — the native amount, the auto-split ratio between the two pool tokens, ' +
|
|
377
|
-
'and the chosen price range. Do NOT mention internal tool/component names.',
|
|
378
|
-
};
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
exports.PreviewAddLiquidityTool = PreviewAddLiquidityTool;
|
|
382
|
-
//# sourceMappingURL=PreviewAddLiquidityTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PreviewAddLiquidityTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/PreviewAddLiquidityTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAYnD,+DAUuC;AACvC,kDAA6D;AAC7D,2EAAwE;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3
|
-
import { type UniswapServiceConfig, type UniswapProtocolVersion } from '../../../services/UniswapService';
|
|
4
|
-
export type TopPoolsToolConfig = UniswapServiceConfig;
|
|
5
|
-
/**
|
|
6
|
-
* Tool: get-top-pools
|
|
7
|
-
*
|
|
8
|
-
* Wraps Uniswap's ExploreStats endpoint
|
|
9
|
-
* (`uniswap.explore.v1.ExploreStatsService/ExploreStats`) to surface the
|
|
10
|
-
* top liquidity pools for a given EVM chain. Returns pools ranked by TVL by
|
|
11
|
-
* default; sorting can be switched to volume or transaction count.
|
|
12
|
-
*/
|
|
13
|
-
export declare class TopPoolsTool extends BaseTool {
|
|
14
|
-
name: string;
|
|
15
|
-
description: string;
|
|
16
|
-
category: string;
|
|
17
|
-
parameters: ToolParameter[];
|
|
18
|
-
private service;
|
|
19
|
-
constructor(config?: TopPoolsToolConfig);
|
|
20
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
21
|
-
error: string;
|
|
22
|
-
_instructions?: undefined;
|
|
23
|
-
chain?: undefined;
|
|
24
|
-
protocolVersion?: undefined;
|
|
25
|
-
sortBy?: undefined;
|
|
26
|
-
count?: undefined;
|
|
27
|
-
pools?: undefined;
|
|
28
|
-
} | {
|
|
29
|
-
_instructions: string;
|
|
30
|
-
chain: string;
|
|
31
|
-
protocolVersion: UniswapProtocolVersion;
|
|
32
|
-
sortBy: "tvl" | "volume1Day" | "volume1Week" | "volume30Day" | "txCount" | "apr";
|
|
33
|
-
count: number;
|
|
34
|
-
pools: {
|
|
35
|
-
apr: number | undefined;
|
|
36
|
-
address: string;
|
|
37
|
-
chain: string | undefined;
|
|
38
|
-
protocolVersion: UniswapProtocolVersion | undefined;
|
|
39
|
-
feeTierBps: number | undefined;
|
|
40
|
-
feeTierPercent: number | undefined;
|
|
41
|
-
tvlUsd: number | undefined;
|
|
42
|
-
volume1DayUsd: number | undefined;
|
|
43
|
-
volume1WeekUsd: number | undefined;
|
|
44
|
-
volume30DayUsd: number | undefined;
|
|
45
|
-
txCount: number | undefined;
|
|
46
|
-
token0: {
|
|
47
|
-
address: string | undefined;
|
|
48
|
-
symbol: string | undefined;
|
|
49
|
-
name: string | undefined;
|
|
50
|
-
decimals: number | undefined;
|
|
51
|
-
priceUsd: number | undefined;
|
|
52
|
-
} | undefined;
|
|
53
|
-
token1: {
|
|
54
|
-
address: string | undefined;
|
|
55
|
-
symbol: string | undefined;
|
|
56
|
-
name: string | undefined;
|
|
57
|
-
decimals: number | undefined;
|
|
58
|
-
priceUsd: number | undefined;
|
|
59
|
-
} | undefined;
|
|
60
|
-
}[];
|
|
61
|
-
error?: undefined;
|
|
62
|
-
}>;
|
|
63
|
-
private parseProtocolVersion;
|
|
64
|
-
private parseSortKey;
|
|
65
|
-
/** Trim the upstream payload to the fields a downstream LLM actually needs. */
|
|
66
|
-
private formatPool;
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=TopPoolsTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopPoolsTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/TopPoolsTool.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,kBAAkB,GAAG,oBAAoB,CAAC;AAOtD;;;;;;;GAOG;AACH,qBAAa,YAAa,SAAQ,QAAQ;IACxC,IAAI,SAAmB;IACvB,WAAW,SAOsE;IACjF,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CA6CzB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,kBAAkB;cAKvB,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuC5E,OAAO,CAAC,oBAAoB;IAU5B,OAAO,CAAC,YAAY;IAUpB,+EAA+E;IAC/E,OAAO,CAAC,UAAU;CAiCnB"}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TopPoolsTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const chainResolver_1 = require("../../chainResolver");
|
|
6
|
-
const UniswapService_1 = require("../../../services/UniswapService");
|
|
7
|
-
const SUPPORTED_SORT_KEYS = ['tvl', 'volume1Day', 'volume1Week', 'volume30Day', 'txCount', 'apr'];
|
|
8
|
-
const SUPPORTED_VERSIONS = ['V2', 'V3', 'V4'];
|
|
9
|
-
/**
|
|
10
|
-
* Tool: get-top-pools
|
|
11
|
-
*
|
|
12
|
-
* Wraps Uniswap's ExploreStats endpoint
|
|
13
|
-
* (`uniswap.explore.v1.ExploreStatsService/ExploreStats`) to surface the
|
|
14
|
-
* top liquidity pools for a given EVM chain. Returns pools ranked by TVL by
|
|
15
|
-
* default; sorting can be switched to volume or transaction count.
|
|
16
|
-
*/
|
|
17
|
-
class TopPoolsTool extends BaseTool_1.BaseTool {
|
|
18
|
-
name = 'get-top-pools';
|
|
19
|
-
description = 'List the top Uniswap liquidity pools on a given EVM chain, ranked by TVL by default. ' +
|
|
20
|
-
"Returns each pool's address, fee tier, protocol version, both tokens (symbol, name, address, decimals), " +
|
|
21
|
-
'TVL, transaction count, and rolling volume buckets (1d / 1w / 30d). ' +
|
|
22
|
-
'Use this tool for questions like: "top pools on Ethereum", "biggest Uniswap V3 pools on Base", ' +
|
|
23
|
-
'"which pool has the most liquidity for USDC", "show pools with highest 24h volume on Arbitrum". ' +
|
|
24
|
-
'Source: https://app.uniswap.org/explore (ExploreStats gateway). ' +
|
|
25
|
-
'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea';
|
|
26
|
-
category = 'blockchain-data';
|
|
27
|
-
parameters = [
|
|
28
|
-
{
|
|
29
|
-
name: 'chain',
|
|
30
|
-
type: 'string',
|
|
31
|
-
description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
32
|
-
'"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.',
|
|
33
|
-
required: false,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'protocolVersion',
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'Uniswap protocol version to filter by: "V2", "V3", or "V4". ' +
|
|
39
|
-
'Default is "V3" (the dataset with the richest stats). ' +
|
|
40
|
-
'Use "V4" only when the user explicitly asks for V4 pools.',
|
|
41
|
-
required: false,
|
|
42
|
-
default: 'V3',
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
name: 'sortBy',
|
|
46
|
-
type: 'string',
|
|
47
|
-
description: 'Ranking metric: "tvl" (total value locked, default), "volume1Day", "volume1Week", ' +
|
|
48
|
-
'"volume30Day", "txCount", or "apr" (estimated annualized fee yield). ' +
|
|
49
|
-
'Pools are returned in descending order by this metric.',
|
|
50
|
-
required: false,
|
|
51
|
-
default: 'tvl',
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'limit',
|
|
55
|
-
type: 'number',
|
|
56
|
-
description: 'Maximum number of pools to return after sorting. Defaults to 10.',
|
|
57
|
-
required: false,
|
|
58
|
-
default: 10,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'multichain',
|
|
62
|
-
type: 'boolean',
|
|
63
|
-
description: "When true, request Uniswap's multichain aggregated view instead of a single chain. " +
|
|
64
|
-
'Defaults to false. Most queries should leave this off.',
|
|
65
|
-
required: false,
|
|
66
|
-
default: false,
|
|
67
|
-
},
|
|
68
|
-
];
|
|
69
|
-
service;
|
|
70
|
-
constructor(config) {
|
|
71
|
-
super();
|
|
72
|
-
this.service = new UniswapService_1.UniswapService(config);
|
|
73
|
-
}
|
|
74
|
-
async run(args, userContext) {
|
|
75
|
-
const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
|
|
76
|
-
const protocolVersion = this.parseProtocolVersion(args.protocolVersion);
|
|
77
|
-
const sortBy = this.parseSortKey(args.sortBy);
|
|
78
|
-
const limit = typeof args.limit === 'number' && Number.isFinite(args.limit) && args.limit > 0
|
|
79
|
-
? Math.min(Math.floor(args.limit), 50)
|
|
80
|
-
: 10;
|
|
81
|
-
const multichain = args.multichain === true;
|
|
82
|
-
const result = await this.service.getTopPools({
|
|
83
|
-
chain,
|
|
84
|
-
protocolVersion,
|
|
85
|
-
sortBy,
|
|
86
|
-
limit,
|
|
87
|
-
multichain,
|
|
88
|
-
});
|
|
89
|
-
if (!result.success) {
|
|
90
|
-
return { error: result.error || 'Failed to fetch top pools' };
|
|
91
|
-
}
|
|
92
|
-
const pools = (result.data ?? []).map((p) => this.formatPool(p));
|
|
93
|
-
return {
|
|
94
|
-
_instructions: 'Present the pools as a ranked list. For each pool show: rank, pair (token0/token1 symbols), apr(in %), ' +
|
|
95
|
-
'fee tier (in %), TVL in USD, 24h volume, 24h fee revenue, and protocol version. ' +
|
|
96
|
-
'Format numbers human-readably (e.g. $12.5M, 0.05%). Mention the chain and the sort metric ' +
|
|
97
|
-
'in the intro line. If a value is null, omit it. Do NOT mention tool or API names.',
|
|
98
|
-
chain,
|
|
99
|
-
protocolVersion,
|
|
100
|
-
sortBy,
|
|
101
|
-
count: pools.length,
|
|
102
|
-
pools,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
parseProtocolVersion(value) {
|
|
106
|
-
if (typeof value === 'string') {
|
|
107
|
-
const upper = value.trim().toUpperCase();
|
|
108
|
-
if (SUPPORTED_VERSIONS.includes(upper)) {
|
|
109
|
-
return upper;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
return 'V3';
|
|
113
|
-
}
|
|
114
|
-
parseSortKey(value) {
|
|
115
|
-
if (typeof value === 'string') {
|
|
116
|
-
const trimmed = value.trim();
|
|
117
|
-
if (SUPPORTED_SORT_KEYS.includes(trimmed)) {
|
|
118
|
-
return trimmed;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
return 'tvl';
|
|
122
|
-
}
|
|
123
|
-
/** Trim the upstream payload to the fields a downstream LLM actually needs. */
|
|
124
|
-
formatPool(p) {
|
|
125
|
-
return {
|
|
126
|
-
apr: p.apr,
|
|
127
|
-
address: p.id,
|
|
128
|
-
chain: p.chain,
|
|
129
|
-
protocolVersion: p.protocolVersion,
|
|
130
|
-
feeTierBps: p.feeTier,
|
|
131
|
-
feeTierPercent: typeof p.feeTier === 'number' ? p.feeTier / 10_000 : undefined,
|
|
132
|
-
tvlUsd: p.totalLiquidity?.value,
|
|
133
|
-
volume1DayUsd: p.volume1Day?.value,
|
|
134
|
-
volume1WeekUsd: p.volume1Week?.value,
|
|
135
|
-
volume30DayUsd: p.volume30Day?.value,
|
|
136
|
-
txCount: p.txCount,
|
|
137
|
-
token0: p.token0
|
|
138
|
-
? {
|
|
139
|
-
address: p.token0.address,
|
|
140
|
-
symbol: p.token0.symbol,
|
|
141
|
-
name: p.token0.name,
|
|
142
|
-
decimals: p.token0.decimals,
|
|
143
|
-
priceUsd: p.token0.price?.value,
|
|
144
|
-
}
|
|
145
|
-
: undefined,
|
|
146
|
-
token1: p.token1
|
|
147
|
-
? {
|
|
148
|
-
address: p.token1.address,
|
|
149
|
-
symbol: p.token1.symbol,
|
|
150
|
-
name: p.token1.name,
|
|
151
|
-
decimals: p.token1.decimals,
|
|
152
|
-
priceUsd: p.token1.price?.value,
|
|
153
|
-
}
|
|
154
|
-
: undefined,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
exports.TopPoolsTool = TopPoolsTool;
|
|
159
|
-
//# sourceMappingURL=TopPoolsTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TopPoolsTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/pool/TopPoolsTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAK0C;AAI1C,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,CAAU,CAAC;AAG3G,MAAM,kBAAkB,GAA6B,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAExE;;;;;;;GAOG;AACH,MAAa,YAAa,SAAQ,mBAAQ;IACxC,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GACT,uFAAuF;QACvF,0GAA0G;QAC1G,sEAAsE;QACtE,iGAAiG;QACjG,kGAAkG;QAClG,kEAAkE;QAClE,8EAA8E,CAAC;IACjF,QAAQ,GAAG,iBAAiB,CAAC;IAC7B,UAAU,GAAoB;QAC5B;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,2FAA2F;gBAC3F,uKAAuK;YACzK,QAAQ,EAAE,KAAK;SAChB;QACD;YACE,IAAI,EAAE,iBAAiB;YACvB,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,8DAA8D;gBAC9D,wDAAwD;gBACxD,2DAA2D;YAC7D,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,IAAI;SACd;QACD;YACE,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,oFAAoF;gBACpF,uEAAuE;gBACvE,wDAAwD;YAC1D,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,KAAK;SACf;QACD;YACE,IAAI,EAAE,OAAO;YACb,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kEAAkE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,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS;YAC9E,MAAM,EAAE,CAAC,CAAC,cAAc,EAAE,KAAK;YAC/B,aAAa,EAAE,CAAC,CAAC,UAAU,EAAE,KAAK;YAClC,cAAc,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK;YACpC,cAAc,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK;YACpC,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,MAAM,EAAE,CAAC,CAAC,MAAM;gBACd,CAAC,CAAC;oBACE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO;oBACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;oBACvB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;oBACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ;oBAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK;iBAChC;gBACH,CAAC,CAAC,SAAS;YACb,MAAM,EAAE,CAAC,CAAC,MAAM;gBACd,CAAC,CAAC;oBACE,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO;oBACzB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM;oBACvB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI;oBACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ;oBAC3B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,EAAE,KAAK;iBAChC;gBACH,CAAC,CAAC,SAAS;SACd,CAAC;IACJ,CAAC;CACF;AA9JD,oCA8JC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export { TopPoolsTool } from './TopPoolsTool';
|
|
2
|
-
export type { TopPoolsToolConfig } from './TopPoolsTool';
|
|
3
|
-
export { PoolDetailTool } from './PoolDetailTool';
|
|
4
|
-
export type { PoolDetailToolConfig } from './PoolDetailTool';
|
|
5
|
-
export { PoolSearchTool } from './PoolSearchTool';
|
|
6
|
-
export type { PoolSearchToolConfig } from './PoolSearchTool';
|
|
7
|
-
export { PoolByAddressTool } from './PoolByAddressTool';
|
|
8
|
-
export type { PoolByAddressToolConfig } from './PoolByAddressTool';
|
|
9
|
-
export { OpenAddLiquidityFormTool } from './OpenAddLiquidityFormTool';
|
|
10
|
-
export type { OpenAddLiquidityFormToolConfig } from './OpenAddLiquidityFormTool';
|
|
11
|
-
export { PreviewAddLiquidityTool } from './PreviewAddLiquidityTool';
|
|
12
|
-
export type { PreviewAddLiquidityToolConfig } from './PreviewAddLiquidityTool';
|
|
13
|
-
export { EstimatePoolYieldTool } from './EstimatePoolYieldTool';
|
|
14
|
-
export type { EstimatePoolYieldToolConfig } from './EstimatePoolYieldTool';
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|