node-red-contrib-nostr
Version:
Node-RED nodes for seamless Nostr protocol integration. Features robust WebSocket handling, event filtering, and NPUB-based routing. Built with TypeScript for type safety and extensive testing. Perfect for Nostr automation flows.
23 lines (22 loc) • 755 B
TypeScript
import { NostrEvent, NostrFilter } from '../nodes/shared/types';
export declare enum MessageType {
EVENT = "EVENT",
REQ = "REQ",
CLOSE = "CLOSE",
NOTICE = "NOTICE",
EOSE = "EOSE",
OK = "OK"
}
export interface RelayMessage {
type: MessageType;
subscriptionId?: string;
event?: NostrEvent;
message?: string;
filters?: NostrFilter[];
success?: boolean;
error?: string;
}
export declare function parseRelayMessage(message: string): RelayMessage | null;
export declare function createEventMessage(event: NostrEvent): string;
export declare function createSubscriptionMessage(subscriptionId: string, filters: NostrFilter[]): string;
export declare function createCloseMessage(subscriptionId: string): string;