ReadonlycapabilitiesCrypto provider for cryptographic operations
ReadonlygroupsManages group lifecycle: persistence, caching, creation, loading, leaving
ReadonlyinvitesManages invite lifecycle: ingestion, decryption, and storage
ReadonlykeyManages key package lifecycle: local storage, publishing, and rotation
ReadonlynetworkThe nostr relay pool to use for the client
ReadonlysignerThe signer used for the clients identity
Whether we still hold the private KeyPackage a Welcome is addressed to —
i.e. whether joinGroupFromWelcome can succeed for this invite.
Accepting an invite whose KeyPackage we no longer hold (e.g. it rotated
away) would fail with "No matching KeyPackage found". Never throws: an
unparseable Welcome yields false.
Joins a group from a Welcome message received via NIP-59 gift wrap.
This method:
this.groups.adoptClientState()this.keyPackages.markUsed()After joining, callers can list used key packages with
(await client.keyPackages.list()).filter(p => p.used) and rotate them
via client.keyPackages.rotate(ref) to publish fresh ones to relays.
Promise resolving to the joined group
Decodes everything showable about an invite before committing to join.
Rumor-level fields (relays, KeyPackage event id, cipher suite, recipient
count) decode without key material; the group block requires decrypting
the Welcome with a held KeyPackage via readInviteGroupInfo and is
null when we don't hold it. Never throws — a malformed Welcome or failed
preview just yields the fields it could read.
Reads the GroupInfo from a Welcome rumor without joining the group.
Finds the local key package that matches one of the welcome's recipient slots, then decrypts the group info using that key package. Useful for previewing group metadata (name, relays, admins) before deciding to join.
The decrypted kind 444 welcome rumor
The decrypted GroupInfo, or null if no matching key package is found or decryption fails
Like InviteManager.watchUnread, but annotates each invite with whether it's joinable. Lets an app default to showing only acceptable invites while still being able to reveal the rest.
The capabilities to use for the client