Conversations
Class: Conversations
Conversations allows you to view ongoing 1:1 messaging sessions with another wallet
Constructors
constructor
new Conversations(client
)
Parameters
Name | Type |
---|---|
client | Client |
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
Name | Type |
---|---|
peerAddresses | string [] |
introTopic | string |
Returns
string
[]
Defined in
conversations/Conversations.ts:139
getPeerAddress
Private
getPeerAddress(message
): string
Parameters
Name | Type |
---|---|
message | Message |
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
Name | Type |
---|---|
peerAddress | string |
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.