lib.ts (1286B)
1 import { type EventTemplate } from "nostr-tools"; 2 import { z } from "zod"; 3 import { nostr_tag_client_schema } from "../schemas/lib.js"; 4 5 export type NostrTagClient = z.infer<typeof nostr_tag_client_schema>; 6 export type NostrEventTag = string[]; 7 export type NostrEventTags = NostrEventTag[]; 8 9 export type NostrEventTagClient = { 10 name: string; 11 pubkey: string; 12 relay: string; 13 }; 14 15 export type NostrEventTagLocation = { 16 primary: string; 17 city?: string; 18 region?: string; 19 country?: string; 20 lat?: number; 21 lng?: number; 22 }; 23 24 export type NostrEventTagImage = { 25 url: string; 26 size?: { 27 w: number; 28 h: number; 29 }; 30 }; 31 32 export type NostrRelayInformationDocument = { 33 id?: string; 34 name?: string; 35 description?: string; 36 pubkey?: string; 37 contact?: string; 38 supported_nips?: number[]; 39 software?: string; 40 version?: string; 41 limitation_payment_required?: string; 42 limitation_restricted_writes?: boolean; 43 } 44 45 export type NostrRelayInformationDocumentFields = { [K in keyof NostrRelayInformationDocument]: string; }; 46 47 export type NostrNeventEncode = { 48 id: string; 49 relays: string[]; 50 author: string; 51 kind: number; 52 }; 53 54 export type NostrEventSign = { 55 secret_key: string; 56 event: EventTemplate; 57 };