Adds a LocalKeyPackage to the store.
Must include publicPackage and privatePackage.
Optionally include identifier to persist the addressable slot identifier.
The storage key (hex ref string)
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.
Clears all entries (local and tracked) from the store.
Returns the number of locally stored key packages (those with private material).
Retrieves the stored key package entry. Returns any entry regardless of whether it has private material.
Retrieves the private key material for a key package.
The key package reference
The private key package, or null if not found
Checks whether a key package with local private material exists.
Lists all LocalKeyPackage entries (those with private material), without the private package itself.
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.
The key package reference
Removes a key package from the backend.
Lists all local key packages with their published events defaulted to an empty array, suitable for emitting as a stable snapshot.
StaticprefixedOptionalcontext: anyCalls each of the listeners registered for a given event.
Return an array listing the events for which the emitter has registered listeners.
Return the number of listeners listening to a given event.
Return the listeners registered for a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: booleanAdd a listener for a given event.
Optionalcontext: anyAdd a one-time listener for a given event.
Optionalcontext: anyRemove all listeners, or those of the specified event.
Optionalevent: keyof KeyPackageStoreEventsRemove the listeners of a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: boolean
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
AccountSecretStoreseam.