Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/nostr_deno_client/lib/relay.ts>default

Nostr protocol client library for deno runtime.
Latest
class default
import { default } from "https://deno.land/x/nostr_deno_client@v0.2.7/lib/relay.ts";

Constructors

new
default(_nostr: Nostr)

Properties

private
listeners: Array<Listener>
private
manualClose: boolean
private
nostr: Nostr
private
ws: WebSocketClient | undefined
connected: boolean
name: string | undefined
reconnect: boolean
relayConnectionTimeout: number
url: string | undefined

Methods

deleteListener(subscribeId: string)

Usage example: for await (const event of relay.events({ kinds: [NostrKind.META_DATA], authors: [publicKey], limit: 1 })) { console.log(event) }

getListener(subscribeId: string)
handleMessage(message: any)
sendErrorEvent(err: Error)
subscribe(filters: NostrFilters, listenerFunc: any)
subscribePromise(filters: NostrFilters): Promise<Array<NostrEvent>>
triggerListenerFunc(subscribeId: string, data: any)