diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 180e2dbf8..1da19508d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: Release XMTP Android Package on: push: branches: - - release + - cv/0.14.1-patch-libxmtp-update-c446f94 jobs: library: @@ -22,21 +22,21 @@ jobs: uses: gradle/actions/setup-gradle@v3 - name: Run build with Gradle Wrapper run: ./gradlew build - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.1 - with: - release_branches: "release" - github_token: ${{ secrets.GITHUB_TOKEN }} - - name: Create a GitHub release + - name: Tag version 0.14.1-patch1 + run: | + git tag 0.14.1-patch1 + git push origin 0.14.1-patch1 + + - name: Create a GitHub release for version 0.14.1-patch uses: ncipollo/release-action@v1 with: - tag: ${{ steps.tag_version.outputs.new_version }} - name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} + tag: "0.14.1-patch1" + name: "Release 0.14.1-patch1" + body: "Patch release for inboxId and group fixes 0.14.1-patch" + - name: Gradle Publish env: - RELEASE_VERSION: ${{ steps.tag_version.outputs.new_version }} + RELEASE_VERSION: "0.14.1-patch1" MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} SIGN_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }} diff --git a/library/src/androidTest/java/org/xmtp/android/library/GroupPermissionsTest.kt b/library/src/androidTest/java/org/xmtp/android/library/GroupPermissionsTest.kt index 3641ba9ea..9957a950f 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/GroupPermissionsTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/GroupPermissionsTest.kt @@ -12,7 +12,7 @@ import org.xmtp.android.library.libxmtp.PermissionLevel import org.xmtp.android.library.messages.PrivateKey import org.xmtp.android.library.messages.PrivateKeyBuilder import org.xmtp.android.library.messages.walletAddress -import uniffi.xmtpv3.GroupPermissions +import uniffi.xmtpv3.FfiGroupPermissionsOptions @RunWith(AndroidJUnit4::class) class GroupPermissionsTest { @@ -76,7 +76,7 @@ class GroupPermissionsTest { @Test fun testGroupCanUpdateAdminList() { - val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), GroupPermissions.ADMIN_ONLY) } + val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), FfiGroupPermissionsOptions.ADMIN_ONLY) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } @@ -170,7 +170,7 @@ class GroupPermissionsTest { @Test fun testGroupCanUpdateSuperAdminList() { - val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), GroupPermissions.ADMIN_ONLY) } + val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), FfiGroupPermissionsOptions.ADMIN_ONLY) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } @@ -211,7 +211,7 @@ class GroupPermissionsTest { @Test fun testGroupMembersAndPermissionLevel() { - val group = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), GroupPermissions.ADMIN_ONLY) } + val group = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), FfiGroupPermissionsOptions.ADMIN_ONLY) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } @@ -260,7 +260,7 @@ class GroupPermissionsTest { @Test fun testCanCommitAfterInvalidPermissionsCommit() { - val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), GroupPermissions.ALL_MEMBERS) } + val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), FfiGroupPermissionsOptions.ALL_MEMBERS) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } diff --git a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt index 7ee39acbb..3b7cda9c9 100644 --- a/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt +++ b/library/src/androidTest/java/org/xmtp/android/library/GroupTest.kt @@ -25,7 +25,7 @@ import org.xmtp.android.library.messages.PrivateKey import org.xmtp.android.library.messages.PrivateKeyBuilder import org.xmtp.android.library.messages.walletAddress import org.xmtp.proto.mls.message.contents.TranscriptMessages -import uniffi.xmtpv3.GroupPermissions +import uniffi.xmtpv3.FfiGroupPermissionsOptions @RunWith(AndroidJUnit4::class) class GroupTest { @@ -63,6 +63,233 @@ class GroupTest { caroClient = fixtures.caroClient } + @Test + fun testCanCreateV3FromKeyBundleWithSigner() { + val keyBytes = byteArrayOf( + -23, 120, -58, 96, -102, 65, -124, 17, -124, 96, -6, 40, 103, 35, 125, 64, + -90, 83, -48, -32, -2, 44, -51, -29, -81, 49, -22, -127, 74, -4, -121, -111 + ) + + // Create a V2 client + val bobWallet = PrivateKeyBuilder() + val bob = runBlocking { + Client().create( + account = bobWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = false, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + // Create a hybrid client + val alixWallet = PrivateKeyBuilder() + val alix = runBlocking { + Client().create( + account = alixWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = true, + dbEncryptionKey = keyBytes, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + runBlocking { + alix.conversations.newConversation(bob.address) + val keyBundle = alix.privateKeyBundle + alix.deleteLocalDatabase() + + // Create from key bundle a hybrid client + val alixKeyBundle = Client().buildFromBundle( + bundle = keyBundle, + account = alixWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = true, + dbEncryptionKey = keyBytes, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + + assertEquals(alixKeyBundle.address, alixWallet.address) + + val convos = alixKeyBundle.conversations.list() + assertEquals(1, convos.size) + } + } + + @Test + fun testCanCreateFromKeyBundleWithSigner() { + val keyBytes = byteArrayOf( + -23, 120, -58, 96, -102, 65, -124, 17, -124, 96, -6, 40, 103, 35, 125, 64, + -90, 83, -48, -32, -2, 44, -51, -29, -81, 49, -22, -127, 74, -4, -121, -111 + ) + + // Create a V2 client + val bobWallet = PrivateKeyBuilder() + val bob = runBlocking { + Client().create( + account = bobWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = false, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + // Create a V2 client + val alixWallet = PrivateKeyBuilder() + val alix = runBlocking { + Client().create( + account = alixWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = false, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + runBlocking { + alix.conversations.newConversation(bob.address) + val keyBundle = alix.privateKeyBundle + + // Create from key bundle a hybrid client + val alixKeyBundle = Client().buildFromBundle( + bundle = keyBundle, + account = alixWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = true, + dbEncryptionKey = keyBytes, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + + assertEquals(alixKeyBundle.address, alix.address) + + val convos1 = alixKeyBundle.conversations.list() + val convos2 = alix.conversations.list() + assertEquals(convos1.size, convos2.size) + } + } + + @Test + fun testCanCreateFromKeyBundleWithoutSigner() { + val keyBytes = byteArrayOf( + -23, 120, -58, 96, -102, 65, -124, 17, -124, 96, -6, 40, 103, 35, 125, 64, + -90, 83, -48, -32, -2, 44, -51, -29, -81, 49, -22, -127, 74, -4, -121, -111 + ) + + // Create a V2 client + val bobWallet = PrivateKeyBuilder() + val bob = runBlocking { + Client().create( + account = bobWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = false, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + // Create a V2 client + val alixWallet = PrivateKeyBuilder() + val alix = runBlocking { + Client().create( + account = alixWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = false, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + runBlocking { + alix.conversations.newConversation(bob.address) + val keyBundle = alix.privateKeyBundle + + // Create from key bundle a hybrid client without signer + val alixKeyBundle = Client().buildFromBundle( + bundle = keyBundle, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = true, + dbEncryptionKey = keyBytes, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + + assertEquals(alixKeyBundle.address, alix.address) + + val convos1 = alixKeyBundle.conversations.list() + val convos2 = alix.conversations.list() + assertEquals(convos1.size, convos2.size) + } + } + + @Test + fun testCanCreateV3FromKeyBundleWithoutSignerShouldFail() { + val keyBytes = byteArrayOf( + -23, 120, -58, 96, -102, 65, -124, 17, -124, 96, -6, 40, 103, 35, 125, 64, + -90, 83, -48, -32, -2, 44, -51, -29, -81, 49, -22, -127, 74, -4, -121, -111 + ) + + // Create a V2 client + val bobWallet = PrivateKeyBuilder() + val bob = runBlocking { + Client().create( + account = bobWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = false, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + // Create a hybrid client + val alixWallet = PrivateKeyBuilder() + val alix = runBlocking { + Client().create( + account = alixWallet, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = true, + dbEncryptionKey = keyBytes, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + + runBlocking { + alix.conversations.newConversation(bob.address) + val keyBundle = alix.privateKeyBundle + alix.deleteLocalDatabase() + + // Create from key bundle a hybrid client without signer should throw an error + assertThrows(XMTPException::class.java) { + runBlocking { + Client().buildFromBundle( + bundle = keyBundle, + options = ClientOptions( + api = ClientOptions.Api(XMTPEnvironment.LOCAL, false), + enableV3 = true, + dbEncryptionKey = keyBytes, + appContext = InstrumentationRegistry.getInstrumentation().targetContext + ) + ) + } + } + } + } + @Test fun testCanCreateAGroupWithDefaultPermissions() { val boGroup = runBlocking { @@ -94,8 +321,8 @@ class GroupTest { assertEquals(alixGroup.members().size, 3) assertEquals(boGroup.members().size, 3) - assertEquals(boGroup.permissionLevel(), GroupPermissions.ALL_MEMBERS) - assertEquals(alixGroup.permissionLevel(), GroupPermissions.ALL_MEMBERS) + assertEquals(boGroup.permissionLevel(), FfiGroupPermissionsOptions.ALL_MEMBERS) + assertEquals(alixGroup.permissionLevel(), FfiGroupPermissionsOptions.ALL_MEMBERS) assertEquals(boGroup.isAdmin(boClient.inboxId), true) assertEquals(boGroup.isAdmin(alixClient.inboxId), false) assertEquals(alixGroup.isAdmin(boClient.inboxId), true) @@ -110,7 +337,7 @@ class GroupTest { val boGroup = runBlocking { boClient.conversations.newGroup( listOf(alix.walletAddress), - permissions = GroupPermissions.ADMIN_ONLY + permissions = FfiGroupPermissionsOptions.ADMIN_ONLY ) } runBlocking { alixClient.conversations.syncGroups() } @@ -152,8 +379,8 @@ class GroupTest { assertEquals(alixGroup.members().size, 2) assertEquals(boGroup.members().size, 2) - assertEquals(boGroup.permissionLevel(), GroupPermissions.ADMIN_ONLY) - assertEquals(alixGroup.permissionLevel(), GroupPermissions.ADMIN_ONLY) + assertEquals(boGroup.permissionLevel(), FfiGroupPermissionsOptions.ADMIN_ONLY) + assertEquals(alixGroup.permissionLevel(), FfiGroupPermissionsOptions.ADMIN_ONLY) assertEquals(boGroup.isAdmin(boClient.inboxId), true) assertEquals(boGroup.isAdmin(alixClient.inboxId), false) assertEquals(alixGroup.isAdmin(boClient.inboxId), true) @@ -749,7 +976,8 @@ class GroupTest { .collect { message -> allMessages.add(message.topic) } - } catch (e: Exception) {} + } catch (e: Exception) { + } } Thread.sleep(2500) diff --git a/library/src/main/java/libxmtp-version.txt b/library/src/main/java/libxmtp-version.txt index 8976d923a..9e47a2743 100644 --- a/library/src/main/java/libxmtp-version.txt +++ b/library/src/main/java/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: feb48641 -Branch: main -Date: 2024-06-26 22:31:21 +0000 +Version: c446f94d +Branch: HEAD +Date: 2024-09-09 14:36:53 +0000 diff --git a/library/src/main/java/org/xmtp/android/library/Conversations.kt b/library/src/main/java/org/xmtp/android/library/Conversations.kt index 928c8a560..df6adff64 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversations.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversations.kt @@ -41,13 +41,13 @@ import uniffi.xmtpv3.FfiConversations import uniffi.xmtpv3.FfiCreateGroupOptions import uniffi.xmtpv3.FfiEnvelope import uniffi.xmtpv3.FfiGroup +import uniffi.xmtpv3.FfiGroupPermissionsOptions import uniffi.xmtpv3.FfiListConversationsOptions import uniffi.xmtpv3.FfiMessage import uniffi.xmtpv3.FfiMessageCallback import uniffi.xmtpv3.FfiV2SubscribeRequest import uniffi.xmtpv3.FfiV2Subscription import uniffi.xmtpv3.FfiV2SubscriptionCallback -import uniffi.xmtpv3.GroupPermissions import uniffi.xmtpv3.NoPointer import java.util.Date import kotlin.time.Duration.Companion.nanoseconds @@ -109,7 +109,7 @@ data class Conversations( suspend fun newGroup( accountAddresses: List, - permissions: GroupPermissions = GroupPermissions.ALL_MEMBERS, + permissions: FfiGroupPermissionsOptions = FfiGroupPermissionsOptions.ALL_MEMBERS, groupName: String = "", groupImageUrlSquare: String = "", ): Group { @@ -131,7 +131,10 @@ data class Conversations( opts = FfiCreateGroupOptions( permissions = permissions, groupName = groupName, - groupImageUrlSquare = groupImageUrlSquare + groupImageUrlSquare = groupImageUrlSquare, + groupDescription = null, + groupPinnedFrameUrl = null, + customPermissionPolicySet = null ) ) ?: throw XMTPException("Client does not support Groups") client.contacts.allowGroups(groupIds = listOf(group.id())) diff --git a/library/src/main/java/org/xmtp/android/library/Group.kt b/library/src/main/java/org/xmtp/android/library/Group.kt index 5de38f1aa..5519c1da8 100644 --- a/library/src/main/java/org/xmtp/android/library/Group.kt +++ b/library/src/main/java/org/xmtp/android/library/Group.kt @@ -17,10 +17,10 @@ import uniffi.xmtpv3.FfiDeliveryStatus import uniffi.xmtpv3.FfiGroup import uniffi.xmtpv3.FfiGroupMetadata import uniffi.xmtpv3.FfiGroupPermissions +import uniffi.xmtpv3.FfiGroupPermissionsOptions import uniffi.xmtpv3.FfiListMessagesOptions import uniffi.xmtpv3.FfiMessage import uniffi.xmtpv3.FfiMessageCallback -import uniffi.xmtpv3.GroupPermissions import java.util.Date import kotlin.time.Duration.Companion.nanoseconds import kotlin.time.DurationUnit @@ -165,7 +165,7 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) { return libXMTPGroup.addedByInboxId() } - fun permissionLevel(): GroupPermissions { + fun permissionLevel(): FfiGroupPermissionsOptions { return permissions.policyType() } diff --git a/library/src/main/java/xmtpv3.kt b/library/src/main/java/xmtpv3.kt index f7de6734f..42a71eb4a 100644 --- a/library/src/main/java/xmtpv3.kt +++ b/library/src/main/java/xmtpv3.kt @@ -3,7 +3,7 @@ @file:Suppress("NAME_SHADOWING") -package uniffi.xmtpv3; +package uniffi.xmtpv3 // Common helper code. // @@ -250,7 +250,7 @@ internal open class UniffiRustCallStatus : Structure() { } } -class InternalException(message: String) : Exception(message) +class InternalException(message: String) : kotlin.Exception(message) // Each top-level error class has a companion object that can lift the error from the call status's rust buffer interface UniffiRustCallStatusErrorHandler { @@ -262,18 +262,18 @@ interface UniffiRustCallStatusErrorHandler { // synchronize itself // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err -private inline fun uniffiRustCallWithError( +private inline fun uniffiRustCallWithError( errorHandler: UniffiRustCallStatusErrorHandler, callback: (UniffiRustCallStatus) -> U, ): U { - var status = UniffiRustCallStatus(); + var status = UniffiRustCallStatus() val return_value = callback(status) uniffiCheckCallStatus(errorHandler, status) return return_value } // Check UniffiRustCallStatus and throw an error if the call wasn't successful -private fun uniffiCheckCallStatus( +private fun uniffiCheckCallStatus( errorHandler: UniffiRustCallStatusErrorHandler, status: UniffiRustCallStatus, ) { @@ -305,7 +305,7 @@ object UniffiNullRustCallStatusErrorHandler : UniffiRustCallStatusErrorHandler uniffiRustCall(callback: (UniffiRustCallStatus) -> U): U { - return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback); + return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback) } internal inline fun uniffiTraitInterfaceCall( @@ -315,7 +315,7 @@ internal inline fun uniffiTraitInterfaceCall( ) { try { writeReturn(makeCall()) - } catch (e: Exception) { + } catch (e: kotlin.Exception) { callStatus.code = UNIFFI_CALL_UNEXPECTED_ERROR callStatus.error_buf = FfiConverterString.lower(e.toString()) } @@ -329,7 +329,7 @@ internal inline fun uniffiTraitInterfaceCallWithError ) { try { writeReturn(makeCall()) - } catch (e: Exception) { + } catch (e: kotlin.Exception) { if (e is E) { callStatus.code = UNIFFI_CALL_ERROR callStatus.error_buf = lowerError(e) @@ -892,6 +892,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, ): Long + fun uniffi_xmtpv3_fn_method_fficonversations_sync_all_groups( + `ptr`: Pointer, + ): Long + fun uniffi_xmtpv3_fn_clone_ffigroup( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Pointer @@ -932,6 +936,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, `opts`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_method_ffigroup_group_description( + `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_method_ffigroup_group_image_url_square( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -948,6 +956,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Pointer + fun uniffi_xmtpv3_fn_method_ffigroup_group_pinned_frame_url( + `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_method_ffigroup_id( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -972,6 +984,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, `envelopeBytes`: RustBuffer.ByValue, ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_publish_messages( + `ptr`: Pointer, + ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_remove_admin( `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, ): Long @@ -992,6 +1008,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, `contentBytes`: RustBuffer.ByValue, ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_send_optimistic( + `ptr`: Pointer, `contentBytes`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, + ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_method_ffigroup_stream( `ptr`: Pointer, `messageCallback`: Long, ): Long @@ -1004,6 +1024,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_update_group_description( + `ptr`: Pointer, `groupDescription`: RustBuffer.ByValue, + ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_update_group_image_url_square( `ptr`: Pointer, `groupImageUrlSquare`: RustBuffer.ByValue, ): Long @@ -1012,6 +1036,17 @@ internal interface UniffiLib : Library { `ptr`: Pointer, `groupName`: RustBuffer.ByValue, ): Long + fun uniffi_xmtpv3_fn_method_ffigroup_update_group_pinned_frame_url( + `ptr`: Pointer, `pinnedFrameUrl`: RustBuffer.ByValue, + ): Long + + fun uniffi_xmtpv3_fn_method_ffigroup_update_permission_policy( + `ptr`: Pointer, + `permissionUpdateType`: RustBuffer.ByValue, + `permissionPolicyOption`: RustBuffer.ByValue, + `metadataField`: RustBuffer.ByValue, + ): Long + fun uniffi_xmtpv3_fn_clone_ffigroupmetadata( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Pointer @@ -1036,6 +1071,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Unit + fun uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_set( + `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, + ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_type( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -1083,6 +1122,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Unit + fun uniffi_xmtpv3_fn_method_ffistreamcloser_end_and_wait( + `ptr`: Pointer, + ): Long + fun uniffi_xmtpv3_fn_method_ffistreamcloser_is_closed( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Byte @@ -1143,6 +1186,16 @@ internal interface UniffiLib : Library { `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): Unit + fun uniffi_xmtpv3_fn_method_ffixmtpclient_add_wallet( + `ptr`: Pointer, + `existingWalletAddress`: RustBuffer.ByValue, + `newWalletAddress`: RustBuffer.ByValue, + ): Long + + fun uniffi_xmtpv3_fn_method_ffixmtpclient_apply_signature_request( + `ptr`: Pointer, `signatureRequest`: Pointer, + ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_can_message( `ptr`: Pointer, `accountAddresses`: RustBuffer.ByValue, ): Long @@ -1159,6 +1212,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, `address`: RustBuffer.ByValue, ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_get_latest_inbox_state( + `ptr`: Pointer, `inboxId`: RustBuffer.ByValue, + ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_group( `ptr`: Pointer, `groupId`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus, ): Pointer @@ -1167,6 +1224,10 @@ internal interface UniffiLib : Library { `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue + fun uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_state( + `ptr`: Pointer, `refreshFromNetwork`: Byte, + ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_installation_id( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -1187,6 +1248,14 @@ internal interface UniffiLib : Library { `ptr`: Pointer, ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_all_other_installations( + `ptr`: Pointer, + ): Long + + fun uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_wallet( + `ptr`: Pointer, `walletAddress`: RustBuffer.ByValue, + ): Long + fun uniffi_xmtpv3_fn_method_ffixmtpclient_signature_request( `ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus, ): RustBuffer.ByValue @@ -1595,6 +1664,9 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_fficonversations_sync( ): Short + fun uniffi_xmtpv3_checksum_method_fficonversations_sync_all_groups( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_add_admin( ): Short @@ -1619,6 +1691,9 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffigroup_find_messages( ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_description( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_image_url_square( ): Short @@ -1631,6 +1706,9 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffigroup_group_permissions( ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_group_pinned_frame_url( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_id( ): Short @@ -1649,6 +1727,9 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffigroup_process_streamed_group_message( ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_publish_messages( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_remove_admin( ): Short @@ -1664,6 +1745,9 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffigroup_send( ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_send_optimistic( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_stream( ): Short @@ -1673,18 +1757,30 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffigroup_sync( ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_description( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_image_url_square( ): Short fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_name( ): Short + fun uniffi_xmtpv3_checksum_method_ffigroup_update_group_pinned_frame_url( + ): Short + + fun uniffi_xmtpv3_checksum_method_ffigroup_update_permission_policy( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type( ): Short fun uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_inbox_id( ): Short + fun uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_set( + ): Short + fun uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_type( ): Short @@ -1706,6 +1802,9 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end( ): Short + fun uniffi_xmtpv3_checksum_method_ffistreamcloser_end_and_wait( + ): Short + fun uniffi_xmtpv3_checksum_method_ffistreamcloser_is_closed( ): Short @@ -1733,6 +1832,12 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffiv2subscription_update( ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_add_wallet( + ): Short + + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_apply_signature_request( + ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_can_message( ): Short @@ -1745,12 +1850,18 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id( ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_get_latest_inbox_state( + ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_group( ): Short fun uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id( ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_state( + ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id( ): Short @@ -1766,6 +1877,12 @@ internal interface UniffiLib : Library { fun uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync( ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_all_other_installations( + ): Short + + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_wallet( + ): Short + fun uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request( ): Short @@ -1861,15 +1978,18 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_fficonversations_process_streamed_welcome_message() != 15283.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_xmtpv3_checksum_method_fficonversations_stream() != 42948.toShort()) { + if (lib.uniffi_xmtpv3_checksum_method_fficonversations_stream() != 3079.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages() != 8742.toShort()) { + if (lib.uniffi_xmtpv3_checksum_method_fficonversations_stream_all_messages() != 13204.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_fficonversations_sync() != 9054.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_fficonversations_sync_all_groups() != 3433.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_add_admin() != 4600.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -1894,6 +2014,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffigroup_find_messages() != 14930.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_group_description() != 37045.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_group_image_url_square() != 16754.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -1906,6 +2029,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffigroup_group_permissions() != 15980.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_group_pinned_frame_url() != 29388.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_id() != 36764.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -1924,6 +2050,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffigroup_process_streamed_group_message() != 19069.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_publish_messages() != 52808.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_remove_admin() != 57094.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -1939,7 +2068,10 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffigroup_send() != 37701.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_xmtpv3_checksum_method_ffigroup_stream() != 45558.toShort()) { + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_send_optimistic() != 13872.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_stream() != 34669.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_super_admin_list() != 5323.toShort()) { @@ -1948,19 +2080,31 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffigroup_sync() != 24219.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_update_group_description() != 34006.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_update_group_image_url_square() != 18878.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_ffigroup_update_group_name() != 550.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_update_group_pinned_frame_url() != 37434.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_xmtpv3_checksum_method_ffigroup_update_permission_policy() != 51936.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_conversation_type() != 30827.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_ffigroupmetadata_creator_inbox_id() != 26872.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_type() != 12694.toShort()) { + if (lib.uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_set() != 24928.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_xmtpv3_checksum_method_ffigrouppermissions_policy_type() != 56975.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_ffisignaturerequest_add_ecdsa_signature() != 8706.toShort()) { @@ -1978,7 +2122,10 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffisignaturerequest_signature_text() != 60472.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (lib.uniffi_xmtpv3_checksum_method_ffistreamcloser_end() != 57139.toShort()) { + if (lib.uniffi_xmtpv3_checksum_method_ffistreamcloser_end() != 11040.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_xmtpv3_checksum_method_ffistreamcloser_end_and_wait() != 1181.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_ffistreamcloser_is_closed() != 62423.toShort()) { @@ -2008,6 +2155,12 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffiv2subscription_update() != 24211.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_add_wallet() != 23786.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_apply_signature_request() != 32172.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_can_message() != 53502.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -2020,12 +2173,18 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_find_inbox_id() != 59020.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_get_latest_inbox_state() != 3165.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_group() != 64533.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_id() != 25128.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_inbox_state() != 7826.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_installation_id() != 37173.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -2041,6 +2200,12 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) { if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_request_history_sync() != 22295.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_all_other_installations() != 36450.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_revoke_wallet() != 12211.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request() != 18270.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -2079,7 +2244,7 @@ internal object uniffiRustFutureContinuationCallbackImpl : UniffiRustFutureConti } } -internal suspend fun uniffiRustCallAsync( +internal suspend fun uniffiRustCallAsync( rustFuture: Long, pollFunc: (Long, UniffiRustFutureContinuationCallback, Long) -> Unit, completeFunc: (Long, UniffiRustCallStatus) -> F, @@ -2491,6 +2656,8 @@ public interface FfiConversationsInterface { suspend fun `sync`() + suspend fun `syncAllGroups`(): kotlin.UInt + companion object } @@ -2676,7 +2843,6 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `stream`(`callback`: FfiConversationCallback): FfiStreamCloser { return uniffiRustCallAsync( @@ -2703,12 +2869,11 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa // lift function { FfiConverterTypeFfiStreamCloser.lift(it) }, // Error FFI converter - GenericException.ErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } - @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `streamAllMessages`(`messageCallback`: FfiMessageCallback): FfiStreamCloser { return uniffiRustCallAsync( @@ -2735,7 +2900,7 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa // lift function { FfiConverterTypeFfiStreamCloser.lift(it) }, // Error FFI converter - GenericException.ErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -2773,6 +2938,38 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa } + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `syncAllGroups`(): kotlin.UInt { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_fficonversations_sync_all_groups( + thisPtr, + + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_u32( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_u32( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_u32(future) }, + // lift function + { FfiConverterUInt.lift(it) }, + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + companion object } @@ -2919,6 +3116,8 @@ public interface FfiGroupInterface { fun `findMessages`(`opts`: FfiListMessagesOptions): List + fun `groupDescription`(): kotlin.String + fun `groupImageUrlSquare`(): kotlin.String fun `groupMetadata`(): FfiGroupMetadata @@ -2927,6 +3126,8 @@ public interface FfiGroupInterface { fun `groupPermissions`(): FfiGroupPermissions + fun `groupPinnedFrameUrl`(): kotlin.String + fun `id`(): kotlin.ByteArray fun `isActive`(): kotlin.Boolean @@ -2939,6 +3140,11 @@ public interface FfiGroupInterface { suspend fun `processStreamedGroupMessage`(`envelopeBytes`: kotlin.ByteArray): FfiMessage + /** + * Publish all unpublished messages + */ + suspend fun `publishMessages`() + suspend fun `removeAdmin`(`inboxId`: kotlin.String) suspend fun `removeMembers`(`accountAddresses`: List) @@ -2949,16 +3155,31 @@ public interface FfiGroupInterface { suspend fun `send`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray + /** + * send a message without immediately publishing to the delivery service. + */ + fun `sendOptimistic`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray + suspend fun `stream`(`messageCallback`: FfiMessageCallback): FfiStreamCloser fun `superAdminList`(): List suspend fun `sync`() + suspend fun `updateGroupDescription`(`groupDescription`: kotlin.String) + suspend fun `updateGroupImageUrlSquare`(`groupImageUrlSquare`: kotlin.String) suspend fun `updateGroupName`(`groupName`: kotlin.String) + suspend fun `updateGroupPinnedFrameUrl`(`pinnedFrameUrl`: kotlin.String) + + suspend fun `updatePermissionPolicy`( + `permissionUpdateType`: FfiPermissionUpdateType, + `permissionPolicyOption`: FfiPermissionPolicy, + `metadataField`: FfiMetadataField?, + ) + companion object } @@ -3231,6 +3452,20 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } + @Throws(GenericException::class) + override fun `groupDescription`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCallWithError(GenericException) { _status -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_description( + it, _status + ) + } + } + ) + } + + @Throws(GenericException::class) override fun `groupImageUrlSquare`(): kotlin.String { return FfiConverterString.lift( @@ -3287,6 +3522,20 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } + @Throws(GenericException::class) + override fun `groupPinnedFrameUrl`(): kotlin.String { + return FfiConverterString.lift( + callWithPointer { + uniffiRustCallWithError(GenericException) { _status -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_group_pinned_frame_url( + it, _status + ) + } + } + ) + } + + override fun `id`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { @@ -3388,6 +3637,42 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } + /** + * Publish all unpublished messages + */ + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `publishMessages`() { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_publish_messages( + thisPtr, + + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `removeAdmin`(`inboxId`: kotlin.String) { @@ -3552,7 +3837,23 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } + /** + * send a message without immediately publishing to the delivery service. + */ @Throws(GenericException::class) + override fun `sendOptimistic`(`contentBytes`: kotlin.ByteArray): kotlin.ByteArray { + return FfiConverterByteArray.lift( + callWithPointer { + uniffiRustCallWithError(GenericException) { _status -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_send_optimistic( + it, FfiConverterByteArray.lower(`contentBytes`), _status + ) + } + } + ) + } + + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `stream`(`messageCallback`: FfiMessageCallback): FfiStreamCloser { return uniffiRustCallAsync( @@ -3579,7 +3880,7 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { // lift function { FfiConverterTypeFfiStreamCloser.lift(it) }, // Error FFI converter - GenericException.ErrorHandler, + UniffiNullRustCallStatusErrorHandler, ) } @@ -3631,6 +3932,39 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `updateGroupDescription`(`groupDescription`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_group_description( + thisPtr, + FfiConverterString.lower(`groupDescription`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `updateGroupImageUrlSquare`(`groupImageUrlSquare`: kotlin.String) { @@ -3697,9 +4031,81 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } - companion object - -} + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `updateGroupPinnedFrameUrl`(`pinnedFrameUrl`: kotlin.String) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_group_pinned_frame_url( + thisPtr, + FfiConverterString.lower(`pinnedFrameUrl`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `updatePermissionPolicy`( + `permissionUpdateType`: FfiPermissionUpdateType, + `permissionPolicyOption`: FfiPermissionPolicy, + `metadataField`: FfiMetadataField?, + ) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigroup_update_permission_policy( + thisPtr, + FfiConverterTypeFfiPermissionUpdateType.lower(`permissionUpdateType`), + FfiConverterTypeFfiPermissionPolicy.lower(`permissionPolicyOption`), + FfiConverterOptionalTypeFfiMetadataField.lower(`metadataField`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + + companion object + +} public object FfiConverterTypeFfiGroup : FfiConverter { @@ -4071,7 +4477,9 @@ public object FfiConverterTypeFfiGroupMetadata : FfiConverter + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_set( + it, _status + ) + } + } + ) + } + + + @Throws(GenericException::class) + override fun `policyType`(): FfiGroupPermissionsOptions { + return FfiConverterTypeFfiGroupPermissionsOptions.lift( callWithPointer { uniffiRustCallWithError(GenericException) { _status -> UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffigrouppermissions_policy_type( @@ -4704,8 +5126,17 @@ public object FfiConverterTypeFfiSignatureRequest : FfiConverter @@ -4802,6 +5238,41 @@ open class FfiStreamCloser : Disposable, AutoCloseable, FfiStreamCloserInterface } + /** + * End the stream and asyncronously wait for it to shutdown + */ + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `endAndWait`() { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffistreamcloser_end_and_wait( + thisPtr, + + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + GenericException.ErrorHandler, + ) + } + override fun `isClosed`(): kotlin.Boolean { return FfiConverterBoolean.lift( callWithPointer { @@ -5644,6 +6115,16 @@ public object FfiConverterTypeFfiV2Subscription : FfiConverter): Map fun `conversations`(): FfiConversations @@ -5652,10 +6133,20 @@ public interface FfiXmtpClientInterface { suspend fun `findInboxId`(`address`: kotlin.String): kotlin.String? + suspend fun `getLatestInboxState`(`inboxId`: kotlin.String): FfiInboxState + fun `group`(`groupId`: kotlin.ByteArray): FfiGroup fun `inboxId`(): kotlin.String + /** + * * Get the client's inbox state. + * * + * * If `refresh_from_network` is true, the client will go to the network first to refresh the state. + * * Otherwise, the state will be read from the local database. + */ + suspend fun `inboxState`(`refreshFromNetwork`: kotlin.Boolean): FfiInboxState + fun `installationId`(): kotlin.ByteArray fun `message`(`messageId`: kotlin.ByteArray): FfiMessage @@ -5666,6 +6157,16 @@ public interface FfiXmtpClientInterface { suspend fun `requestHistorySync`() + /** + * * Revokes all installations except the one the client is currently using + */ + suspend fun `revokeAllOtherInstallations`(): FfiSignatureRequest + + /** + * Revokes or removes an identity - really a wallet address - from the existing client + */ + suspend fun `revokeWallet`(`walletAddress`: kotlin.String): FfiSignatureRequest + fun `signatureRequest`(): FfiSignatureRequest? companion object @@ -5753,6 +6254,78 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { } + /** + * Adds an identity - really a wallet address - to the existing client + */ + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `addWallet`( + `existingWalletAddress`: kotlin.String, + `newWalletAddress`: kotlin.String, + ): FfiSignatureRequest { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_add_wallet( + thisPtr, + FfiConverterString.lower(`existingWalletAddress`), + FfiConverterString.lower(`newWalletAddress`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeFfiSignatureRequest.lift(it) }, + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `applySignatureRequest`(`signatureRequest`: FfiSignatureRequest) { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_apply_signature_request( + thisPtr, + FfiConverterTypeFfiSignatureRequest.lower(`signatureRequest`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_void( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_void( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_void(future) }, + // lift function + { Unit }, + + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + @Throws(GenericException::class) @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `canMessage`(`accountAddresses`: List): Map { @@ -5862,6 +6435,38 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { } + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `getLatestInboxState`(`inboxId`: kotlin.String): FfiInboxState { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_get_latest_inbox_state( + thisPtr, + FfiConverterString.lower(`inboxId`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeFfiInboxState.lift(it) }, + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + @Throws(GenericException::class) override fun `group`(`groupId`: kotlin.ByteArray): FfiGroup { return FfiConverterTypeFfiGroup.lift( @@ -5889,6 +6494,43 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { } + /** + * * Get the client's inbox state. + * * + * * If `refresh_from_network` is true, the client will go to the network first to refresh the state. + * * Otherwise, the state will be read from the local database. + */ + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `inboxState`(`refreshFromNetwork`: kotlin.Boolean): FfiInboxState { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_inbox_state( + thisPtr, + FfiConverterBoolean.lower(`refreshFromNetwork`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_rust_buffer( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_rust_buffer( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_rust_buffer(future) }, + // lift function + { FfiConverterTypeFfiInboxState.lift(it) }, + // Error FFI converter + GenericException.ErrorHandler, + ) + } + override fun `installationId`(): kotlin.ByteArray { return FfiConverterByteArray.lift( callWithPointer { @@ -5992,6 +6634,76 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface { ) } + + /** + * * Revokes all installations except the one the client is currently using + */ + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `revokeAllOtherInstallations`(): FfiSignatureRequest { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_all_other_installations( + thisPtr, + + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeFfiSignatureRequest.lift(it) }, + // Error FFI converter + GenericException.ErrorHandler, + ) + } + + + /** + * Revokes or removes an identity - really a wallet address - from the existing client + */ + @Throws(GenericException::class) + @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") + override suspend fun `revokeWallet`(`walletAddress`: kotlin.String): FfiSignatureRequest { + return uniffiRustCallAsync( + callWithPointer { thisPtr -> + UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_revoke_wallet( + thisPtr, + FfiConverterString.lower(`walletAddress`), + ) + }, + { future, callback, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_poll_pointer( + future, + callback, + continuation + ) + }, + { future, continuation -> + UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_complete_pointer( + future, + continuation + ) + }, + { future -> UniffiLib.INSTANCE.ffi_xmtpv3_rust_future_free_pointer(future) }, + // lift function + { FfiConverterTypeFfiSignatureRequest.lift(it) }, + // Error FFI converter + GenericException.ErrorHandler, + ) + } + override fun `signatureRequest`(): FfiSignatureRequest? { return FfiConverterOptionalTypeFfiSignatureRequest.lift( callWithPointer { @@ -6036,9 +6748,12 @@ public object FfiConverterTypeFfiXmtpClient : FfiConverter { override fun read(buf: ByteBuffer): FfiCreateGroupOptions { return FfiCreateGroupOptions( - FfiConverterOptionalTypeGroupPermissions.read(buf), + FfiConverterOptionalTypeFfiGroupPermissionsOptions.read(buf), + FfiConverterOptionalString.read(buf), FfiConverterOptionalString.read(buf), FfiConverterOptionalString.read(buf), + FfiConverterOptionalString.read(buf), + FfiConverterOptionalTypeFfiPermissionPolicySet.read(buf), ) } override fun allocationSize(value: FfiCreateGroupOptions) = ( - FfiConverterOptionalTypeGroupPermissions.allocationSize(value.`permissions`) + + FfiConverterOptionalTypeFfiGroupPermissionsOptions.allocationSize(value.`permissions`) + FfiConverterOptionalString.allocationSize(value.`groupName`) + - FfiConverterOptionalString.allocationSize(value.`groupImageUrlSquare`) + FfiConverterOptionalString.allocationSize(value.`groupImageUrlSquare`) + + FfiConverterOptionalString.allocationSize(value.`groupDescription`) + + FfiConverterOptionalString.allocationSize(value.`groupPinnedFrameUrl`) + + FfiConverterOptionalTypeFfiPermissionPolicySet.allocationSize(value.`customPermissionPolicySet`) ) override fun write(value: FfiCreateGroupOptions, buf: ByteBuffer) { - FfiConverterOptionalTypeGroupPermissions.write(value.`permissions`, buf) + FfiConverterOptionalTypeFfiGroupPermissionsOptions.write(value.`permissions`, buf) FfiConverterOptionalString.write(value.`groupName`, buf) FfiConverterOptionalString.write(value.`groupImageUrlSquare`, buf) + FfiConverterOptionalString.write(value.`groupDescription`, buf) + FfiConverterOptionalString.write(value.`groupPinnedFrameUrl`, buf) + FfiConverterOptionalTypeFfiPermissionPolicySet.write(value.`customPermissionPolicySet`, buf) } } @@ -6164,6 +6888,42 @@ public object FfiConverterTypeFfiGroupMember : FfiConverterRustBuffer, + var `accountAddresses`: List, +) { + + companion object +} + +public object FfiConverterTypeFfiInboxState : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiInboxState { + return FfiInboxState( + FfiConverterString.read(buf), + FfiConverterString.read(buf), + FfiConverterSequenceByteArray.read(buf), + FfiConverterSequenceString.read(buf), + ) + } + + override fun allocationSize(value: FfiInboxState) = ( + FfiConverterString.allocationSize(value.`inboxId`) + + FfiConverterString.allocationSize(value.`recoveryAddress`) + + FfiConverterSequenceByteArray.allocationSize(value.`installationIds`) + + FfiConverterSequenceString.allocationSize(value.`accountAddresses`) + ) + + override fun write(value: FfiInboxState, buf: ByteBuffer) { + FfiConverterString.write(value.`inboxId`, buf) + FfiConverterString.write(value.`recoveryAddress`, buf) + FfiConverterSequenceByteArray.write(value.`installationIds`, buf) + FfiConverterSequenceString.write(value.`accountAddresses`, buf) + } +} + + data class FfiListConversationsOptions( var `createdAfterNs`: kotlin.Long?, var `createdBeforeNs`: kotlin.Long?, @@ -6314,6 +7074,59 @@ public object FfiConverterTypeFfiPagingInfo : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiPermissionPolicySet { + return FfiPermissionPolicySet( + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + FfiConverterTypeFfiPermissionPolicy.read(buf), + ) + } + + override fun allocationSize(value: FfiPermissionPolicySet) = ( + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`addMemberPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`removeMemberPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`addAdminPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`removeAdminPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupNamePolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupDescriptionPolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupImageUrlSquarePolicy`) + + FfiConverterTypeFfiPermissionPolicy.allocationSize(value.`updateGroupPinnedFrameUrlPolicy`) + ) + + override fun write(value: FfiPermissionPolicySet, buf: ByteBuffer) { + FfiConverterTypeFfiPermissionPolicy.write(value.`addMemberPolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`removeMemberPolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`addAdminPolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`removeAdminPolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`updateGroupNamePolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`updateGroupDescriptionPolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`updateGroupImageUrlSquarePolicy`, buf) + FfiConverterTypeFfiPermissionPolicy.write(value.`updateGroupPinnedFrameUrlPolicy`, buf) + } +} + + data class FfiPublishRequest( var `envelopes`: List, ) { @@ -6526,6 +7339,58 @@ public object FfiConverterTypeFfiGroupMessageKind : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + FfiGroupPermissionsOptions.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } + + override fun allocationSize(value: FfiGroupPermissionsOptions) = 4UL + + override fun write(value: FfiGroupPermissionsOptions, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) + } +} + + +enum class FfiMetadataField { + + GROUP_NAME, + DESCRIPTION, + IMAGE_URL_SQUARE, + PINNED_FRAME_URL; + + companion object +} + + +public object FfiConverterTypeFfiMetadataField : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + FfiMetadataField.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } + + override fun allocationSize(value: FfiMetadataField) = 4UL + + override fun write(value: FfiMetadataField, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) + } +} + + enum class FfiPermissionLevel { MEMBER, @@ -6551,6 +7416,62 @@ public object FfiConverterTypeFfiPermissionLevel : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + FfiPermissionPolicy.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } + + override fun allocationSize(value: FfiPermissionPolicy) = 4UL + + override fun write(value: FfiPermissionPolicy, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) + } +} + + +enum class FfiPermissionUpdateType { + + ADD_MEMBER, + REMOVE_MEMBER, + ADD_ADMIN, + REMOVE_ADMIN, + UPDATE_METADATA; + + companion object +} + + +public object FfiConverterTypeFfiPermissionUpdateType : + FfiConverterRustBuffer { + override fun read(buf: ByteBuffer) = try { + FfiPermissionUpdateType.values()[buf.getInt() - 1] + } catch (e: IndexOutOfBoundsException) { + throw RuntimeException("invalid enum value, something is very wrong!!", e) + } + + override fun allocationSize(value: FfiPermissionUpdateType) = 4UL + + override fun write(value: FfiPermissionUpdateType, buf: ByteBuffer) { + buf.putInt(value.ordinal + 1) + } +} + + enum class FfiSortDirection { UNSPECIFIED, @@ -6576,7 +7497,7 @@ public object FfiConverterTypeFfiSortDirection : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer) = try { - GroupPermissions.values()[buf.getInt() - 1] - } catch (e: IndexOutOfBoundsException) { - throw RuntimeException("invalid enum value, something is very wrong!!", e) - } - - override fun allocationSize(value: GroupPermissions) = 4UL - - override fun write(value: GroupPermissions, buf: ByteBuffer) { - buf.putInt(value.ordinal + 1) - } -} - - -sealed class SigningException(message: String) : Exception(message) { +sealed class SigningException(message: String) : kotlin.Exception(message) { class Generic(message: String) : SigningException(message) @@ -7235,6 +8131,34 @@ public object FfiConverterOptionalTypeFfiPagingInfo : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiPermissionPolicySet? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeFfiPermissionPolicySet.read(buf) + } + + override fun allocationSize(value: FfiPermissionPolicySet?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeFfiPermissionPolicySet.allocationSize(value) + } + } + + override fun write(value: FfiPermissionPolicySet?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeFfiPermissionPolicySet.write(value, buf) + } + } +} + + public object FfiConverterOptionalTypeFfiDeliveryStatus : FfiConverterRustBuffer { override fun read(buf: ByteBuffer): FfiDeliveryStatus? { @@ -7263,28 +8187,56 @@ public object FfiConverterOptionalTypeFfiDeliveryStatus : } -public object FfiConverterOptionalTypeGroupPermissions : FfiConverterRustBuffer { - override fun read(buf: ByteBuffer): GroupPermissions? { +public object FfiConverterOptionalTypeFfiGroupPermissionsOptions : + FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiGroupPermissionsOptions? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeFfiGroupPermissionsOptions.read(buf) + } + + override fun allocationSize(value: FfiGroupPermissionsOptions?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeFfiGroupPermissionsOptions.allocationSize(value) + } + } + + override fun write(value: FfiGroupPermissionsOptions?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeFfiGroupPermissionsOptions.write(value, buf) + } + } +} + + +public object FfiConverterOptionalTypeFfiMetadataField : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiMetadataField? { if (buf.get().toInt() == 0) { return null } - return FfiConverterTypeGroupPermissions.read(buf) + return FfiConverterTypeFfiMetadataField.read(buf) } - override fun allocationSize(value: GroupPermissions?): ULong { + override fun allocationSize(value: FfiMetadataField?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeGroupPermissions.allocationSize(value) + return 1UL + FfiConverterTypeFfiMetadataField.allocationSize(value) } } - override fun write(value: GroupPermissions?, buf: ByteBuffer) { + override fun write(value: FfiMetadataField?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeGroupPermissions.write(value, buf) + FfiConverterTypeFfiMetadataField.write(value, buf) } } } diff --git a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so index bbb3c93de..5d3aeaf77 100644 Binary files a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so index fff785cd7..e2fee1a2a 100644 Binary files a/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so b/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so index e3540ee0e..76e0421fc 100644 Binary files a/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/x86/libuniffi_xmtpv3.so differ diff --git a/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so b/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so index c855e1316..e5c8548b1 100644 Binary files a/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so and b/library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so differ