Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • WakuMessage

Index

Constructors

Private constructor

Properties

proto

Accessors

contentTopic

  • get contentTopic(): undefined | string

payload

  • get payload(): undefined | Uint8Array

payloadAsUtf8

  • get payloadAsUtf8(): string

signature

  • get signature(): undefined | Uint8Array

signaturePublicKey

  • get signaturePublicKey(): undefined | Uint8Array

timestamp

  • get timestamp(): undefined | Date

version

  • get version(): undefined | number

Methods

encode

  • encode(): Uint8Array

Static decode

  • Decode a byte array into Waku Message.

    params

    bytes The message encoded using protobuf as defined in 14/WAKU2-MESSAGE.

    params

    decryptionKeys If the payload is encrypted (version = 1), then the keys are used to attempt decryption of the message. The passed key can either be asymmetric private keys or symmetric keys, both method are tried for each key until the message is decrypted or combinations are run out.

    Parameters

    • bytes: Uint8Array
    • Optional decryptionKeys: { contentTopic?: string[]; key: Uint8Array; method?: DecryptionMethod }[]

    Returns Promise<undefined | waku_message.WakuMessage>

Static decodeProto

  • Decode and decrypt Waku Message Protobuf Object into Waku Message.

    params

    protoBuf The message to decode and decrypt.

    params

    decryptionKeys If the payload is encrypted (version = 1), then the keys are used to attempt decryption of the message. The passed key can either be asymmetric private keys or symmetric keys, both method are tried for each key until the message is decrypted or combinations are run out.

    Parameters

    Returns Promise<undefined | waku_message.WakuMessage>

Static fromBytes

  • Create a Waku Message with the given payload.

    By default, the payload is kept clear (version 0). If opts.encPublicKey is passed, the payload is encrypted using asymmetric encryption (version 1).

    If opts.sigPrivKey is passed and version 1 is used, the payload is signed before encryption.

    throws

    if both opts.encPublicKey and opt.symKey are passed

    Parameters

    • payload: Uint8Array
    • contentTopic: string
    • Optional opts: Options

    Returns Promise<waku_message.WakuMessage>

Static fromUtf8String

Generated using TypeDoc