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.

57 lines (56 loc) 1.9 kB
import { BaseServiceBuilder } from "hedera-agent-kit"; import { inscribe, inscribeWithSigner, retrieveInscription } from "@hashgraphonline/standards-sdk"; class InscriberBuilder extends BaseServiceBuilder { constructor(hederaKit) { super(hederaKit); } /** * Get or create Inscription SDK - temporarily returns null since we don't have the actual SDK */ async getInscriptionSDK(options) { return null; } /** * Inscribe content using server-side authentication */ async inscribe(input, options) { const operatorId = this.hederaKit.signer.getAccountId().toString(); const operatorPrivateKey = this.hederaKit.signer?.getOperatorPrivateKey() ? this.hederaKit.signer.getOperatorPrivateKey().toStringRaw() : ""; const network = this.hederaKit.client.network; const networkType = network.toString().includes("mainnet") ? "mainnet" : "testnet"; const clientConfig = { accountId: operatorId, privateKey: operatorPrivateKey, network: networkType }; return await inscribe(input, clientConfig, options); } /** * Inscribe content using a DApp signer */ async inscribeWithSigner(input, signer, options) { return await inscribeWithSigner(input, signer, options); } /** * Retrieve an existing inscription */ async retrieveInscription(transactionId, options) { const operatorId = this.hederaKit.signer.getAccountId().toString(); const operatorPrivateKey = this.hederaKit.signer?.getOperatorPrivateKey() ? this.hederaKit.signer.getOperatorPrivateKey().toStringRaw() : ""; return await retrieveInscription(transactionId, { ...options, accountId: operatorId, privateKey: operatorPrivateKey }); } /** * Close the inscription SDK */ async close() { this.inscriptionSDK = void 0; } } export { InscriberBuilder }; //# sourceMappingURL=standards-agent-kit.es5.js.map