import { ISigner } from "applesauce-signers"; import { NostrEvent } from "applesauce-core/helpers/event"; export type EventTemplate = { kind: number; content: string; tags: string[][]; created_at: number; }; /** A type for serializing an account */ export type SerializedAccount = { /** Internal account ID */ id: string; /** account type */ type: string; /** pubkey of the account */ pubkey: string; /** Signer data */ signer: SignerData; /** Extra application specific account metadata */ metadata?: Metadata; }; /** An interface for an account */ export interface IAccount extends ISigner { id: string; name?: string; pubkey: string; metadata?: Metadata; signer: Signer; type: string; disableQueue?: boolean; toJSON(): SerializedAccount; } /** A constructor for an account */ export interface IAccountConstructor { readonly type: string; new (pubkey: string, signer: Signer): IAccount; fromJSON(json: SerializedAccount): IAccount; } /** An interface for caching decrypted content of events */ export interface DecryptionCache { getContent(event: NostrEvent): Promise; setContent(event: NostrEvent, content: string): Promise; }