Crypto provider for cryptographic operations
ReadonlynetworkThe nostr relay pool to use for the client
ReadonlysignerThe signer used for the clients identity
ReadonlystoreThe backend storing serialized group state bytes
Returns the list of currently loaded group instances
Persists and caches a group built from a ClientState, emitting the given lifecycle event. Used by higher-level flows (e.g. joining from a welcome message) that construct ClientStates themselves.
The ClientState to adopt
Optionaloptions: { emit?: "imported" | "joined" }Optionalemit?: "imported" | "joined"Which lifecycle event to emit. Defaults to "imported".
The persisted and cached MarmotGroup
Creates a new simple group
Optionaloptions: SimpleGroupOptions & {Destroys a group and purges the group history
Gets a group from cache or loads it from store
Checks if a group exists in the backend
Imports a new group from a ClientState object, persisting it to
the store and emitting imported.
Leaves a group by publishing a self-remove proposal and purging all local group data from storage.
At least one relay must acknowledge the proposals before local state is destroyed. If no relay acks, an error is thrown and local state is preserved so the caller can retry.
The group ID as a hex string or Uint8Array.
The relay publish responses for the leave proposal event(s).
Lists all persisted group IDs, decoded from their hex storage keys.
Loads all groups from the store and returns them
Unloads a group from the client but does not remove it from the store
Watches for changes to the groups in the store. Returns an async generator that yields the current list of groups whenever the store changes.
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 GroupsManagerEvents<THistory, TMedia>Remove the listeners of a given event.
Optionalfn: (Optionalcontext: anyOptionalonce: boolean
Manages the lifecycle of MarmotGroup instances — persistence, in-memory caching, creation, loading, unloading, destroying, and leaving.