@konemono/nostr-login 1.11.10 → 1.11.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,10 @@ declare class AuthNostrService extends EventEmitter implements Signer {
18
18
  private nostrConnectSecret;
19
19
  private iframe?;
20
20
  private starterReady?;
21
+ private reconnectAttempts;
22
+ private readonly MAX_RECONNECT_ATTEMPTS;
23
+ private currentInfo?;
24
+ private isReconnecting;
21
25
  nip04: {
22
26
  encrypt: (pubkey: string, plaintext: string) => Promise<string>;
23
27
  decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
@@ -71,16 +75,9 @@ declare class AuthNostrService extends EventEmitter implements Signer {
71
75
  eventToAddAccount?: boolean | undefined;
72
76
  }): Promise<void>;
73
77
  private initSignerInternal;
74
- authNip46(type: 'login' | 'signup', { name, bunkerUrl, sk, domain, iframeUrl, customRelays, }: {
75
- name: string;
76
- bunkerUrl: string;
77
- sk?: string;
78
- domain?: string;
79
- iframeUrl?: string;
80
- customRelays?: string[];
81
- }): Promise<void>;
82
- signEvent(event: any): Promise<any>;
78
+ private handleReconnection;
83
79
  private ensureSigner;
80
+ signEvent(event: any): Promise<any>;
84
81
  private codec_call;
85
82
  encrypt04(pubkey: string, plaintext: string): Promise<string>;
86
83
  decrypt04(pubkey: string, ciphertext: string): Promise<string>;
@@ -8,7 +8,7 @@ declare class NostrRpc extends NDKNostrRpc {
8
8
  protected requests: Set<string>;
9
9
  private sub?;
10
10
  protected _useNip44: boolean;
11
- protected eventEmitter: EventEmitter;
11
+ eventEmitter: EventEmitter;
12
12
  constructor(ndk: NDK, signer: PrivateKeySigner);
13
13
  subscribe(filter: NDKFilter): Promise<NDKSubscription>;
14
14
  stop(): void;
@@ -50,9 +50,11 @@ export declare class Nip46Signer extends NDKNip46Signer {
50
50
  private _rpc;
51
51
  private lastPingTime;
52
52
  private pingCacheDuration;
53
+ private isReconnecting;
53
54
  constructor(ndk: NDK, localSigner: PrivateKeySigner, signerPubkey: string, iframeOrigin?: string);
54
55
  get userPubkey(): string;
55
56
  private ensureConnection;
57
+ reconnect(info: any): Promise<void>;
56
58
  private setSignerPubkey;
57
59
  initUserPubkey(hintPubkey?: string): Promise<void>;
58
60
  listen(nostrConnectSecret: string): Promise<void>;
@@ -67,6 +69,7 @@ export declare class Nip46Signer extends NDKNip46Signer {
67
69
  domain: string;
68
70
  perms?: string;
69
71
  }): Promise<string>;
72
+ removeAllListeners: (event?: string | symbol) => this;
70
73
  on: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
71
74
  once: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
72
75
  emit: <EventKey extends string | symbol = string>(event: EventKey, ...args: any[]) => boolean;