AppleSauce
    Preparing search index...

    Class PrivateKeyAccount<Metadata>

    A simple account that hold the private key in memory

    Type Parameters

    • Metadata extends unknown

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    abort: AbortController | null = null
    disableQueue?: boolean

    Disable request queueing

    id: string = ...
    lock: Promise<any> | null = null
    metadata$: BehaviorSubject<Metadata | undefined> = ...
    pubkey: string
    queueLength: number = 0

    internal queue

    signer: PrivateKeySigner
    type: "nsec"

    Accessors

    • get nip04(): | {
          decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
          encrypt: (pubkey: string, plaintext: string) => Promise<string>;
      }
      | undefined

      Returns
          | {
              decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
              encrypt: (pubkey: string, plaintext: string) => Promise<string>;
          }
          | undefined

    • get nip44(): | {
          decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
          encrypt: (pubkey: string, plaintext: string) => Promise<string>;
      }
      | undefined

      Returns
          | {
              decrypt: (pubkey: string, ciphertext: string) => Promise<string>;
              encrypt: (pubkey: string, plaintext: string) => Promise<string>;
          }
          | undefined

    Methods

    • A method that wraps any signer interaction, this allows the account to wait for unlock or queue requests

      Type Parameters

      • T extends unknown

      Parameters

      • operation: () => Promise<T>

      Returns Promise<T>