Conversation
public enum Conversation : Sendable
extension Conversation: Hashable, Equatable
Wrapper that provides a common interface between ConversationV1
and ConversationV2
objects.
-
Undocumented
Declaration
Swift
case v1(ConversationV1)
-
Undocumented
Declaration
Swift
case v2(ConversationV2)
-
Undocumented
See moreDeclaration
Swift
public enum Version
-
consentState()
AsynchronousUndocumented
Declaration
Swift
public func consentState() async -> ConsentState
-
Undocumented
Declaration
Swift
public var version: Version { get }
-
Undocumented
Declaration
Swift
public var createdAt: Date { get }
-
Undocumented
Declaration
Swift
public var encodedContainer: ConversationContainer { get }
-
The wallet address of the other person in this conversation.
Declaration
Swift
public var peerAddress: String { get }
-
An optional string that can specify a different context for a conversation with another account address.
Note
conversationID
is only available forConversationV2
conversations.Declaration
Swift
public var conversationID: String? { get }
-
Exports the serializable topic data required for later import. See Conversations.importTopicData()
Declaration
Swift
public func toTopicData() -> Xmtp_KeystoreApi_V1_TopicMap.TopicData
-
Undocumented
Declaration
Swift
public func decode(_ envelope: Envelope) throws -> DecodedMessage
-
Undocumented
Declaration
Swift
public func decrypt(_ envelope: Envelope) throws -> DecryptedMessage
-
encode(codec:
Asynchronouscontent: ) Undocumented
Declaration
Swift
public func encode<Codec, T>(codec: Codec, content: T) async throws -> Data where Codec : ContentCodec, T == Codec.T
-
prepareMessage(encodedContent:
Asynchronousoptions: ) Undocumented
Declaration
Swift
public func prepareMessage(encodedContent: EncodedContent, options: SendOptions? = nil) async throws -> PreparedMessage
-
prepareMessage(content:
Asynchronousoptions: ) Undocumented
Declaration
Swift
public func prepareMessage<T>(content: T, options: SendOptions? = nil) async throws -> PreparedMessage
-
send(prepared:
Asynchronous) Undocumented
Declaration
Swift
@discardableResult public func send(prepared: PreparedMessage) async throws -> String
-
send(content:
Asynchronousoptions: fallback: ) Undocumented
Declaration
Swift
@discardableResult public func send<T>(content: T, options: SendOptions? = nil, fallback _: String? = nil) async throws -> String
-
send(encodedContent:
Asynchronousoptions: ) Undocumented
Declaration
Swift
@discardableResult public func send(encodedContent: EncodedContent, options: SendOptions? = nil) async throws -> String
-
send(text:
Asynchronousoptions: ) Send a message to the conversation
Declaration
Swift
public func send(text: String, options: SendOptions? = nil) async throws -> String
-
Undocumented
Declaration
Swift
public var clientAddress: String { get }
-
The topic identifier for this conversation
Declaration
Swift
public var topic: String { get }
-
Undocumented
Declaration
Swift
public func streamEphemeral() -> AsyncThrowingStream<Envelope, Error>?
-
Returns a stream you can iterate through to receive new messages in this conversation.
Note
All messages in the conversation are returned by this stream. If you want to filter out messages by a sender, you can check the
Client
address against the message’speerAddress
.Declaration
Swift
public func streamMessages() -> AsyncThrowingStream<DecodedMessage, Error>
-
Undocumented
Declaration
Swift
public func streamDecryptedMessages() -> AsyncThrowingStream<DecryptedMessage, Error>
-
messages(limit:
Asynchronousbefore: after: direction: ) List messages in the conversation
Declaration
Swift
public func messages(limit: Int? = nil, before: Date? = nil, after: Date? = nil, direction: PagingInfoSortDirection? = .descending) async throws -> [DecodedMessage]
-
decryptedMessages(limit:
Asynchronousbefore: after: direction: ) Undocumented
Declaration
Swift
public func decryptedMessages(limit: Int? = nil, before: Date? = nil, after: Date? = nil, direction: PagingInfoSortDirection? = .descending) async throws -> [DecryptedMessage]
-
Declaration
Swift
public static func == (lhs: Conversation, rhs: Conversation) -> Bool
-
Declaration
Swift
public func hash(into hasher: inout Hasher)