@konemono/nostr-login 1.11.21 → 1.11.23
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.
- package/dist/index.esm.js +7 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/modules/AuthNostrService.d.ts +6 -9
- package/dist/modules/Nip46.d.ts +2 -1
- package/dist/unpkg.js +2 -2
- package/package.json +1 -1
- package/src/modules/AuthNostrService.ts +173 -143
- package/src/modules/Nip46.ts +44 -44
|
@@ -22,6 +22,7 @@ declare class AuthNostrService extends EventEmitter implements Signer {
|
|
|
22
22
|
private readonly MAX_RECONNECT_ATTEMPTS;
|
|
23
23
|
private currentInfo?;
|
|
24
24
|
private isReconnecting;
|
|
25
|
+
private reconnectTimer?;
|
|
25
26
|
nip04: {
|
|
26
27
|
encrypt: (pubkey: string, plaintext: string) => Promise<string>;
|
|
27
28
|
decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
|
|
@@ -52,19 +53,10 @@ declare class AuthNostrService extends EventEmitter implements Signer {
|
|
|
52
53
|
setExtension(pubkey: string): void;
|
|
53
54
|
setOTP(pubkey: string, data: string): void;
|
|
54
55
|
setConnect(info: Info): Promise<void>;
|
|
55
|
-
authNip46(type: 'login' | 'signup', options: {
|
|
56
|
-
name?: string;
|
|
57
|
-
bunkerUrl: string;
|
|
58
|
-
domain?: string;
|
|
59
|
-
customRelays?: string[];
|
|
60
|
-
sk?: string;
|
|
61
|
-
}): Promise<void>;
|
|
62
56
|
createAccount(nip05: string): Promise<{
|
|
63
57
|
bunkerUrl: string;
|
|
64
58
|
sk: string | undefined;
|
|
65
59
|
}>;
|
|
66
|
-
private releaseSigner;
|
|
67
|
-
logout(keepSigner?: boolean): Promise<void>;
|
|
68
60
|
private setUserInfo;
|
|
69
61
|
exportKeys(): "" | `nsec1${string}`;
|
|
70
62
|
private onAuth;
|
|
@@ -82,9 +74,14 @@ declare class AuthNostrService extends EventEmitter implements Signer {
|
|
|
82
74
|
eventToAddAccount?: boolean | undefined;
|
|
83
75
|
}): Promise<void>;
|
|
84
76
|
private initSignerInternal;
|
|
77
|
+
private setupSignerEventHandlers;
|
|
78
|
+
private scheduleReconnection;
|
|
85
79
|
private handleReconnection;
|
|
86
80
|
private ensureSigner;
|
|
87
81
|
signEvent(event: any): Promise<any>;
|
|
82
|
+
cleanup(): void;
|
|
83
|
+
private releaseSigner;
|
|
84
|
+
logout(keepSigner?: boolean): Promise<void>;
|
|
88
85
|
private codec_call;
|
|
89
86
|
encrypt04(pubkey: string, plaintext: string): Promise<string>;
|
|
90
87
|
decrypt04(pubkey: string, ciphertext: string): Promise<string>;
|
package/dist/modules/Nip46.d.ts
CHANGED
|
@@ -51,9 +51,10 @@ export declare class Nip46Signer extends NDKNip46Signer {
|
|
|
51
51
|
private lastPingTime;
|
|
52
52
|
private pingCacheDuration;
|
|
53
53
|
private isReconnecting;
|
|
54
|
+
private connectionLostEmitted;
|
|
54
55
|
constructor(ndk: NDK, localSigner: PrivateKeySigner, signerPubkey: string, iframeOrigin?: string);
|
|
55
56
|
get userPubkey(): string;
|
|
56
|
-
|
|
57
|
+
ensureConnection(): Promise<void>;
|
|
57
58
|
reconnect(info: any): Promise<void>;
|
|
58
59
|
private setSignerPubkey;
|
|
59
60
|
initUserPubkey(hintPubkey?: string): Promise<void>;
|