import { EventKind, type NostrEvent, type NostrLink, type NotSignedNostrEvent } from "."; /** * Generic thread structure extracted from a note */ export interface Thread { kind: "nip10" | "nip22"; root?: NostrLink; replyTo?: NostrLink; mentions: Array; pubKeys: Array; } export declare enum EventType { Regular = 0, Replaceable = 1, Addressable = 2 } /** * Helper class for parsing event data */ export declare abstract class EventExt { /** * Get the pub key of the creator of this event. * * NIP-26 delegation tags are intentionally ignored: accepting an unverified * delegation tag would allow any event to claim authorship by any pubkey. * Full NIP-26 support requires verifying the delegation token signature * before trusting the delegator pubkey. */ static getRootPubKey(e: NostrEvent): string; /** * Sign this message with a private key */ static sign(e: NostrEvent, key: string): NostrEvent; /** * Check the signature of this event. * - Validates that `sig` and `pubkey` are correctly-formatted hex strings. * - Validates that `id` matches the canonical hash of the event payload. * - Verifies the Schnorr signature. * Never throws; returns `false` for any malformed or untrusted input. * @returns True only if the event is cryptographically authentic. */ static verify(e: NostrEvent): boolean; /** * Returns true if this event ID has already been verified in the current session. */ static isVerified(e: NostrEvent): boolean; /** * Mark an event as verified. Call this after an external verifier (e.g. WASM) * has confirmed the signature so that subsequent verify() calls are skipped * for any object carrying the same event ID. */ static markVerified(e: NostrEvent): void; static createId(e: NostrEvent | NotSignedNostrEvent): string; /** * Mine POW for an event (NIP-13) */ static minePow(e: NostrEvent, target: number): import("./pow-util").NostrPowEvent; /** * Create a new event for a specific pubkey */ static forPubKey(pk: string, kind: EventKind): NostrEvent; static extractThread(ev: NostrEvent): Thread | undefined; /** * Assign props if undefined */ static fixupEvent(e: NostrEvent): void; static getType(kind: number): EventType; static isReplaceable(kind: number): boolean; static isAddressable(kind: number): boolean; /** * Check that an event is structurally well-formed WITHOUT verifying the * Schnorr signature. Specifically: `sig` must be present, `tags` must be * an array, and addressable events must have a `"d"` tag. * Never throws; returns `false` for any malformed input. * Use `isValid` when cryptographic authenticity is required. */ static isWellFormed(ev: NostrEvent): boolean; /** * Check that an event is structurally well-formed AND has a valid Schnorr * signature. Use this wherever event authenticity matters (relay message * handlers, NIP-46, etc.). */ static isValid(ev: NostrEvent): boolean; /** * Create a string key for an event * * Addressable: {kind}:{pubkey}:{identifier} * * Replaceable: {kind}:{pubkey} * * {id} */ static keyOf(e: NostrEvent): string; } //# sourceMappingURL=event-ext.d.ts.map