keyring-agent-core 0.1.1 → 0.2.1
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/agent/AgentCore.d.ts +37 -1
- package/dist/agent/AgentCore.d.ts.map +1 -1
- package/dist/agent/AgentCore.js +287 -144
- package/dist/agent/AgentCore.js.map +1 -1
- package/dist/agent/QueryRewriter.d.ts +17 -0
- package/dist/agent/QueryRewriter.d.ts.map +1 -1
- package/dist/agent/QueryRewriter.js +48 -4
- package/dist/agent/QueryRewriter.js.map +1 -1
- package/dist/agent/Router.d.ts.map +1 -1
- package/dist/agent/Router.js +73 -35
- package/dist/agent/Router.js.map +1 -1
- package/dist/agent/Subagent.d.ts +17 -0
- package/dist/agent/Subagent.d.ts.map +1 -1
- package/dist/agent/Subagent.js +32 -0
- package/dist/agent/Subagent.js.map +1 -1
- package/dist/agent/chatGraph.d.ts +364 -0
- package/dist/agent/chatGraph.d.ts.map +1 -0
- package/dist/agent/chatGraph.js +184 -0
- package/dist/agent/chatGraph.js.map +1 -0
- package/dist/agent/subagents/AiAgent.d.ts +1 -1
- package/dist/agent/subagents/AiAgent.d.ts.map +1 -1
- package/dist/agent/subagents/AiAgent.js +24 -20
- package/dist/agent/subagents/AiAgent.js.map +1 -1
- package/dist/agent/subagents/NftAgent.d.ts +1 -1
- package/dist/agent/subagents/NftAgent.d.ts.map +1 -1
- package/dist/agent/subagents/NftAgent.js +36 -26
- package/dist/agent/subagents/NftAgent.js.map +1 -1
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts +6 -0
- package/dist/agent/subagents/PoolSubgraphAgent.d.ts.map +1 -0
- package/dist/agent/subagents/PoolSubgraphAgent.js +117 -0
- package/dist/agent/subagents/PoolSubgraphAgent.js.map +1 -0
- package/dist/agent/subagents/TokenAgent.d.ts +1 -1
- package/dist/agent/subagents/TokenAgent.d.ts.map +1 -1
- package/dist/agent/subagents/TokenAgent.js +23 -22
- package/dist/agent/subagents/TokenAgent.js.map +1 -1
- package/dist/agent/subagents/WalletActionAgent.d.ts +6 -0
- package/dist/agent/subagents/WalletActionAgent.d.ts.map +1 -0
- package/dist/agent/subagents/WalletActionAgent.js +55 -0
- package/dist/agent/subagents/WalletActionAgent.js.map +1 -0
- package/dist/agent/subagents/WalletAgent.d.ts +1 -1
- package/dist/agent/subagents/WalletAgent.d.ts.map +1 -1
- package/dist/agent/subagents/WalletAgent.js +18 -17
- package/dist/agent/subagents/WalletAgent.js.map +1 -1
- package/dist/agent/subagents/index.d.ts +23 -3
- package/dist/agent/subagents/index.d.ts.map +1 -1
- package/dist/agent/subagents/index.js +42 -11
- package/dist/agent/subagents/index.js.map +1 -1
- package/dist/constants/abi.d.ts +31 -0
- package/dist/constants/abi.d.ts.map +1 -1
- package/dist/constants/abi.js +24 -1
- package/dist/constants/abi.js.map +1 -1
- package/dist/functions/web3.d.ts +0 -1
- package/dist/functions/web3.d.ts.map +1 -1
- package/dist/functions/web3.js +0 -45
- package/dist/functions/web3.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/llm/GeminiProvider.d.ts.map +1 -1
- package/dist/llm/GeminiProvider.js +115 -34
- package/dist/llm/GeminiProvider.js.map +1 -1
- package/dist/memory/UpstashKnowledgeBase.d.ts +1 -1
- package/dist/memory/UpstashKnowledgeBase.js +1 -1
- package/dist/services/MoralisService.d.ts +3 -25
- package/dist/services/MoralisService.d.ts.map +1 -1
- package/dist/services/MoralisService.js +7 -132
- package/dist/services/MoralisService.js.map +1 -1
- package/dist/services/PantographService.d.ts +61 -1
- package/dist/services/PantographService.d.ts.map +1 -1
- package/dist/services/PantographService.js +264 -12
- package/dist/services/PantographService.js.map +1 -1
- package/dist/services/PoolService.d.ts +1 -4
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/PoolService.js +18 -40
- package/dist/services/PoolService.js.map +1 -1
- package/dist/services/UniswapSubgraphService.d.ts +144 -0
- package/dist/services/UniswapSubgraphService.d.ts.map +1 -0
- package/dist/services/UniswapSubgraphService.js +606 -0
- package/dist/services/UniswapSubgraphService.js.map +1 -0
- package/dist/services/rpc.d.ts +35 -0
- package/dist/services/rpc.d.ts.map +1 -0
- package/dist/services/rpc.js +110 -0
- package/dist/services/rpc.js.map +1 -0
- package/dist/services/swap/DebridgeAdapter.d.ts +17 -0
- package/dist/services/swap/DebridgeAdapter.d.ts.map +1 -1
- package/dist/services/swap/DebridgeAdapter.js +74 -6
- package/dist/services/swap/DebridgeAdapter.js.map +1 -1
- package/dist/services/swap/SwapServiceFactory.d.ts +1 -0
- package/dist/services/swap/SwapServiceFactory.d.ts.map +1 -1
- package/dist/services/swap/SwapServiceFactory.js +8 -3
- package/dist/services/swap/SwapServiceFactory.js.map +1 -1
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts +36 -0
- package/dist/tools/builtin/ai/GeminiSearchAiTool.d.ts.map +1 -0
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js +91 -0
- package/dist/tools/builtin/ai/GeminiSearchAiTool.js.map +1 -0
- package/dist/tools/builtin/ai/index.d.ts +2 -4
- package/dist/tools/builtin/ai/index.d.ts.map +1 -1
- package/dist/tools/builtin/ai/index.js +3 -5
- package/dist/tools/builtin/ai/index.js.map +1 -1
- package/dist/tools/builtin/index.d.ts +2 -0
- package/dist/tools/builtin/index.d.ts.map +1 -1
- package/dist/tools/builtin/index.js +2 -0
- package/dist/tools/builtin/index.js.map +1 -1
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts +35 -0
- package/dist/tools/builtin/nft/BaseNftMessageTool.d.ts.map +1 -0
- package/dist/tools/builtin/nft/BaseNftMessageTool.js +45 -0
- package/dist/tools/builtin/nft/BaseNftMessageTool.js.map +1 -0
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts +7 -13
- package/dist/tools/builtin/nft/NFTContractInfoTool.d.ts.map +1 -1
- package/dist/tools/builtin/nft/NFTContractInfoTool.js +8 -43
- package/dist/tools/builtin/nft/NFTContractInfoTool.js.map +1 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts +7 -113
- package/dist/tools/builtin/nft/NFTMetadataTool.d.ts.map +1 -1
- package/dist/tools/builtin/nft/NFTMetadataTool.js +9 -148
- package/dist/tools/builtin/nft/NFTMetadataTool.js.map +1 -1
- package/dist/tools/builtin/nft/SendNftTool.d.ts +14 -0
- package/dist/tools/builtin/nft/SendNftTool.d.ts.map +1 -0
- package/dist/tools/builtin/nft/SendNftTool.js +20 -0
- package/dist/tools/builtin/nft/SendNftTool.js.map +1 -0
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts +7 -74
- package/dist/tools/builtin/nft/WalletNFTsTool.d.ts.map +1 -1
- package/dist/tools/builtin/nft/WalletNFTsTool.js +9 -161
- package/dist/tools/builtin/nft/WalletNFTsTool.js.map +1 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js +4 -3
- package/dist/tools/builtin/pool/EstimatePoolYieldTool.js.map +1 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts +1 -0
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js +8 -5
- package/dist/tools/builtin/pool/OpenAddLiquidityFormTool.js.map +1 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PoolByAddressTool.js +4 -3
- package/dist/tools/builtin/pool/PoolByAddressTool.js.map +1 -1
- package/dist/tools/builtin/pool/PoolDetailTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PoolDetailTool.js +4 -3
- package/dist/tools/builtin/pool/PoolDetailTool.js.map +1 -1
- package/dist/tools/builtin/pool/PoolSearchTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PoolSearchTool.js +4 -3
- package/dist/tools/builtin/pool/PoolSearchTool.js.map +1 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts +1 -0
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js +5 -3
- package/dist/tools/builtin/pool/PreviewAddLiquidityTool.js.map +1 -1
- package/dist/tools/builtin/pool/TopPoolsTool.d.ts.map +1 -1
- package/dist/tools/builtin/pool/TopPoolsTool.js +4 -3
- package/dist/tools/builtin/pool/TopPoolsTool.js.map +1 -1
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts +54 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js +98 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphCoinPoolPairsTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts +63 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js +82 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByAddressTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts +79 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js +97 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolByPositionIdTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts +77 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js +190 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPoolSearchTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts +107 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js +92 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphPositionDetailTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts +56 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js +94 -0
- package/dist/tools/builtin/pool-subgraph/SubgraphTrendingPoolsTool.js.map +1 -0
- package/dist/tools/builtin/pool-subgraph/index.d.ts +13 -0
- package/dist/tools/builtin/pool-subgraph/index.d.ts.map +1 -0
- package/dist/tools/builtin/pool-subgraph/index.js +18 -0
- package/dist/tools/builtin/pool-subgraph/index.js.map +1 -0
- package/dist/tools/builtin/token/TokenAnalyticsTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenAnalyticsTool.js +4 -3
- package/dist/tools/builtin/token/TokenAnalyticsTool.js.map +1 -1
- package/dist/tools/builtin/token/TokenHoldersTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenHoldersTool.js +4 -3
- package/dist/tools/builtin/token/TokenHoldersTool.js.map +1 -1
- package/dist/tools/builtin/token/TokenInfoTool.d.ts +6 -2
- package/dist/tools/builtin/token/TokenInfoTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenInfoTool.js +66 -8
- package/dist/tools/builtin/token/TokenInfoTool.js.map +1 -1
- package/dist/tools/builtin/token/TokenScoreTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TokenScoreTool.js +4 -3
- package/dist/tools/builtin/token/TokenScoreTool.js.map +1 -1
- package/dist/tools/builtin/token/TopGainersTool.d.ts +10 -19
- package/dist/tools/builtin/token/TopGainersTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TopGainersTool.js +44 -54
- package/dist/tools/builtin/token/TopGainersTool.js.map +1 -1
- package/dist/tools/builtin/token/TopLosersTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TopLosersTool.js +3 -2
- package/dist/tools/builtin/token/TopLosersTool.js.map +1 -1
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts +1 -1
- package/dist/tools/builtin/token/TrendingTokensTool.d.ts.map +1 -1
- package/dist/tools/builtin/token/TrendingTokensTool.js +20 -12
- package/dist/tools/builtin/token/TrendingTokensTool.js.map +1 -1
- package/dist/tools/builtin/token/index.d.ts +0 -2
- package/dist/tools/builtin/token/index.d.ts.map +1 -1
- package/dist/tools/builtin/token/index.js +1 -3
- package/dist/tools/builtin/token/index.js.map +1 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/TransactionByHashTool.js +4 -3
- package/dist/tools/builtin/wallet/TransactionByHashTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletApprovalsTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletDefiPositionsTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletDefiProtocolPositionsTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletDefiSummaryTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletHistoryTool.js +5 -4
- package/dist/tools/builtin/wallet/WalletHistoryTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js +1 -1
- package/dist/tools/builtin/wallet/WalletNetWorthTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js +5 -4
- package/dist/tools/builtin/wallet/WalletNftTransfersTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletPnlSummaryTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletPnlTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletPnlTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js +4 -3
- package/dist/tools/builtin/wallet/WalletTokenBalancesTool.js.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js +5 -4
- package/dist/tools/builtin/wallet/WalletTokenTransfersTool.js.map +1 -1
- package/dist/tools/builtin/wallet/index.d.ts +3 -0
- package/dist/tools/builtin/wallet/index.d.ts.map +1 -1
- package/dist/tools/builtin/wallet/index.js +5 -1
- package/dist/tools/builtin/wallet/index.js.map +1 -1
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts +25 -0
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js +98 -0
- package/dist/tools/builtin/wallet-action/ApproveTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts +211 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js +499 -0
- package/dist/tools/builtin/wallet-action/BaseWalletActionTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts +240 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js +1257 -0
- package/dist/tools/builtin/wallet-action/BuyTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts +41 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.js +127 -0
- package/dist/tools/builtin/wallet-action/SendNativeTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts +63 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.js +294 -0
- package/dist/tools/builtin/wallet-action/SendTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts +247 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js +1258 -0
- package/dist/tools/builtin/wallet-action/SwapTokenTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts +20 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js +36 -0
- package/dist/tools/builtin/wallet-action/UnwrapNativeTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts +23 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js +54 -0
- package/dist/tools/builtin/wallet-action/WrapNativeTool.js.map +1 -0
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts +62 -0
- package/dist/tools/builtin/wallet-action/amountSpec.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/amountSpec.js +93 -0
- package/dist/tools/builtin/wallet-action/amountSpec.js.map +1 -0
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts +42 -0
- package/dist/tools/builtin/wallet-action/gasReserve.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/gasReserve.js +103 -0
- package/dist/tools/builtin/wallet-action/gasReserve.js.map +1 -0
- package/dist/tools/builtin/wallet-action/index.d.ts +9 -0
- package/dist/tools/builtin/wallet-action/index.d.ts.map +1 -0
- package/dist/tools/builtin/wallet-action/index.js +20 -0
- package/dist/tools/builtin/wallet-action/index.js.map +1 -0
- package/dist/tools/chainResolver.d.ts +98 -0
- package/dist/tools/chainResolver.d.ts.map +1 -0
- package/dist/tools/chainResolver.js +302 -0
- package/dist/tools/chainResolver.js.map +1 -0
- package/dist/types/index.d.ts +218 -7
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +5 -2
- package/dist/tools/builtin/ai/MoralisCortexTool.d.ts +0 -33
- package/dist/tools/builtin/ai/MoralisCortexTool.d.ts.map +0 -1
- package/dist/tools/builtin/ai/MoralisCortexTool.js +0 -76
- package/dist/tools/builtin/ai/MoralisCortexTool.js.map +0 -1
- package/dist/tools/builtin/ai/SolanaCortexTool.d.ts +0 -22
- package/dist/tools/builtin/ai/SolanaCortexTool.d.ts.map +0 -1
- package/dist/tools/builtin/ai/SolanaCortexTool.js +0 -80
- package/dist/tools/builtin/ai/SolanaCortexTool.js.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseNftMessageTool = void 0;
|
|
4
|
+
const BaseTool_1 = require("../../BaseTool");
|
|
5
|
+
/**
|
|
6
|
+
* Shared base for the canned-message NFT notice tools (`send-nft`,
|
|
7
|
+
* `get-wallet-nfts`, `get-nft-metadata`, `get-nft-contract-info`).
|
|
8
|
+
*
|
|
9
|
+
* Each tool emits one fixed sentence that points the user at a website. The
|
|
10
|
+
* phrase "this website" is rendered as a Markdown link to `config.url` when one
|
|
11
|
+
* was supplied at AgentCore construction; otherwise it stays plain text. The
|
|
12
|
+
* tool takes no arguments — it returns the fully-built Markdown message plus
|
|
13
|
+
* `_instructions` telling the agent to reply with it verbatim.
|
|
14
|
+
*/
|
|
15
|
+
class BaseNftMessageTool extends BaseTool_1.BaseTool {
|
|
16
|
+
kind = 'data';
|
|
17
|
+
category = 'nft';
|
|
18
|
+
// The message points the user at a concrete next step (a website), so generic
|
|
19
|
+
// follow-up suggestions would only add noise.
|
|
20
|
+
noSuggestions = true;
|
|
21
|
+
parameters = [];
|
|
22
|
+
/** The phrase inside the template that links to the website. */
|
|
23
|
+
linkPhrase = 'this website';
|
|
24
|
+
/** Resolved (trimmed) URL, or undefined when none was configured. */
|
|
25
|
+
url;
|
|
26
|
+
constructor(config) {
|
|
27
|
+
super();
|
|
28
|
+
const u = config?.url?.trim();
|
|
29
|
+
this.url = u ? u : undefined;
|
|
30
|
+
}
|
|
31
|
+
async run() {
|
|
32
|
+
const link = this.url ? `[${this.linkPhrase}](${this.url})` : this.linkPhrase;
|
|
33
|
+
const message = this.template.replace('{link}', link);
|
|
34
|
+
return {
|
|
35
|
+
message,
|
|
36
|
+
_instructions: 'This is a fixed notice. Output it to the user EXACTLY as written below — in English, ' +
|
|
37
|
+
'without translating, rephrasing, summarising, or adding/removing any words. ' +
|
|
38
|
+
'Preserve the Markdown link verbatim (do not change, wrap, or drop the URL or the linked words). ' +
|
|
39
|
+
'Do not mention tools. Reply with only this message:\n\n' +
|
|
40
|
+
message,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.BaseNftMessageTool = BaseNftMessageTool;
|
|
45
|
+
//# sourceMappingURL=BaseNftMessageTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseNftMessageTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/BaseNftMessageTool.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAY1C;;;;;;;;;GASG;AACH,MAAsB,kBAAmB,SAAQ,mBAAQ;IACvD,IAAI,GAAa,MAAM,CAAC;IACxB,QAAQ,GAAG,KAAK,CAAC;IACjB,8EAA8E;IAC9E,8CAA8C;IAC9C,aAAa,GAAG,IAAI,CAAC;IACrB,UAAU,GAAoB,EAAE,CAAC;IAEjC,gEAAgE;IAC7C,UAAU,GAAG,cAAc,CAAC;IAI/C,qEAAqE;IAClD,GAAG,CAAU;IAEhC,YAAY,MAA6B;QACvC,KAAK,EAAE,CAAC;QACR,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;QAC9B,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/B,CAAC;IAES,KAAK,CAAC,GAAG;QACjB,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC;QAC9E,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACtD,OAAO;YACL,OAAO;YACP,aAAa,EACX,uFAAuF;gBACvF,8EAA8E;gBAC9E,kGAAkG;gBAClG,yDAAyD;gBACzD,OAAO;SACV,CAAC;IACJ,CAAC;CACF;AAnCD,gDAmCC"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { type MoralisServiceConfig } from '../../../services/MoralisService';
|
|
4
|
-
export type NFTContractInfoToolConfig = MoralisServiceConfig;
|
|
1
|
+
import { BaseNftMessageTool, type NftMessageToolConfig } from './BaseNftMessageTool';
|
|
2
|
+
export type NFTContractInfoToolConfig = NftMessageToolConfig;
|
|
5
3
|
/**
|
|
6
4
|
* Tool: get-nft-contract-info
|
|
7
5
|
*
|
|
8
|
-
*
|
|
6
|
+
* Points the user to the NFT website instead of returning collection/contract
|
|
7
|
+
* metadata. Emits a fixed NFT website notice; "this website" links to the
|
|
8
|
+
* configured `nftLink` URL when set, otherwise it stays plain text.
|
|
9
9
|
*/
|
|
10
|
-
export declare class NFTContractInfoTool extends
|
|
10
|
+
export declare class NFTContractInfoTool extends BaseNftMessageTool {
|
|
11
11
|
name: string;
|
|
12
12
|
description: string;
|
|
13
|
-
|
|
14
|
-
parameters: ToolParameter[];
|
|
15
|
-
private service;
|
|
16
|
-
constructor(config?: NFTContractInfoToolConfig);
|
|
17
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<import("../../../services/MoralisService").NFTContractMetadata | {
|
|
18
|
-
error: string;
|
|
19
|
-
} | undefined>;
|
|
13
|
+
protected readonly template = "Please view your NFT collection on {link} for more details";
|
|
20
14
|
}
|
|
21
15
|
//# sourceMappingURL=NFTContractInfoTool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFTContractInfoTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTContractInfoTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NFTContractInfoTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTContractInfoTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAErF,MAAM,MAAM,yBAAyB,GAAG,oBAAoB,CAAC;AAE7D;;;;;;GAMG;AACH,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,IAAI,SAA2B;IAC/B,WAAW,SAEuE;IAElF,SAAS,CAAC,QAAQ,CAAC,QAAQ,gEAAgE;CAC5F"}
|
|
@@ -1,54 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NFTContractInfoTool = void 0;
|
|
4
|
-
const
|
|
5
|
-
const MoralisService_1 = require("../../../services/MoralisService");
|
|
4
|
+
const BaseNftMessageTool_1 = require("./BaseNftMessageTool");
|
|
6
5
|
/**
|
|
7
6
|
* Tool: get-nft-contract-info
|
|
8
7
|
*
|
|
9
|
-
*
|
|
8
|
+
* Points the user to the NFT website instead of returning collection/contract
|
|
9
|
+
* metadata. Emits a fixed NFT website notice; "this website" links to the
|
|
10
|
+
* configured `nftLink` URL when set, otherwise it stays plain text.
|
|
10
11
|
*/
|
|
11
|
-
class NFTContractInfoTool extends
|
|
12
|
+
class NFTContractInfoTool extends BaseNftMessageTool_1.BaseNftMessageTool {
|
|
12
13
|
name = 'get-nft-contract-info';
|
|
13
|
-
description = '
|
|
14
|
-
'
|
|
15
|
-
|
|
16
|
-
category = 'blockchain-data';
|
|
17
|
-
parameters = [
|
|
18
|
-
{
|
|
19
|
-
name: 'contractAddress',
|
|
20
|
-
type: 'string',
|
|
21
|
-
description: 'NFT contract address (0x…).',
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: 'chain',
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
28
|
-
'"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea . Defaults to connected chain.',
|
|
29
|
-
required: true,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
service;
|
|
33
|
-
constructor(config) {
|
|
34
|
-
super();
|
|
35
|
-
this.service = new MoralisService_1.MoralisService(config);
|
|
36
|
-
}
|
|
37
|
-
async run(args, userContext) {
|
|
38
|
-
const contractAddress = args.contractAddress;
|
|
39
|
-
const chain = args.chain || userContext?.chain || undefined;
|
|
40
|
-
if (!contractAddress) {
|
|
41
|
-
return { error: 'NFT contract address is required.' };
|
|
42
|
-
}
|
|
43
|
-
const result = await this.service.getNftContractMetadata({
|
|
44
|
-
address: contractAddress,
|
|
45
|
-
chain,
|
|
46
|
-
});
|
|
47
|
-
if (!result.success) {
|
|
48
|
-
return { error: result.error || 'Failed to fetch NFT contract metadata' };
|
|
49
|
-
}
|
|
50
|
-
return result.data;
|
|
51
|
-
}
|
|
14
|
+
description = 'Use when the user asks about an NFT collection / contract (name, symbol, type, floor, socials). ' +
|
|
15
|
+
'Returns a fixed notice directing them to the NFT website. Takes no arguments.';
|
|
16
|
+
template = 'Please view your NFT collection on {link} for more details';
|
|
52
17
|
}
|
|
53
18
|
exports.NFTContractInfoTool = NFTContractInfoTool;
|
|
54
19
|
//# sourceMappingURL=NFTContractInfoTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFTContractInfoTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTContractInfoTool.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"NFTContractInfoTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTContractInfoTool.ts"],"names":[],"mappings":";;;AAAA,6DAAqF;AAIrF;;;;;;GAMG;AACH,MAAa,mBAAoB,SAAQ,uCAAkB;IACzD,IAAI,GAAG,uBAAuB,CAAC;IAC/B,WAAW,GACT,kGAAkG;QAClG,+EAA+E,CAAC;IAE/D,QAAQ,GAAG,4DAA4D,CAAC;CAC5F;AAPD,kDAOC"}
|
|
@@ -1,121 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { type MoralisServiceConfig } from '../../../services/MoralisService';
|
|
4
|
-
export type NFTMetadataToolConfig = MoralisServiceConfig;
|
|
1
|
+
import { BaseNftMessageTool, type NftMessageToolConfig } from './BaseNftMessageTool';
|
|
2
|
+
export type NFTMetadataToolConfig = NftMessageToolConfig;
|
|
5
3
|
/**
|
|
6
4
|
* Tool: get-nft-metadata
|
|
7
5
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* Moralis docs: https://docs.moralis.com/data-api/evm/nft/metadata/nft-metadata
|
|
6
|
+
* Points the user to the NFT website instead of returning a single NFT's
|
|
7
|
+
* metadata. Emits a fixed NFT website notice; "this website" links to the
|
|
8
|
+
* configured `nftLink` URL when set, otherwise it stays plain text.
|
|
12
9
|
*/
|
|
13
|
-
export declare class NFTMetadataTool extends
|
|
10
|
+
export declare class NFTMetadataTool extends BaseNftMessageTool {
|
|
14
11
|
name: string;
|
|
15
12
|
description: string;
|
|
16
|
-
|
|
17
|
-
parameters: ToolParameter[];
|
|
18
|
-
private service;
|
|
19
|
-
constructor(config?: NFTMetadataToolConfig);
|
|
20
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<{
|
|
21
|
-
error: string;
|
|
22
|
-
chain?: undefined;
|
|
23
|
-
contractAddress?: undefined;
|
|
24
|
-
tokenId?: undefined;
|
|
25
|
-
contractType?: undefined;
|
|
26
|
-
amount?: undefined;
|
|
27
|
-
owner?: undefined;
|
|
28
|
-
minter?: undefined;
|
|
29
|
-
blockNumber?: undefined;
|
|
30
|
-
blockNumberMinted?: undefined;
|
|
31
|
-
tokenHash?: undefined;
|
|
32
|
-
name?: undefined;
|
|
33
|
-
description?: undefined;
|
|
34
|
-
image?: undefined;
|
|
35
|
-
animationUrl?: undefined;
|
|
36
|
-
attributes?: undefined;
|
|
37
|
-
tokenUri?: undefined;
|
|
38
|
-
metadata?: undefined;
|
|
39
|
-
collection?: undefined;
|
|
40
|
-
media?: undefined;
|
|
41
|
-
floorPrice?: undefined;
|
|
42
|
-
floorPriceUsd?: undefined;
|
|
43
|
-
floorPriceCurrency?: undefined;
|
|
44
|
-
rarityRank?: undefined;
|
|
45
|
-
rarityPercentage?: undefined;
|
|
46
|
-
rarityLabel?: undefined;
|
|
47
|
-
verifiedCollection?: undefined;
|
|
48
|
-
possibleSpam?: undefined;
|
|
49
|
-
lastMetadataSync?: undefined;
|
|
50
|
-
lastTokenUriSync?: undefined;
|
|
51
|
-
} | {
|
|
52
|
-
chain: string | undefined;
|
|
53
|
-
contractAddress: string;
|
|
54
|
-
tokenId: string;
|
|
55
|
-
contractType: "ERC721" | "ERC1155";
|
|
56
|
-
amount: string;
|
|
57
|
-
owner: string;
|
|
58
|
-
minter: string | undefined;
|
|
59
|
-
blockNumber: string;
|
|
60
|
-
blockNumberMinted: string;
|
|
61
|
-
tokenHash: string;
|
|
62
|
-
name: string;
|
|
63
|
-
description: string | undefined;
|
|
64
|
-
image: string | undefined;
|
|
65
|
-
animationUrl: string | undefined;
|
|
66
|
-
attributes: {
|
|
67
|
-
trait_type: string;
|
|
68
|
-
value: string;
|
|
69
|
-
}[] | undefined;
|
|
70
|
-
tokenUri: string | undefined;
|
|
71
|
-
metadata: string | undefined;
|
|
72
|
-
collection: {
|
|
73
|
-
name: string;
|
|
74
|
-
symbol: string;
|
|
75
|
-
logo: string | undefined;
|
|
76
|
-
banner: string | undefined;
|
|
77
|
-
category: string | undefined;
|
|
78
|
-
projectUrl: string | undefined;
|
|
79
|
-
wikiUrl: string | undefined;
|
|
80
|
-
discordUrl: string | undefined;
|
|
81
|
-
telegramUrl: string | undefined;
|
|
82
|
-
twitter: string | undefined;
|
|
83
|
-
instagram: string | undefined;
|
|
84
|
-
};
|
|
85
|
-
media: {
|
|
86
|
-
mimetype: string | undefined;
|
|
87
|
-
status: string | undefined;
|
|
88
|
-
originalUrl: string | undefined;
|
|
89
|
-
previews: {
|
|
90
|
-
low?: {
|
|
91
|
-
url: string;
|
|
92
|
-
width: number;
|
|
93
|
-
height: number;
|
|
94
|
-
};
|
|
95
|
-
medium?: {
|
|
96
|
-
url: string;
|
|
97
|
-
width: number;
|
|
98
|
-
height: number;
|
|
99
|
-
};
|
|
100
|
-
high?: {
|
|
101
|
-
url: string;
|
|
102
|
-
width: number;
|
|
103
|
-
height: number;
|
|
104
|
-
};
|
|
105
|
-
} | undefined;
|
|
106
|
-
updatedAt: string | undefined;
|
|
107
|
-
} | undefined;
|
|
108
|
-
floorPrice: string | undefined;
|
|
109
|
-
floorPriceUsd: string | undefined;
|
|
110
|
-
floorPriceCurrency: string | undefined;
|
|
111
|
-
rarityRank: number | undefined;
|
|
112
|
-
rarityPercentage: number | undefined;
|
|
113
|
-
rarityLabel: string | undefined;
|
|
114
|
-
verifiedCollection: boolean;
|
|
115
|
-
possibleSpam: boolean;
|
|
116
|
-
lastMetadataSync: string | undefined;
|
|
117
|
-
lastTokenUriSync: string | undefined;
|
|
118
|
-
error?: undefined;
|
|
119
|
-
}>;
|
|
13
|
+
protected readonly template = "Please view your NFT collection on {link} for more details";
|
|
120
14
|
}
|
|
121
15
|
//# sourceMappingURL=NFTMetadataTool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFTMetadataTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTMetadataTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"NFTMetadataTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTMetadataTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAErF,MAAM,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEzD;;;;;;GAMG;AACH,qBAAa,eAAgB,SAAQ,kBAAkB;IACrD,IAAI,SAAsB;IAC1B,WAAW,SAGuE;IAElF,SAAS,CAAC,QAAQ,CAAC,QAAQ,gEAAgE;CAC5F"}
|
|
@@ -1,159 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NFTMetadataTool = void 0;
|
|
4
|
-
const
|
|
5
|
-
const MoralisService_1 = require("../../../services/MoralisService");
|
|
4
|
+
const BaseNftMessageTool_1 = require("./BaseNftMessageTool");
|
|
6
5
|
/**
|
|
7
6
|
* Tool: get-nft-metadata
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* Moralis docs: https://docs.moralis.com/data-api/evm/nft/metadata/nft-metadata
|
|
8
|
+
* Points the user to the NFT website instead of returning a single NFT's
|
|
9
|
+
* metadata. Emits a fixed NFT website notice; "this website" links to the
|
|
10
|
+
* configured `nftLink` URL when set, otherwise it stays plain text.
|
|
13
11
|
*/
|
|
14
|
-
class NFTMetadataTool extends
|
|
12
|
+
class NFTMetadataTool extends BaseNftMessageTool_1.BaseNftMessageTool {
|
|
15
13
|
name = 'get-nft-metadata';
|
|
16
|
-
description = '
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
|
|
20
|
-
'"details of token ID 42 in contract 0x…", "traits of this NFT", or "floor price of this NFT". ' +
|
|
21
|
-
'Only supports EVM chains: Ethereum, Optimism, BSC, Polygon, Base, Arbitrum, Avalanche, Linea.';
|
|
22
|
-
category = 'blockchain-data';
|
|
23
|
-
parameters = [
|
|
24
|
-
{
|
|
25
|
-
name: 'contractAddress',
|
|
26
|
-
type: 'string',
|
|
27
|
-
description: 'NFT contract address (0x…). The collection / contract that mints the token.',
|
|
28
|
-
required: true,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
name: 'tokenId',
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'The NFT token ID to look up (as a string, in the format specified by the "format" parameter).',
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'chain',
|
|
38
|
-
type: 'string',
|
|
39
|
-
description: 'Hex chain ID: "0x1" Ethereum, "0xa" Optimism, "0x38" BSC, "0x89" Polygon, "0x2105" Base, ' +
|
|
40
|
-
'"0xa4b1" Arbitrum, "0xa86a" Avalanche, "0xe708" Linea. Defaults to connected chain.',
|
|
41
|
-
required: true,
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'format',
|
|
45
|
-
type: 'string',
|
|
46
|
-
description: 'Format of the provided token ID: "decimal" (default) or "hex".',
|
|
47
|
-
required: false,
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
name: 'normalizeMetadata',
|
|
51
|
-
type: 'boolean',
|
|
52
|
-
description: 'Whether Moralis should return a normalized metadata object (name/description/image/attributes). Default: true.',
|
|
53
|
-
required: false,
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
name: 'mediaItems',
|
|
57
|
-
type: 'boolean',
|
|
58
|
-
description: 'Whether to include resized media variants (low / medium / high previews). Default: true.',
|
|
59
|
-
required: false,
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'include',
|
|
63
|
-
type: 'string',
|
|
64
|
-
description: 'Optional extra field to refresh / include in the response: "last_token_uri_sync" or "last_metadata_sync".',
|
|
65
|
-
required: false,
|
|
66
|
-
},
|
|
67
|
-
];
|
|
68
|
-
service;
|
|
69
|
-
constructor(config) {
|
|
70
|
-
super();
|
|
71
|
-
this.service = new MoralisService_1.MoralisService(config);
|
|
72
|
-
}
|
|
73
|
-
async run(args, userContext) {
|
|
74
|
-
const contractAddress = args.contractAddress;
|
|
75
|
-
const tokenId = args.tokenId != null ? String(args.tokenId) : '';
|
|
76
|
-
const chain = args.chain || userContext?.chain || undefined;
|
|
77
|
-
const format = args.format || undefined;
|
|
78
|
-
const normalizeMetadata = typeof args.normalizeMetadata === 'boolean' ? args.normalizeMetadata : undefined;
|
|
79
|
-
const mediaItems = typeof args.mediaItems === 'boolean' ? args.mediaItems : undefined;
|
|
80
|
-
const include = args.include || undefined;
|
|
81
|
-
if (!contractAddress) {
|
|
82
|
-
return { error: 'NFT contract address is required.' };
|
|
83
|
-
}
|
|
84
|
-
if (!tokenId) {
|
|
85
|
-
return { error: 'Token ID is required.' };
|
|
86
|
-
}
|
|
87
|
-
const result = await this.service.getNftMetadata({
|
|
88
|
-
address: contractAddress,
|
|
89
|
-
tokenId,
|
|
90
|
-
chain,
|
|
91
|
-
format,
|
|
92
|
-
normalizeMetadata,
|
|
93
|
-
mediaItems,
|
|
94
|
-
include,
|
|
95
|
-
});
|
|
96
|
-
if (!result.success) {
|
|
97
|
-
return { error: result.error || 'Failed to fetch NFT metadata' };
|
|
98
|
-
}
|
|
99
|
-
const data = result.data;
|
|
100
|
-
if (!data) {
|
|
101
|
-
return { error: 'NFT not found' };
|
|
102
|
-
}
|
|
103
|
-
const normalized = data.normalized_metadata;
|
|
104
|
-
const media = data.media;
|
|
105
|
-
return {
|
|
106
|
-
chain: chain,
|
|
107
|
-
contractAddress: data.token_address,
|
|
108
|
-
tokenId: data.token_id,
|
|
109
|
-
contractType: data.contract_type,
|
|
110
|
-
amount: data.amount,
|
|
111
|
-
owner: data.owner_of,
|
|
112
|
-
minter: data.minter_address,
|
|
113
|
-
blockNumber: data.block_number,
|
|
114
|
-
blockNumberMinted: data.block_number_minted,
|
|
115
|
-
tokenHash: data.token_hash,
|
|
116
|
-
name: normalized?.name || data.name,
|
|
117
|
-
description: normalized?.description,
|
|
118
|
-
image: normalized?.image || media?.original_media_url,
|
|
119
|
-
animationUrl: normalized?.animation_url,
|
|
120
|
-
attributes: normalized?.attributes,
|
|
121
|
-
tokenUri: data.token_uri,
|
|
122
|
-
metadata: data.metadata,
|
|
123
|
-
collection: {
|
|
124
|
-
name: data.name,
|
|
125
|
-
symbol: data.symbol,
|
|
126
|
-
logo: data.collection_logo,
|
|
127
|
-
banner: data.collection_banner_image,
|
|
128
|
-
category: data.collection_category,
|
|
129
|
-
projectUrl: data.project_url,
|
|
130
|
-
wikiUrl: data.wiki_url,
|
|
131
|
-
discordUrl: data.discord_url,
|
|
132
|
-
telegramUrl: data.telegram_url,
|
|
133
|
-
twitter: data.twitter_username,
|
|
134
|
-
instagram: data.instagram_username,
|
|
135
|
-
},
|
|
136
|
-
media: media
|
|
137
|
-
? {
|
|
138
|
-
mimetype: media.mimetype,
|
|
139
|
-
status: media.status,
|
|
140
|
-
originalUrl: media.original_media_url,
|
|
141
|
-
previews: media.media_collection,
|
|
142
|
-
updatedAt: media.updated_at,
|
|
143
|
-
}
|
|
144
|
-
: undefined,
|
|
145
|
-
floorPrice: data.floor_price,
|
|
146
|
-
floorPriceUsd: data.floor_price_usd,
|
|
147
|
-
floorPriceCurrency: data.floor_price_currency,
|
|
148
|
-
rarityRank: data.rarity_rank,
|
|
149
|
-
rarityPercentage: data.rarity_percentage,
|
|
150
|
-
rarityLabel: data.rarity_label,
|
|
151
|
-
verifiedCollection: data.verified_collection,
|
|
152
|
-
possibleSpam: data.possible_spam,
|
|
153
|
-
lastMetadataSync: data.last_metadata_sync,
|
|
154
|
-
lastTokenUriSync: data.last_token_uri_sync,
|
|
155
|
-
};
|
|
156
|
-
}
|
|
14
|
+
description = 'Use when the user asks about a specific NFT — its details, traits, image, or floor price ' +
|
|
15
|
+
'("show NFT #1234 of collection X", "traits of this NFT", "floor price of this NFT"). ' +
|
|
16
|
+
'Returns a fixed notice directing them to the NFT website. Takes no arguments.';
|
|
17
|
+
template = 'Please view your NFT collection on {link} for more details';
|
|
157
18
|
}
|
|
158
19
|
exports.NFTMetadataTool = NFTMetadataTool;
|
|
159
20
|
//# sourceMappingURL=NFTMetadataTool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NFTMetadataTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTMetadataTool.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"NFTMetadataTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/NFTMetadataTool.ts"],"names":[],"mappings":";;;AAAA,6DAAqF;AAIrF;;;;;;GAMG;AACH,MAAa,eAAgB,SAAQ,uCAAkB;IACrD,IAAI,GAAG,kBAAkB,CAAC;IAC1B,WAAW,GACT,2FAA2F;QAC3F,uFAAuF;QACvF,+EAA+E,CAAC;IAE/D,QAAQ,GAAG,4DAA4D,CAAC;CAC5F;AARD,0CAQC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseNftMessageTool } from './BaseNftMessageTool';
|
|
2
|
+
/**
|
|
3
|
+
* Tool: send-nft
|
|
4
|
+
*
|
|
5
|
+
* Points the user to the website to send/transfer an NFT. Emits a fixed
|
|
6
|
+
* message; "this website" links to the configured `nftLink` URL when one is
|
|
7
|
+
* set, otherwise it stays plain text.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SendNftTool extends BaseNftMessageTool {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
protected readonly template = "Please select the NFT you would like to send from the list and proceed via {link}.";
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=SendNftTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendNftTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/SendNftTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D;;;;;;GAMG;AACH,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,IAAI,SAAc;IAClB,WAAW,SAGsB;IAEjC,SAAS,CAAC,QAAQ,CAAC,QAAQ,wFAAwF;CACpH"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SendNftTool = void 0;
|
|
4
|
+
const BaseNftMessageTool_1 = require("./BaseNftMessageTool");
|
|
5
|
+
/**
|
|
6
|
+
* Tool: send-nft
|
|
7
|
+
*
|
|
8
|
+
* Points the user to the website to send/transfer an NFT. Emits a fixed
|
|
9
|
+
* message; "this website" links to the configured `nftLink` URL when one is
|
|
10
|
+
* set, otherwise it stays plain text.
|
|
11
|
+
*/
|
|
12
|
+
class SendNftTool extends BaseNftMessageTool_1.BaseNftMessageTool {
|
|
13
|
+
name = 'send-nft';
|
|
14
|
+
description = 'Use when the user wants to SEND / transfer an NFT ("send my NFT", "transfer an NFT", ' +
|
|
15
|
+
'"gửi NFT"). Returns a fixed message directing them to select and send the NFT on the ' +
|
|
16
|
+
'website. Takes no arguments.';
|
|
17
|
+
template = 'Please select the NFT you would like to send from the list and proceed via {link}.';
|
|
18
|
+
}
|
|
19
|
+
exports.SendNftTool = SendNftTool;
|
|
20
|
+
//# sourceMappingURL=SendNftTool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SendNftTool.js","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/SendNftTool.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D;;;;;;GAMG;AACH,MAAa,WAAY,SAAQ,uCAAkB;IACjD,IAAI,GAAG,UAAU,CAAC;IAClB,WAAW,GACT,uFAAuF;QACvF,uFAAuF;QACvF,8BAA8B,CAAC;IAEd,QAAQ,GAAG,oFAAoF,CAAC;CACpH;AARD,kCAQC"}
|
|
@@ -1,82 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { type MoralisServiceConfig } from '../../../services/MoralisService';
|
|
4
|
-
export type WalletNFTsToolConfig = MoralisServiceConfig;
|
|
5
|
-
interface NormalizedNftAttribute {
|
|
6
|
-
trait_type: string;
|
|
7
|
-
value: string;
|
|
8
|
-
}
|
|
9
|
-
interface NormalizedNftMedia {
|
|
10
|
-
original?: string;
|
|
11
|
-
low?: string;
|
|
12
|
-
medium?: string;
|
|
13
|
-
high?: string;
|
|
14
|
-
mimetype?: string;
|
|
15
|
-
status?: string;
|
|
16
|
-
}
|
|
17
|
-
interface NormalizedNft {
|
|
18
|
-
name: string | null;
|
|
19
|
-
collectionName: string | null;
|
|
20
|
-
symbol: string | null;
|
|
21
|
-
tokenId: string;
|
|
22
|
-
contractAddress: string;
|
|
23
|
-
contractType: 'ERC721' | 'ERC1155' | string;
|
|
24
|
-
amount: string;
|
|
25
|
-
ownerOf: string;
|
|
26
|
-
tokenHash: string;
|
|
27
|
-
tokenUri: string | null;
|
|
28
|
-
description: string | null;
|
|
29
|
-
image: string | null;
|
|
30
|
-
animationUrl: string | null;
|
|
31
|
-
media: NormalizedNftMedia;
|
|
32
|
-
attributes: NormalizedNftAttribute[];
|
|
33
|
-
verifiedCollection: boolean;
|
|
34
|
-
possibleSpam: boolean;
|
|
35
|
-
collectionLogo: string | null;
|
|
36
|
-
collectionBanner: string | null;
|
|
37
|
-
blockNumber: string;
|
|
38
|
-
blockNumberMinted: string;
|
|
39
|
-
}
|
|
40
|
-
interface WalletNFTsResult {
|
|
41
|
-
walletAddress: string;
|
|
42
|
-
chain: string;
|
|
43
|
-
filters: {
|
|
44
|
-
contractAddresses: string[] | null;
|
|
45
|
-
excludeSpam: boolean;
|
|
46
|
-
includePrices: boolean;
|
|
47
|
-
limit: number;
|
|
48
|
-
cursor: string | null;
|
|
49
|
-
};
|
|
50
|
-
pagination: {
|
|
51
|
-
cursor: string | null;
|
|
52
|
-
pageSize: number;
|
|
53
|
-
page: number | null;
|
|
54
|
-
hasMore: boolean;
|
|
55
|
-
};
|
|
56
|
-
nftCount: number;
|
|
57
|
-
nfts: NormalizedNft[];
|
|
58
|
-
}
|
|
1
|
+
import { BaseNftMessageTool, type NftMessageToolConfig } from './BaseNftMessageTool';
|
|
2
|
+
export type WalletNFTsToolConfig = NftMessageToolConfig;
|
|
59
3
|
/**
|
|
60
4
|
* Tool: get-wallet-nfts
|
|
61
5
|
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* Default page size is 10. Pass `cursor` from a previous response to
|
|
67
|
-
* fetch the next page.
|
|
6
|
+
* Points the user to the NFT website instead of returning on-chain holdings.
|
|
7
|
+
* Emits a fixed NFT website notice; "this website" links to the configured
|
|
8
|
+
* `nftLink` URL when set, otherwise it stays plain text.
|
|
68
9
|
*/
|
|
69
|
-
export declare class WalletNFTsTool extends
|
|
10
|
+
export declare class WalletNFTsTool extends BaseNftMessageTool {
|
|
70
11
|
name: string;
|
|
71
12
|
description: string;
|
|
72
|
-
|
|
73
|
-
parameters: ToolParameter[];
|
|
74
|
-
private service;
|
|
75
|
-
constructor(config?: WalletNFTsToolConfig);
|
|
76
|
-
protected run(args: Record<string, unknown>, userContext?: UserContext): Promise<WalletNFTsResult | {
|
|
77
|
-
error: string;
|
|
78
|
-
}>;
|
|
79
|
-
private normalize;
|
|
13
|
+
protected readonly template = "Please view your NFT collection on {link} for more details";
|
|
80
14
|
}
|
|
81
|
-
export {};
|
|
82
15
|
//# sourceMappingURL=WalletNFTsTool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletNFTsTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/WalletNFTsTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"WalletNFTsTool.d.ts","sourceRoot":"","sources":["../../../../src/tools/builtin/nft/WalletNFTsTool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAErF,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAC;AAExD;;;;;;GAMG;AACH,qBAAa,cAAe,SAAQ,kBAAkB;IACpD,IAAI,SAAqB;IACzB,WAAW,SAGsC;IAEjD,SAAS,CAAC,QAAQ,CAAC,QAAQ,gEAAgE;CAC5F"}
|