import { Relay } from "https://deno.land/x/lophus@0.0.13/core/relays.ts";
A class that represents a remote Nostr Relay.
Constructors
new
Relay(init: RelayUrl | RelayInit, options?: RelayOptions)Properties
readonly
config: Readonly<RelayConfig>ws: LazyWebSocket
Methods
publish<K extends EventKind>(event: NostrEvent<K>): Promise<void>
Publish an event to the relay and wait for a response.
subscribe<K extends EventKind>(filter: SubscriptionFilter<K> | SubscriptionFilter<K>[], options?: Partial<SubscriptionOptions>): ReadableStream<NostrEvent<K>>