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

65 lines (64 loc) 1.81 kB
const _SignerProviderRegistry = class _SignerProviderRegistry { static setSignerProvider(provider) { this._signerProvider = provider; } static async getSigner() { const p = this._signerProvider; if (!p) return null; try { if (typeof p === "function") { const val = p(); return val && typeof val.then === "function" ? await val : val; } return p; } catch { return null; } } static setWalletInfoResolver(resolver) { this._walletInfoResolver = resolver || null; } static async getWalletInfo() { const r = this._walletInfoResolver; if (!r) return null; try { const val = r(); return val && typeof val.then === "function" ? await val : val; } catch { return null; } } static setWalletExecutor(executor) { this._walletExecutor = executor || null; } static get walletExecutor() { return this._walletExecutor || null; } static setStartHCSDelegate(delegate) { this._startHCSDelegate = delegate || null; } static get startHCSDelegate() { return this._startHCSDelegate || null; } static setPreferWalletOnly(flag) { this._preferWalletOnly = !!flag; } /** * Register a factory to construct a BrowserHCSClient-like instance for wallet-driven flows */ static setBrowserHCSClientFactory(factory) { this._browserHCSClientFactory = factory || null; } static getBrowserHCSClient(network) { return this._browserHCSClientFactory ? this._browserHCSClientFactory(network) : null; } static get preferWalletOnly() { return this._preferWalletOnly; } }; _SignerProviderRegistry._preferWalletOnly = false; let SignerProviderRegistry = _SignerProviderRegistry; export { SignerProviderRegistry }; //# sourceMappingURL=standards-agent-kit.es3.js.map