The wallet address connected to the client
Returns the consent state of the conversation peer address
Optional
contextOptional 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.
Returns true if conversation peer address is on the allow list
Returns true if conversation peer address is on the deny list
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)
})
Optional
opts: ListMessagesOptionsOptional
opts: ListMessagesPaginatedOptionsReturn a PreparedMessage
that has contains the message ID
of the message that will be sent.
Optional
options: SendOptionsSend a message into the conversation
await conversation.send('Hello world') // returns a `DecodedMessage` instance
Optional
options: SendOptionsReturn 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.