keyring-agent-core 0.2.0 → 0.2.2
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 +4 -3
- 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,50 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from '../../BaseTool';
|
|
2
|
-
import type { ToolParameter, UserContext } from '../../../types';
|
|
3
|
-
import { type MoralisServiceConfig } from '../../../services/MoralisService';
|
|
4
|
-
export type WalletDefiSummaryToolConfig = MoralisServiceConfig;
|
|
5
|
-
/**
|
|
6
|
-
* Tool: get-wallet-defi-summary
|
|
7
|
-
*
|
|
8
|
-
* Queries `GET /wallets/{address}/defi/summary` — a high-level DeFi overview
|
|
9
|
-
* for a wallet: total USD value, total unclaimed rewards, number of active
|
|
10
|
-
* protocols and positions, plus a per-protocol breakdown.
|
|
11
|
-
*
|
|
12
|
-
* Moralis docs: https://docs.moralis.com/data-api/evm/wallet/wallet-protocols
|
|
13
|
-
*/
|
|
14
|
-
export declare class WalletDefiSummaryTool extends BaseTool {
|
|
15
|
-
name: string;
|
|
16
|
-
description: string;
|
|
17
|
-
category: string;
|
|
18
|
-
parameters: ToolParameter[];
|
|
19
|
-
private service;
|
|
20
|
-
constructor(config?: WalletDefiSummaryToolConfig);
|
|
21
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
22
|
-
error: string;
|
|
23
|
-
walletAddress?: undefined;
|
|
24
|
-
chain?: undefined;
|
|
25
|
-
activeProtocols?: undefined;
|
|
26
|
-
totalPositions?: undefined;
|
|
27
|
-
totalUsdValue?: undefined;
|
|
28
|
-
totalUnclaimedUsdValue?: undefined;
|
|
29
|
-
protocols?: undefined;
|
|
30
|
-
} | {
|
|
31
|
-
walletAddress: string;
|
|
32
|
-
chain: string;
|
|
33
|
-
activeProtocols: number;
|
|
34
|
-
totalPositions: number;
|
|
35
|
-
totalUsdValue: number;
|
|
36
|
-
totalUnclaimedUsdValue: number;
|
|
37
|
-
protocols: {
|
|
38
|
-
protocolName: string | undefined;
|
|
39
|
-
protocolId: string | undefined;
|
|
40
|
-
protocolUrl: string | undefined;
|
|
41
|
-
protocolLogo: string | undefined;
|
|
42
|
-
positions: number;
|
|
43
|
-
totalUsdValue: number;
|
|
44
|
-
totalUnclaimedUsdValue: number;
|
|
45
|
-
accountHealthFactor: number | null;
|
|
46
|
-
}[];
|
|
47
|
-
error?: undefined;
|
|
48
|
-
}>;
|
|
49
|
-
}
|
|
50
|
-
//# sourceMappingURL=WalletDefiSummaryTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletDefiSummaryTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletDefiSummaryTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7F,MAAM,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AAE/D;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,QAAQ;IACjD,IAAI,SAA6B;IACjC,WAAW,SASkE;IAC7E,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CAezB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,2BAA2B;cAKhC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkC7E"}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletDefiSummaryTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const chainResolver_1 = require("../../chainResolver");
|
|
6
|
-
const MoralisService_1 = require("../../../services/MoralisService");
|
|
7
|
-
/**
|
|
8
|
-
* Tool: get-wallet-defi-summary
|
|
9
|
-
*
|
|
10
|
-
* Queries `GET /wallets/{address}/defi/summary` — a high-level DeFi overview
|
|
11
|
-
* for a wallet: total USD value, total unclaimed rewards, number of active
|
|
12
|
-
* protocols and positions, plus a per-protocol breakdown.
|
|
13
|
-
*
|
|
14
|
-
* Moralis docs: https://docs.moralis.com/data-api/evm/wallet/wallet-protocols
|
|
15
|
-
*/
|
|
16
|
-
class WalletDefiSummaryTool extends BaseTool_1.BaseTool {
|
|
17
|
-
name = 'get-wallet-defi-summary';
|
|
18
|
-
description = "Get a wallet's DeFi protocols summary: which protocols the wallet is using, " +
|
|
19
|
-
'total USD value locked across all protocols, total unclaimed rewards/fees, ' +
|
|
20
|
-
'number of active protocols, and total number of positions. ' +
|
|
21
|
-
'Returns a per-protocol breakdown (protocol name, logo, url, positions count, usd value, unclaimed). ' +
|
|
22
|
-
'Use for questions like: "Which DeFi protocols am I using?", "What\'s my total DeFi value?", ' +
|
|
23
|
-
'"How much do I have in DeFi?", "Show my DeFi portfolio overview", "Unclaimed rewards across protocols". ' +
|
|
24
|
-
'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea (EVM mainnets only). ' +
|
|
25
|
-
'Do NOT use for: detailed per-position data → get-wallet-defi-positions; ' +
|
|
26
|
-
'positions inside a single protocol → get-wallet-defi-protocol-positions.';
|
|
27
|
-
category = 'blockchain-data';
|
|
28
|
-
parameters = [
|
|
29
|
-
{
|
|
30
|
-
name: 'address',
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'EVM wallet address (0x…). If omitted, uses the connected wallet from user context.',
|
|
33
|
-
required: false,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'chain',
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
39
|
-
'"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea. ONLY set this when the user EXPLICITLY names a chain; otherwise OMIT it so the connected wallet chain is used.',
|
|
40
|
-
required: false,
|
|
41
|
-
},
|
|
42
|
-
];
|
|
43
|
-
service;
|
|
44
|
-
constructor(config) {
|
|
45
|
-
super();
|
|
46
|
-
this.service = new MoralisService_1.MoralisService(config);
|
|
47
|
-
}
|
|
48
|
-
async run(args, userContext) {
|
|
49
|
-
const address = args.address || userContext?.walletAddress || undefined;
|
|
50
|
-
const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
|
|
51
|
-
if (!address) {
|
|
52
|
-
return { error: 'No wallet address available. Please connect a wallet or pass "address".' };
|
|
53
|
-
}
|
|
54
|
-
const result = await this.service.getWalletDefiSummary({ address, chain });
|
|
55
|
-
if (!result.success) {
|
|
56
|
-
return { error: result.error || 'Failed to fetch wallet DeFi summary' };
|
|
57
|
-
}
|
|
58
|
-
const data = result.data;
|
|
59
|
-
return {
|
|
60
|
-
walletAddress: address,
|
|
61
|
-
chain: chain || 'default',
|
|
62
|
-
activeProtocols: data.active_protocols,
|
|
63
|
-
totalPositions: data.total_positions,
|
|
64
|
-
totalUsdValue: data.total_usd_value,
|
|
65
|
-
totalUnclaimedUsdValue: data.total_unclaimed_usd_value,
|
|
66
|
-
protocols: (data.protocols || []).map((p) => ({
|
|
67
|
-
protocolName: p.protocol_name,
|
|
68
|
-
protocolId: p.protocol_id,
|
|
69
|
-
protocolUrl: p.protocol_url,
|
|
70
|
-
protocolLogo: p.protocol_logo,
|
|
71
|
-
positions: p.positions,
|
|
72
|
-
totalUsdValue: p.total_usd_value,
|
|
73
|
-
totalUnclaimedUsdValue: p.total_unclaimed_usd_value,
|
|
74
|
-
accountHealthFactor: p.account_health_factor ?? null,
|
|
75
|
-
})),
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
exports.WalletDefiSummaryTool = WalletDefiSummaryTool;
|
|
80
|
-
//# sourceMappingURL=WalletDefiSummaryTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletDefiSummaryTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletDefiSummaryTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAA6F;AAI7F;;;;;;;;GAQG;AACH,MAAa,qBAAsB,SAAQ,mBAAQ;IACjD,IAAI,GAAG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C1B,OAAO;YACL,aAAa,EAAE,OAAO;YACtB,KAAK,EAAE,KAAK,IAAI,SAAS;YACzB,eAAe,EAAE,IAAI,CAAC,gBAAgB;YACtC,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,aAAa,EAAE,IAAI,CAAC,eAAe;YACnC,sBAAsB,EAAE,IAAI,CAAC,yBAAyB;YACtD,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC5C,YAAY,EAAE,CAAC,CAAC,aAAa;gBAC7B,UAAU,EAAE,CAAC,CAAC,WAAW;gBACzB,WAAW,EAAE,CAAC,CAAC,YAAY;gBAC3B,YAAY,EAAE,CAAC,CAAC,aAAa;gBAC7B,SAAS,EAAE,CAAC,CAAC,SAAS;gBACtB,aAAa,EAAE,CAAC,CAAC,eAAe;gBAChC,sBAAsB,EAAE,CAAC,CAAC,yBAAyB;gBACnD,mBAAmB,EAAE,CAAC,CAAC,qBAAqB,IAAI,IAAI;aACrD,CAAC,CAAC;SACJ,CAAC;IACJ,CAAC;CACF;AAvED,sDAuEC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from '../../BaseTool';
|
|
2
|
-
import type { ToolParameter, UserContext } from '../../../types';
|
|
3
|
-
import { type MoralisServiceConfig, type WalletHistoryItem } from '../../../services/MoralisService';
|
|
4
|
-
export type WalletHistoryToolConfig = MoralisServiceConfig;
|
|
5
|
-
export declare class WalletHistoryTool extends BaseTool {
|
|
6
|
-
name: string;
|
|
7
|
-
description: string;
|
|
8
|
-
category: string;
|
|
9
|
-
parameters: ToolParameter[];
|
|
10
|
-
private service;
|
|
11
|
-
constructor(config?: WalletHistoryToolConfig);
|
|
12
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
13
|
-
error: string;
|
|
14
|
-
walletAddress?: undefined;
|
|
15
|
-
chain?: undefined;
|
|
16
|
-
pagination?: undefined;
|
|
17
|
-
transactionCount?: undefined;
|
|
18
|
-
transactions?: undefined;
|
|
19
|
-
} | {
|
|
20
|
-
walletAddress: string;
|
|
21
|
-
chain: string;
|
|
22
|
-
pagination: {
|
|
23
|
-
cursor: string | null;
|
|
24
|
-
hasMore: boolean;
|
|
25
|
-
};
|
|
26
|
-
transactionCount: number;
|
|
27
|
-
transactions: WalletHistoryItem[];
|
|
28
|
-
error?: undefined;
|
|
29
|
-
}>;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=WalletHistoryTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletHistoryTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletHistoryTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,CAAC;AAE3D,qBAAa,iBAAkB,SAAQ,QAAQ;IAC7C,IAAI,SAAwB;IAC5B,WAAW,SAWyE;IACpF,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CAuEzB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,uBAAuB;cAK5B,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;CAoE7E"}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletHistoryTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const chainResolver_1 = require("../../chainResolver");
|
|
6
|
-
const MoralisService_1 = require("../../../services/MoralisService");
|
|
7
|
-
class WalletHistoryTool extends BaseTool_1.BaseTool {
|
|
8
|
-
name = 'get-wallet-history';
|
|
9
|
-
description = "Get a wallet's decoded on-chain transaction history. Always fetches the latest 100 transactions. " +
|
|
10
|
-
'Each transaction includes: category, summary, from_address, to_address, and nested arrays: ' +
|
|
11
|
-
'native_transfers (each has direction="send"|"receive", from_address, to_address, value_formatted, token_symbol), ' +
|
|
12
|
-
'erc20_transfers (each has direction, token_symbol, value_formatted), nft_transfers. ' +
|
|
13
|
-
'To find ETH sends/receives, inspect native_transfers[].direction — ETH moves appear across many categories ' +
|
|
14
|
-
'(e.g. "token swap", "send", "receive"), not just category="send". ' +
|
|
15
|
-
'Use this tool for: native coin transfers, swaps, airdrops, deposits, withdrawals, contract interactions, mixed history. ' +
|
|
16
|
-
'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea. ' +
|
|
17
|
-
'Returns paginated results — pass cursor to get the next page. ' +
|
|
18
|
-
'Do NOT use for: specific ERC-20 tokens → get-wallet-token-transfers; ' +
|
|
19
|
-
'NFT transfers → get-wallet-nft-transfers; balances → get-wallet-token-balances.';
|
|
20
|
-
category = 'blockchain-data';
|
|
21
|
-
parameters = [
|
|
22
|
-
{
|
|
23
|
-
name: 'address',
|
|
24
|
-
type: 'string',
|
|
25
|
-
description: 'EVM wallet address (0x…). If omitted, uses the connected wallet from user context.',
|
|
26
|
-
required: false,
|
|
27
|
-
},
|
|
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: 'fromDate',
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'Inclusive start date (ISO-8601 or "YYYY-MM-DD").',
|
|
39
|
-
required: false,
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
name: 'toDate',
|
|
43
|
-
type: 'string',
|
|
44
|
-
description: 'Inclusive end date (ISO-8601 or "YYYY-MM-DD").',
|
|
45
|
-
required: false,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
name: 'fromBlock',
|
|
49
|
-
type: 'number',
|
|
50
|
-
description: 'Minimum block number.',
|
|
51
|
-
required: false,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'toBlock',
|
|
55
|
-
type: 'number',
|
|
56
|
-
description: 'Maximum block number.',
|
|
57
|
-
required: false,
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
name: 'cursor',
|
|
61
|
-
type: 'string',
|
|
62
|
-
description: 'Pagination cursor from a previous response.',
|
|
63
|
-
required: false,
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'order',
|
|
67
|
-
type: 'string',
|
|
68
|
-
description: '"DESC" newest first (default) or "ASC" oldest first.',
|
|
69
|
-
required: false,
|
|
70
|
-
default: 'DESC',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
name: 'includeInternalTransactions',
|
|
74
|
-
type: 'boolean',
|
|
75
|
-
description: 'Include decoded internal transactions on each item.',
|
|
76
|
-
required: false,
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
name: 'nftMetadata',
|
|
80
|
-
type: 'boolean',
|
|
81
|
-
description: 'Include NFT normalized metadata in nft_transfers.',
|
|
82
|
-
required: false,
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
name: 'limit',
|
|
86
|
-
type: 'number',
|
|
87
|
-
description: 'Number of transactions to return per page. Defaults to 10.',
|
|
88
|
-
required: false,
|
|
89
|
-
default: 10,
|
|
90
|
-
},
|
|
91
|
-
];
|
|
92
|
-
service;
|
|
93
|
-
constructor(config) {
|
|
94
|
-
super();
|
|
95
|
-
this.service = new MoralisService_1.MoralisService(config);
|
|
96
|
-
}
|
|
97
|
-
async run(args, userContext) {
|
|
98
|
-
const address = args.address || userContext?.walletAddress || undefined;
|
|
99
|
-
const chain = (0, chainResolver_1.resolveChain)(args.chain, userContext);
|
|
100
|
-
if (!address) {
|
|
101
|
-
return { error: 'No wallet address available. Please connect a wallet or pass "address".' };
|
|
102
|
-
}
|
|
103
|
-
const fromDate = typeof args.fromDate === 'string' && args.fromDate ? args.fromDate : undefined;
|
|
104
|
-
const toDate = typeof args.toDate === 'string' && args.toDate ? args.toDate : undefined;
|
|
105
|
-
const fromBlockRaw = typeof args.fromBlock === 'number'
|
|
106
|
-
? args.fromBlock
|
|
107
|
-
: typeof args.fromBlock === 'string' && args.fromBlock
|
|
108
|
-
? Number(args.fromBlock)
|
|
109
|
-
: undefined;
|
|
110
|
-
const toBlockRaw = typeof args.toBlock === 'number'
|
|
111
|
-
? args.toBlock
|
|
112
|
-
: typeof args.toBlock === 'string' && args.toBlock
|
|
113
|
-
? Number(args.toBlock)
|
|
114
|
-
: undefined;
|
|
115
|
-
const fromBlock = Number.isFinite(fromBlockRaw) ? fromBlockRaw : undefined;
|
|
116
|
-
const toBlock = Number.isFinite(toBlockRaw) ? toBlockRaw : undefined;
|
|
117
|
-
const cursor = typeof args.cursor === 'string' && args.cursor ? args.cursor : undefined;
|
|
118
|
-
const rawOrder = typeof args.order === 'string' ? args.order.toUpperCase() : undefined;
|
|
119
|
-
const order = rawOrder === 'ASC' ? 'ASC' : 'DESC';
|
|
120
|
-
const includeInternalTransactions = typeof args.includeInternalTransactions === 'boolean' ? args.includeInternalTransactions : undefined;
|
|
121
|
-
const nftMetadata = typeof args.nftMetadata === 'boolean' ? args.nftMetadata : undefined;
|
|
122
|
-
const limitRaw = typeof args.limit === 'number' ? args.limit : typeof args.limit === 'string' ? Number(args.limit) : undefined;
|
|
123
|
-
const limit = Number.isFinite(limitRaw) && limitRaw > 0 ? limitRaw : 10;
|
|
124
|
-
const result = await this.service.getWalletHistory({
|
|
125
|
-
address,
|
|
126
|
-
chain,
|
|
127
|
-
limit,
|
|
128
|
-
fromDate,
|
|
129
|
-
toDate,
|
|
130
|
-
fromBlock,
|
|
131
|
-
toBlock,
|
|
132
|
-
cursor,
|
|
133
|
-
order,
|
|
134
|
-
includeInternalTransactions,
|
|
135
|
-
nftMetadata,
|
|
136
|
-
});
|
|
137
|
-
if (!result.success) {
|
|
138
|
-
return { error: result.error || 'Failed to fetch wallet history' };
|
|
139
|
-
}
|
|
140
|
-
const transactions = result.data?.result || [];
|
|
141
|
-
return {
|
|
142
|
-
walletAddress: address,
|
|
143
|
-
chain: chain || 'default',
|
|
144
|
-
pagination: {
|
|
145
|
-
cursor: result.data?.cursor ?? null,
|
|
146
|
-
hasMore: !!result.data?.cursor,
|
|
147
|
-
},
|
|
148
|
-
transactionCount: transactions.length,
|
|
149
|
-
transactions,
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
exports.WalletHistoryTool = WalletHistoryTool;
|
|
154
|
-
//# sourceMappingURL=WalletHistoryTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletHistoryTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletHistoryTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,uDAAmD;AAEnD,qEAAqH;AAIrH,MAAa,iBAAkB,SAAQ,mBAAQ;IAC7C,IAAI,GAAG,oBAAoB,CAAC;IAC5B,WAAW,GACT,mGAAmG;QACnG,6FAA6F;QAC7F,mHAAmH;QACnH,sFAAsF;QACtF,6GAA6G;QAC7G,oEAAoE;QACpE,0HAA0H;QAC1H,gFAAgF;QAChF,gEAAgE;QAChE,uEAAuE;QACvE,iFAAiF,CAAC;IACpF,QAAQ,GA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AAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAChH,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAK,QAAmB,GAAG,CAAC,CAAC,CAAC,CAAE,QAAmB,CAAC,CAAC,CAAC,EAAE,CAAC;QAEhG,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAAC;YACjD,OAAO;YACP,KAAK;YACL,KAAK;YACL,QAAQ;YACR,MAAM;YACN,SAAS;YACT,OAAO;YACP,MAAM;YACN,KAAK;YACL,2BAA2B;YAC3B,WAAW;SACZ,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,gCAAgC,EAAE,CAAC;QACrE,CAAC;QAED,MAAM,YAAY,GAAwB,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,EAAE,CAAC;QAEpE,OAAO;YACL,aAAa,EAAE,OAAO;YACtB,KAAK,EAAE,KAAK,IAAI,SAAS;YACzB,UAAU,EAAE;gBACV,MAAM,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,IAAI,IAAI;gBACnC,OAAO,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM;aAC/B;YACD,gBAAgB,EAAE,YAAY,CAAC,MAAM;YACrC,YAAY;SACb,CAAC;IACJ,CAAC;CACF;AAnKD,8CAmKC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from '../../BaseTool';
|
|
2
|
-
import type { ToolParameter, UserContext } from '../../../types';
|
|
3
|
-
import { type MoralisServiceConfig } from '../../../services/MoralisService';
|
|
4
|
-
export type WalletNetWorthToolConfig = MoralisServiceConfig;
|
|
5
|
-
/**
|
|
6
|
-
* Tool: get-wallet-net-worth
|
|
7
|
-
*
|
|
8
|
-
* Queries `GET /wallets/{address}/net-worth` to return a wallet's total USD
|
|
9
|
-
* value across one or more chains. Response includes per-chain breakdown
|
|
10
|
-
* (native + token USD value) plus a grand total.
|
|
11
|
-
*/
|
|
12
|
-
export declare class WalletNetWorthTool extends BaseTool {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
category: string;
|
|
16
|
-
parameters: ToolParameter[];
|
|
17
|
-
private service;
|
|
18
|
-
constructor(config?: WalletNetWorthToolConfig);
|
|
19
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
20
|
-
error: string;
|
|
21
|
-
walletAddress?: undefined;
|
|
22
|
-
chainsQueried?: undefined;
|
|
23
|
-
filters?: undefined;
|
|
24
|
-
totalNetWorthUsd?: undefined;
|
|
25
|
-
chains?: undefined;
|
|
26
|
-
unsupportedChainIds?: undefined;
|
|
27
|
-
unavailableChains?: undefined;
|
|
28
|
-
} | {
|
|
29
|
-
walletAddress: string;
|
|
30
|
-
chainsQueried: string[];
|
|
31
|
-
filters: {
|
|
32
|
-
excludeSpam: boolean;
|
|
33
|
-
excludeUnverifiedContracts: boolean | null;
|
|
34
|
-
maxTokenInactivity: number | null;
|
|
35
|
-
minPairSideLiquidityUsd: number | null;
|
|
36
|
-
};
|
|
37
|
-
totalNetWorthUsd: string;
|
|
38
|
-
chains: import("../../../services/MoralisService").WalletNetWorthChainBreakdown[];
|
|
39
|
-
unsupportedChainIds: string[];
|
|
40
|
-
unavailableChains: import("../../../services/MoralisService").WalletNetWorthUnavailableChain[];
|
|
41
|
-
error?: undefined;
|
|
42
|
-
}>;
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=WalletNetWorthTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletNetWorthTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletNetWorthTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAE7F,MAAM,MAAM,wBAAwB,GAAG,oBAAoB,CAAC;AAE5D;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,QAAQ;IAC9C,IAAI,SAA0B;IAC9B,WAAW,SAWwC;IACnD,QAAQ,SAAqB;IAC7B,UAAU,EAAE,aAAa,EAAE,CA2CzB;IAEF,OAAO,CAAC,OAAO,CAAiB;gBAEpB,MAAM,CAAC,EAAE,wBAAwB;cAK7B,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW;;;;;;;;;;;;;;;;;;;;;;;;CAwD7E"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WalletNetWorthTool = void 0;
|
|
4
|
-
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
-
const MoralisService_1 = require("../../../services/MoralisService");
|
|
6
|
-
/**
|
|
7
|
-
* Tool: get-wallet-net-worth
|
|
8
|
-
*
|
|
9
|
-
* Queries `GET /wallets/{address}/net-worth` to return a wallet's total USD
|
|
10
|
-
* value across one or more chains. Response includes per-chain breakdown
|
|
11
|
-
* (native + token USD value) plus a grand total.
|
|
12
|
-
*/
|
|
13
|
-
class WalletNetWorthTool extends BaseTool_1.BaseTool {
|
|
14
|
-
name = 'get-wallet-net-worth';
|
|
15
|
-
description = "Get a wallet's total net worth in USD, with a per-chain breakdown. " +
|
|
16
|
-
'Returns: total_networth_usd (grand total across all queried chains), ' +
|
|
17
|
-
'chains[] (each with chain, native_balance_formatted, native_balance_usd, token_balance_usd, networth_usd), ' +
|
|
18
|
-
'and optional unsupported_chain_ids / unavailable_chains lists. ' +
|
|
19
|
-
'Use this tool for questions like: ' +
|
|
20
|
-
'"How much is my wallet worth?", "What is my total portfolio value?", ' +
|
|
21
|
-
'"What is my net worth on Ethereum?", "Portfolio value across all chains?". ' +
|
|
22
|
-
'Pass chains=["0x1","0x2105"] to query multiple chains at once; defaults to the connected chain. ' +
|
|
23
|
-
'Supports: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea. ' +
|
|
24
|
-
'Do NOT use for: individual token balances → get-wallet-token-balances; ' +
|
|
25
|
-
'realized profit/loss → get-wallet-pnl-summary.';
|
|
26
|
-
category = 'blockchain-data';
|
|
27
|
-
parameters = [
|
|
28
|
-
{
|
|
29
|
-
name: 'address',
|
|
30
|
-
type: 'string',
|
|
31
|
-
description: 'EVM wallet address (0x…). If omitted, uses the connected wallet from user context.',
|
|
32
|
-
required: false,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
name: 'chains',
|
|
36
|
-
type: 'array',
|
|
37
|
-
description: 'One or more hex chain IDs to aggregate. Values: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
38
|
-
'"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea ' +
|
|
39
|
-
'If omitted, defaults to the connected chain.',
|
|
40
|
-
required: false,
|
|
41
|
-
items: { type: 'string' },
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'excludeSpam',
|
|
45
|
-
type: 'boolean',
|
|
46
|
-
description: 'Exclude tokens flagged as spam. Default true for cleaner totals.',
|
|
47
|
-
required: false,
|
|
48
|
-
default: true,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'excludeUnverifiedContracts',
|
|
52
|
-
type: 'boolean',
|
|
53
|
-
description: 'Exclude unverified token contracts. Default false.',
|
|
54
|
-
required: false,
|
|
55
|
-
default: false,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: 'maxTokenInactivity',
|
|
59
|
-
type: 'number',
|
|
60
|
-
description: 'Exclude tokens that have been inactive for more than N days.',
|
|
61
|
-
required: false,
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
name: 'minPairSideLiquidityUsd',
|
|
65
|
-
type: 'number',
|
|
66
|
-
description: 'Exclude tokens with pair-side liquidity below this USD threshold.',
|
|
67
|
-
required: false,
|
|
68
|
-
},
|
|
69
|
-
];
|
|
70
|
-
service;
|
|
71
|
-
constructor(config) {
|
|
72
|
-
super();
|
|
73
|
-
this.service = new MoralisService_1.MoralisService(config);
|
|
74
|
-
}
|
|
75
|
-
async run(args, userContext) {
|
|
76
|
-
const address = args.address || userContext?.walletAddress || undefined;
|
|
77
|
-
if (!address) {
|
|
78
|
-
return { error: 'No wallet address available. Please connect a wallet or pass "address".' };
|
|
79
|
-
}
|
|
80
|
-
const chains = Array.isArray(args.chains)
|
|
81
|
-
? args.chains.filter((c) => typeof c === 'string' && !!c).map((c) => c.trim())
|
|
82
|
-
: undefined;
|
|
83
|
-
const fallbackChain = userContext?.chain;
|
|
84
|
-
const chainsToQuery = chains && chains.length > 0 ? chains : fallbackChain ? [fallbackChain] : undefined;
|
|
85
|
-
const excludeSpam = typeof args.excludeSpam === 'boolean' ? args.excludeSpam : true;
|
|
86
|
-
const excludeUnverifiedContracts = typeof args.excludeUnverifiedContracts === 'boolean' ? args.excludeUnverifiedContracts : undefined;
|
|
87
|
-
const maxTokenInactivity = typeof args.maxTokenInactivity === 'number' && Number.isFinite(args.maxTokenInactivity)
|
|
88
|
-
? args.maxTokenInactivity
|
|
89
|
-
: undefined;
|
|
90
|
-
const minPairSideLiquidityUsd = typeof args.minPairSideLiquidityUsd === 'number' && Number.isFinite(args.minPairSideLiquidityUsd)
|
|
91
|
-
? args.minPairSideLiquidityUsd
|
|
92
|
-
: undefined;
|
|
93
|
-
const result = await this.service.getWalletNetWorth({
|
|
94
|
-
address,
|
|
95
|
-
chains: chainsToQuery,
|
|
96
|
-
excludeSpam,
|
|
97
|
-
excludeUnverifiedContracts,
|
|
98
|
-
maxTokenInactivity,
|
|
99
|
-
minPairSideLiquidityUsd,
|
|
100
|
-
});
|
|
101
|
-
if (!result.success) {
|
|
102
|
-
return { error: result.error || 'Failed to fetch wallet net worth' };
|
|
103
|
-
}
|
|
104
|
-
const data = result.data;
|
|
105
|
-
return {
|
|
106
|
-
walletAddress: address,
|
|
107
|
-
chainsQueried: chainsToQuery ?? ['default'],
|
|
108
|
-
filters: {
|
|
109
|
-
excludeSpam,
|
|
110
|
-
excludeUnverifiedContracts: excludeUnverifiedContracts ?? null,
|
|
111
|
-
maxTokenInactivity: maxTokenInactivity ?? null,
|
|
112
|
-
minPairSideLiquidityUsd: minPairSideLiquidityUsd ?? null,
|
|
113
|
-
},
|
|
114
|
-
totalNetWorthUsd: data.total_networth_usd,
|
|
115
|
-
chains: data.chains,
|
|
116
|
-
unsupportedChainIds: data.unsupported_chain_ids ?? [],
|
|
117
|
-
unavailableChains: data.unavailable_chains ?? [],
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
exports.WalletNetWorthTool = WalletNetWorthTool;
|
|
122
|
-
//# sourceMappingURL=WalletNetWorthTool.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletNetWorthTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletNetWorthTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAE1C,qEAA6F;AAI7F;;;;;;GAMG;AACH,MAAa,kBAAmB,SAAQ,mBAAQ;IAC9C,IAAI,GAAG,sBAAsB,CAAC;IAC9B,WAAW,GACT,qEAAqE;QACrE,uEAAuE;QACvE,6GAA6G;QAC7G,iEAAiE;QACjE,oCAAoC;QACpC,uEAAuE;QACvE,6EAA6E;QAC7E,kGAAkG;QAClG,gFAAgF;QAChF,yEAAyE;QACzE,gDAAgD,CAAC;IACnD,QAAQ,GAAG,iBAAiB,CAAC;IAC7B,UAAU,GAAoB;QAC5B;YACE,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ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B,kBAAkB;YAClB,uBAAuB;SACxB,CAAC,CAAC;QAEH,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,IAAI,kCAAkC,EAAE,CAAC;QACvE,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAK,CAAC;QAE1B,OAAO;YACL,aAAa,EAAE,OAAO;YACtB,aAAa,EAAE,aAAa,IAAI,CAAC,SAAS,CAAC;YAC3C,OAAO,EAAE;gBACP,WAAW;gBACX,0BAA0B,EAAE,0BAA0B,IAAI,IAAI;gBAC9D,kBAAkB,EAAE,kBAAkB,IAAI,IAAI;gBAC9C,uBAAuB,EAAE,uBAAuB,IAAI,IAAI;aACzD;YACD,gBAAgB,EAAE,IAAI,CAAC,kBAAkB;YACzC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,mBAAmB,EAAE,IAAI,CAAC,qBAAqB,IAAI,EAAE;YACrD,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,IAAI,EAAE;SACjD,CAAC;IACJ,CAAC;CACF;AA3HD,gDA2HC"}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { BaseTool } from '../../BaseTool';
|
|
2
|
-
import type { ToolParameter, UserContext } from '../../../types';
|
|
3
|
-
import { type MoralisServiceConfig, type WalletNftTransferItem } from '../../../services/MoralisService';
|
|
4
|
-
export type WalletNftTransfersToolConfig = MoralisServiceConfig;
|
|
5
|
-
interface EnrichedNftTransfer extends WalletNftTransferItem {
|
|
6
|
-
/** "send" = wallet sent this NFT, "receive" = wallet received it */
|
|
7
|
-
direction: 'send' | 'receive';
|
|
8
|
-
/** The other party's address */
|
|
9
|
-
counterparty: string;
|
|
10
|
-
counterparty_label?: string;
|
|
11
|
-
counterparty_entity?: string;
|
|
12
|
-
}
|
|
13
|
-
interface NftCounterpartySummary {
|
|
14
|
-
address: string;
|
|
15
|
-
label?: string;
|
|
16
|
-
entity?: string;
|
|
17
|
-
token_ids: string[];
|
|
18
|
-
collections: string[];
|
|
19
|
-
tx_count: number;
|
|
20
|
-
first_seen: string;
|
|
21
|
-
last_seen: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Tool: get-wallet-nft-transfers
|
|
25
|
-
*
|
|
26
|
-
* Queries the dedicated Moralis NFT transfer endpoint
|
|
27
|
-
* `GET /{address}/nft/transfers`, which returns every NFT transfer involving
|
|
28
|
-
* the wallet — optionally scoped to specific NFT contract addresses.
|
|
29
|
-
*
|
|
30
|
-
* Each item is enriched with:
|
|
31
|
-
* - `direction`: "send" or "receive" (from from_address vs wallet)
|
|
32
|
-
* - `counterparty`: the other address with optional label/entity
|
|
33
|
-
* - `last_sale`: purchase price data if `includePrices=true`
|
|
34
|
-
*
|
|
35
|
-
* The response includes a `counterparties` aggregation with token IDs,
|
|
36
|
-
* collections, and timestamps for each unique sender/recipient.
|
|
37
|
-
*/
|
|
38
|
-
export declare class WalletNftTransfersTool extends BaseTool {
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
category: string;
|
|
42
|
-
parameters: ToolParameter[];
|
|
43
|
-
private service;
|
|
44
|
-
constructor(config?: WalletNftTransfersToolConfig);
|
|
45
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
46
|
-
error: string;
|
|
47
|
-
walletAddress?: undefined;
|
|
48
|
-
chain?: undefined;
|
|
49
|
-
filters?: undefined;
|
|
50
|
-
pagination?: undefined;
|
|
51
|
-
transferCount?: undefined;
|
|
52
|
-
transfers?: undefined;
|
|
53
|
-
counterparties?: undefined;
|
|
54
|
-
} | {
|
|
55
|
-
walletAddress: string;
|
|
56
|
-
chain: string;
|
|
57
|
-
filters: {
|
|
58
|
-
contractAddresses: string[] | null;
|
|
59
|
-
direction: "receive" | "send" | "all";
|
|
60
|
-
limit: number;
|
|
61
|
-
order: "ASC" | "DESC";
|
|
62
|
-
fromDate: string | null;
|
|
63
|
-
toDate: string | null;
|
|
64
|
-
fromBlock: number | null;
|
|
65
|
-
toBlock: number | null;
|
|
66
|
-
includePrices: boolean | null;
|
|
67
|
-
};
|
|
68
|
-
pagination: {
|
|
69
|
-
cursor: string | null;
|
|
70
|
-
pageSize: number;
|
|
71
|
-
page: number | null;
|
|
72
|
-
hasMore: boolean;
|
|
73
|
-
};
|
|
74
|
-
transferCount: number;
|
|
75
|
-
transfers: EnrichedNftTransfer[];
|
|
76
|
-
counterparties: {
|
|
77
|
-
sent: NftCounterpartySummary[];
|
|
78
|
-
received: NftCounterpartySummary[];
|
|
79
|
-
};
|
|
80
|
-
error?: undefined;
|
|
81
|
-
}>;
|
|
82
|
-
private buildCounterparties;
|
|
83
|
-
private parseBlock;
|
|
84
|
-
}
|
|
85
|
-
export {};
|
|
86
|
-
//# sourceMappingURL=WalletNftTransfersTool.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WalletNftTransfersTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/wallet/WalletNftTransfersTool.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,EACzB,KAAK,qBAAqB,EAC3B,MAAM,kCAAkC,CAAC;AAE1C,MAAM,MAAM,4BAA4B,GAAG,oBAAoB,CAAC;AAEhE,UAAU,mBAAoB,SAAQ,qBAAqB;IACzD,oEAAoE;IACpE,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,gCAAgC;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,UAAU,sBAAsB;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,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