@hashgraphonline/standards-agent-kit
Version:
A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication. https://hol.org
36 lines (35 loc) • 1.5 kB
JavaScript
import { z } from "zod";
import { BaseHCS10TransactionTool } from "./standards-agent-kit.es10.js";
const AcceptConnectionRequestZodSchema = z.object({
requestKey: z.string().describe(
'The unique request key of the specific request to accept. Use the "manage_connection_requests" tool with action="list" first to get valid keys.'
),
hbarFee: z.number().optional().describe(
"Optional HBAR fee amount to charge the connecting agent per message on the new connection topic."
),
exemptAccountIds: z.array(z.string()).optional().describe(
"Optional list of account IDs to exempt from any configured fees on the new connection topic."
)
});
class AcceptConnectionRequestTool extends BaseHCS10TransactionTool {
constructor(params) {
super(params);
this.name = "accept_connection_request";
this.description = "Accepts a pending HCS-10 connection request from another agent. Use list_unapproved_connection_requests to see pending requests.";
this.specificInputSchema = AcceptConnectionRequestZodSchema;
this.neverScheduleThisTool = true;
this.requiresMultipleTransactions = true;
}
async callBuilderMethod(builder, specificArgs) {
const hcs10Builder = builder;
await hcs10Builder.acceptConnection({
requestKey: specificArgs.requestKey,
hbarFee: specificArgs.hbarFee,
exemptAccountIds: specificArgs.exemptAccountIds
});
}
}
export {
AcceptConnectionRequestTool
};
//# sourceMappingURL=standards-agent-kit.es19.js.map