Constructors
constructor
- new NostrClient(relays, options?): NostrClient
Parameters
- relays: string[]
- options: {
eoseSubTimeout?: number;
getTimeout?: number;
} = {}Optional
eoseSubTimeout?: number
Optional
getTimeout?: number
Methods
addRelay
- addRelay(relay): void
Returns void
addRelays
- addRelays(relays): void
Returns void
disconnect
- disconnect(): void
Returns void
get
- get<K>(filter, opts?): Promise<null | Event<K>>
Type Parameters
- K extends number = number
Parameters
- filter: Filter<K>
Optional
opts: SubscriptionOptions
Returns Promise<null | Event<K>>
list
- list<K>(filters, opts?): Promise<Event<K>[]>
Type Parameters
- K extends number = number
Parameters
- filters: Filter<K>[]
Optional
opts: SubscriptionOptions
Returns Promise<Event<K>[]>
removeRelay
- removeRelay(relay): void
Returns void
removeRelays
- removeRelays(relays): void
Returns void
sub
- sub<K>(filters, onEventFn?, opts?): Sub<K>
Type Parameters
- K extends number = number
Parameters
- filters: Filter<K>[]
Optional
onEventFn: ((element) => void)- (element): void
Returns void
Optional
opts: SubscriptionOptions
Returns Sub<K>