Marmot-TS
    Preparing search index...

    Class GroupsManager<THistory, TMedia>

    Manages the lifecycle of MarmotGroup instances — persistence, in-memory caching, creation, loading, unloading, destroying, and leaving.

    Type Parameters

    Hierarchy

    Index

    Client - Group Manager

    cryptoProvider: CryptoProvider

    Crypto provider for cryptographic operations

    The nostr relay pool to use for the client

    signer: EventSigner

    The signer used for the clients identity

    The backend storing serialized group state bytes

    • Creates a new simple group

      Parameters

      • name: string
      • Optionaloptions: SimpleGroupOptions & {
            ciphersuite?:
                | "MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519"
                | "MLS_128_DHKEMP256_AES128GCM_SHA256_P256"
                | "MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519"
                | "MLS_256_DHKEMX448_AES256GCM_SHA512_Ed448"
                | "MLS_256_DHKEMP521_AES256GCM_SHA512_P521"
                | "MLS_256_DHKEMX448_CHACHA20POLY1305_SHA512_Ed448"
                | "MLS_256_DHKEMP384_AES256GCM_SHA384_P384"
                | "MLS_128_MLKEM512_AES128GCM_SHA256_Ed25519"
                | "MLS_128_MLKEM512_CHACHA20POLY1305_SHA256_Ed25519"
                | "MLS_256_MLKEM768_AES256GCM_SHA384_Ed25519"
                | "MLS_256_MLKEM768_CHACHA20POLY1305_SHA384_Ed25519"
                | "MLS_256_MLKEM1024_AES256GCM_SHA512_Ed25519"
                | "MLS_256_MLKEM1024_CHACHA20POLY1305_SHA512_Ed25519"
                | "MLS_256_XWING_AES256GCM_SHA512_Ed25519"
                | "MLS_256_XWING_CHACHA20POLY1305_SHA512_Ed25519"
                | "MLS_256_MLKEM1024_AES256GCM_SHA512_MLDSA87"
                | "MLS_256_MLKEM1024_CHACHA20POLY1305_SHA512_MLDSA87"
                | "MLS_256_XWING_AES256GCM_SHA512_MLDSA87"
                | "MLS_256_XWING_CHACHA20POLY1305_SHA512_MLDSA87";
        }

      Returns Promise<MarmotGroup<THistory, TMedia>>

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

      Parameters

      • groupId: string | Uint8Array<ArrayBufferLike>

        The group ID as a hex string or Uint8Array.

      Returns Promise<Record<string, PublishResponse>>

      The relay publish responses for the leave proposal event(s).

    Other

    prefixed: string | boolean
    • Return an array listing the events for which the emitter has registered listeners.

      Returns (keyof GroupsManagerEvents<THistory, TMedia>)[]

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

      Parameters

      Returns number

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

      Parameters

      • Optionalevent: keyof GroupsManagerEvents<THistory, TMedia>

      Returns this