@konemono/nostr-login 1.11.8 → 1.11.9

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.
@@ -1,12 +1,14 @@
1
+ /// <reference types="node" />
1
2
  import NDK, { NDKEvent, NDKFilter, NDKNip46Signer, NDKNostrRpc, NDKRpcRequest, NDKRpcResponse, NDKSubscription, NDKUser, NostrEvent } from '@nostr-dev-kit/ndk';
2
3
  import { PrivateKeySigner } from './Signer';
4
+ import { EventEmitter } from 'events';
3
5
  declare class NostrRpc extends NDKNostrRpc {
4
6
  protected _ndk: NDK;
5
7
  protected _signer: PrivateKeySigner;
6
8
  protected requests: Set<string>;
7
9
  private sub?;
8
10
  protected _useNip44: boolean;
9
- private eventEmitter;
11
+ protected eventEmitter: EventEmitter;
10
12
  constructor(ndk: NDK, signer: PrivateKeySigner);
11
13
  subscribe(filter: NDKFilter): Promise<NDKSubscription>;
12
14
  stop(): void;
@@ -20,6 +22,7 @@ declare class NostrRpc extends NDKNostrRpc {
20
22
  ping(remotePubkey: string): Promise<void>;
21
23
  pingWithTimeout(remotePubkey: string, timeoutMs?: number): Promise<void>;
22
24
  protected getId(): string;
25
+ once: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
23
26
  sendRequest(remotePubkey: string, method: string, params?: string[], kind?: number, cb?: (res: NDKRpcResponse) => void): Promise<NDKRpcResponse>;
24
27
  protected setResponseHandler(id: string, cb?: (res: NDKRpcResponse) => void): Promise<NDKRpcResponse>;
25
28
  protected createRequestEvent(id: string, remotePubkey: string, method: string, params?: string[], kind?: number): Promise<NDKEvent>;
@@ -47,11 +50,8 @@ export declare class Nip46Signer extends NDKNip46Signer {
47
50
  private _rpc;
48
51
  private lastPingTime;
49
52
  private pingCacheDuration;
50
- private _remotePubkey?;
51
53
  constructor(ndk: NDK, localSigner: PrivateKeySigner, signerPubkey: string, iframeOrigin?: string);
52
54
  get userPubkey(): string;
53
- get remotePubkeyAccessor(): string | undefined;
54
- set remotePubkeyAccessor(value: string | undefined);
55
55
  private ensureConnection;
56
56
  private setSignerPubkey;
57
57
  initUserPubkey(hintPubkey?: string): Promise<void>;
@@ -67,6 +67,8 @@ export declare class Nip46Signer extends NDKNip46Signer {
67
67
  domain: string;
68
68
  perms?: string;
69
69
  }): Promise<string>;
70
+ on: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
71
+ once: <EventKey extends string | symbol = string>(event: EventKey, listener: (...args: any[]) => void) => this;
70
72
  emit: <EventKey extends string | symbol = string>(event: EventKey, ...args: any[]) => boolean;
71
73
  }
72
74
  export {};