Skip to main content

Conversations

Class: Conversations

Conversations allows you to view ongoing 1:1 messaging sessions with another wallet

Constructors

constructor

new Conversations(client)

Parameters

NameType
clientClient

Defined in

conversations/Conversations.ts:19

Properties

client

Private client: Client

Defined in

conversations/Conversations.ts:18

Methods

buildTopicsForAllMessages

Private buildTopicsForAllMessages(peerAddresses, introTopic): string[]

Builds a list of topics for existing conversations and new intro topics

Parameters

NameType
peerAddressesstring[]
introTopicstring

Returns

string[]

Defined in

conversations/Conversations.ts:139


getPeerAddress

Private getPeerAddress(message): string

Parameters

NameType
messageMessage

Returns

string

Defined in

conversations/Conversations.ts:163


list

list(): Promise<Conversation[]>

List all conversations with the current wallet found in the network, deduped by peer address

Returns

Promise<Conversation[]>

Defined in

conversations/Conversations.ts:26


newConversation

newConversation(peerAddress): Promise<Conversation>

Creates a new conversation for the given address. Will throw an error if the peer is not found in the XMTP network

Parameters

NameType
peerAddressstring

Returns

Promise<Conversation>

Defined in

conversations/Conversations.ts:154


stream

stream(): Promise<Stream<Conversation>>

Returns a stream of any newly created conversations. Will dedupe to not return the same conversation twice in the same stream. Does not dedupe any other previously seen conversations

Returns

Promise<Stream<Conversation>>

Defined in

conversations/Conversations.ts:56


streamAllMessages

streamAllMessages(): Promise<Stream<Message>>

Returns a stream for all new messages from existing and new conversations.

Returns

Promise<Stream<Message>>

Defined in

conversations/Conversations.ts:90