• Creates an encoder that encrypts messages using symmetric encryption for the given key, as defined in 26/WAKU2-PAYLOAD.

    An encoder is used to encode messages in the [`14/WAKU2-MESSAGE](https://rfc.vac.dev/spec/14/) format to be sent over the Waku network. The resulting encoder can then be pass to @waku/interfaces.LightPush.push or @waku/interfaces.Relay.send to automatically encrypt and encode outgoing messages.

    The payload can optionally be signed with the given private key as defined in 26/WAKU2-PAYLOAD.

    Parameters

    • contentTopic: string

      The content topic to set on outgoing messages.

    • symKey: Uint8Array

      The symmetric key to encrypt the payload with.

    • Optional sigPrivKey: Uint8Array

      An optional private key to used to sign the payload before encryption.

    • ephemeral: boolean = false

      An optional flag to mark message as ephemeral, ie, not to be stored by Waku Store nodes.

    Returns symmetric.Encoder

Generated using TypeDoc