diff --git a/event.ts b/event.ts index 8e5abafb..54e1ce3a 100644 --- a/event.ts +++ b/event.ts @@ -5,6 +5,7 @@ import {bytesToHex} from '@noble/hashes/utils' import {getPublicKey} from './keys.ts' import {utf8Encoder} from './utils.ts' +/** @deprecated Use numbers instead. */ /* eslint-disable no-unused-vars */ export enum Kind { Metadata = 0, @@ -33,18 +34,18 @@ export enum Kind { Article = 30023 } -export type EventTemplate = { +export type EventTemplate = { kind: K tags: string[][] content: string created_at: number } -export type UnsignedEvent = EventTemplate & { +export type UnsignedEvent = EventTemplate & { pubkey: string } -export type Event = UnsignedEvent & { +export type Event = UnsignedEvent & { id: string sig: string } @@ -60,7 +61,7 @@ export function getBlankEvent(kind: K | Kind.Blank = Kind.Blank) { } } -export function finishEvent( +export function finishEvent( t: EventTemplate, privateKey: string ): Event { diff --git a/filter.ts b/filter.ts index 9ca2730c..0fef5f0f 100644 --- a/filter.ts +++ b/filter.ts @@ -1,6 +1,6 @@ import {Event, type Kind} from './event.ts' -export type Filter = { +export type Filter = { ids?: string[] kinds?: K[] authors?: string[]