Optional
opts: NDKSubscriptionOptionsOptional
relaySet: NDKRelaySetOptional
subId: stringWhether the subscription should close when all relays have reached the end of the event stream.
Relays that have sent an EOSE.
Events that have been seen by the subscription, with the time they were first seen.
Readonly
filtersReadonly
optsReadonly
poolOptional
relayTracks the filters as they are executed on each relay
Optional
relayReadonly
skipReadonly
skipOptional
Readonly
subCalled when an event is received from a relay or the cache
Whether the event was received from the cache
Whether this event is coming from an optimistic publish
Represents a subscription to an NDK event stream.
Emits
event Emitted when an event is received by the subscription.
Emits
event:dup Emitted when a duplicate event is received by the subscription.
Emits
eose - Emitted when all relays have reached the end of the event stream.
Emits
close - Emitted when the subscription is closed.
Example
Description
Subscriptions are created using NDK.subscribe.
Event validation
By defaults, subscriptions will validate events to comply with the minimal requirement of each known NIP. This can be disabled by setting the
skipValidation
option totrue
.Example