mirror of
https://github.com/purrgrammer/grimoire.git
synced 2026-04-17 19:07:06 +02:00
37 lines
757 B
TypeScript
37 lines
757 B
TypeScript
// Nostr Event interface following NIP-01 specification
|
|
export interface NostrEvent {
|
|
id: string;
|
|
pubkey: string;
|
|
created_at: number;
|
|
kind: number;
|
|
tags: string[][];
|
|
content: string;
|
|
sig: string;
|
|
}
|
|
|
|
// Filter interface for querying events
|
|
export interface NostrFilter {
|
|
ids?: string[];
|
|
authors?: string[];
|
|
kinds?: number[];
|
|
since?: number;
|
|
until?: number;
|
|
limit?: number;
|
|
search?: string;
|
|
[key: `#${string}`]: string[] | undefined;
|
|
}
|
|
|
|
// Relay connection state
|
|
export type RelayConnectionState =
|
|
| "connecting"
|
|
| "connected"
|
|
| "disconnected"
|
|
| "error";
|
|
|
|
// Relay message types
|
|
export type RelayMessage =
|
|
| ["EVENT", string, NostrEvent]
|
|
| ["EOSE", string]
|
|
| ["NOTICE", string]
|
|
| ["OK", string, boolean, string];
|