Interface IAccount<Signer, SignerData, Metadata>

interface IAccount<
    Signer extends Nip07Interface = Nip07Interface,
    SignerData = any,
    Metadata extends unknown = any,
> {
    disableQueue?: boolean;
    getPublicKey: () => string | Promise<string>;
    getRelays?: () => | Record<string, { read: boolean; write: boolean }>
    | Promise<Record<string, { read: boolean; write: boolean }>>;
    id: string;
    metadata?: Metadata;
    name?: string;
    nip04?: {
        decrypt: (
            pubkey: string,
            ciphertext: string,
        ) => string | Promise<string>;
        encrypt: (pubkey: string, plaintext: string) => string | Promise<string>;
    };
    nip44?: {
        decrypt: (
            pubkey: string,
            ciphertext: string,
        ) => string | Promise<string>;
        encrypt: (pubkey: string, plaintext: string) => string | Promise<string>;
    };
    pubkey: string;
    signer: Signer;
    signEvent: (template: EventTemplate) => Event | Promise<Event>;
    type: string;
    toJSON(): SerializedAccount<SignerData, Metadata>;
}

Type Parameters

Hierarchy (View Summary)

Implemented by

Properties

disableQueue?: boolean
getPublicKey: () => string | Promise<string>
getRelays?: () => | Record<string, { read: boolean; write: boolean }>
| Promise<Record<string, { read: boolean; write: boolean }>>
id: string
metadata?: Metadata
name?: string
nip04?: {
    decrypt: (
        pubkey: string,
        ciphertext: string,
    ) => string | Promise<string>;
    encrypt: (pubkey: string, plaintext: string) => string | Promise<string>;
}
nip44?: {
    decrypt: (
        pubkey: string,
        ciphertext: string,
    ) => string | Promise<string>;
    encrypt: (pubkey: string, plaintext: string) => string | Promise<string>;
}
pubkey: string
signer: Signer
signEvent: (template: EventTemplate) => Event | Promise<Event>
type: string

Methods