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

46 lines (45 loc) 2.19 kB
export type NetworkString = 'mainnet' | 'testnet'; export interface DAppSigner { getAccountId(): { toString(): string; }; [key: string]: unknown; } export type WalletInfo = { accountId: string; network: NetworkString; }; export type WalletInfoResolver = () => Promise<WalletInfo | null> | WalletInfo | null; export type WalletExecutor = (base64: string, network: NetworkString) => Promise<{ transactionId: string; }>; export type HCSOperation = 'submitConnectionRequest' | 'handleConnectionRequest' | 'sendMessage' | 'hcs2.createRegistry' | 'hcs2.migrateRegistry' | 'hcs2.registerEntry' | 'hcs2.updateEntry' | 'hcs2.deleteEntry' | 'hcs2.submitMessage' | 'hcs6.createRegistry' | 'hcs6.registerEntry' | 'hcs6.submitMessage'; export type StartHCSDelegate = (op: HCSOperation, request: Record<string, unknown>, network: NetworkString) => Promise<{ transactionBytes: string; }>; /** * Central registry for browser signer and wallet execution delegates */ export declare class SignerProviderRegistry { private static _signerProvider; private static _walletInfoResolver; private static _walletExecutor; private static _startHCSDelegate; private static _browserHCSClientFactory; private static _preferWalletOnly; static setSignerProvider(provider: typeof SignerProviderRegistry._signerProvider): void; static getSigner(): Promise<DAppSigner | null>; static setWalletInfoResolver(resolver: WalletInfoResolver | null): void; static getWalletInfo(): Promise<WalletInfo | null>; static setWalletExecutor(executor: WalletExecutor | null): void; static get walletExecutor(): WalletExecutor | null; static setStartHCSDelegate(delegate: StartHCSDelegate | null): void; static get startHCSDelegate(): StartHCSDelegate | null; static setPreferWalletOnly(flag: boolean): void; /** * Register a factory to construct a BrowserHCSClient-like instance for wallet-driven flows */ static setBrowserHCSClientFactory(factory: ((network: NetworkString) => unknown) | null): void; static getBrowserHCSClient(network: NetworkString): unknown | null; static get preferWalletOnly(): boolean; }