Skip to main content

Message

Class: Message

Implements

  • MessageV1

Constructors

constructor

new Message(id, bytes, obj, header)

Parameters

NameType
idstring
bytesUint8Array
objMessage
headerMessageHeaderV1

Defined in

Message.ts:45

Properties

bytes

Private bytes: Uint8Array

Defined in

Message.ts:43


ciphertext

ciphertext: default

Implementation of

proto.MessageV1.ciphertext

Defined in

Message.ts:29


content

Optional content: any

Defined in

Message.ts:34


contentTopic

Optional contentTopic: string

Defined in

Message.ts:35


contentType

Optional contentType: ContentTypeId

Defined in

Message.ts:33


decrypted

Optional decrypted: Uint8Array

Defined in

Message.ts:30


error

Optional error: Error

Defined in

Message.ts:36


header: MessageHeaderV1

Defined in

Message.ts:27


headerBytes

headerBytes: Uint8Array

Implementation of

proto.MessageV1.headerBytes

Defined in

Message.ts:28


id

id: string

Identifier that is deterministically derived from the bytes of the message header and ciphertext, where all those bytes are authenticated. This can be used in determining uniqueness of messages.

Defined in

Message.ts:42

Accessors

recipientAddress

get recipientAddress(): undefined | string

Returns

undefined | string

Defined in

Message.ts:97


senderAddress

get senderAddress(): undefined | string

Returns

undefined | string

Defined in

Message.ts:87


sent

get sent(): undefined | Date

Returns

undefined | Date

Defined in

Message.ts:82

Methods

toBytes

toBytes(): Uint8Array

Returns

Uint8Array

Defined in

Message.ts:62


create

Static create(obj, header, bytes): Promise<Message>

Parameters

NameType
objMessage
headerMessageHeaderV1
bytesUint8Array

Returns

Promise<Message>

Defined in

Message.ts:66


decode

Static decode(viewer, bytes): Promise<Message>

Parameters

NameType
viewerPrivateKeyBundleV1
bytesUint8Array

Returns

Promise<Message>

Defined in

Message.ts:139


encode

Static encode(sender, recipient, message, timestamp): Promise<Message>

Parameters

NameType
senderPrivateKeyBundleV1
recipientPublicKeyBundle
messageUint8Array
timestampDate

Returns

Promise<Message>

Defined in

Message.ts:107


fromBytes

Static fromBytes(bytes): Promise<Message>

Parameters

NameType
bytesUint8Array

Returns

Promise<Message>

Defined in

Message.ts:75