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:77
Properties
client
Private
client: Client
Defined in
conversations/Conversations.ts:73
v1Cache
Private
v1Cache: ConversationCache
Defined in
conversations/Conversations.ts:74
v2Mutex
Private
v2Mutex: Mutex
Defined in
conversations/Conversations.ts:75
Methods
conversationReferenceToV2
Private
conversationReferenceToV2(convoRef
): ConversationV2
Parameters
Name | Type |
---|---|
convoRef | ConversationReference |
Returns
ConversationV2
Defined in
conversations/Conversations.ts:207
createV2Convo
Private
createV2Convo(recipient
, context?
): Promise
<ConversationV2
>
Parameters
Name | Type |
---|---|
recipient | SignedPublicKeyBundle |
context? | InvitationContext |
Returns
Promise
<ConversationV2
>
Defined in
conversations/Conversations.ts:503
decodeInvites
Private
decodeInvites(envelopes
, shouldThrow?
): Promise
<ConversationV2
[]>
Parameters
Name | Type | Default value |
---|---|---|
envelopes | Envelope [] | undefined |
shouldThrow | boolean | false |
Returns
Promise
<ConversationV2
[]>
Defined in
conversations/Conversations.ts:170
getIntroductionPeers
Private
getIntroductionPeers(opts?
): Promise
<Map
<string
, Date
>>
Parameters
Name | Type |
---|---|
opts? | ListMessagesOptions |
Returns
Promise
<Map
<string
, Date
>>
Defined in
conversations/Conversations.ts:391
getPeerAddress
Private
getPeerAddress(message
): string
Parameters
Name | Type |
---|---|
message | MessageV1 |
Returns
string
Defined in
conversations/Conversations.ts:535
getV2ConversationsFromKeystore
Private
getV2ConversationsFromKeystore(): Promise
<ConversationV2
[]>
Returns
Promise
<ConversationV2
[]>
Defined in
conversations/Conversations.ts:152
list
list(): Promise
<Conversation
[]>
List all conversations with the current wallet found in the network.
Returns
Promise
<Conversation
[]>
Defined in
conversations/Conversations.ts:86
listV1Conversations
Private
listV1Conversations(): Promise
<Conversation
[]>
Returns
Promise
<Conversation
[]>
Defined in
conversations/Conversations.ts:98
listV2Conversations
Private
listV2Conversations(): Promise
<Conversation
[]>
List all V2 conversations
Returns
Promise
<Conversation
[]>
Defined in
conversations/Conversations.ts:117
newConversation
newConversation(peerAddress
, context?
): 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 |
context? | InvitationContext |
Returns
Promise
<Conversation
>
Defined in
conversations/Conversations.ts:435
saveInviteResponseToConversation
Private
saveInviteResponseToConversation(«destructured»
): ConversationV2
Parameters
Name | Type |
---|---|
«destructured» | SaveInvitesResponse_Response |
Returns
ConversationV2
Defined in
conversations/Conversations.ts:197
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:224
streamAllMessages
streamAllMessages(): Promise
<AsyncGenerator
<DecodedMessage
, any
, unknown
>>
Streams messages from all conversations.
When a new conversation is initiated with the client's address, this function will automatically register it and add it to the list of conversations to watch. Callers should be aware the first messages in a newly created conversation are picked up on a best effort basis and there are other potential race conditions which may cause some newly created conversations to be missed.
Returns
Promise
<AsyncGenerator
<DecodedMessage
, any
, unknown
>>
Defined in
conversations/Conversations.ts:272
updateV2Conversations
updateV2Conversations(startTime?
): Promise
<ConversationV2
[]>
Parameters
Name | Type |
---|---|
startTime? | Date |
Returns
Promise
<ConversationV2
[]>