kernl API
    Preparing search index...

    Class ThrowawayIdentity

    An identity for trying the shell: a fresh key held by its signer in memory and nowhere else. It signs like any other, so the live store, applets and consent all behave as they will for a kept identity. It refuses to be serialised, so the account manager's persistence skips it and a reload starts without it (D-044).

    const identity = createThrowawayIdentity();
    await kernl.login(identity);

    Hierarchy

    • BaseAccount<PrivateKeySigner, never, { name: string }>
      • ThrowawayIdentity
    Index
    • Parameters

      • pubkey: string
      • signer: PrivateKeySigner

      Returns ThrowawayIdentity

    abort: AbortController | null
    disableQueue?: boolean

    Disable request queueing

    id: string
    lock: Promise<any> | null
    metadata$: BehaviorSubject<{ name: string } | undefined>
    pubkey: string
    queueLength: number

    internal queue

    signer: PrivateKeySigner
    type: "throwaway" = THROWAWAY_IDENTITY_TYPE
    • get metadata(): Metadata | undefined

      Returns Metadata | undefined

    • set metadata(metadata: Metadata): void

      Parameters

      • metadata: Metadata

      Returns void

    • 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

    • get type(): string

      Returns string

    • Aborts all pending requests in the queue

      Parameters

      • reason: Error

      Returns void

    • Returns the account's known public key without contacting or unlocking the signer

      Returns string

    • Gets the pubkey from the signer

      Returns Promise<string>

    • 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>

    • Returns void

    • Adds the common fields to the serialized output of a toJSON method

      Parameters

      • json: Omit<
            SerializedAccount<SignerData, Metadata>,
            "id" | "type" | "metadata" | "pubkey",
        >

      Returns SerializedAccount<never, { name: string }>

    • sign the event and make sure its signed with the correct pubkey

      Parameters

      • template: EventTemplate

      Returns Promise<NostrEvent>

    • Refuse to be written down.

      Returns SerializedAccount<never, { name: string }>

      denied:plaintext-key-persistence, always.

    • Type Parameters

      • T extends unknown

      Parameters

      • operation: () => Promise<T>

      Returns Promise<T>

    • Sets an accounts id and metadata. NOTE: This should only be used in fromJSON methods

      Type Parameters

      • T extends IAccount<ISigner, any, any>

      Parameters

      • account: T
      • json: SerializedAccount<any, any>

      Returns T