@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.
63 lines (57 loc) • 1.56 kB
text/typescript
import {
BaseHederaTransactionTool,
BaseHederaQueryTool,
BaseServiceBuilder,
} from 'hedera-agent-kit';
import { InscriberBuilder } from '../../builders/inscriber/inscriber-builder';
import {
InscriberTransactionToolParams,
InscriberQueryToolParams,
} from './inscriber-tool-params';
import { z } from 'zod';
/**
* Base class for Inscriber transaction tools
*/
export abstract class BaseInscriberTransactionTool<
T extends z.ZodObject<
z.ZodRawShape,
z.UnknownKeysParam,
z.ZodTypeAny
> = z.ZodObject<z.ZodRawShape>
> extends BaseHederaTransactionTool<T> {
protected inscriberBuilder: InscriberBuilder;
namespace = 'inscriber' as const;
constructor(params: InscriberTransactionToolParams) {
super(params);
this.inscriberBuilder = params.inscriberBuilder;
}
/**
* Override to return the InscriberBuilder
*/
protected getServiceBuilder(): BaseServiceBuilder {
return this.inscriberBuilder;
}
}
/**
* Base class for Inscriber query tools
*/
export abstract class BaseInscriberQueryTool<
T extends z.ZodObject<
z.ZodRawShape,
z.UnknownKeysParam,
z.ZodTypeAny
> = z.ZodObject<z.ZodRawShape>
> extends BaseHederaQueryTool<T> {
protected inscriberBuilder: InscriberBuilder;
namespace = 'inscriber' as const;
constructor(params: InscriberQueryToolParams) {
super(params);
this.inscriberBuilder = params.inscriberBuilder;
}
/**
* Override to return the InscriberBuilder
*/
protected getServiceBuilder(): BaseServiceBuilder {
return this.inscriberBuilder;
}
}