UNPKG

@enclaved/encli

Version:

CLI utilities for working with enclaved application server for TEEs

39 lines (38 loc) 884 B
import { Event, Filter } from "nostr-tools"; export interface RelayOptions { relayUrl: string; } export interface Req { id: string; filter: Filter; fetch: boolean; since?: number; onEvent?: (e: Event) => void; onClosed?: () => void; onEOSE?: (events: Event[]) => void; } export declare class Relay { private relayUrl; private ws?; private publishing; private reqs; constructor(relayUrl: string); [Symbol.dispose](): void; private connect; private onOpen; private onClose; private onError; private onMessage; private onEvent; private onEOSE; private onNotice; private onClosed; private onOK; private send; private publishEvent; get url(): string; close(id: string): void; req(req: Req): void; publish(e: Event, to?: number): Promise<void>; reconnect(): void; }