/** * NIP-46 Remote Signer using nostr-tools BunkerSigner * * Wraps BunkerSigner with state persistence and a simple API * for use by Shakespeare tools. */ import type { EventTemplate, VerifiedEvent } from 'nostr-tools'; /** Default relays for NIP-46 communication */ export declare const DEFAULT_RELAYS: string[]; /** * Signer status information */ export interface SignerStatus { connected: boolean; userPubkey: string | null; npub: string | null; relays: string[]; } /** * Shakespeare Signer - manages NIP-46 remote signing using BunkerSigner */ export declare class ShakespeareSigner { private bunkerSigner; private pool; private clientSecretKey; private userPubkey; private relays; private pendingConnection; constructor(); /** * Restore signer state from disk */ private restore; /** * Check if the signer is connected (has credentials to sign) */ isConnected(): boolean; /** * Ensure bunkerSigner is available, creating it lazily if needed */ private ensureBunkerSigner; /** * Get the user's public key (hex) */ getUserPubkey(): string | null; /** * Get the user's public key as npub */ getUserNpub(): string | null; /** * Get configured relays */ getRelays(): string[]; /** * Set relays to use */ setRelays(relays: string[]): void; /** * Disconnect and clear stored credentials */ disconnect(): Promise; /** * Initiate connection using nostrconnect:// flow (client-initiated) * Returns formatted output for display */ connect(customRelays?: string[]): Promise; /** * Initiate connection (step 1 of two-step flow) * Returns QR code and saves pending state, but doesn't wait for completion */ initiateConnection(customRelays?: string[]): Promise; /** * Check if there's a pending connection waiting to be completed */ hasPendingConnection(): boolean; /** * Complete a pending connection (step 2 of two-step flow) */ completeConnection(timeoutMs?: number): Promise; /** * Sign a Nostr event using the remote signer */ signEvent(eventTemplate: EventTemplate): Promise; /** * Get connection status info */ getStatus(): SignerStatus; /** * Publish a signed event to relays */ publishEvent(event: VerifiedEvent): Promise<{ success: number; total: number; }>; /** * Publish multiple events to relays */ publishEvents(events: VerifiedEvent[]): Promise<{ success: number; total: number; }>; } /** * Get the singleton signer instance */ export declare function getSigner(): ShakespeareSigner; //# sourceMappingURL=signer.d.ts.map