mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 22:25:26 +00:00
receive works
This commit is contained in:
@@ -284,10 +284,7 @@ class CashuService {
|
||||
|
||||
Log.d(TAG, "Token validation successful, amount: $amount")
|
||||
|
||||
// TODO: Implement proper token receiving using CDK FFI
|
||||
// The CDK FFI doesn't have a direct receive() method
|
||||
// This might involve using prepareSend() or another approach
|
||||
// wallet!!.receive(token)
|
||||
wallet!!.receive(token)
|
||||
|
||||
Result.success(amount)
|
||||
|
||||
|
||||
Binary file not shown.
@@ -745,6 +745,8 @@ internal interface UniffiForeignFutureCompleteVoid : com.sun.jna.Callback {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -801,6 +803,8 @@ internal interface UniffiLib : Library {
|
||||
): RustBuffer.ByValue
|
||||
fun uniffi_cdk_ffi_fn_method_ffiwallet_prepare_send(`ptr`: Pointer,`amount`: RustBuffer.ByValue,`options`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
||||
): RustBuffer.ByValue
|
||||
fun uniffi_cdk_ffi_fn_method_ffiwallet_receive(`ptr`: Pointer,`token`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
||||
): RustBuffer.ByValue
|
||||
fun uniffi_cdk_ffi_fn_method_ffiwallet_send(`ptr`: Pointer,`amount`: RustBuffer.ByValue,`options`: RustBuffer.ByValue,`memo`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
||||
): RustBuffer.ByValue
|
||||
fun uniffi_cdk_ffi_fn_method_ffiwallet_unit(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus,
|
||||
@@ -939,6 +943,8 @@ internal interface UniffiLib : Library {
|
||||
): Short
|
||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_prepare_send(
|
||||
): Short
|
||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_receive(
|
||||
): Short
|
||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_send(
|
||||
): Short
|
||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_unit(
|
||||
@@ -998,6 +1004,9 @@ private fun uniffiCheckApiChecksums(lib: UniffiLib) {
|
||||
if (lib.uniffi_cdk_ffi_checksum_method_ffiwallet_prepare_send() != 46706.toShort()) {
|
||||
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
||||
}
|
||||
if (lib.uniffi_cdk_ffi_checksum_method_ffiwallet_receive() != 57605.toShort()) {
|
||||
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
||||
}
|
||||
if (lib.uniffi_cdk_ffi_checksum_method_ffiwallet_send() != 15473.toShort()) {
|
||||
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
||||
}
|
||||
@@ -1598,6 +1607,11 @@ public interface FfiWalletInterface {
|
||||
|
||||
fun `prepareSend`(`amount`: FfiAmount, `options`: FfiSendOptions): FfiPreparedSend
|
||||
|
||||
/**
|
||||
* Receive token
|
||||
*/
|
||||
fun `receive`(`token`: kotlin.String): FfiAmount
|
||||
|
||||
fun `send`(`amount`: FfiAmount, `options`: FfiSendOptions, `memo`: FfiSendMemo?): FfiToken
|
||||
|
||||
fun `unit`(): kotlin.String
|
||||
@@ -1813,6 +1827,22 @@ open class FfiWallet: Disposable, AutoCloseable, FfiWalletInterface {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Receive token
|
||||
*/
|
||||
@Throws(FfiException::class)override fun `receive`(`token`: kotlin.String): FfiAmount {
|
||||
return FfiConverterTypeFFIAmount.lift(
|
||||
callWithPointer {
|
||||
uniffiRustCallWithError(FfiException) { _status ->
|
||||
UniffiLib.INSTANCE.uniffi_cdk_ffi_fn_method_ffiwallet_receive(
|
||||
it, FfiConverterString.lower(`token`),_status)
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Throws(FfiException::class)override fun `send`(`amount`: FfiAmount, `options`: FfiSendOptions, `memo`: FfiSendMemo?): FfiToken {
|
||||
return FfiConverterTypeFFIToken.lift(
|
||||
callWithPointer {
|
||||
|
||||
Reference in New Issue
Block a user