Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/lophus/core/nodes.ts>NostrNodeBase

Fully-modular TypeScript implementation of the Nostr protocol, oriented to web standards and edge environments
Latest
class NostrNodeBase
implements NostrNode<W, R>
extends EventTarget
import { NostrNodeBase } from "https://deno.land/x/lophus@0.0.13/core/nodes.ts";

Common base class for relays and clients.

Constructors

new
NostrNodeBase(ws: WebSocketLike, opts?: NostrNodeOptions)

Properties

addEventListener: NostrNode<W, R>["addEventListener"]
readonly
config: Readonly<NostrNodeConfig<W, R>>
dispatchEvent: NostrNode<W, R>["dispatchEvent"]
removeEventListener: NostrNode<W, R>["removeEventListener"]
readonly
status
readonly
writable: WritableStream<W>

Methods

dispatch<T extends EventType<R>>(type: T, data: R[T])
on<T extends EventType<R>>(type: T, listener: (data: R[T]) => any)
send(msg: W)