Class NDKNwc

Implements the Nostr Wallet Connect (NIP-47) protocol.

const nwc = ndk.nwc("nostr+walletconnect://...");
const balance = await nwc.getBalance();
const payment = await nwc.payInvoice("lnbc1...");

Hierarchy

  • EventEmitter
    • NDKNwc

Constructors

  • Parameters

    • opts:: {
          ndk: default;
          pubkey: string;
          relayUrls: string[];
          secret: string | Uint8Array;
      }

      NostrWalletConnectOptions

      • ndk: default
      • pubkey: string
      • relayUrls: string[]
      • secret: string | Uint8Array

    Returns NDKNwc

    NDKNwc

Properties

active: boolean = false
debug: Debugger
getBalance: ((...args: []) => Promise<NDKNwcResponse<GetBalanceResponse>>) = ...
ndk: default
relaySet: NDKRelaySet
signer: NDKSigner
walletService: NDKUser

The Wallet Service's public key

Methods

  • Blocks until we're subscribed to talk to the wallet service

    Parameters

    • OptionalmsTimeout: number

      Timeout in ms to wait for the subscription to be ready

    Returns Promise<void>