Skip to main content

Conversation

Class: Conversation

Conversation class allows you to view, stream, and send messages to/from a peer address

Constructors

constructor

new Conversation(client, address)

Parameters

NameType
clientClient
addressstring

Defined in

conversations/Conversation.ts:14

Properties

client

Private client: Client

Defined in

conversations/Conversation.ts:12


peerAddress

peerAddress: string

Defined in

conversations/Conversation.ts:11

Methods

messages

messages(opts?): Promise<Message[]>

Returns a list of all messages to/from the peerAddress

Parameters

NameType
opts?ListMessagesOptions

Returns

Promise<Message[]>

Defined in

conversations/Conversation.ts:22


send

send(message, options?): Promise<Message>

Send a message into the conversation

Parameters

NameType
messageany
options?SendOptions

Returns

Promise<Message>

Defined in

conversations/Conversation.ts:36


streamMessages

streamMessages(): Promise<Stream<Message>>

Returns a Stream of any new messages to/from the peerAddress

Returns

Promise<Stream<Message>>

Defined in

conversations/Conversation.ts:29