Client

class Client(libXMTPClient: FfiXmtpClient, val dbPath: String, val installationId: String, val inboxId: InboxId, val environment: String, val publicIdentity: PublicIdentity)

Constructors

Link copied to clipboard
constructor(libXMTPClient: FfiXmtpClient, dbPath: String, installationId: String, inboxId: InboxId, environment: String, publicIdentity: PublicIdentity)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

true when this client is backed by an in-memory database. In that case deleteLocalDatabase, dropLocalDatabaseConnection and reconnectLocalDatabase are no-ops and the underlying state is discarded when the client is garbage collected.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun addAccount(newAccount: SigningKey, allowReassignInboxId: Boolean = false)
Link copied to clipboard
suspend fun archiveMetadata(path: String, encryptionKey: ByteArray): ArchiveMetadata
Link copied to clipboard
suspend fun canMessage(identities: List<PublicIdentity>): Map<String, Boolean>
Link copied to clipboard
suspend fun catchUpToLive(timeoutMs: Long? = null): CatchUpSummary

Bring the local store current with the network, then stop — for background fetch and cold start, where holding a live stream is wasted because the wire is about to go away.

Link copied to clipboard
suspend fun createArchive(path: String, encryptionKey: ByteArray, opts: ArchiveOptions = ArchiveOptions()): FfiBackupMetadata
Link copied to clipboard
suspend fun deleteLocalDatabase()
Link copied to clipboard
suspend fun disableNotifications()

Disable notifications. Per-conversation overrides remain stored.

Link copied to clipboard
Link copied to clipboard

Enable notifications and register the delivery channel.

Link copied to clipboard
suspend fun ffiAddIdentity(publicIdentityToAdd: PublicIdentity, allowReassignInboxId: Boolean = false): SignatureRequest
Link copied to clipboard
suspend fun ffiApplySignatureRequest(signatureRequest: SignatureRequest)
Link copied to clipboard
suspend fun ffiRegisterIdentity(signatureRequest: SignatureRequest, visibilityConfirmationOptions: VisibilityConfirmationOptions? = null)
Link copied to clipboard
suspend fun ffiRevokeIdentity(publicIdentityToRemove: PublicIdentity): SignatureRequest
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
suspend fun importArchive(path: String, encryptionKey: ByteArray)
Link copied to clipboard
suspend fun inboxIdFromIdentity(publicIdentity: PublicIdentity): InboxId?
Link copied to clipboard
suspend fun inboxState(refreshFromNetwork: Boolean): InboxState
Link copied to clipboard
suspend fun inboxStatesForInboxIds(refreshFromNetwork: Boolean, inboxIds: List<InboxId>): List<InboxState>
Link copied to clipboard

Read the local state without a backend request.

Link copied to clipboard
Link copied to clipboard

Fetch this deployment's configuration now, rewrite the stored copy, and return what the deployment answered (spec 006 CFG-082).

Link copied to clipboard
suspend fun removeAccount(recoverAccount: SigningKey, publicIdentityToRemove: PublicIdentity)
Link copied to clipboard
suspend fun revokeAllOtherInstallations(signingKey: SigningKey): Unit?
Link copied to clipboard
suspend fun revokeInstallations(signingKey: SigningKey, installationIds: List<String>)
Link copied to clipboard

What this deployment published about itself, as resolved when this client was built (spec 006 CFG-030, CFG-080).

Link copied to clipboard
Link copied to clipboard

Manually sync all device sync groups.

Link copied to clipboard
fun verifySignature(message: String, signature: ByteArray): Boolean
Link copied to clipboard
fun verifySignatureWithInstallationId(message: String, signature: ByteArray, installationId: String): Boolean