Skip to content

Commit

Permalink
update the kotlin bindings (#282)
Browse files Browse the repository at this point in the history
  • Loading branch information
nplasterer authored Oct 24, 2023
1 parent f01fb14 commit 2ffa175
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
Binary file modified xmtp_dh/jniLibs/arm64-v8a/libuniffi_xmtp_dh.so
Binary file not shown.
Binary file modified xmtp_dh/jniLibs/armeabi-v7a/libuniffi_xmtp_dh.so
Binary file not shown.
Binary file modified xmtp_dh/jniLibs/x86/libuniffi_xmtp_dh.so
Binary file not shown.
Binary file modified xmtp_dh/jniLibs/x86_64/libuniffi_xmtp_dh.so
Binary file not shown.
16 changes: 16 additions & 0 deletions xmtp_dh/src/uniffi/xmtp_dh/xmtp_dh.kt
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ internal interface _UniFFILib : Library {
): RustBuffer.ByValue
fun uniffi_xmtp_dh_fn_func_ecies_decrypt_k256_sha3_256(`publicKeyBytes`: RustBuffer.ByValue,`privateKeyBytes`: RustBuffer.ByValue,`messageBytes`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun uniffi_xmtp_dh_fn_func_generate_private_preferences_topic_identifier(`privateKeyBytes`: RustBuffer.ByValue,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun ffi_xmtp_dh_rustbuffer_alloc(`size`: Int,_uniffi_out_err: RustCallStatus,
): RustBuffer.ByValue
fun ffi_xmtp_dh_rustbuffer_from_bytes(`bytes`: ForeignBytes.ByValue,_uniffi_out_err: RustCallStatus,
Expand All @@ -384,6 +386,8 @@ internal interface _UniFFILib : Library {
): Short
fun uniffi_xmtp_dh_checksum_func_ecies_decrypt_k256_sha3_256(
): Short
fun uniffi_xmtp_dh_checksum_func_generate_private_preferences_topic_identifier(
): Short
fun ffi_xmtp_dh_uniffi_contract_version(
): Int

Expand All @@ -410,6 +414,9 @@ private fun uniffiCheckApiChecksums(lib: _UniFFILib) {
if (lib.uniffi_xmtp_dh_checksum_func_ecies_decrypt_k256_sha3_256() != 45037.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
if (lib.uniffi_xmtp_dh_checksum_func_generate_private_preferences_topic_identifier() != 65141.toShort()) {
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
}
}

// Public interface members begin here.
Expand Down Expand Up @@ -612,4 +619,13 @@ fun `eciesDecryptK256Sha3256`(`publicKeyBytes`: List<UByte>, `privateKeyBytes`:
})
}

@Throws(EciesException::class)

fun `generatePrivatePreferencesTopicIdentifier`(`privateKeyBytes`: List<UByte>): String {
return FfiConverterString.lift(
rustCallWithError(EciesException) { _status ->
_UniFFILib.INSTANCE.uniffi_xmtp_dh_fn_func_generate_private_preferences_topic_identifier(FfiConverterSequenceUByte.lower(`privateKeyBytes`),_status)
})
}


0 comments on commit 2ffa175

Please sign in to comment.