Optional
cacheOptional
clientOptional
clientOptional
devAttempts to fetch an event from a tag, following relay hints and other best practices.
Rest
...args: [tag: NDKTag, originalEvent: NDKEvent, subOpts?: NDKSubscriptionOptions, fallback: NDKFetchFallbackOptions]Fetch function to use for HTTP requests.
Optional
init: RequestInitOptional
init: RequestInitOptional
Readonly
netProvide a caller function to receive all networking traffic from relays
Optional
outboxOptional
outboxOptional
relayDefault relay-auth policy that will be used when a relay requests authentication, if no other policy is specified for that relay.
Optional
validationOptional
walletSets the active user for this NDK instance, typically this will be called when assigning a signer to the NDK instance.
This function will automatically connect to the user's relays if
autoConnectUserRelays
is set to true.
It will also fetch the user's mutelist if autoFetchUserMutelist
is set to true.
Adds an explicit relay to the pool.
Optional
relayAuthPolicy: NDKAuthPolicyAuthentication policy to use if different from the default
Whether to connect to the relay automatically
Fetch a single event.
event id in bech32 format or filter
Optional
opts: NDKSubscriptionOptionssubscription options
Optional
relaySetOrRelay: NDKRelay | NDKRelaySetexplicit relay set to use
Fetch events
Optional
opts: NDKSubscriptionOptionsOptional
relaySet: NDKRelaySetCreates a new Nostr Wallet Connect instance for the given URI and waits for it to be ready.
WalletConnect URI
Timeout in milliseconds to wait for the NWC to be ready. Set to false
to avoid connecting.
Publish an event to a relay
event to publish
Optional
relaySet: NDKRelaySetexplicit relay set to use
Optional
timeoutMs: numbertimeout in milliseconds to wait for the event to be published
The relays the event was published to
Create a new subscription. Subscriptions automatically start, you can make them automatically close when all relays send back an EOSE by setting opts.closeOnEose
to true
)
Optional
opts: NDKSubscriptionOptionsOptional
relaySet: NDKRelaySetexplicit relay set to use
automatically start the subscription
NDKSubscription
Zap a user or an event
This function wi
The amount to zap in millisatoshis
Optional
comment?: stringOptional
onOptional
onOptional
onOptional
signer?: NDKSignerOptional
tags?: NDKTag[]Optional
unit?: string
The NDK class is the main entry point to the library.
Emits
signer:ready when a signer is ready
Emits
invalid-signature when an event with an invalid signature is received