Marmot-TS
    Preparing search index...

    Class KeyPackageStore

    Owns the persisted key package entries — the local private material and the tracked kind-30443 events that advertise each package. Pure storage: it never signs or publishes (that is KeyPackagePublisher's job). Mirrors darkmatter's AccountSecretStore seam.

    Hierarchy

    Index

    Client - Key Package Manager

    • Appends a kind-30443 Nostr event to the published list of the key package identified by ref. If no entry exists yet, a TrackedKeyPackage is created by decoding the public key package from the event body.

      Throws if the event body cannot be decoded as a valid key package, or if the event's i tag (KeyPackageRef) does not match the decoded body.

      Parameters

      • ref: string | Uint8Array<ArrayBufferLike>
      • event: NostrEvent

      Returns Promise<void>

    • Retrieves the private key material for a key package.

      Parameters

      • ref: string | Uint8Array<ArrayBufferLike>

        The key package reference

      Returns Promise<PrivateKeyPackage | null>

      The private key package, or null if not found

    • Marks a key package as used by setting used = true on the stored entry.

      Does nothing if no entry is found for the given ref.

      Parameters

      • ref: string | Uint8Array<ArrayBufferLike>

        The key package reference

      Returns Promise<void>

    Other

    prefixed: string | boolean
    • Type Parameters

      Parameters

      Returns this

    • Return an array listing the events for which the emitter has registered listeners.

      Returns (keyof KeyPackageStoreEvents)[]

    • Return the number of listeners listening to a given event.

      Parameters

      Returns number

    • Return the listeners registered for a given event.

      Type Parameters

      Parameters

      • event: T

      Returns (
          (
              ...args: ArgumentMap<KeyPackageStoreEvents>[Extract<
                  T,
                  keyof KeyPackageStoreEvents,
              >],
          ) => void
      )[]

    • Type Parameters

      Parameters

      Returns this

    • Add a listener for a given event.

      Type Parameters

      Parameters

      Returns this

    • Add a one-time listener for a given event.

      Type Parameters

      Parameters

      Returns this

    • Remove all listeners, or those of the specified event.

      Parameters

      • Optionalevent: keyof KeyPackageStoreEvents

      Returns this

    • Remove the listeners of a given event.

      Type Parameters

      Parameters

      Returns this