import { EventEmitter } from "eventemitter3"; import type { NostrEvent } from "../nostr"; import { type EventSigner } from "../signer"; interface Nip46Events { oauth: (url: string) => void; ready: () => void; } export declare class Nip46Signer extends EventEmitter implements EventSigner { #private; /** * Start NIP-46 connection * * Connection formats: * - bunker://: bunker://?relay=&secret= * (NIP-46 "Direct connection initiated by remote-signer") * - nostrconnect://: nostrconnect://?relay=&secret=&perms= * (NIP-46 "Direct connection initiated by the client") * * Note: For nostrconnect:// flow, the `secret` parameter is REQUIRED per NIP-46 to prevent * connection spoofing. The client MUST validate the `secret` returned by the connect response. * * @param config bunker:// or nostrconnect:// URL * @param insideSigner Optional signer for encrypting/decrypting messages * * @see https://github.com/nostr-protocol/nips/blob/master/46.md#initiating-a-connection */ constructor(config: string, insideSigner?: EventSigner); get supports(): string[]; get relays(): string[]; get privateKey(): string | undefined; get isBunker(): boolean; /** * Connect to the remote signer relay and establish the NIP-46 connection. * * For bunker:// flow: sends connect request to the remote signer. * For nostrconnect:// flow: waits for the remote signer to send a connect response, * from which the remote signer's pubkey is discovered (per NIP-46 spec). * * @param autoConnect Automatically initiate the connect flow * @see https://github.com/nostr-protocol/nips/blob/master/46.md#initiating-a-connection */ init(autoConnect?: boolean): Promise; close(): Promise; describe(): Promise; /** * Get the user's public key from the remote signer. * Per NIP-46 Overview step 5, client must call get_public_key after connect * to learn the user-pubkey (which may differ from remote-signer-pubkey). * * @see https://github.com/nostr-protocol/nips/blob/master/46.md#overview */ getPubKey(): Promise; nip4Encrypt(content: string, otherKey: string): Promise; nip4Decrypt(content: string, otherKey: string): Promise; nip44Encrypt(_content: string, _key: string): Promise; nip44Decrypt(_content: string, _otherKey: string): Promise; sign(ev: NostrEvent): Promise<{ id: string; sig: string; pubkey: string; created_at: number; kind: number; tags: Array>; content: string; }>; /** * NIP-46 oAuth bunker signup * @param name Desired name * @param domain Desired domain * @param email Backup email address * @returns */ createAccount(name: string, domain: string, email?: string): Promise; } export {}; //# sourceMappingURL=nip46.d.ts.map