Skip to content

Commit

Permalink
Merge branch 'main' into np/frames-signer
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer authored Nov 19, 2024
2 parents 2f9b43e + 96f23f2 commit 0a21656
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 29a955a1
Version: 8e8ff6a6
Branch: main
Date: 2024-11-14 22:21:21 +0000
Date: 2024-11-19 01:30:43 +0000
35 changes: 35 additions & 0 deletions library/src/main/java/xmtpv3.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1448,6 +1448,10 @@ internal interface UniffiLib : Library {
`ptr`: Pointer, `records`: RustBuffer.ByValue,
): Long

fun uniffi_xmtpv3_fn_method_ffixmtpclient_sign_with_installation_key(
`ptr`: Pointer, `text`: RustBuffer.ByValue, uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue

fun uniffi_xmtpv3_fn_method_ffixmtpclient_signature_request(
`ptr`: Pointer, uniffi_out_err: UniffiRustCallStatus,
): RustBuffer.ByValue
Expand Down Expand Up @@ -2132,6 +2136,9 @@ internal interface UniffiLib : Library {
fun uniffi_xmtpv3_checksum_method_ffixmtpclient_set_consent_states(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_sign_with_installation_key(
): Short

fun uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request(
): Short

Expand Down Expand Up @@ -2515,6 +2522,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_set_consent_states() != 64566.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtpv3_checksum_method_ffixmtpclient_sign_with_installation_key() != 49813.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")
}
Expand Down Expand Up @@ -7835,6 +7845,8 @@ public interface FfiXmtpClientInterface {

suspend fun `setConsentStates`(`records`: List<FfiConsent>)

fun `signWithInstallationKey`(`text`: kotlin.String): kotlin.ByteArray

fun `signatureRequest`(): FfiSignatureRequest?

companion object
Expand Down Expand Up @@ -8533,6 +8545,21 @@ open class FfiXmtpClient : Disposable, AutoCloseable, FfiXmtpClientInterface {
)
}


@Throws(GenericException::class)
override fun `signWithInstallationKey`(`text`: kotlin.String): kotlin.ByteArray {
return FfiConverterByteArray.lift(
callWithPointer {
uniffiRustCallWithError(GenericException) { _status ->
UniffiLib.INSTANCE.uniffi_xmtpv3_fn_method_ffixmtpclient_sign_with_installation_key(
it, FfiConverterString.lower(`text`), _status
)
}
}
)
}


override fun `signatureRequest`(): FfiSignatureRequest? {
return FfiConverterOptionalTypeFfiSignatureRequest.lift(
callWithPointer {
Expand Down Expand Up @@ -9691,6 +9718,8 @@ sealed class GenericException(message: String) : kotlin.Exception(message) {

class DeviceSync(message: String) : GenericException(message)

class Identity(message: String) : GenericException(message)


companion object ErrorHandler : UniffiRustCallStatusErrorHandler<GenericException> {
override fun lift(error_buf: RustBuffer.ByValue): GenericException =
Expand Down Expand Up @@ -9720,6 +9749,7 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
13 -> GenericException.FailedToConvertToU32(FfiConverterString.read(buf))
14 -> GenericException.Association(FfiConverterString.read(buf))
15 -> GenericException.DeviceSync(FfiConverterString.read(buf))
16 -> GenericException.Identity(FfiConverterString.read(buf))
else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
}

Expand Down Expand Up @@ -9805,6 +9835,11 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
buf.putInt(15)
Unit
}

is GenericException.Identity -> {
buf.putInt(16)
Unit
}
}.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
}

Expand Down
Binary file modified library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/x86/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so
Binary file not shown.

0 comments on commit 0a21656

Please sign in to comment.