Marmot-TS
    Preparing search index...

    Function evaluateKeyPackageForGroup

    • Evaluates whether a candidate's KeyPackage event (kind 30443) can be added to a group, against every Marmot add requirement: cipher-suite match, the group's required_capabilities (extension/proposal/credential types), the agent-text-stream-QUIC required_member_roles policy, and whether the KeyPackage's account is already a member.

      This is the eligibility logic an app needs before sending an invite — the library's createInviteIntent only checks the credential identity. A reasons array of length 0 means the KeyPackage is safe to add; a non-empty array explains every failing requirement. Never throws: an undecodable KeyPackage yields eligible: false with an undecodable: … reason.

      Parameters

      • state: ClientState | GroupInfo

        The local group state to evaluate against (group.state).

      • keyPackageEvent: NostrEvent

        The invitee's kind-30443 KeyPackage event.

      Returns KeyPackageEligibility