Marmot-TS
    Preparing search index...

    Type Alias MarmotClientOptions<THistory, TMedia>

    MarmotClientOptions: {
        audit?: AuditSink;
        auditContext?: AuditContextOptions;
        capabilities?: Capabilities;
        clientId?: string;
        convergencePolicy?: ConvergencePolicy;
        cryptoProvider?: CryptoProvider;
        getSignatureKeyPair?: KeyPackageManagerOptions["getSignatureKeyPair"];
        groupStateStore: GenericKeyValueStore<SerializedClientState>;
        ingestionPool?: IngestionPoolOptions;
        ingestStateStore?: GenericKeyValueStore<Uint8Array>;
        inviteStore?: GenericKeyValueStore<StoredInviteEntry>;
        keyPackageStore: GenericKeyValueStore<StoredKeyPackage>;
        lifecycleStore?: GenericKeyValueStore<Uint8Array>;
        network: NostrNetworkInterface;
        removedMarkerStore?: GenericKeyValueStore<boolean>;
        rewindStore?: GenericKeyValueStore<Uint8Array>;
        signer: EventSigner;
        verifyEvent?: VerifyEventMethod;
    } & (
        THistory extends undefined
            ? {}
            : { historyFactory: GroupHistoryFactory<THistory> }
    ) & (
        TMedia extends undefined
            ? {}
            : { mediaFactory: GroupMediaFactory<TMedia> }
    )

    Type Parameters

    Type Declaration

    • Optionalaudit?: AuditSink

      Optional forensic audit sink inherited by groups. Omitted by default.

    • OptionalauditContext?: AuditContextOptions

      Required when audit is set; contains stable engine/account/session metadata.

    • Optionalcapabilities?: Capabilities

      The capabilities to use for the client

    • OptionalclientId?: string

      Default d tag value (slot identifier) for key package events. Used by KeyPackageManager.create when no explicit d is passed. Generate 32 random bytes once and persist their 64-character lowercase hex encoding so key packages share a stable addressable slot on relays.

    • OptionalconvergencePolicy?: ConvergencePolicy

      Convergence policy applied to every group: branch selection and the maxRewindCommits rollback horizon. Keep the finite profile-1 default (DEFAULT_CONVERGENCE_POLICY) for production. Infinity is an explicit debugging/forensics choice that keeps arbitrarily old forks eligible and can retain unbounded evidence; the horizon does not guarantee pruning of every full-history tree record.

    • OptionalcryptoProvider?: CryptoProvider

      The crypto provider to use for cryptographic operations

    • OptionalgetSignatureKeyPair?: KeyPackageManagerOptions["getSignatureKeyPair"]

      Load a persisted installation signing identity for KeyPackages.

    • groupStateStore: GenericKeyValueStore<SerializedClientState>

      The backend to store and load the groups from

    • OptionalingestionPool?: IngestionPoolOptions

      Ingestion-pool tuning applied to every group: max entries and max epoch-age for undecryptable events held and retried as history grows. Defaults bound it; a debugging tool that retains and processes everything can raise both (e.g. a large maxSize and a very large maxRewindCommits).

    • OptionalingestStateStore?: GenericKeyValueStore<Uint8Array>

      Durable terminal-wrapper and convergence-effect evidence.

    • OptionalinviteStore?: GenericKeyValueStore<StoredInviteEntry>

      Key value store for the InviteManager class, if non is provided an InMemoryKeyValueStore is used

    • keyPackageStore: GenericKeyValueStore<StoredKeyPackage>

      The backend for key package private material and publish tracking

    • OptionallifecycleStore?: GenericKeyValueStore<Uint8Array>

      Durable backend for group lifecycle intent and terminal records. When omitted, lifecycle records share the groupStateStore from MarmotClientOptions through a disband-key-scoped adapter.

    • network: NostrNetworkInterface

      The nostr relay pool to use for the client. Should implement GroupNostrInterface for group operations.

    • OptionalremovedMarkerStore?: GenericKeyValueStore<boolean>

      Dedicated backend for the persisted removed-inactive marker (D-12), keyed by group-id hex like groupStateStore. When provided, the fact that an involuntary removal was already realized survives a restart, so the removed event fires exactly once across process boundaries and a re-convergence that supersedes the removing commit can clear it durably. Back it with the same durable backend as groupStateStore. Optional — when omitted, realization is in-memory-only and does not survive a restart.

    • OptionalrewindStore?: GenericKeyValueStore<Uint8Array>

      Dedicated backend for the per-group full-fork history tree (the single persisted source for fork recovery and the MarmotGroup.forkTree API) and exact pending commit publication records. When provided, the tree and pending private MLS states are persisted so recovery survives a restart; back it with the same durable (ideally encrypted) backend as groupStateStore. Optional — when omitted, history is in-memory only and is rebuilt from the current tip after each restart.

    • signer: EventSigner

      The signer used for the client's Nostr identity. Also signs the kind-450 account identity proof carried by every KeyPackage and leaf this client creates.

    • OptionalverifyEvent?: VerifyEventMethod

      Injectable Nostr event verifier gating the inbound trust boundary (SEC-01) across all three entry points: the 445 group-message drain, the 1059 gift-wrap ingest, and the 30443 KeyPackage publish/track path. Defaults to applesauce's verifyEvent (real BIP-340 Schnorr signature verification). Callers that trust their event source upstream (e.g. already verified by a relay pool) may inject fakeVerifyEvent instead, or supply a native/WASM verifier for performance — do not introduce a separate boolean skip-verification flag.