UNPKG

@hashgraphonline/hedera-agent-kit

Version:

Build LLM-powered applications that interact with the Hedera Network. Create conversational agents that can understand user requests in natural language and execute Hedera transactions, or build backend systems that leverage AI for on-chain operations.

33 lines (32 loc) 1.03 kB
import { z } from "zod"; import { BaseHederaQueryTool } from "./index20.js"; const GetTopicInfoZodSchema = z.object({ topicId: z.string().describe('The topic ID to get information for (e.g., "0.0.12345")') }); class HederaGetTopicInfoTool extends BaseHederaQueryTool { constructor(params) { super(params); this.name = "hedera-get-topic-info"; this.description = "Retrieves information about a Hedera Consensus Service topic including admin key, submit key, memo, and other metadata."; this.specificInputSchema = GetTopicInfoZodSchema; this.namespace = "hcs"; } async executeQuery(args) { this.logger.info(`Getting topic info for topic ID: ${args.topicId}`); const topicInfo = await this.hederaKit.query().getTopicInfo(args.topicId); if (!topicInfo) { return { success: false, error: `Topic ${args.topicId} not found` }; } return { success: true, topicInfo }; } } export { HederaGetTopicInfoTool }; //# sourceMappingURL=index25.js.map