The wallet address connected to the client
Optional field containing the conversationId
and metadata
for V2 conversations.
Will always be undefined on V1 conversations
Timestamp the conversation was created at
A unique identifier for ephemeral envelopes for a conversation.
The wallet address of the other party in the conversation
A unique identifier for a conversation. Each conversation is stored on the network on one topic
Takes a XMTP envelope as input and will decrypt and decode it
returning a DecodedMessage
instance.
Retrieve messages in this conversation. Default to returning all messages.
If only a subset is required, results can be narrowed by specifying a start/end timestamp.
// Get all messages in the past 24 hours
const messages = await conversation.messages({
startTime: new Date(+new Date() - 86_400)
})
Return a PreparedMessage
that has contains the message ID
of the message that will be sent.
Send a message into the conversation
await conversation.send('Hello world') // returns a `DecodedMessage` instance
Return a Stream
of new ephemeral messages from this conversation's
ephemeral topic.
Stream instances are async generators and can be used in
for await
statements.
for await (const message of await conversation.streamEphemeral()) {
console.log(message.content)
}
Return a Stream
of new messages in this conversation.
Stream instances are async generators and can be used in
for await
statements.
for await (const message of await conversation.stream()) {
console.log(message.content)
}
Generated using TypeDoc
Conversation represents either a V1 or V2 conversation with a common set of methods.