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..1832d6939 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,8 @@ 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.org.xmtp.android.library.libxmtp.GroupPermissionPreconfiguration +import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.PermissionOption @RunWith(AndroidJUnit4::class) class GroupPermissionsTest { @@ -56,7 +57,7 @@ class GroupPermissionsTest { runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } - assert(boGroup.isAdmin(boClient.inboxId)) + assert(!boGroup.isAdmin(boClient.inboxId)) assert(boGroup.isSuperAdmin(boClient.inboxId)) assert(!alixGroup.isCreator()) assert(!alixGroup.isAdmin(alixClient.inboxId)) @@ -68,19 +69,19 @@ class GroupPermissionsTest { val superAdminList = runBlocking { boGroup.listSuperAdmins() } - assert(adminList.size == 1) - assert(adminList.contains(boClient.inboxId)) + assert(adminList.isEmpty()) + assert(!adminList.contains(boClient.inboxId)) assert(superAdminList.size == 1) assert(superAdminList.contains(boClient.inboxId)) } @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), GroupPermissionPreconfiguration.ADMIN_ONLY) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } - assert(boGroup.isAdmin(boClient.inboxId)) + assert(!boGroup.isAdmin(boClient.inboxId)) assert(boGroup.isSuperAdmin(boClient.inboxId)) assert(!alixGroup.isCreator()) assert(!alixGroup.isAdmin(alixClient.inboxId)) @@ -92,8 +93,8 @@ class GroupPermissionsTest { var superAdminList = runBlocking { boGroup.listSuperAdmins() } - assert(adminList.size == 1) - assert(adminList.contains(boClient.inboxId)) + assert(adminList.size == 0) + assert(!adminList.contains(boClient.inboxId)) assert(superAdminList.size == 1) assert(superAdminList.contains(boClient.inboxId)) @@ -126,7 +127,7 @@ class GroupPermissionsTest { } assert(alixGroup.isAdmin(alixClient.inboxId)) - assert(adminList.size == 2) + assert(adminList.size == 1) assert(adminList.contains(alixClient.inboxId)) assert(superAdminList.size == 1) @@ -155,7 +156,7 @@ class GroupPermissionsTest { } assert(!alixGroup.isAdmin(alixClient.inboxId)) - assert(adminList.size == 1) + assert(adminList.size == 0) assert(!adminList.contains(alixClient.inboxId)) assert(superAdminList.size == 1) @@ -170,7 +171,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), GroupPermissionPreconfiguration.ADMIN_ONLY) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } @@ -211,7 +212,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), GroupPermissionPreconfiguration.ADMIN_ONLY) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } @@ -260,7 +261,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), GroupPermissionPreconfiguration.ALL_MEMBERS) } runBlocking { alixClient.conversations.syncGroups() } val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } @@ -288,4 +289,42 @@ class GroupPermissionsTest { assert(boGroup.name == "Alix group name") assert(alixGroup.name == "Alix group name") } + + @Test + fun testCanUpdatePermissions() { + val boGroup = runBlocking { boClient.conversations.newGroup(listOf(alix.walletAddress, caro.walletAddress), GroupPermissionPreconfiguration.ADMIN_ONLY) } + runBlocking { alixClient.conversations.syncGroups() } + val alixGroup = runBlocking { alixClient.conversations.listGroups().first() } + + // Verify that alix can NOT update group name + assert(boGroup.name == "") + val exception = assertThrows(XMTPException::class.java) { + runBlocking { + alixGroup.updateGroupDescription("new group description") + } + } + assertEquals(exception.message, "Permission denied: Unable to update group description") + runBlocking { + alixGroup.sync() + boGroup.sync() + } + assertEquals(boGroup.permissionPolicySet().updateGroupDescriptionPolicy, PermissionOption.Admin) + + // Update group name permissions so Alix can update + runBlocking { + boGroup.updateGroupDescriptionPermission(PermissionOption.Allow) + boGroup.sync() + alixGroup.sync() + } + assertEquals(boGroup.permissionPolicySet().updateGroupDescriptionPolicy, PermissionOption.Allow) + + // Verify that alix can now update group name + runBlocking { + alixGroup.updateGroupDescription("Alix group description") + alixGroup.sync() + boGroup.sync() + } + assert(boGroup.description == "Alix group description") + assert(alixGroup.description == "Alix group description") + } } 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..11973474d 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,8 @@ 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.org.xmtp.android.library.libxmtp.GroupPermissionPreconfiguration +import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.PermissionOption @RunWith(AndroidJUnit4::class) class GroupTest { @@ -94,12 +95,12 @@ 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.isAdmin(boClient.inboxId), true) - assertEquals(boGroup.isAdmin(alixClient.inboxId), false) - assertEquals(alixGroup.isAdmin(boClient.inboxId), true) - assertEquals(alixGroup.isAdmin(alixClient.inboxId), false) + assertEquals(boGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Allow) + assertEquals(alixGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Allow) + assertEquals(boGroup.isSuperAdmin(boClient.inboxId), true) + assertEquals(boGroup.isSuperAdmin(alixClient.inboxId), false) + assertEquals(alixGroup.isSuperAdmin(boClient.inboxId), true) + assertEquals(alixGroup.isSuperAdmin(alixClient.inboxId), false) // can not fetch creator ID. See https://github.com/xmtp/libxmtp/issues/788 // assert(boGroup.isCreator()) assert(!alixGroup.isCreator()) @@ -110,7 +111,7 @@ class GroupTest { val boGroup = runBlocking { boClient.conversations.newGroup( listOf(alix.walletAddress), - permissions = GroupPermissions.ADMIN_ONLY + permissions = GroupPermissionPreconfiguration.ADMIN_ONLY ) } runBlocking { alixClient.conversations.syncGroups() } @@ -152,12 +153,12 @@ 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.isAdmin(boClient.inboxId), true) - assertEquals(boGroup.isAdmin(alixClient.inboxId), false) - assertEquals(alixGroup.isAdmin(boClient.inboxId), true) - assertEquals(alixGroup.isAdmin(alixClient.inboxId), false) + assertEquals(boGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Admin) + assertEquals(alixGroup.permissionPolicySet().addMemberPolicy, PermissionOption.Admin) + assertEquals(boGroup.isSuperAdmin(boClient.inboxId), true) + assertEquals(boGroup.isSuperAdmin(alixClient.inboxId), false) + assertEquals(alixGroup.isSuperAdmin(boClient.inboxId), true) + assertEquals(alixGroup.isSuperAdmin(alixClient.inboxId), false) // can not fetch creator ID. See https://github.com/xmtp/libxmtp/issues/788 // assert(boGroup.isCreator()) assert(!alixGroup.isCreator()) diff --git a/library/src/main/java/libxmtp-version.txt b/library/src/main/java/libxmtp-version.txt index 8976d923a..0cd9cfece 100644 --- a/library/src/main/java/libxmtp-version.txt +++ b/library/src/main/java/libxmtp-version.txt @@ -1,3 +1,3 @@ -Version: feb48641 +Version: e4cfade7 Branch: main -Date: 2024-06-26 22:31:21 +0000 +Date: 2024-07-01 19:23:57 +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..876e1ea1f 100644 --- a/library/src/main/java/org/xmtp/android/library/Conversations.kt +++ b/library/src/main/java/org/xmtp/android/library/Conversations.kt @@ -47,8 +47,8 @@ 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 uniffi.xmtpv3.org.xmtp.android.library.libxmtp.GroupPermissionPreconfiguration import java.util.Date import kotlin.time.Duration.Companion.nanoseconds import kotlin.time.DurationUnit @@ -109,9 +109,10 @@ data class Conversations( suspend fun newGroup( accountAddresses: List, - permissions: GroupPermissions = GroupPermissions.ALL_MEMBERS, + permissions: GroupPermissionPreconfiguration = GroupPermissionPreconfiguration.ALL_MEMBERS, groupName: String = "", groupImageUrlSquare: String = "", + groupDescription: String = "", ): Group { if (accountAddresses.size == 1 && accountAddresses.first().lowercase() == client.address.lowercase() @@ -129,9 +130,10 @@ data class Conversations( libXMTPConversations?.createGroup( accountAddresses, opts = FfiCreateGroupOptions( - permissions = permissions, + permissions = GroupPermissionPreconfiguration.toFfiGroupPermissionOptions(permissions), groupName = groupName, - groupImageUrlSquare = groupImageUrlSquare + groupImageUrlSquare = groupImageUrlSquare, + groupDescription = groupDescription ) ) ?: 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..74a42358e 100644 --- a/library/src/main/java/org/xmtp/android/library/Group.kt +++ b/library/src/main/java/org/xmtp/android/library/Group.kt @@ -20,7 +20,10 @@ import uniffi.xmtpv3.FfiGroupPermissions import uniffi.xmtpv3.FfiListMessagesOptions import uniffi.xmtpv3.FfiMessage import uniffi.xmtpv3.FfiMessageCallback -import uniffi.xmtpv3.GroupPermissions +import uniffi.xmtpv3.FfiMetadataField +import uniffi.xmtpv3.FfiPermissionUpdateType +import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.PermissionOption +import uniffi.xmtpv3.org.xmtp.android.library.libxmtp.PermissionPolicySet import java.util.Date import kotlin.time.Duration.Companion.nanoseconds import kotlin.time.DurationUnit @@ -47,6 +50,9 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) { val imageUrlSquare: String get() = libXMTPGroup.groupImageUrlSquare() + val description: String + get() = libXMTPGroup.groupDescription() + suspend fun send(text: String): String { return send(prepareMessage(content = text, options = null)) } @@ -165,8 +171,8 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) { return libXMTPGroup.addedByInboxId() } - fun permissionLevel(): GroupPermissions { - return permissions.policyType() + fun permissionPolicySet(): PermissionPolicySet { + return PermissionPolicySet(permissions.policySet()) } fun creatorInboxId(): String { @@ -220,11 +226,55 @@ class Group(val client: Client, private val libXMTPGroup: FfiGroup) { } suspend fun updateGroupName(name: String) { - return libXMTPGroup.updateGroupName(name) + try { + return libXMTPGroup.updateGroupName(name) + } catch (e: Exception) { + throw XMTPException("Permission denied: Unable to update group name", e) + } } suspend fun updateGroupImageUrlSquare(imageUrl: String) { - return libXMTPGroup.updateGroupImageUrlSquare(imageUrl) + try { + return libXMTPGroup.updateGroupImageUrlSquare(imageUrl) + } catch (e: Exception) { + throw XMTPException("Permission denied: Unable to update image url", e) + } + } + + suspend fun updateGroupDescription(description: String) { + try { + return libXMTPGroup.updateGroupDescription(description) + } catch (e: Exception) { + throw XMTPException("Permission denied: Unable to update group description", e) + } + } + + suspend fun updateAddMemberPermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.ADD_MEMBER, PermissionOption.toFfiPermissionPolicy(newPermissionOption), null) + } + + suspend fun updateRemoveMemberPermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.REMOVE_MEMBER, PermissionOption.toFfiPermissionPolicy(newPermissionOption), null) + } + + suspend fun updateAddAdminPermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.ADD_ADMIN, PermissionOption.toFfiPermissionPolicy(newPermissionOption), null) + } + + suspend fun updateRemoveAdminPermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.REMOVE_ADMIN, PermissionOption.toFfiPermissionPolicy(newPermissionOption), null) + } + + suspend fun updateGroupNamePermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.UPDATE_METADATA, PermissionOption.toFfiPermissionPolicy(newPermissionOption), FfiMetadataField.GROUP_NAME) + } + + suspend fun updateGroupDescriptionPermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.UPDATE_METADATA, PermissionOption.toFfiPermissionPolicy(newPermissionOption), FfiMetadataField.DESCRIPTION) + } + + suspend fun updateGroupImageUrlSquarePermission(newPermissionOption: PermissionOption) { + return libXMTPGroup.updatePermissionPolicy(FfiPermissionUpdateType.UPDATE_METADATA, PermissionOption.toFfiPermissionPolicy(newPermissionOption), FfiMetadataField.IMAGE_URL_SQUARE) } fun isAdmin(inboxId: String): Boolean { diff --git a/library/src/main/java/org/xmtp/android/library/libxmtp/PermissionPolicySet.kt b/library/src/main/java/org/xmtp/android/library/libxmtp/PermissionPolicySet.kt new file mode 100644 index 000000000..a003367c8 --- /dev/null +++ b/library/src/main/java/org/xmtp/android/library/libxmtp/PermissionPolicySet.kt @@ -0,0 +1,64 @@ +package uniffi.xmtpv3.org.xmtp.android.library.libxmtp + +import uniffi.xmtpv3.FfiGroupPermissionsOptions +import uniffi.xmtpv3.FfiPermissionPolicy +import uniffi.xmtpv3.FfiPermissionPolicySet +enum class PermissionOption { + Allow, + Deny, + Admin, + SuperAdmin, + Unknown; + companion object { + fun toFfiPermissionPolicy(option: PermissionOption): FfiPermissionPolicy { + return when (option) { + Allow -> FfiPermissionPolicy.ALLOW + Deny -> FfiPermissionPolicy.DENY + Admin -> FfiPermissionPolicy.ADMIN + SuperAdmin -> FfiPermissionPolicy.SUPER_ADMIN + Unknown -> FfiPermissionPolicy.OTHER + } + } + fun fromFfiPermissionPolicy(ffiPolicy: FfiPermissionPolicy): PermissionOption { + return when (ffiPolicy) { + FfiPermissionPolicy.ALLOW -> Allow + FfiPermissionPolicy.DENY -> Deny + FfiPermissionPolicy.ADMIN -> Admin + FfiPermissionPolicy.SUPER_ADMIN -> SuperAdmin + FfiPermissionPolicy.DOES_NOT_EXIST -> Unknown + FfiPermissionPolicy.OTHER -> Unknown + } + } + } +} + +enum class GroupPermissionPreconfiguration { + ALL_MEMBERS, + ADMIN_ONLY; + + companion object { + fun toFfiGroupPermissionOptions(option: GroupPermissionPreconfiguration): FfiGroupPermissionsOptions { + return when (option) { + ALL_MEMBERS -> FfiGroupPermissionsOptions.ALL_MEMBERS + ADMIN_ONLY -> FfiGroupPermissionsOptions.ADMIN_ONLY + } + } + } +} + +class PermissionPolicySet(private val ffiPermissionPolicySet: FfiPermissionPolicySet) { + val addMemberPolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.addMemberPolicy) + val removeMemberPolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.removeMemberPolicy) + val addAdminPolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.addAdminPolicy) + val removeAdminPolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.removeAdminPolicy) + val updateGroupNamePolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.updateGroupNamePolicy) + val updateGroupDescriptionPolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.updateGroupDescriptionPolicy) + val updateGroupImagePolicy: PermissionOption + get() = PermissionOption.fromFfiPermissionPolicy(ffiPermissionPolicySet.updateGroupImageUrlSquarePolicy) +} diff --git a/library/src/main/java/xmtpv3.kt b/library/src/main/java/xmtpv3.kt index f7de6734f..adc9cbab4 100644 --- a/library/src/main/java/xmtpv3.kt +++ b/library/src/main/java/xmtpv3.kt @@ -264,7 +264,7 @@ interface UniffiRustCallStatusErrorHandler { // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err private inline fun uniffiRustCallWithError( errorHandler: UniffiRustCallStatusErrorHandler, - callback: (UniffiRustCallStatus) -> U, + callback: (UniffiRustCallStatus) -> U ): U { var status = UniffiRustCallStatus(); val return_value = callback(status) @@ -275,7 +275,7 @@ private inline fun uniffiRustCallWithError( // Check UniffiRustCallStatus and throw an error if the call wasn't successful private fun uniffiCheckCallStatus( errorHandler: UniffiRustCallStatusErrorHandler, - status: UniffiRustCallStatus, + status: UniffiRustCallStatus ) { if (status.isSuccess()) { return @@ -325,7 +325,7 @@ internal inline fun uniffiTraitInterfaceCallWithError callStatus: UniffiRustCallStatus, makeCall: () -> T, writeReturn: (T) -> Unit, - lowerError: (E) -> RustBuffer.ByValue, + lowerError: (E) -> RustBuffer.ByValue ) { try { writeReturn(makeCall()) @@ -380,7 +380,7 @@ private fun findLibraryName(componentName: String): String { } private inline fun loadIndirect( - componentName: String, + componentName: String ): Lib { return Native.load(findLibraryName(componentName), Lib::class.java) } @@ -932,6 +932,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 @@ -1004,6 +1008,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 +1020,13 @@ internal interface UniffiLib : Library { `ptr`: Pointer, `groupName`: 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 +1051,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 @@ -1619,6 +1638,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 @@ -1673,18 +1695,27 @@ 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_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 @@ -1894,6 +1925,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") } @@ -1948,19 +1982,28 @@ 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_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()) { @@ -2085,7 +2128,7 @@ internal suspend fun uniffiRustCallAsync( completeFunc: (Long, UniffiRustCallStatus) -> F, freeFunc: (Long) -> Unit, liftFunc: (F) -> T, - errorHandler: UniffiRustCallStatusErrorHandler, + errorHandler: UniffiRustCallStatusErrorHandler ): T { try { do { @@ -2469,7 +2512,7 @@ private class JavaLangRefCleaner : UniffiCleaner { } private class JavaLangRefCleanable( - val cleanable: java.lang.ref.Cleaner.Cleanable, + val cleanable: java.lang.ref.Cleaner.Cleanable ) : UniffiCleaner.Cleanable { override fun clean() = cleanable.clean() } @@ -2478,7 +2521,7 @@ public interface FfiConversationsInterface { suspend fun `createGroup`( `accountAddresses`: List, - `opts`: FfiCreateGroupOptions, + `opts`: FfiCreateGroupOptions ): FfiGroup suspend fun `list`(`opts`: FfiListConversationsOptions): List @@ -2580,7 +2623,7 @@ open class FfiConversations : Disposable, AutoCloseable, FfiConversationsInterfa @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `createGroup`( `accountAddresses`: List, - `opts`: FfiCreateGroupOptions, + `opts`: FfiCreateGroupOptions ): FfiGroup { return uniffiRustCallAsync( callWithPointer { thisPtr -> @@ -2919,6 +2962,8 @@ public interface FfiGroupInterface { fun `findMessages`(`opts`: FfiListMessagesOptions): List + fun `groupDescription`(): kotlin.String + fun `groupImageUrlSquare`(): kotlin.String fun `groupMetadata`(): FfiGroupMetadata @@ -2955,10 +3000,18 @@ public interface FfiGroupInterface { suspend fun `sync`() + suspend fun `updateGroupDescription`(`groupDescription`: kotlin.String) + suspend fun `updateGroupImageUrlSquare`(`groupImageUrlSquare`: kotlin.String) suspend fun `updateGroupName`(`groupName`: kotlin.String) + suspend fun `updatePermissionPolicy`( + `permissionUpdateType`: FfiPermissionUpdateType, + `permissionPolicyOption`: FfiPermissionPolicy, + `metadataField`: FfiMetadataField? + ) + companion object } @@ -3231,6 +3284,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( @@ -3631,6 +3698,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,6 +3797,45 @@ open class FfiGroup : Disposable, AutoCloseable, FfiGroupInterface { } + @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 } @@ -4071,7 +4210,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( @@ -4307,7 +4462,7 @@ public interface FfiSignatureRequestInterface { suspend fun `addScwSignature`( `signatureBytes`: kotlin.ByteArray, `address`: kotlin.String, - `chainRpcUrl`: kotlin.String, + `chainRpcUrl`: kotlin.String ) suspend fun `isReady`(): kotlin.Boolean @@ -4442,7 +4597,7 @@ open class FfiSignatureRequest : Disposable, AutoCloseable, FfiSignatureRequestI override suspend fun `addScwSignature`( `signatureBytes`: kotlin.ByteArray, `address`: kotlin.String, - `chainRpcUrl`: kotlin.String, + `chainRpcUrl`: kotlin.String ) { return uniffiRustCallAsync( callWithPointer { thisPtr -> @@ -4955,7 +5110,7 @@ public interface FfiV2ApiClientInterface { suspend fun `subscribe`( `request`: FfiV2SubscribeRequest, - `callback`: FfiV2SubscriptionCallback, + `callback`: FfiV2SubscriptionCallback ): FfiV2Subscription companion object @@ -5154,7 +5309,7 @@ open class FfiV2ApiClient : Disposable, AutoCloseable, FfiV2ApiClientInterface { @Suppress("ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE") override suspend fun `subscribe`( `request`: FfiV2SubscribeRequest, - `callback`: FfiV2SubscriptionCallback, + `callback`: FfiV2SubscriptionCallback ): FfiV2Subscription { return uniffiRustCallAsync( callWithPointer { thisPtr -> @@ -6036,9 +6191,10 @@ 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), ) } 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`) ) 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) } } data class FfiCursor( var `digest`: kotlin.ByteArray, - var `senderTimeNs`: kotlin.ULong, + var `senderTimeNs`: kotlin.ULong ) { companion object @@ -6099,7 +6258,7 @@ public object FfiConverterTypeFfiCursor : FfiConverterRustBuffer { data class FfiEnvelope( var `contentTopic`: kotlin.String, var `timestampNs`: kotlin.ULong, - var `message`: kotlin.ByteArray, + var `message`: kotlin.ByteArray ) { companion object @@ -6132,7 +6291,7 @@ data class FfiGroupMember( var `inboxId`: kotlin.String, var `accountAddresses`: List, var `installationIds`: List, - var `permissionLevel`: FfiPermissionLevel, + var `permissionLevel`: FfiPermissionLevel ) { companion object @@ -6167,7 +6326,7 @@ public object FfiConverterTypeFfiGroupMember : FfiConverterRustBuffer { data class FfiPagingInfo( var `limit`: kotlin.UInt, var `cursor`: FfiCursor?, - var `direction`: FfiSortDirection, + var `direction`: FfiSortDirection ) { companion object @@ -6314,8 +6473,57 @@ 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), + ) + } + + 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`) + ) + + 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) + } +} + + data class FfiPublishRequest( - var `envelopes`: List, + var `envelopes`: List ) { companion object @@ -6339,7 +6547,7 @@ public object FfiConverterTypeFfiPublishRequest : FfiConverterRustBuffer, + var `requests`: List ) { companion object @@ -6364,7 +6572,7 @@ public object FfiConverterTypeFfiV2BatchQueryRequest : data class FfiV2BatchQueryResponse( - var `responses`: List, + var `responses`: List ) { companion object @@ -6392,7 +6600,7 @@ data class FfiV2QueryRequest( var `contentTopics`: List, var `startTimeNs`: kotlin.ULong, var `endTimeNs`: kotlin.ULong, - var `pagingInfo`: FfiPagingInfo?, + var `pagingInfo`: FfiPagingInfo? ) { companion object @@ -6426,7 +6634,7 @@ public object FfiConverterTypeFfiV2QueryRequest : FfiConverterRustBuffer, - var `pagingInfo`: FfiPagingInfo?, + var `pagingInfo`: FfiPagingInfo? ) { companion object @@ -6453,7 +6661,7 @@ public object FfiConverterTypeFfiV2QueryResponse : FfiConverterRustBuffer, + var `contentTopics`: List ) { companion object @@ -6526,6 +6734,57 @@ 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; + + 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 +6810,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, @@ -6693,31 +7008,6 @@ public object FfiConverterTypeGenericError : 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) { class Generic(message: String) : SigningException(message) @@ -7263,28 +7553,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 FfiConverterTypeGroupPermissions.read(buf) + return FfiConverterTypeFfiGroupPermissionsOptions.read(buf) } - override fun allocationSize(value: GroupPermissions?): ULong { + override fun allocationSize(value: FfiGroupPermissionsOptions?): ULong { if (value == null) { return 1UL } else { - return 1UL + FfiConverterTypeGroupPermissions.allocationSize(value) + return 1UL + FfiConverterTypeFfiGroupPermissionsOptions.allocationSize(value) } } - override fun write(value: GroupPermissions?, buf: ByteBuffer) { + override fun write(value: FfiGroupPermissionsOptions?, buf: ByteBuffer) { if (value == null) { buf.put(0) } else { buf.put(1) - FfiConverterTypeGroupPermissions.write(value, buf) + FfiConverterTypeFfiGroupPermissionsOptions.write(value, buf) + } + } +} + + +public object FfiConverterOptionalTypeFfiMetadataField : FfiConverterRustBuffer { + override fun read(buf: ByteBuffer): FfiMetadataField? { + if (buf.get().toInt() == 0) { + return null + } + return FfiConverterTypeFfiMetadataField.read(buf) + } + + override fun allocationSize(value: FfiMetadataField?): ULong { + if (value == null) { + return 1UL + } else { + return 1UL + FfiConverterTypeFfiMetadataField.allocationSize(value) + } + } + + override fun write(value: FfiMetadataField?, buf: ByteBuffer) { + if (value == null) { + buf.put(0) + } else { + buf.put(1) + FfiConverterTypeFfiMetadataField.write(value, buf) } } } @@ -7545,7 +7863,7 @@ suspend fun `createClient`( `accountAddress`: kotlin.String, `nonce`: kotlin.ULong, `legacySignedPrivateKeyProto`: kotlin.ByteArray?, - `historySyncUrl`: kotlin.String?, + `historySyncUrl`: kotlin.String? ): FfiXmtpClient { return uniffiRustCallAsync( UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_create_client( @@ -7615,7 +7933,7 @@ suspend fun `createV2Client`(`host`: kotlin.String, `isSecure`: kotlin.Boolean): @Throws(GenericException::class) fun `diffieHellmanK256`( `privateKeyBytes`: kotlin.ByteArray, - `publicKeyBytes`: kotlin.ByteArray, + `publicKeyBytes`: kotlin.ByteArray ): kotlin.ByteArray { return FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> @@ -7659,7 +7977,7 @@ suspend fun `getInboxIdForAddress`( `logger`: FfiLogger, `host`: kotlin.String, `isSecure`: kotlin.Boolean, - `accountAddress`: kotlin.String, + `accountAddress`: kotlin.String ): kotlin.String? { return uniffiRustCallAsync( UniffiLib.INSTANCE.uniffi_xmtpv3_fn_func_get_inbox_id_for_address( @@ -7727,7 +8045,7 @@ fun `publicKeyFromPrivateKeyK256`(`privateKeyBytes`: kotlin.ByteArray): kotlin.B @Throws(GenericException::class) fun `recoverAddress`( `signatureBytes`: kotlin.ByteArray, - `predigestMessage`: kotlin.String, + `predigestMessage`: kotlin.String ): kotlin.String { return FfiConverterString.lift( uniffiRustCallWithError(GenericException) { _status -> @@ -7744,7 +8062,7 @@ fun `recoverAddress`( @Throws(GenericException::class) fun `recoverPublicKeyK256Keccak256`( `message`: kotlin.ByteArray, - `signature`: kotlin.ByteArray, + `signature`: kotlin.ByteArray ): kotlin.ByteArray { return FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> @@ -7761,7 +8079,7 @@ fun `recoverPublicKeyK256Keccak256`( @Throws(GenericException::class) fun `recoverPublicKeyK256Sha256`( `message`: kotlin.ByteArray, - `signature`: kotlin.ByteArray, + `signature`: kotlin.ByteArray ): kotlin.ByteArray { return FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> @@ -7789,7 +8107,7 @@ fun `sha256`(`input`: kotlin.ByteArray): kotlin.ByteArray { fun `userPreferencesDecrypt`( `publicKey`: kotlin.ByteArray, `privateKey`: kotlin.ByteArray, - `message`: kotlin.ByteArray, + `message`: kotlin.ByteArray ): kotlin.ByteArray { return FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> @@ -7808,7 +8126,7 @@ fun `userPreferencesDecrypt`( fun `userPreferencesEncrypt`( `publicKey`: kotlin.ByteArray, `privateKey`: kotlin.ByteArray, - `message`: kotlin.ByteArray, + `message`: kotlin.ByteArray ): kotlin.ByteArray { return FfiConverterByteArray.lift( uniffiRustCallWithError(GenericException) { _status -> @@ -7828,7 +8146,7 @@ fun `verifyK256Sha256`( `signedBy`: kotlin.ByteArray, `message`: kotlin.ByteArray, `signature`: kotlin.ByteArray, - `recoveryId`: kotlin.UByte, + `recoveryId`: kotlin.UByte ): kotlin.Boolean { return FfiConverterBoolean.lift( uniffiRustCallWithError(GenericException) { _status -> diff --git a/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so b/library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so index bbb3c93de..fd4f4441e 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..7a74794ca 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..383213e89 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..a17a5d139 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