mirror of
https://github.com/permissionlesstech/bitchat-android.git
synced 2026-07-25 13:05:19 +00:00
receive works
This commit is contained in:
@@ -283,11 +283,8 @@ class CashuService {
|
|||||||
val amount = decodedToken.amount.toLong()
|
val amount = decodedToken.amount.toLong()
|
||||||
|
|
||||||
Log.d(TAG, "Token validation successful, amount: $amount")
|
Log.d(TAG, "Token validation successful, amount: $amount")
|
||||||
|
|
||||||
// TODO: Implement proper token receiving using CDK FFI
|
wallet!!.receive(token)
|
||||||
// The CDK FFI doesn't have a direct receive() method
|
|
||||||
// This might involve using prepareSend() or another approach
|
|
||||||
// wallet!!.receive(token)
|
|
||||||
|
|
||||||
Result.success(amount)
|
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
|
): RustBuffer.ByValue
|
||||||
fun uniffi_cdk_ffi_fn_method_ffiwallet_prepare_send(`ptr`: Pointer,`amount`: RustBuffer.ByValue,`options`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
fun uniffi_cdk_ffi_fn_method_ffiwallet_prepare_send(`ptr`: Pointer,`amount`: RustBuffer.ByValue,`options`: RustBuffer.ByValue,uniffi_out_err: UniffiRustCallStatus,
|
||||||
): RustBuffer.ByValue
|
): 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,
|
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
|
): RustBuffer.ByValue
|
||||||
fun uniffi_cdk_ffi_fn_method_ffiwallet_unit(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus,
|
fun uniffi_cdk_ffi_fn_method_ffiwallet_unit(`ptr`: Pointer,uniffi_out_err: UniffiRustCallStatus,
|
||||||
@@ -939,6 +943,8 @@ internal interface UniffiLib : Library {
|
|||||||
): Short
|
): Short
|
||||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_prepare_send(
|
fun uniffi_cdk_ffi_checksum_method_ffiwallet_prepare_send(
|
||||||
): Short
|
): Short
|
||||||
|
fun uniffi_cdk_ffi_checksum_method_ffiwallet_receive(
|
||||||
|
): Short
|
||||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_send(
|
fun uniffi_cdk_ffi_checksum_method_ffiwallet_send(
|
||||||
): Short
|
): Short
|
||||||
fun uniffi_cdk_ffi_checksum_method_ffiwallet_unit(
|
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()) {
|
if (lib.uniffi_cdk_ffi_checksum_method_ffiwallet_prepare_send() != 46706.toShort()) {
|
||||||
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
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()) {
|
if (lib.uniffi_cdk_ffi_checksum_method_ffiwallet_send() != 15473.toShort()) {
|
||||||
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
|
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
|
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 `send`(`amount`: FfiAmount, `options`: FfiSendOptions, `memo`: FfiSendMemo?): FfiToken
|
||||||
|
|
||||||
fun `unit`(): kotlin.String
|
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 {
|
@Throws(FfiException::class)override fun `send`(`amount`: FfiAmount, `options`: FfiSendOptions, `memo`: FfiSendMemo?): FfiToken {
|
||||||
return FfiConverterTypeFFIToken.lift(
|
return FfiConverterTypeFFIToken.lift(
|
||||||
callWithPointer {
|
callWithPointer {
|
||||||
|
|||||||
Reference in New Issue
Block a user