UNPKG

@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

113 lines (112 loc) 4.82 kB
import { z } from 'zod'; import { BaseInscriberQueryTool } from './base-inscriber-tools'; import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager'; import { InscriptionResponse } from '../../types/inscription-response'; import { FormValidatable } from '../../interfaces/FormValidatable'; /** * Schema for inscribing Hashinal NFT */ declare const inscribeHashinalSchema: import('../..').ZodSchemaWithRender<{ name?: string | undefined; url?: string | undefined; type?: string | undefined; description?: string | undefined; tags?: string[] | undefined; creator?: string | undefined; properties?: Record<string, unknown> | undefined; mimeType?: string | undefined; fileStandard?: "1" | "6" | undefined; chunkSize?: number | undefined; jsonFileURL?: string | undefined; waitForConfirmation?: boolean | undefined; timeoutMs?: number | undefined; quoteOnly?: boolean | undefined; fileName?: string | undefined; base64Data?: string | undefined; attributes?: { value: string | number; trait_type: string; }[] | undefined; contentRef?: string | undefined; withHashLinkBlocks?: boolean | undefined; renderForm?: boolean | undefined; }>; /** * Tool for inscribing Hashinal NFTs */ export declare class InscribeHashinalTool extends BaseInscriberQueryTool implements FormValidatable { name: string; description: string; getEntityResolutionPreferences(): Record<string, string>; get specificInputSchema(): z.ZodObject<z.ZodRawShape>; private _schemaWithRenderConfig?; get schema(): z.ZodObject<z.ZodRawShape>; /** * Implementation of FormValidatable interface * Determines if a form should be generated for the given input */ shouldGenerateForm(input: unknown): boolean; /** * Implementation of FormValidatable interface * Returns the focused schema for form generation */ getFormSchema(): z.ZodObject<z.ZodRawShape>; protected executeQuery(params: z.infer<typeof inscribeHashinalSchema>, _runManager?: CallbackManagerForToolRun): Promise<InscriptionResponse>; /** * Creates HashLink block configuration for Hashinal inscriptions. * Automatically detects network and selects appropriate block ID configuration. * Uses testnet block as fallback for unknown networks or undeployed mainnet blocks. * * @param response The inscription response containing metadata and network information * @param _mimeType Optional MIME type (currently unused, preserved for compatibility) * @returns HCS12BlockResult with network-specific block configuration * * @example * ```typescript * // Testnet usage (automatic detection from client) * const testnetClient = Client.forTestnet(); * const tool = new InscribeHashinalTool(testnetClient); * const block = await tool.createHashLinkBlock(inscriptionResponse); * const id = block.blockId; // '0.0.6617393' * const link = block.hashLink; // 'hcs://12/0.0.6617393' * * // Mainnet usage (automatic detection from client) * const mainnetClient = Client.forMainnet(); * const tool = new InscribeHashinalTool(mainnetClient); * const block = await tool.createHashLinkBlock(inscriptionResponse); * const mainnetId = block.blockId; // Network-specific mainnet block ID * * // HashLink Block Response Structure: * { * blockId: string; // Hedera account ID format (e.g., '0.0.6617393') * hashLink: string; // HCS-12 URL format: 'hcs://12/{blockId}' * template: string; // Block template reference matching blockId * attributes: { // Metadata for client-side processing * name: string; // Content display name * creator: string; // Creator account ID * topicId: string; // HCS topic containing the inscription * hrl: string; // Hedera Resource Locator * network: string; // Network type: 'testnet' | 'mainnet' * } * } * * // Render function usage in HashLink blocks: * // The block's JavaScript render function receives this structure * // and can access network-specific resources through attributes.network * ``` */ private createHashLinkBlock; private resolveContent; private handleDirectContent; /** * Implementation of FormValidatable interface * Returns essential fields that should always be shown in forms */ getEssentialFields(): string[]; /** * Implementation of FormValidatable interface * Determines if a field value should be considered empty for this tool */ isFieldEmpty(fieldName: string, value: unknown): boolean; } export {};