diff --git a/Cargo.lock b/Cargo.lock index 62d79b4..7cf6b9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -475,7 +475,7 @@ dependencies = [ [[package]] name = "bitkitcore" -version = "0.1.73" +version = "0.3.0" dependencies = [ "android_logger", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 9502908..401cbe6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bitkitcore" -version = "0.1.73" +version = "0.3.0" edition = "2021" [lib] diff --git a/Package.swift b/Package.swift index 22c2bdd..fa412e3 100644 --- a/Package.swift +++ b/Package.swift @@ -3,8 +3,8 @@ import PackageDescription -let tag = "v0.1.73" -let checksum = "0fc1897b87ef3224abcec3b119d02c4a93966dd04c0a7c938588d4c5e98fc013" +let tag = "v0.3.0" +let checksum = "5a1850e4b5477ed2cb8f459efa9903395e2e76a1ba01905d20d72a3c5c3ff2d6" let url = "https://github.com/synonymdev/bitkit-core/releases/download/\(tag)/BitkitCore.xcframework.zip" let package = Package( diff --git a/README.md b/README.md index c5ac9eb..7df8a2e 100644 --- a/README.md +++ b/README.md @@ -118,50 +118,121 @@ ```rust fn init_db(base_path: String) -> Result ``` + - [get_default_wallet_id](src/modules/activity/README.md#usage-examples): Get the default wallet ID for the built-in Bitkit wallet + ```rust + fn get_default_wallet_id() -> String + ``` - [insert_activity](src/modules/activity/README.md#usage-examples): Insert an activity (onchain or lightning) ```rust fn insert_activity(activity: Activity) -> Result<(), ActivityError> ``` - - [get_activities](src/modules/activity/README.md#usage-examples): Get activities with optional filtering, limit and sort direction - ```rust - fn get_activities(filter: ActivityFilter, limit: Option, sort_direction: Option) -> Result, ActivityError> + - [get_activities](src/modules/activity/README.md#usage-examples): Get activities with optional wallet scope, filtering, limit and sort direction + ```rust + fn get_activities( + wallet_id: Option, + filter: Option, + tx_type: Option, + tags: Option>, + search: Option, + min_date: Option, + max_date: Option, + limit: Option, + sort_direction: Option + ) -> Result, ActivityError> ``` - - [get_activity_by_id](src/modules/activity/README.md#usage-examples): Look up any activity by its ID + - [get_activity_by_id](src/modules/activity/README.md#usage-examples): Look up any activity by wallet ID and activity ID ```rust - fn get_activity_by_id(activity_id: String) -> Result, ActivityError> + fn get_activity_by_id(wallet_id: String, activity_id: String) -> Result, ActivityError> + ``` + - [get_activity_by_tx_id](src/modules/activity/README.md#usage-examples): Look up an onchain activity by wallet ID and transaction ID + ```rust + fn get_activity_by_tx_id(wallet_id: String, tx_id: String) -> Result, ActivityError> ``` - [update_activity](src/modules/activity/README.md#usage-examples): Update an existing activity (onchain or lightning) ```rust fn update_activity(activity_id: String, activity: Activity) -> Result<(), ActivityError> ``` - - [delete_activity_by_id](src/modules/activity/README.md#usage-examples): Delete any activity (onchain or lightning) by its ID. Returns true if activity was found and deleted, false if not found + - [delete_activity_by_id](src/modules/activity/README.md#usage-examples): Delete any activity by wallet ID and activity ID. Returns true if activity was found and deleted, false if not found + ```rust + fn delete_activity_by_id(wallet_id: String, activity_id: String) -> Result + ``` + - [delete_activities_by_wallet_id](src/modules/activity/README.md#usage-examples): Delete all activities and scoped activity data for a wallet ```rust - fn delete_activity_by_id(activity_id: String) -> Result + fn delete_activities_by_wallet_id(wallet_id: String) -> Result + ``` + - [mark_activity_as_seen](src/modules/activity/README.md#usage-examples): Mark an activity as seen by wallet ID and activity ID + ```rust + fn mark_activity_as_seen(wallet_id: String, activity_id: String, seen_at: u64) -> Result<(), ActivityError> ``` - [add_tags](src/modules/activity/README.md#usage-examples): Add tags to an activity ```rust - fn add_tags(activity_id: String, tags: Vec) -> Result<(), ActivityError> + fn add_tags(wallet_id: String, activity_id: String, tags: Vec) -> Result<(), ActivityError> ``` - [remove_tags](src/modules/activity/README.md#usage-examples): Remove tags from an activity ```rust - fn remove_tags(activity_id: String, tags: Vec) -> Result<(), ActivityError> + fn remove_tags(wallet_id: String, activity_id: String, tags: Vec) -> Result<(), ActivityError> ``` - [get_tags](src/modules/activity/README.md#usage-examples): Get all tags for an activity ```rust - fn get_tags(activity_id: String) -> Result, ActivityError> + fn get_tags(wallet_id: String, activity_id: String) -> Result, ActivityError> ``` - [get_all_unique_tags](src/modules/activity/README.md#usage-examples): Get all unique tags in the database sorted alphabetically ```rust fn get_all_unique_tags() -> Result, ActivityError> ``` - - [get_activities_by_tag](src/modules/activity/README.md#usage-examples): Get all activities with a specific tag + - [get_activities_by_tag](src/modules/activity/README.md#usage-examples): Get activities with a specific tag and optional wallet scope ```rust - fn get_activities_by_tag(tag: String, limit: Option, sort_direction: Option) -> Result, ActivityError> + fn get_activities_by_tag( + wallet_id: Option, + tag: String, + limit: Option, + sort_direction: Option + ) -> Result, ActivityError> ``` - [upsert_activity](src/modules/activity/README.md#usage-examples): Insert or update an activity ```rust fn upsert_activity(activity: Activity) -> Result<(), ActivityError> ``` + - [add_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Store pending metadata before an activity exists + ```rust + fn add_pre_activity_metadata(pre_activity_metadata: PreActivityMetadata) -> Result<(), ActivityError> + ``` + - [get_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Get pending metadata by wallet ID and payment ID or address + ```rust + fn get_pre_activity_metadata( + wallet_id: String, + search_key: String, + search_by_address: bool + ) -> Result, ActivityError> + ``` + - [add_pre_activity_metadata_tags](src/modules/activity/README.md#usage-examples): Add tags to pending metadata + ```rust + fn add_pre_activity_metadata_tags(wallet_id: String, payment_id: String, tags: Vec) -> Result<(), ActivityError> + ``` + - [remove_pre_activity_metadata_tags](src/modules/activity/README.md#usage-examples): Remove tags from pending metadata + ```rust + fn remove_pre_activity_metadata_tags(wallet_id: String, payment_id: String, tags: Vec) -> Result<(), ActivityError> + ``` + - [reset_pre_activity_metadata_tags](src/modules/activity/README.md#usage-examples): Remove all tags from pending metadata + ```rust + fn reset_pre_activity_metadata_tags(wallet_id: String, payment_id: String) -> Result<(), ActivityError> + ``` + - [delete_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Delete pending metadata by wallet ID and payment ID + ```rust + fn delete_pre_activity_metadata(wallet_id: String, payment_id: String) -> Result<(), ActivityError> + ``` + - [upsert_pre_activity_metadata](src/modules/activity/README.md#usage-examples): Insert or update pending metadata records + ```rust + fn upsert_pre_activity_metadata(pre_activity_metadata: Vec) -> Result<(), ActivityError> + ``` + - [get_transaction_details](src/modules/activity/README.md#usage-examples): Get transaction details by wallet ID and transaction ID + ```rust + fn get_transaction_details(wallet_id: String, tx_id: String) -> Result, ActivityError> + ``` + - [delete_transaction_details](src/modules/activity/README.md#usage-examples): Delete transaction details by wallet ID and transaction ID + ```rust + fn delete_transaction_details(wallet_id: String, tx_id: String) -> Result + ``` - Blocktank: - [init_db](src/modules/blocktank/README.md#usage-examples): Initialize database ```rust @@ -510,4 +581,4 @@ cargo test modules::blocktank # Run tests for the Trezor module cargo test modules::trezor -``` \ No newline at end of file +``` diff --git a/bindings/android/gradle.properties b/bindings/android/gradle.properties index 65db0f1..0a1983b 100644 --- a/bindings/android/gradle.properties +++ b/bindings/android/gradle.properties @@ -3,4 +3,4 @@ android.useAndroidX=true android.enableJetifier=true kotlin.code.style=official group=com.synonym -version=0.1.73 +version=0.3.0 diff --git a/bindings/android/lib/src/main/jniLibs/arm64-v8a/libbitkitcore.so b/bindings/android/lib/src/main/jniLibs/arm64-v8a/libbitkitcore.so index 7e8982e..f9572ce 100755 Binary files a/bindings/android/lib/src/main/jniLibs/arm64-v8a/libbitkitcore.so and b/bindings/android/lib/src/main/jniLibs/arm64-v8a/libbitkitcore.so differ diff --git a/bindings/android/lib/src/main/jniLibs/armeabi-v7a/libbitkitcore.so b/bindings/android/lib/src/main/jniLibs/armeabi-v7a/libbitkitcore.so index f398fcc..9cc3f0c 100755 Binary files a/bindings/android/lib/src/main/jniLibs/armeabi-v7a/libbitkitcore.so and b/bindings/android/lib/src/main/jniLibs/armeabi-v7a/libbitkitcore.so differ diff --git a/bindings/android/lib/src/main/jniLibs/x86/libbitkitcore.so b/bindings/android/lib/src/main/jniLibs/x86/libbitkitcore.so index 32f9fee..2651aa2 100755 Binary files a/bindings/android/lib/src/main/jniLibs/x86/libbitkitcore.so and b/bindings/android/lib/src/main/jniLibs/x86/libbitkitcore.so differ diff --git a/bindings/android/lib/src/main/jniLibs/x86_64/libbitkitcore.so b/bindings/android/lib/src/main/jniLibs/x86_64/libbitkitcore.so index 02c4522..8a49b0b 100755 Binary files a/bindings/android/lib/src/main/jniLibs/x86_64/libbitkitcore.so and b/bindings/android/lib/src/main/jniLibs/x86_64/libbitkitcore.so differ diff --git a/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.android.kt b/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.android.kt index 03fb477..2d2f9f2 100644 --- a/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.android.kt +++ b/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.android.kt @@ -437,11 +437,11 @@ internal open class UniffiForeignFutureStruct( @JvmField public var `free`: UniffiForeignFutureFree?, ) : com.sun.jna.Structure() { internal constructor(): this( - + `handle` = 0.toLong(), - + `free` = null, - + ) internal class UniffiByValue( @@ -468,11 +468,11 @@ internal open class UniffiForeignFutureStructU8Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.toByte(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -502,11 +502,11 @@ internal open class UniffiForeignFutureStructI8Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.toByte(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -536,11 +536,11 @@ internal open class UniffiForeignFutureStructU16Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.toShort(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -570,11 +570,11 @@ internal open class UniffiForeignFutureStructI16Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.toShort(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -604,11 +604,11 @@ internal open class UniffiForeignFutureStructU32Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0, - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -638,11 +638,11 @@ internal open class UniffiForeignFutureStructI32Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0, - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -672,11 +672,11 @@ internal open class UniffiForeignFutureStructU64Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.toLong(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -706,11 +706,11 @@ internal open class UniffiForeignFutureStructI64Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.toLong(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -740,11 +740,11 @@ internal open class UniffiForeignFutureStructF32Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.0f, - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -774,11 +774,11 @@ internal open class UniffiForeignFutureStructF64Struct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = 0.0, - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -808,11 +808,11 @@ internal open class UniffiForeignFutureStructPointerStruct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = NullPointer, - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -842,11 +842,11 @@ internal open class UniffiForeignFutureStructRustBufferStruct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `returnValue` = RustBufferHelper.allocValue(), - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -875,9 +875,9 @@ internal open class UniffiForeignFutureStructVoidStruct( @JvmField public var `callStatus`: UniffiRustCallStatusByValue, ) : com.sun.jna.Structure() { internal constructor(): this( - + `callStatus` = UniffiRustCallStatusHelper.allocValue(), - + ) internal class UniffiByValue( @@ -946,11 +946,11 @@ internal open class UniffiVTableCallbackInterfaceEventListenerStruct( @JvmField public var `uniffiFree`: UniffiCallbackInterfaceFree?, ) : com.sun.jna.Structure() { internal constructor(): this( - + `onEvent` = null, - + `uniffiFree` = null, - + ) internal class UniffiByValue( @@ -987,31 +987,31 @@ internal open class UniffiVTableCallbackInterfaceTrezorTransportCallbackStruct( @JvmField public var `uniffiFree`: UniffiCallbackInterfaceFree?, ) : com.sun.jna.Structure() { internal constructor(): this( - + `enumerateDevices` = null, - + `openDevice` = null, - + `closeDevice` = null, - + `readChunk` = null, - + `writeChunk` = null, - + `getChunkSize` = null, - + `callMessage` = null, - + `getPairingCode` = null, - + `saveThpCredential` = null, - + `loadThpCredential` = null, - + `logDebug` = null, - + `uniffiFree` = null, - + ) internal class UniffiByValue( @@ -1069,13 +1069,13 @@ internal open class UniffiVTableCallbackInterfaceTrezorUiCallbackStruct( @JvmField public var `uniffiFree`: UniffiCallbackInterfaceFree?, ) : com.sun.jna.Structure() { internal constructor(): this( - + `onPinRequest` = null, - + `onPassphraseRequest` = null, - + `uniffiFree` = null, - + ) internal class UniffiByValue( @@ -1475,6 +1475,10 @@ internal typealias UniffiVTableCallbackInterfaceTrezorUiCallbackUniffiByValue = + + + + @@ -1525,10 +1529,10 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_add_pre_activity_metadata() != 17211.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags() != 28081.toShort()) { + if (uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags() != 5813.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_add_tags() != 63739.toShort()) { + if (uniffi_bitkitcore_checksum_func_add_tags() != 61276.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (uniffi_bitkitcore_checksum_func_approve_pubky_auth() != 22222.toShort()) { @@ -1573,13 +1577,16 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_decode() != 28437.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_delete_activity_by_id() != 29867.toShort()) { + if (uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id() != 15848.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata() != 46621.toShort()) { + if (uniffi_bitkitcore_checksum_func_delete_activity_by_id() != 13256.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_delete_transaction_details() != 21670.toShort()) { + if (uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata() != 63740.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } + if (uniffi_bitkitcore_checksum_func_delete_transaction_details() != 43443.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (uniffi_bitkitcore_checksum_func_derive_bitcoin_address() != 35090.toShort()) { @@ -1621,16 +1628,16 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_generate_mnemonic() != 19292.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_activities() != 21347.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_activities() != 9879.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_activities_by_tag() != 52823.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_activities_by_tag() != 16182.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_activity_by_id() != 44227.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_activity_by_id() != 28490.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_activity_by_tx_id() != 2520.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_activity_by_tx_id() != 28432.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (uniffi_bitkitcore_checksum_func_get_all_activities_tags() != 29245.toShort()) { @@ -1663,6 +1670,9 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_get_default_lsp_balance() != 35903.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } + if (uniffi_bitkitcore_checksum_func_get_default_wallet_id() != 19552.toShort()) { + throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + } if (uniffi_bitkitcore_checksum_func_get_gift() != 386.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } @@ -1681,13 +1691,13 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_get_payment() != 29170.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_pre_activity_metadata() != 53126.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_pre_activity_metadata() != 24738.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_tags() != 11308.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_tags() != 8596.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_get_transaction_details() != 6118.toShort()) { + if (uniffi_bitkitcore_checksum_func_get_transaction_details() != 4810.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (uniffi_bitkitcore_checksum_func_gift_order() != 22040.toShort()) { @@ -1711,7 +1721,7 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_lnurl_auth() != 58593.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_mark_activity_as_seen() != 65086.toShort()) { + if (uniffi_bitkitcore_checksum_func_mark_activity_as_seen() != 36622.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (uniffi_bitkitcore_checksum_func_mnemonic_to_entropy() != 36669.toShort()) { @@ -1807,13 +1817,13 @@ internal object IntegrityCheckingUniffiLib : Library { if (uniffi_bitkitcore_checksum_func_remove_closed_channel_by_id() != 17150.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags() != 1991.toShort()) { + if (uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags() != 37046.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_remove_tags() != 58873.toShort()) { + if (uniffi_bitkitcore_checksum_func_remove_tags() != 53863.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } - if (uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags() != 34703.toShort()) { + if (uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags() != 49760.toShort()) { throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project") } if (uniffi_bitkitcore_checksum_func_resolve_pubky_url() != 43253.toShort()) { @@ -2048,6 +2058,9 @@ internal object IntegrityCheckingUniffiLib : Library { external fun uniffi_bitkitcore_checksum_func_decode( ): Short @JvmStatic + external fun uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id( + ): Short + @JvmStatic external fun uniffi_bitkitcore_checksum_func_delete_activity_by_id( ): Short @JvmStatic @@ -2138,6 +2151,9 @@ internal object IntegrityCheckingUniffiLib : Library { external fun uniffi_bitkitcore_checksum_func_get_default_lsp_balance( ): Short @JvmStatic + external fun uniffi_bitkitcore_checksum_func_get_default_wallet_id( + ): Short + @JvmStatic external fun uniffi_bitkitcore_checksum_func_get_gift( ): Short @JvmStatic @@ -2626,12 +2642,14 @@ internal object UniffiLib : Library { ): Unit @JvmStatic external fun uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags( + `walletId`: RustBufferByValue, `paymentId`: RustBufferByValue, `tags`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Unit @JvmStatic external fun uniffi_bitkitcore_fn_func_add_tags( + `walletId`: RustBufferByValue, `activityId`: RustBufferByValue, `tags`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, @@ -2712,17 +2730,25 @@ internal object UniffiLib : Library { `invoice`: RustBufferByValue, ): Long @JvmStatic + external fun uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id( + `walletId`: RustBufferByValue, + uniffiCallStatus: UniffiRustCallStatus, + ): Int + @JvmStatic external fun uniffi_bitkitcore_fn_func_delete_activity_by_id( + `walletId`: RustBufferByValue, `activityId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Byte @JvmStatic external fun uniffi_bitkitcore_fn_func_delete_pre_activity_metadata( + `walletId`: RustBufferByValue, `paymentId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Unit @JvmStatic external fun uniffi_bitkitcore_fn_func_delete_transaction_details( + `walletId`: RustBufferByValue, `txId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Byte @@ -2807,6 +2833,7 @@ internal object UniffiLib : Library { ): RustBufferByValue @JvmStatic external fun uniffi_bitkitcore_fn_func_get_activities( + `walletId`: RustBufferByValue, `filter`: RustBufferByValue, `txType`: RustBufferByValue, `tags`: RustBufferByValue, @@ -2819,6 +2846,7 @@ internal object UniffiLib : Library { ): RustBufferByValue @JvmStatic external fun uniffi_bitkitcore_fn_func_get_activities_by_tag( + `walletId`: RustBufferByValue, `tag`: RustBufferByValue, `limit`: RustBufferByValue, `sortDirection`: RustBufferByValue, @@ -2826,11 +2854,13 @@ internal object UniffiLib : Library { ): RustBufferByValue @JvmStatic external fun uniffi_bitkitcore_fn_func_get_activity_by_id( + `walletId`: RustBufferByValue, `activityId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): RustBufferByValue @JvmStatic external fun uniffi_bitkitcore_fn_func_get_activity_by_tx_id( + `walletId`: RustBufferByValue, `txId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): RustBufferByValue @@ -2882,6 +2912,10 @@ internal object UniffiLib : Library { uniffiCallStatus: UniffiRustCallStatus, ): Long @JvmStatic + external fun uniffi_bitkitcore_fn_func_get_default_wallet_id( + uniffiCallStatus: UniffiRustCallStatus, + ): RustBufferByValue + @JvmStatic external fun uniffi_bitkitcore_fn_func_get_gift( `giftId`: RustBufferByValue, ): Long @@ -2910,17 +2944,20 @@ internal object UniffiLib : Library { ): Long @JvmStatic external fun uniffi_bitkitcore_fn_func_get_pre_activity_metadata( + `walletId`: RustBufferByValue, `searchKey`: RustBufferByValue, `searchByAddress`: Byte, uniffiCallStatus: UniffiRustCallStatus, ): RustBufferByValue @JvmStatic external fun uniffi_bitkitcore_fn_func_get_tags( + `walletId`: RustBufferByValue, `activityId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): RustBufferByValue @JvmStatic external fun uniffi_bitkitcore_fn_func_get_transaction_details( + `walletId`: RustBufferByValue, `txId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): RustBufferByValue @@ -2964,6 +3001,7 @@ internal object UniffiLib : Library { ): Long @JvmStatic external fun uniffi_bitkitcore_fn_func_mark_activity_as_seen( + `walletId`: RustBufferByValue, `activityId`: RustBufferByValue, `seenAt`: Long, uniffiCallStatus: UniffiRustCallStatus, @@ -3145,18 +3183,21 @@ internal object UniffiLib : Library { ): Byte @JvmStatic external fun uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags( + `walletId`: RustBufferByValue, `paymentId`: RustBufferByValue, `tags`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Unit @JvmStatic external fun uniffi_bitkitcore_fn_func_remove_tags( + `walletId`: RustBufferByValue, `activityId`: RustBufferByValue, `tags`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Unit @JvmStatic external fun uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags( + `walletId`: RustBufferByValue, `paymentId`: RustBufferByValue, uniffiCallStatus: UniffiRustCallStatus, ): Unit @@ -4030,7 +4071,7 @@ public open class EventListenerImpl: Disposable, EventListener { }!! } - + /** * Called when a watcher event occurs. * @@ -4051,13 +4092,13 @@ public open class EventListenerImpl: Disposable, EventListener { } - - - - + + + + public companion object - + } @@ -4246,7 +4287,7 @@ public open class TrezorTransportCallbackImpl: Disposable, TrezorTransportCallba }!! } - + /** * Enumerate all connected Trezor devices */ @@ -4461,13 +4502,13 @@ public open class TrezorTransportCallbackImpl: Disposable, TrezorTransportCallba } - - - - + + + + public companion object - + } @@ -4844,7 +4885,7 @@ public open class TrezorUiCallbackImpl: Disposable, TrezorUiCallback { }!! } - + /** * Called when the device requests a PIN. * @@ -4885,13 +4926,13 @@ public open class TrezorUiCallbackImpl: Disposable, TrezorUiCallback { } - - - - + + + + public companion object - + } @@ -5088,17 +5129,20 @@ public object FfiConverterTypeAccountUtxo: FfiConverterRustBuffer { public object FfiConverterTypeActivityTags: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): ActivityTags { return ActivityTags( + FfiConverterString.read(buf), FfiConverterString.read(buf), FfiConverterSequenceString.read(buf), ) } override fun allocationSize(value: ActivityTags): ULong = ( + FfiConverterString.allocationSize(value.`walletId`) + FfiConverterString.allocationSize(value.`activityId`) + FfiConverterSequenceString.allocationSize(value.`tags`) ) override fun write(value: ActivityTags, buf: ByteBuffer) { + FfiConverterString.write(value.`walletId`, buf) FfiConverterString.write(value.`activityId`, buf) FfiConverterSequenceString.write(value.`tags`, buf) } @@ -6625,6 +6669,7 @@ public object FfiConverterTypeLegacyRnCloseRecoverySweepPreview: FfiConverterRus public object FfiConverterTypeLightningActivity: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): LightningActivity { return LightningActivity( + FfiConverterString.read(buf), FfiConverterString.read(buf), FfiConverterTypePaymentType.read(buf), FfiConverterTypePaymentState.read(buf), @@ -6642,6 +6687,7 @@ public object FfiConverterTypeLightningActivity: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): OnchainActivity { return OnchainActivity( + FfiConverterString.read(buf), FfiConverterString.read(buf), FfiConverterTypePaymentType.read(buf), FfiConverterString.read(buf), @@ -6967,6 +7015,7 @@ public object FfiConverterTypeOnchainActivity: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): PreActivityMetadata { return PreActivityMetadata( + FfiConverterString.read(buf), FfiConverterString.read(buf), FfiConverterSequenceString.read(buf), FfiConverterOptionalString.read(buf), @@ -7033,6 +7084,7 @@ public object FfiConverterTypePreActivityMetadata: FfiConverterRustBuffer { override fun read(buf: ByteBuffer): TransactionDetails { return TransactionDetails( + FfiConverterString.read(buf), FfiConverterString.read(buf), FfiConverterLong.read(buf), FfiConverterSequenceTypeTxInput.read(buf), @@ -7376,6 +7430,7 @@ public object FfiConverterTypeTransactionDetails: FfiConverterRustBuffer) { +public fun `addPreActivityMetadataTags`(`walletId`: kotlin.String, `paymentId`: kotlin.String, `tags`: List) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`paymentId`), FfiConverterSequenceString.lower(`tags`), uniffiRustCallStatus, @@ -12872,9 +12929,10 @@ public fun `addPreActivityMetadataTags`(`paymentId`: kotlin.String, `tags`: List } @Throws(ActivityException::class) -public fun `addTags`(`activityId`: kotlin.String, `tags`: List) { +public fun `addTags`(`walletId`: kotlin.String, `activityId`: kotlin.String, `tags`: List) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_add_tags( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`activityId`), FfiConverterSequenceString.lower(`tags`), uniffiRustCallStatus, @@ -12895,7 +12953,7 @@ public suspend fun `approvePubkyAuth`(`authUrl`: kotlin.String, `secretKeyHex`: { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter PubkyExceptionErrorHandler, ) @@ -12912,7 +12970,7 @@ public suspend fun `blocktankRemoveAllCjitEntries`() { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -12929,7 +12987,7 @@ public suspend fun `blocktankRemoveAllOrders`() { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -12946,7 +13004,7 @@ public suspend fun `blocktankWipeAll`() { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -12993,7 +13051,7 @@ public suspend fun `cancelPubkyAuth`() { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter PubkyExceptionErrorHandler, ) @@ -13120,9 +13178,20 @@ public suspend fun `decode`(`invoice`: kotlin.String): Scanner { } @Throws(ActivityException::class) -public fun `deleteActivityById`(`activityId`: kotlin.String): kotlin.Boolean { +public fun `deleteActivitiesByWalletId`(`walletId`: kotlin.String): kotlin.UInt { + return FfiConverterUInt.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> + UniffiLib.uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id( + FfiConverterString.lower(`walletId`), + uniffiRustCallStatus, + ) + }) +} + +@Throws(ActivityException::class) +public fun `deleteActivityById`(`walletId`: kotlin.String, `activityId`: kotlin.String): kotlin.Boolean { return FfiConverterBoolean.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_delete_activity_by_id( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`activityId`), uniffiRustCallStatus, ) @@ -13130,9 +13199,10 @@ public fun `deleteActivityById`(`activityId`: kotlin.String): kotlin.Boolean { } @Throws(ActivityException::class) -public fun `deletePreActivityMetadata`(`paymentId`: kotlin.String) { +public fun `deletePreActivityMetadata`(`walletId`: kotlin.String, `paymentId`: kotlin.String) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_delete_pre_activity_metadata( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`paymentId`), uniffiRustCallStatus, ) @@ -13140,9 +13210,10 @@ public fun `deletePreActivityMetadata`(`paymentId`: kotlin.String) { } @Throws(ActivityException::class) -public fun `deleteTransactionDetails`(`txId`: kotlin.String): kotlin.Boolean { +public fun `deleteTransactionDetails`(`walletId`: kotlin.String, `txId`: kotlin.String): kotlin.Boolean { return FfiConverterBoolean.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_delete_transaction_details( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`txId`), uniffiRustCallStatus, ) @@ -13342,9 +13413,10 @@ public fun `generateMnemonic`(`wordCount`: WordCount?): kotlin.String { } @Throws(ActivityException::class) -public fun `getActivities`(`filter`: ActivityFilter?, `txType`: PaymentType?, `tags`: List?, `search`: kotlin.String?, `minDate`: kotlin.ULong?, `maxDate`: kotlin.ULong?, `limit`: kotlin.UInt?, `sortDirection`: SortDirection?): List { +public fun `getActivities`(`walletId`: kotlin.String?, `filter`: ActivityFilter?, `txType`: PaymentType?, `tags`: List?, `search`: kotlin.String?, `minDate`: kotlin.ULong?, `maxDate`: kotlin.ULong?, `limit`: kotlin.UInt?, `sortDirection`: SortDirection?): List { return FfiConverterSequenceTypeActivity.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_activities( + FfiConverterOptionalString.lower(`walletId`), FfiConverterOptionalTypeActivityFilter.lower(`filter`), FfiConverterOptionalTypePaymentType.lower(`txType`), FfiConverterOptionalSequenceString.lower(`tags`), @@ -13359,9 +13431,10 @@ public fun `getActivities`(`filter`: ActivityFilter?, `txType`: PaymentType?, `t } @Throws(ActivityException::class) -public fun `getActivitiesByTag`(`tag`: kotlin.String, `limit`: kotlin.UInt?, `sortDirection`: SortDirection?): List { +public fun `getActivitiesByTag`(`walletId`: kotlin.String?, `tag`: kotlin.String, `limit`: kotlin.UInt?, `sortDirection`: SortDirection?): List { return FfiConverterSequenceTypeActivity.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_activities_by_tag( + FfiConverterOptionalString.lower(`walletId`), FfiConverterString.lower(`tag`), FfiConverterOptionalUInt.lower(`limit`), FfiConverterOptionalTypeSortDirection.lower(`sortDirection`), @@ -13371,9 +13444,10 @@ public fun `getActivitiesByTag`(`tag`: kotlin.String, `limit`: kotlin.UInt?, `so } @Throws(ActivityException::class) -public fun `getActivityById`(`activityId`: kotlin.String): Activity? { +public fun `getActivityById`(`walletId`: kotlin.String, `activityId`: kotlin.String): Activity? { return FfiConverterOptionalTypeActivity.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_id( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`activityId`), uniffiRustCallStatus, ) @@ -13381,9 +13455,10 @@ public fun `getActivityById`(`activityId`: kotlin.String): Activity? { } @Throws(ActivityException::class) -public fun `getActivityByTxId`(`txId`: kotlin.String): OnchainActivity? { +public fun `getActivityByTxId`(`walletId`: kotlin.String, `txId`: kotlin.String): OnchainActivity? { return FfiConverterOptionalTypeOnchainActivity.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_tx_id( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`txId`), uniffiRustCallStatus, ) @@ -13492,6 +13567,14 @@ public fun `getDefaultLspBalance`(`params`: DefaultLspBalanceParams): kotlin.ULo }) } +public fun `getDefaultWalletId`(): kotlin.String { + return FfiConverterString.lift(uniffiRustCall { uniffiRustCallStatus -> + UniffiLib.uniffi_bitkitcore_fn_func_get_default_wallet_id( + uniffiRustCallStatus, + ) + }) +} + @Throws(BlocktankException::class, kotlin.coroutines.cancellation.CancellationException::class) public suspend fun `getGift`(`giftId`: kotlin.String): IGift { return uniffiRustCallAsync( @@ -13598,9 +13681,10 @@ public suspend fun `getPayment`(`paymentId`: kotlin.String): IBtBolt11Invoice { } @Throws(ActivityException::class) -public fun `getPreActivityMetadata`(`searchKey`: kotlin.String, `searchByAddress`: kotlin.Boolean): PreActivityMetadata? { +public fun `getPreActivityMetadata`(`walletId`: kotlin.String, `searchKey`: kotlin.String, `searchByAddress`: kotlin.Boolean): PreActivityMetadata? { return FfiConverterOptionalTypePreActivityMetadata.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_pre_activity_metadata( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`searchKey`), FfiConverterBoolean.lower(`searchByAddress`), uniffiRustCallStatus, @@ -13609,9 +13693,10 @@ public fun `getPreActivityMetadata`(`searchKey`: kotlin.String, `searchByAddress } @Throws(ActivityException::class) -public fun `getTags`(`activityId`: kotlin.String): List { +public fun `getTags`(`walletId`: kotlin.String, `activityId`: kotlin.String): List { return FfiConverterSequenceString.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_tags( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`activityId`), uniffiRustCallStatus, ) @@ -13619,9 +13704,10 @@ public fun `getTags`(`activityId`: kotlin.String): List { } @Throws(ActivityException::class) -public fun `getTransactionDetails`(`txId`: kotlin.String): TransactionDetails? { +public fun `getTransactionDetails`(`walletId`: kotlin.String, `txId`: kotlin.String): TransactionDetails? { return FfiConverterOptionalTypeTransactionDetails.lift(uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_get_transaction_details( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`txId`), uniffiRustCallStatus, ) @@ -13725,9 +13811,10 @@ public suspend fun `lnurlAuth`(`domain`: kotlin.String, `k1`: kotlin.String, `ca } @Throws(ActivityException::class) -public fun `markActivityAsSeen`(`activityId`: kotlin.String, `seenAt`: kotlin.ULong) { +public fun `markActivityAsSeen`(`walletId`: kotlin.String, `activityId`: kotlin.String, `seenAt`: kotlin.ULong) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_mark_activity_as_seen( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`activityId`), FfiConverterULong.lower(`seenAt`), uniffiRustCallStatus, @@ -13915,7 +14002,7 @@ public suspend fun `onchainStartWatcher`(`params`: WatcherParams, `listener`: Ev { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter AccountInfoExceptionErrorHandler, ) @@ -14042,7 +14129,7 @@ public suspend fun `pubkyPutWithSecretKey`(`secretKeyHex`: kotlin.String, `path` { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter PubkyExceptionErrorHandler, ) @@ -14061,7 +14148,7 @@ public suspend fun `pubkySessionDelete`(`sessionSecret`: kotlin.String, `path`: { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter PubkyExceptionErrorHandler, ) @@ -14099,7 +14186,7 @@ public suspend fun `pubkySessionPut`(`sessionSecret`: kotlin.String, `path`: kot { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter PubkyExceptionErrorHandler, ) @@ -14269,7 +14356,7 @@ public suspend fun `regtestMine`(`count`: kotlin.UInt?) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -14304,9 +14391,10 @@ public fun `removeClosedChannelById`(`channelId`: kotlin.String): kotlin.Boolean } @Throws(ActivityException::class) -public fun `removePreActivityMetadataTags`(`paymentId`: kotlin.String, `tags`: List) { +public fun `removePreActivityMetadataTags`(`walletId`: kotlin.String, `paymentId`: kotlin.String, `tags`: List) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`paymentId`), FfiConverterSequenceString.lower(`tags`), uniffiRustCallStatus, @@ -14315,9 +14403,10 @@ public fun `removePreActivityMetadataTags`(`paymentId`: kotlin.String, `tags`: L } @Throws(ActivityException::class) -public fun `removeTags`(`activityId`: kotlin.String, `tags`: List) { +public fun `removeTags`(`walletId`: kotlin.String, `activityId`: kotlin.String, `tags`: List) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_remove_tags( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`activityId`), FfiConverterSequenceString.lower(`tags`), uniffiRustCallStatus, @@ -14326,9 +14415,10 @@ public fun `removeTags`(`activityId`: kotlin.String, `tags`: List } @Throws(ActivityException::class) -public fun `resetPreActivityMetadataTags`(`paymentId`: kotlin.String) { +public fun `resetPreActivityMetadataTags`(`walletId`: kotlin.String, `paymentId`: kotlin.String) { uniffiRustCallWithError(ActivityExceptionErrorHandler) { uniffiRustCallStatus -> UniffiLib.uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags( + FfiConverterString.lower(`walletId`), FfiConverterString.lower(`paymentId`), uniffiRustCallStatus, ) @@ -14433,7 +14523,7 @@ public suspend fun `trezorClearCredentials`(`deviceId`: kotlin.String) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter TrezorExceptionErrorHandler, ) @@ -14482,7 +14572,7 @@ public suspend fun `trezorDisconnect`() { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter TrezorExceptionErrorHandler, ) @@ -14609,7 +14699,7 @@ public suspend fun `trezorInitialize`(`credentialPath`: kotlin.String?) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter TrezorExceptionErrorHandler, ) @@ -14848,7 +14938,7 @@ public suspend fun `updateBlocktankUrl`(`newUrl`: kotlin.String) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -14886,7 +14976,7 @@ public suspend fun `upsertCjitEntries`(`entries`: List) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -14924,7 +15014,7 @@ public suspend fun `upsertInfo`(`info`: IBtInfo) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) @@ -14962,7 +15052,7 @@ public suspend fun `upsertOrders`(`orders`: List) { { future -> UniffiLib.ffi_bitkitcore_rust_future_cancel_void(future) }, // lift function { Unit }, - + // Error FFI converter BlocktankExceptionErrorHandler, ) diff --git a/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.common.kt b/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.common.kt index 7f80bb1..3df8da3 100644 --- a/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.common.kt +++ b/bindings/android/lib/src/main/kotlin/com/synonym/bitkitcore/bitkitcore.common.kt @@ -120,7 +120,7 @@ public object NoPointer * from xpub watchers. */ public interface EventListener { - + /** * Called when a watcher event occurs. * @@ -128,7 +128,7 @@ public interface EventListener { * `event` is a typed enum — no JSON parsing needed. */ public fun `onEvent`(`watcherId`: kotlin.String, `event`: WatcherEvent) - + public companion object } @@ -158,37 +158,37 @@ public interface EventListener { * Use IOKit/CoreBluetooth with same service/characteristic UUIDs. */ public interface TrezorTransportCallback { - + /** * Enumerate all connected Trezor devices */ public fun `enumerateDevices`(): List - + /** * Open a connection to a device */ public fun `openDevice`(`path`: kotlin.String): TrezorTransportWriteResult - + /** * Close the connection to a device */ public fun `closeDevice`(`path`: kotlin.String): TrezorTransportWriteResult - + /** * Read a chunk of data from the device */ public fun `readChunk`(`path`: kotlin.String): TrezorTransportReadResult - + /** * Write a chunk of data to the device */ public fun `writeChunk`(`path`: kotlin.String, `data`: kotlin.ByteArray): TrezorTransportWriteResult - + /** * Get the chunk size for a device (64 for USB, 244 for Bluetooth) */ public fun `getChunkSize`(`path`: kotlin.String): kotlin.UInt - + /** * High-level message call for BLE/THP devices. * @@ -205,7 +205,7 @@ public interface TrezorTransportCallback { * * `data` - Serialized protobuf message data */ public fun `callMessage`(`path`: kotlin.String, `messageType`: kotlin.UShort, `data`: kotlin.ByteArray): TrezorCallMessageResult? - + /** * Get pairing code from user during BLE THP pairing. * @@ -218,7 +218,7 @@ public interface TrezorTransportCallback { * Returns the 6-digit code as a string, or empty string to cancel. */ public fun `getPairingCode`(): kotlin.String - + /** * Save THP pairing credentials for a device. * @@ -232,7 +232,7 @@ public interface TrezorTransportCallback { * Returns true if credentials were saved successfully. */ public fun `saveThpCredential`(`deviceId`: kotlin.String, `credentialJson`: kotlin.String): kotlin.Boolean - + /** * Load THP pairing credentials for a device. * @@ -245,7 +245,7 @@ public interface TrezorTransportCallback { * Returns the JSON string containing ThpCredentials, or None if not found. */ public fun `loadThpCredential`(`deviceId`: kotlin.String): kotlin.String? - + /** * Log a debug message from the Rust THP handshake layer. * @@ -258,7 +258,7 @@ public interface TrezorTransportCallback { * * `message` - Human-readable debug message */ public fun `logDebug`(`tag`: kotlin.String, `message`: kotlin.String) - + public companion object } @@ -272,7 +272,7 @@ public interface TrezorTransportCallback { * input UI when the device requests it during operations like signing. */ public interface TrezorUiCallback { - + /** * Called when the device requests a PIN. * @@ -280,7 +280,7 @@ public interface TrezorUiCallback { * Return empty string to cancel. */ public fun `onPinRequest`(): kotlin.String - + /** * Called when the device requests a passphrase. * @@ -292,7 +292,7 @@ public interface TrezorUiCallback { * `OnDevice` (defer entry to the Trezor), or `Cancel`. */ public fun `onPassphraseRequest`(`onDevice`: kotlin.Boolean): PassphraseResponse - + public companion object } @@ -307,11 +307,11 @@ public data class AccountAddresses ( /** * Used receive addresses (have at least one transaction) */ - val `used`: List, + val `used`: List, /** * Unused receive addresses (no transactions yet) */ - val `unused`: List, + val `unused`: List, /** * Change addresses */ @@ -330,19 +330,19 @@ public data class AccountInfoResult ( /** * The account structure with addresses and UTXOs */ - val `account`: ComposeAccount, + val `account`: ComposeAccount, /** * Total confirmed balance in satoshis */ - val `balance`: kotlin.ULong, + val `balance`: kotlin.ULong, /** * Number of UTXOs */ - val `utxoCount`: kotlin.UInt, + val `utxoCount`: kotlin.UInt, /** * The detected or specified account type */ - val `accountType`: AccountType, + val `accountType`: AccountType, /** * The current blockchain tip height */ @@ -361,39 +361,39 @@ public data class AccountUtxo ( /** * Transaction ID (hex) */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * Output index */ - val `vout`: kotlin.UInt, + val `vout`: kotlin.UInt, /** * Amount in satoshis */ - val `amount`: kotlin.ULong, + val `amount`: kotlin.ULong, /** * Block height where the UTXO was confirmed (0 if unconfirmed) */ - val `blockHeight`: kotlin.UInt, + val `blockHeight`: kotlin.UInt, /** * Address holding this UTXO */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * BIP32 derivation path (e.g., "m/84'/0'/0'/0/0") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Number of confirmations (0 if unconfirmed) */ - val `confirmations`: kotlin.UInt, + val `confirmations`: kotlin.UInt, /** * Whether this is a coinbase output */ - val `coinbase`: kotlin.Boolean, + val `coinbase`: kotlin.Boolean, /** * Whether this UTXO is owned by the account */ - val `own`: kotlin.Boolean, + val `own`: kotlin.Boolean, /** * Whether this UTXO must be included in the transaction */ @@ -406,7 +406,8 @@ public data class AccountUtxo ( @kotlinx.serialization.Serializable public data class ActivityTags ( - val `activityId`: kotlin.String, + val `walletId`: kotlin.String, + val `activityId`: kotlin.String, val `tags`: List ) { public companion object @@ -422,11 +423,11 @@ public data class AddressInfo ( /** * The Bitcoin address */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * BIP32 derivation path */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Number of transfers (real count in `get_address_info`, 1/0 presence flag in `get_account_info`) */ @@ -439,9 +440,9 @@ public data class AddressInfo ( @kotlinx.serialization.Serializable public data class ChannelLiquidityOptions ( - val `defaultLspBalanceSat`: kotlin.ULong, - val `minLspBalanceSat`: kotlin.ULong, - val `maxLspBalanceSat`: kotlin.ULong, + val `defaultLspBalanceSat`: kotlin.ULong, + val `minLspBalanceSat`: kotlin.ULong, + val `maxLspBalanceSat`: kotlin.ULong, val `maxClientBalanceSat`: kotlin.ULong ) { public companion object @@ -451,10 +452,10 @@ public data class ChannelLiquidityOptions ( @kotlinx.serialization.Serializable public data class ChannelLiquidityParams ( - val `clientBalanceSat`: kotlin.ULong, - val `existingChannelsTotalSat`: kotlin.ULong, - val `minChannelSizeSat`: kotlin.ULong, - val `maxChannelSizeSat`: kotlin.ULong, + val `clientBalanceSat`: kotlin.ULong, + val `existingChannelsTotalSat`: kotlin.ULong, + val `minChannelSizeSat`: kotlin.ULong, + val `maxChannelSizeSat`: kotlin.ULong, val `satsPerEur`: kotlin.ULong ) { public companion object @@ -464,19 +465,19 @@ public data class ChannelLiquidityParams ( @kotlinx.serialization.Serializable public data class ClosedChannelDetails ( - val `channelId`: kotlin.String, - val `counterpartyNodeId`: kotlin.String, - val `fundingTxoTxid`: kotlin.String, - val `fundingTxoIndex`: kotlin.UInt, - val `channelValueSats`: kotlin.ULong, - val `closedAt`: kotlin.ULong, - val `outboundCapacityMsat`: kotlin.ULong, - val `inboundCapacityMsat`: kotlin.ULong, - val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, - val `unspendablePunishmentReserve`: kotlin.ULong, - val `forwardingFeeProportionalMillionths`: kotlin.UInt, - val `forwardingFeeBaseMsat`: kotlin.UInt, - val `channelName`: kotlin.String, + val `channelId`: kotlin.String, + val `counterpartyNodeId`: kotlin.String, + val `fundingTxoTxid`: kotlin.String, + val `fundingTxoIndex`: kotlin.UInt, + val `channelValueSats`: kotlin.ULong, + val `closedAt`: kotlin.ULong, + val `outboundCapacityMsat`: kotlin.ULong, + val `inboundCapacityMsat`: kotlin.ULong, + val `counterpartyUnspendablePunishmentReserve`: kotlin.ULong, + val `unspendablePunishmentReserve`: kotlin.ULong, + val `forwardingFeeProportionalMillionths`: kotlin.UInt, + val `forwardingFeeBaseMsat`: kotlin.UInt, + val `channelName`: kotlin.String, val `channelClosureReason`: kotlin.String ) { public companion object @@ -492,11 +493,11 @@ public data class ComposeAccount ( /** * Account derivation path (e.g., "m/84'/0'/0'") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Categorized addresses */ - val `addresses`: AccountAddresses, + val `addresses`: AccountAddresses, /** * Unspent transaction outputs */ @@ -515,15 +516,15 @@ public data class ComposeParams ( /** * Wallet configuration (key, server, network) */ - val `wallet`: WalletParams, + val `wallet`: WalletParams, /** * Desired transaction outputs */ - val `outputs`: List, + val `outputs`: List, /** * Fee rates to evaluate (sat/vB), one PSBT per rate */ - val `feeRates`: List, + val `feeRates`: List, /** * UTXO selection strategy (defaults to BranchAndBound) */ @@ -536,7 +537,7 @@ public data class ComposeParams ( @kotlinx.serialization.Serializable public data class CreateCjitOptions ( - val `source`: kotlin.String?, + val `source`: kotlin.String?, val `discountCode`: kotlin.String? ) { public companion object @@ -546,18 +547,18 @@ public data class CreateCjitOptions ( @kotlinx.serialization.Serializable public data class CreateOrderOptions ( - val `clientBalanceSat`: kotlin.ULong, - val `lspNodeId`: kotlin.String?, - val `couponCode`: kotlin.String, - val `source`: kotlin.String?, - val `discountCode`: kotlin.String?, - val `zeroConf`: kotlin.Boolean, - val `zeroConfPayment`: kotlin.Boolean?, - val `zeroReserve`: kotlin.Boolean, - val `clientNodeId`: kotlin.String?, - val `signature`: kotlin.String?, - val `timestamp`: kotlin.String?, - val `refundOnchainAddress`: kotlin.String?, + val `clientBalanceSat`: kotlin.ULong, + val `lspNodeId`: kotlin.String?, + val `couponCode`: kotlin.String, + val `source`: kotlin.String?, + val `discountCode`: kotlin.String?, + val `zeroConf`: kotlin.Boolean, + val `zeroConfPayment`: kotlin.Boolean?, + val `zeroReserve`: kotlin.Boolean, + val `clientNodeId`: kotlin.String?, + val `signature`: kotlin.String?, + val `timestamp`: kotlin.String?, + val `refundOnchainAddress`: kotlin.String?, val `announceChannel`: kotlin.Boolean ) { public companion object @@ -567,8 +568,8 @@ public data class CreateOrderOptions ( @kotlinx.serialization.Serializable public data class DefaultLspBalanceParams ( - val `clientBalanceSat`: kotlin.ULong, - val `maxChannelSizeSat`: kotlin.ULong, + val `clientBalanceSat`: kotlin.ULong, + val `maxChannelSizeSat`: kotlin.ULong, val `satsPerEur`: kotlin.ULong ) { public companion object @@ -587,8 +588,8 @@ public data class ErrorData ( @kotlinx.serialization.Serializable public data class FeeRates ( - val `fast`: kotlin.UInt, - val `mid`: kotlin.UInt, + val `fast`: kotlin.UInt, + val `mid`: kotlin.UInt, val `slow`: kotlin.UInt ) { public companion object @@ -598,7 +599,7 @@ public data class FeeRates ( @kotlinx.serialization.Serializable public data class FundingTx ( - val `id`: kotlin.String, + val `id`: kotlin.String, val `vout`: kotlin.ULong ) { public companion object @@ -611,11 +612,11 @@ public data class GetAddressResponse ( /** * The generated Bitcoin address as a string */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * The derivation path used to generate the address */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * The hexadecimal representation of the public key */ @@ -646,42 +647,42 @@ public data class HistoryTransaction ( /** * Transaction ID (hex) */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * Amount received by the wallet (sats) */ - val `received`: kotlin.ULong, + val `received`: kotlin.ULong, /** * Amount sent by the wallet (sats) — includes change sent back to self */ - val `sent`: kotlin.ULong, + val `sent`: kotlin.ULong, /** * Net value from wallet's perspective: received - sent (positive = inflow, negative = outflow) */ - val `net`: kotlin.Long, + val `net`: kotlin.Long, /** * Transaction fee in sats (None if not available, e.g. for received-only txs) */ - val `fee`: kotlin.ULong?, + val `fee`: kotlin.ULong?, /** * Display amount in sats: * - Received: the received value * - Sent: amount that left the wallet (sent - received - fee) * - SelfTransfer: the fee paid */ - val `amount`: kotlin.ULong, + val `amount`: kotlin.ULong, /** * Transaction direction */ - val `direction`: TxDirection, + val `direction`: TxDirection, /** * Block height (None if unconfirmed/mempool) */ - val `blockHeight`: kotlin.UInt?, + val `blockHeight`: kotlin.UInt?, /** * Block timestamp as unix epoch seconds (None if unconfirmed) */ - val `timestamp`: kotlin.ULong?, + val `timestamp`: kotlin.ULong?, /** * Number of confirmations (0 if unconfirmed) */ @@ -694,7 +695,7 @@ public data class HistoryTransaction ( @kotlinx.serialization.Serializable public data class IBt0ConfMinTxFeeWindow ( - val `satPerVbyte`: kotlin.Double, + val `satPerVbyte`: kotlin.Double, val `validityEndsAt`: kotlin.String ) { public companion object @@ -704,9 +705,9 @@ public data class IBt0ConfMinTxFeeWindow ( @kotlinx.serialization.Serializable public data class IBtBolt11Invoice ( - val `request`: kotlin.String, - val `state`: BtBolt11InvoiceState, - val `expiresAt`: kotlin.String, + val `request`: kotlin.String, + val `state`: BtBolt11InvoiceState, + val `expiresAt`: kotlin.String, val `updatedAt`: kotlin.String ) { public companion object @@ -716,13 +717,13 @@ public data class IBtBolt11Invoice ( @kotlinx.serialization.Serializable public data class IBtChannel ( - val `state`: BtOpenChannelState, - val `lspNodePubkey`: kotlin.String, - val `clientNodePubkey`: kotlin.String, - val `announceChannel`: kotlin.Boolean, - val `fundingTx`: FundingTx, - val `closingTxId`: kotlin.String?, - val `close`: IBtChannelClose?, + val `state`: BtOpenChannelState, + val `lspNodePubkey`: kotlin.String, + val `clientNodePubkey`: kotlin.String, + val `announceChannel`: kotlin.Boolean, + val `fundingTx`: FundingTx, + val `closingTxId`: kotlin.String?, + val `close`: IBtChannelClose?, val `shortChannelId`: kotlin.String? ) { public companion object @@ -732,9 +733,9 @@ public data class IBtChannel ( @kotlinx.serialization.Serializable public data class IBtChannelClose ( - val `txId`: kotlin.String, - val `closeType`: kotlin.String, - val `initiator`: kotlin.String, + val `txId`: kotlin.String, + val `closeType`: kotlin.String, + val `initiator`: kotlin.String, val `registeredAt`: kotlin.String ) { public companion object @@ -744,7 +745,7 @@ public data class IBtChannelClose ( @kotlinx.serialization.Serializable public data class IBtEstimateFeeResponse ( - val `feeSat`: kotlin.ULong, + val `feeSat`: kotlin.ULong, val `min0ConfTxFee`: IBt0ConfMinTxFeeWindow ) { public companion object @@ -754,9 +755,9 @@ public data class IBtEstimateFeeResponse ( @kotlinx.serialization.Serializable public data class IBtEstimateFeeResponse2 ( - val `feeSat`: kotlin.ULong, - val `networkFeeSat`: kotlin.ULong, - val `serviceFeeSat`: kotlin.ULong, + val `feeSat`: kotlin.ULong, + val `networkFeeSat`: kotlin.ULong, + val `serviceFeeSat`: kotlin.ULong, val `min0ConfTxFee`: IBt0ConfMinTxFeeWindow ) { public companion object @@ -766,10 +767,10 @@ public data class IBtEstimateFeeResponse2 ( @kotlinx.serialization.Serializable public data class IBtInfo ( - val `version`: kotlin.UInt, - val `nodes`: List, - val `options`: IBtInfoOptions, - val `versions`: IBtInfoVersions, + val `version`: kotlin.UInt, + val `nodes`: List, + val `options`: IBtInfoOptions, + val `versions`: IBtInfoVersions, val `onchain`: IBtInfoOnchain ) { public companion object @@ -779,7 +780,7 @@ public data class IBtInfo ( @kotlinx.serialization.Serializable public data class IBtInfoOnchain ( - val `network`: BitcoinNetworkEnum, + val `network`: BitcoinNetworkEnum, val `feeRates`: FeeRates ) { public companion object @@ -789,13 +790,13 @@ public data class IBtInfoOnchain ( @kotlinx.serialization.Serializable public data class IBtInfoOptions ( - val `minChannelSizeSat`: kotlin.ULong, - val `maxChannelSizeSat`: kotlin.ULong, - val `minExpiryWeeks`: kotlin.UInt, - val `maxExpiryWeeks`: kotlin.UInt, - val `minPaymentConfirmations`: kotlin.UInt, - val `minHighRiskPaymentConfirmations`: kotlin.UInt, - val `max0ConfClientBalanceSat`: kotlin.ULong, + val `minChannelSizeSat`: kotlin.ULong, + val `maxChannelSizeSat`: kotlin.ULong, + val `minExpiryWeeks`: kotlin.UInt, + val `maxExpiryWeeks`: kotlin.UInt, + val `minPaymentConfirmations`: kotlin.UInt, + val `minHighRiskPaymentConfirmations`: kotlin.UInt, + val `max0ConfClientBalanceSat`: kotlin.ULong, val `maxClientBalanceSat`: kotlin.ULong ) { public companion object @@ -805,8 +806,8 @@ public data class IBtInfoOptions ( @kotlinx.serialization.Serializable public data class IBtInfoVersions ( - val `http`: kotlin.String, - val `btc`: kotlin.String, + val `http`: kotlin.String, + val `btc`: kotlin.String, val `ln2`: kotlin.String ) { public companion object @@ -816,13 +817,13 @@ public data class IBtInfoVersions ( @kotlinx.serialization.Serializable public data class IBtOnchainTransaction ( - val `amountSat`: kotlin.ULong, - val `txId`: kotlin.String, - val `vout`: kotlin.UInt, - val `blockHeight`: kotlin.UInt?, - val `blockConfirmationCount`: kotlin.UInt, - val `feeRateSatPerVbyte`: kotlin.Double, - val `confirmed`: kotlin.Boolean, + val `amountSat`: kotlin.ULong, + val `txId`: kotlin.String, + val `vout`: kotlin.UInt, + val `blockHeight`: kotlin.UInt?, + val `blockConfirmationCount`: kotlin.UInt, + val `feeRateSatPerVbyte`: kotlin.Double, + val `confirmed`: kotlin.Boolean, val `suspicious0ConfReason`: kotlin.String ) { public companion object @@ -832,9 +833,9 @@ public data class IBtOnchainTransaction ( @kotlinx.serialization.Serializable public data class IBtOnchainTransactions ( - val `address`: kotlin.String, - val `confirmedSat`: kotlin.ULong, - val `requiredConfirmations`: kotlin.UInt, + val `address`: kotlin.String, + val `confirmedSat`: kotlin.ULong, + val `requiredConfirmations`: kotlin.UInt, val `transactions`: List ) { public companion object @@ -844,28 +845,28 @@ public data class IBtOnchainTransactions ( @kotlinx.serialization.Serializable public data class IBtOrder ( - val `id`: kotlin.String, - val `state`: BtOrderState, - val `state2`: BtOrderState2?, - val `feeSat`: kotlin.ULong, - val `networkFeeSat`: kotlin.ULong, - val `serviceFeeSat`: kotlin.ULong, - val `lspBalanceSat`: kotlin.ULong, - val `clientBalanceSat`: kotlin.ULong, - val `zeroConf`: kotlin.Boolean, - val `zeroReserve`: kotlin.Boolean, - val `clientNodeId`: kotlin.String?, - val `channelExpiryWeeks`: kotlin.UInt, - val `channelExpiresAt`: kotlin.String, - val `orderExpiresAt`: kotlin.String, - val `channel`: IBtChannel?, - val `lspNode`: ILspNode?, - val `lnurl`: kotlin.String?, - val `payment`: IBtPayment?, - val `couponCode`: kotlin.String?, - val `source`: kotlin.String?, - val `discount`: IDiscount?, - val `updatedAt`: kotlin.String, + val `id`: kotlin.String, + val `state`: BtOrderState, + val `state2`: BtOrderState2?, + val `feeSat`: kotlin.ULong, + val `networkFeeSat`: kotlin.ULong, + val `serviceFeeSat`: kotlin.ULong, + val `lspBalanceSat`: kotlin.ULong, + val `clientBalanceSat`: kotlin.ULong, + val `zeroConf`: kotlin.Boolean, + val `zeroReserve`: kotlin.Boolean, + val `clientNodeId`: kotlin.String?, + val `channelExpiryWeeks`: kotlin.UInt, + val `channelExpiresAt`: kotlin.String, + val `orderExpiresAt`: kotlin.String, + val `channel`: IBtChannel?, + val `lspNode`: ILspNode?, + val `lnurl`: kotlin.String?, + val `payment`: IBtPayment?, + val `couponCode`: kotlin.String?, + val `source`: kotlin.String?, + val `discount`: IDiscount?, + val `updatedAt`: kotlin.String, val `createdAt`: kotlin.String ) { public companion object @@ -875,12 +876,12 @@ public data class IBtOrder ( @kotlinx.serialization.Serializable public data class IBtPayment ( - val `state`: BtPaymentState, - val `state2`: BtPaymentState2?, - val `paidSat`: kotlin.ULong, - val `bolt11Invoice`: IBtBolt11Invoice?, - val `onchain`: IBtOnchainTransactions?, - val `isManuallyPaid`: kotlin.Boolean?, + val `state`: BtPaymentState, + val `state2`: BtPaymentState2?, + val `paidSat`: kotlin.ULong, + val `bolt11Invoice`: IBtBolt11Invoice?, + val `onchain`: IBtOnchainTransactions?, + val `isManuallyPaid`: kotlin.Boolean?, val `manualRefunds`: List? ) { public companion object @@ -890,23 +891,23 @@ public data class IBtPayment ( @kotlinx.serialization.Serializable public data class IcJitEntry ( - val `id`: kotlin.String, - val `state`: CJitStateEnum, - val `feeSat`: kotlin.ULong, - val `networkFeeSat`: kotlin.ULong, - val `serviceFeeSat`: kotlin.ULong, - val `channelSizeSat`: kotlin.ULong, - val `channelExpiryWeeks`: kotlin.UInt, - val `channelOpenError`: kotlin.String?, - val `nodeId`: kotlin.String, - val `invoice`: IBtBolt11Invoice, - val `channel`: IBtChannel?, - val `lspNode`: ILspNode, - val `couponCode`: kotlin.String, - val `source`: kotlin.String?, - val `discount`: IDiscount?, - val `expiresAt`: kotlin.String, - val `updatedAt`: kotlin.String, + val `id`: kotlin.String, + val `state`: CJitStateEnum, + val `feeSat`: kotlin.ULong, + val `networkFeeSat`: kotlin.ULong, + val `serviceFeeSat`: kotlin.ULong, + val `channelSizeSat`: kotlin.ULong, + val `channelExpiryWeeks`: kotlin.UInt, + val `channelOpenError`: kotlin.String?, + val `nodeId`: kotlin.String, + val `invoice`: IBtBolt11Invoice, + val `channel`: IBtChannel?, + val `lspNode`: ILspNode, + val `couponCode`: kotlin.String, + val `source`: kotlin.String?, + val `discount`: IDiscount?, + val `expiresAt`: kotlin.String, + val `updatedAt`: kotlin.String, val `createdAt`: kotlin.String ) { public companion object @@ -916,9 +917,9 @@ public data class IcJitEntry ( @kotlinx.serialization.Serializable public data class IDiscount ( - val `code`: kotlin.String, - val `absoluteSat`: kotlin.ULong, - val `relative`: kotlin.Double, + val `code`: kotlin.String, + val `absoluteSat`: kotlin.ULong, + val `relative`: kotlin.Double, val `overallSat`: kotlin.ULong ) { public companion object @@ -928,15 +929,15 @@ public data class IDiscount ( @kotlinx.serialization.Serializable public data class IGift ( - val `id`: kotlin.String, - val `nodeId`: kotlin.String, - val `orderId`: kotlin.String?, - val `order`: IGiftOrder?, - val `bolt11PaymentId`: kotlin.String?, - val `bolt11Payment`: IGiftPayment?, - val `appliedGiftCodeId`: kotlin.String?, - val `appliedGiftCode`: IGiftCode?, - val `createdAt`: kotlin.String?, + val `id`: kotlin.String, + val `nodeId`: kotlin.String, + val `orderId`: kotlin.String?, + val `order`: IGiftOrder?, + val `bolt11PaymentId`: kotlin.String?, + val `bolt11Payment`: IGiftPayment?, + val `appliedGiftCodeId`: kotlin.String?, + val `appliedGiftCode`: IGiftCode?, + val `createdAt`: kotlin.String?, val `updatedAt`: kotlin.String? ) { public companion object @@ -946,16 +947,16 @@ public data class IGift ( @kotlinx.serialization.Serializable public data class IGiftBolt11Invoice ( - val `id`: kotlin.String, - val `request`: kotlin.String, - val `state`: kotlin.String, - val `isHodlInvoice`: kotlin.Boolean?, - val `paymentHash`: kotlin.String?, - val `amountSat`: kotlin.ULong?, - val `amountMsat`: kotlin.String?, - val `internalNodePubkey`: kotlin.String?, - val `updatedAt`: kotlin.String?, - val `createdAt`: kotlin.String?, + val `id`: kotlin.String, + val `request`: kotlin.String, + val `state`: kotlin.String, + val `isHodlInvoice`: kotlin.Boolean?, + val `paymentHash`: kotlin.String?, + val `amountSat`: kotlin.ULong?, + val `amountMsat`: kotlin.String?, + val `internalNodePubkey`: kotlin.String?, + val `updatedAt`: kotlin.String?, + val `createdAt`: kotlin.String?, val `expiresAt`: kotlin.String? ) { public companion object @@ -965,14 +966,14 @@ public data class IGiftBolt11Invoice ( @kotlinx.serialization.Serializable public data class IGiftBtcAddress ( - val `id`: kotlin.String, - val `address`: kotlin.String, - val `transactions`: List, - val `allTransactions`: List, - val `isBlacklisted`: kotlin.Boolean?, - val `watchUntil`: kotlin.String?, - val `watchForBlockConfirmations`: kotlin.UInt?, - val `updatedAt`: kotlin.String?, + val `id`: kotlin.String, + val `address`: kotlin.String, + val `transactions`: List, + val `allTransactions`: List, + val `isBlacklisted`: kotlin.Boolean?, + val `watchUntil`: kotlin.String?, + val `watchForBlockConfirmations`: kotlin.UInt?, + val `updatedAt`: kotlin.String?, val `createdAt`: kotlin.String? ) { public companion object @@ -982,13 +983,13 @@ public data class IGiftBtcAddress ( @kotlinx.serialization.Serializable public data class IGiftCode ( - val `id`: kotlin.String, - val `code`: kotlin.String, - val `createdAt`: kotlin.String, - val `updatedAt`: kotlin.String, - val `expiresAt`: kotlin.String, - val `giftSat`: kotlin.ULong?, - val `scope`: kotlin.String?, + val `id`: kotlin.String, + val `code`: kotlin.String, + val `createdAt`: kotlin.String, + val `updatedAt`: kotlin.String, + val `expiresAt`: kotlin.String, + val `giftSat`: kotlin.ULong?, + val `scope`: kotlin.String?, val `maxCount`: kotlin.UInt? ) { public companion object @@ -998,8 +999,8 @@ public data class IGiftCode ( @kotlinx.serialization.Serializable public data class IGiftLspNode ( - val `alias`: kotlin.String, - val `pubkey`: kotlin.String, + val `alias`: kotlin.String, + val `pubkey`: kotlin.String, val `connectionStrings`: List ) { public companion object @@ -1009,27 +1010,27 @@ public data class IGiftLspNode ( @kotlinx.serialization.Serializable public data class IGiftOrder ( - val `id`: kotlin.String, - val `state`: kotlin.String, - val `oldState`: kotlin.String?, - val `isChannelExpired`: kotlin.Boolean?, - val `isOrderExpired`: kotlin.Boolean?, - val `lspBalanceSat`: kotlin.ULong?, - val `clientBalanceSat`: kotlin.ULong?, - val `channelExpiryWeeks`: kotlin.UInt?, - val `zeroConf`: kotlin.Boolean?, - val `zeroReserve`: kotlin.Boolean?, - val `announced`: kotlin.Boolean?, - val `clientNodeId`: kotlin.String?, - val `channelExpiresAt`: kotlin.String?, - val `orderExpiresAt`: kotlin.String?, - val `feeSat`: kotlin.ULong?, - val `networkFeeSat`: kotlin.ULong?, - val `serviceFeeSat`: kotlin.ULong?, - val `payment`: IGiftPayment?, - val `lspNode`: IGiftLspNode?, - val `updatedAt`: kotlin.String?, - val `createdAt`: kotlin.String?, + val `id`: kotlin.String, + val `state`: kotlin.String, + val `oldState`: kotlin.String?, + val `isChannelExpired`: kotlin.Boolean?, + val `isOrderExpired`: kotlin.Boolean?, + val `lspBalanceSat`: kotlin.ULong?, + val `clientBalanceSat`: kotlin.ULong?, + val `channelExpiryWeeks`: kotlin.UInt?, + val `zeroConf`: kotlin.Boolean?, + val `zeroReserve`: kotlin.Boolean?, + val `announced`: kotlin.Boolean?, + val `clientNodeId`: kotlin.String?, + val `channelExpiresAt`: kotlin.String?, + val `orderExpiresAt`: kotlin.String?, + val `feeSat`: kotlin.ULong?, + val `networkFeeSat`: kotlin.ULong?, + val `serviceFeeSat`: kotlin.ULong?, + val `payment`: IGiftPayment?, + val `lspNode`: IGiftLspNode?, + val `updatedAt`: kotlin.String?, + val `createdAt`: kotlin.String?, val `nodeIdVerified`: kotlin.Boolean? ) { public companion object @@ -1039,25 +1040,25 @@ public data class IGiftOrder ( @kotlinx.serialization.Serializable public data class IGiftPayment ( - val `id`: kotlin.String, - val `state`: kotlin.String, - val `oldState`: kotlin.String?, - val `onchainState`: kotlin.String?, - val `lnState`: kotlin.String?, - val `paidOnchainSat`: kotlin.ULong?, - val `paidLnSat`: kotlin.ULong?, - val `paidSat`: kotlin.ULong?, - val `isOverpaid`: kotlin.Boolean?, - val `isRefunded`: kotlin.Boolean?, - val `overpaidAmountSat`: kotlin.ULong?, - val `requiredOnchainConfirmations`: kotlin.UInt?, - val `settlementState`: kotlin.String?, - val `expectedAmountSat`: kotlin.ULong?, - val `isManuallyPaid`: kotlin.Boolean?, - val `btcAddress`: IGiftBtcAddress?, - val `btcAddressId`: kotlin.String?, - val `bolt11Invoice`: IGiftBolt11Invoice?, - val `bolt11InvoiceId`: kotlin.String?, + val `id`: kotlin.String, + val `state`: kotlin.String, + val `oldState`: kotlin.String?, + val `onchainState`: kotlin.String?, + val `lnState`: kotlin.String?, + val `paidOnchainSat`: kotlin.ULong?, + val `paidLnSat`: kotlin.ULong?, + val `paidSat`: kotlin.ULong?, + val `isOverpaid`: kotlin.Boolean?, + val `isRefunded`: kotlin.Boolean?, + val `overpaidAmountSat`: kotlin.ULong?, + val `requiredOnchainConfirmations`: kotlin.UInt?, + val `settlementState`: kotlin.String?, + val `expectedAmountSat`: kotlin.ULong?, + val `isManuallyPaid`: kotlin.Boolean?, + val `btcAddress`: IGiftBtcAddress?, + val `btcAddressId`: kotlin.String?, + val `bolt11Invoice`: IGiftBolt11Invoice?, + val `bolt11InvoiceId`: kotlin.String?, val `manualRefunds`: List ) { public companion object @@ -1067,9 +1068,9 @@ public data class IGiftPayment ( @kotlinx.serialization.Serializable public data class ILspNode ( - val `alias`: kotlin.String, - val `pubkey`: kotlin.String, - val `connectionStrings`: List, + val `alias`: kotlin.String, + val `pubkey`: kotlin.String, + val `connectionStrings`: List, val `readonly`: kotlin.Boolean? ) { public companion object @@ -1079,12 +1080,12 @@ public data class ILspNode ( @kotlinx.serialization.Serializable public data class IManualRefund ( - val `amountSat`: kotlin.ULong, - val `target`: kotlin.String, - val `state`: ManualRefundStateEnum, - val `createdByName`: kotlin.String, - val `votedByName`: kotlin.String?, - val `reason`: kotlin.String?, + val `amountSat`: kotlin.ULong, + val `target`: kotlin.String, + val `state`: ManualRefundStateEnum, + val `createdByName`: kotlin.String, + val `votedByName`: kotlin.String?, + val `reason`: kotlin.String?, val `targetType`: kotlin.String ) { public companion object @@ -1097,7 +1098,7 @@ public data class LegacyRnCloseRecoveryScanResult ( /** * Total balance found in legacy RN P2WPKH close outputs (in satoshis). */ - val `totalAmount`: kotlin.ULong, + val `totalAmount`: kotlin.ULong, /** * Number of P2WPKH outputs found. */ @@ -1113,31 +1114,31 @@ public data class LegacyRnCloseRecoverySweepPreview ( /** * Fully signed raw sweep transaction hex. Broadcast only after user confirmation. */ - val `txHex`: kotlin.String, + val `txHex`: kotlin.String, /** * Transaction id of the sweep transaction. */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * Total input amount in satoshis. */ - val `totalAmount`: kotlin.ULong, + val `totalAmount`: kotlin.ULong, /** * Fee in satoshis. */ - val `estimatedFee`: kotlin.ULong, + val `estimatedFee`: kotlin.ULong, /** * Transaction virtual size in vbytes. */ - val `estimatedVsize`: kotlin.ULong, + val `estimatedVsize`: kotlin.ULong, /** * Number of recovered outputs swept. */ - val `outputsCount`: kotlin.UInt, + val `outputsCount`: kotlin.UInt, /** * Destination address receiving the sweep. */ - val `destinationAddress`: kotlin.String, + val `destinationAddress`: kotlin.String, /** * Amount sent to destination after fees. */ @@ -1150,18 +1151,19 @@ public data class LegacyRnCloseRecoverySweepPreview ( @kotlinx.serialization.Serializable public data class LightningActivity ( - val `id`: kotlin.String, - val `txType`: PaymentType, - val `status`: PaymentState, - val `value`: kotlin.ULong, - val `fee`: kotlin.ULong?, - val `invoice`: kotlin.String, - val `message`: kotlin.String, - val `timestamp`: kotlin.ULong, - val `preimage`: kotlin.String?, - val `contact`: kotlin.String?, - val `createdAt`: kotlin.ULong?, - val `updatedAt`: kotlin.ULong?, + val `walletId`: kotlin.String, + val `id`: kotlin.String, + val `txType`: PaymentType, + val `status`: PaymentState, + val `value`: kotlin.ULong, + val `fee`: kotlin.ULong?, + val `invoice`: kotlin.String, + val `message`: kotlin.String, + val `timestamp`: kotlin.ULong, + val `preimage`: kotlin.String?, + val `contact`: kotlin.String?, + val `createdAt`: kotlin.ULong?, + val `updatedAt`: kotlin.ULong?, val `seenAt`: kotlin.ULong? ) { public companion object @@ -1171,14 +1173,14 @@ public data class LightningActivity ( @kotlinx.serialization.Serializable public data class LightningInvoice ( - val `bolt11`: kotlin.String, - val `paymentHash`: kotlin.ByteArray, - val `amountSatoshis`: kotlin.ULong, - val `timestampSeconds`: kotlin.ULong, - val `expirySeconds`: kotlin.ULong, - val `isExpired`: kotlin.Boolean, - val `description`: kotlin.String?, - val `networkType`: NetworkType, + val `bolt11`: kotlin.String, + val `paymentHash`: kotlin.ByteArray, + val `amountSatoshis`: kotlin.ULong, + val `timestampSeconds`: kotlin.ULong, + val `expirySeconds`: kotlin.ULong, + val `isExpired`: kotlin.Boolean, + val `description`: kotlin.String?, + val `networkType`: NetworkType, val `payeeNodeId`: kotlin.ByteArray? ) { override fun equals(other: Any?): Boolean { @@ -1220,8 +1222,8 @@ public data class LightningInvoice ( @kotlinx.serialization.Serializable public data class LnurlAddressData ( - val `uri`: kotlin.String, - val `domain`: kotlin.String, + val `uri`: kotlin.String, + val `domain`: kotlin.String, val `username`: kotlin.String ) { public companion object @@ -1231,9 +1233,9 @@ public data class LnurlAddressData ( @kotlinx.serialization.Serializable public data class LnurlAuthData ( - val `uri`: kotlin.String, - val `tag`: kotlin.String, - val `k1`: kotlin.String, + val `uri`: kotlin.String, + val `tag`: kotlin.String, + val `k1`: kotlin.String, val `domain`: kotlin.String ) { public companion object @@ -1243,9 +1245,9 @@ public data class LnurlAuthData ( @kotlinx.serialization.Serializable public data class LnurlChannelData ( - val `uri`: kotlin.String, - val `callback`: kotlin.String, - val `k1`: kotlin.String, + val `uri`: kotlin.String, + val `callback`: kotlin.String, + val `k1`: kotlin.String, val `tag`: kotlin.String ) { public companion object @@ -1255,13 +1257,13 @@ public data class LnurlChannelData ( @kotlinx.serialization.Serializable public data class LnurlPayData ( - val `uri`: kotlin.String, - val `callback`: kotlin.String, - val `minSendable`: kotlin.ULong, - val `maxSendable`: kotlin.ULong, - val `metadataStr`: kotlin.String, - val `commentAllowed`: kotlin.UInt?, - val `allowsNostr`: kotlin.Boolean, + val `uri`: kotlin.String, + val `callback`: kotlin.String, + val `minSendable`: kotlin.ULong, + val `maxSendable`: kotlin.ULong, + val `metadataStr`: kotlin.String, + val `commentAllowed`: kotlin.UInt?, + val `allowsNostr`: kotlin.Boolean, val `nostrPubkey`: kotlin.ByteArray? ) { override fun equals(other: Any?): Boolean { @@ -1301,12 +1303,12 @@ public data class LnurlPayData ( @kotlinx.serialization.Serializable public data class LnurlWithdrawData ( - val `uri`: kotlin.String, - val `callback`: kotlin.String, - val `k1`: kotlin.String, - val `defaultDescription`: kotlin.String, - val `minWithdrawable`: kotlin.ULong?, - val `maxWithdrawable`: kotlin.ULong, + val `uri`: kotlin.String, + val `callback`: kotlin.String, + val `k1`: kotlin.String, + val `defaultDescription`: kotlin.String, + val `minWithdrawable`: kotlin.ULong?, + val `maxWithdrawable`: kotlin.ULong, val `tag`: kotlin.String ) { public companion object @@ -1322,19 +1324,19 @@ public data class NativeDeviceInfo ( /** * Unique path/identifier for this device */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Transport type: "usb" or "bluetooth" */ - val `transportType`: kotlin.String, + val `transportType`: kotlin.String, /** * Optional device name (from BLE advertisement or USB descriptor) */ - val `name`: kotlin.String?, + val `name`: kotlin.String?, /** * USB Vendor ID (for USB devices) */ - val `vendorId`: kotlin.UShort?, + val `vendorId`: kotlin.UShort?, /** * USB Product ID (for USB devices) */ @@ -1347,10 +1349,10 @@ public data class NativeDeviceInfo ( @kotlinx.serialization.Serializable public data class OnChainInvoice ( - val `address`: kotlin.String, - val `amountSatoshis`: kotlin.ULong, - val `label`: kotlin.String?, - val `message`: kotlin.String?, + val `address`: kotlin.String, + val `amountSatoshis`: kotlin.ULong, + val `label`: kotlin.String?, + val `message`: kotlin.String?, val `params`: Map? ) { public companion object @@ -1360,25 +1362,26 @@ public data class OnChainInvoice ( @kotlinx.serialization.Serializable public data class OnchainActivity ( - val `id`: kotlin.String, - val `txType`: PaymentType, - val `txId`: kotlin.String, - val `value`: kotlin.ULong, - val `fee`: kotlin.ULong, - val `feeRate`: kotlin.ULong, - val `address`: kotlin.String, - val `confirmed`: kotlin.Boolean, - val `timestamp`: kotlin.ULong, - val `isBoosted`: kotlin.Boolean, - val `boostTxIds`: List, - val `isTransfer`: kotlin.Boolean, - val `doesExist`: kotlin.Boolean, - val `confirmTimestamp`: kotlin.ULong?, - val `channelId`: kotlin.String?, - val `transferTxId`: kotlin.String?, - val `contact`: kotlin.String?, - val `createdAt`: kotlin.ULong?, - val `updatedAt`: kotlin.ULong?, + val `walletId`: kotlin.String, + val `id`: kotlin.String, + val `txType`: PaymentType, + val `txId`: kotlin.String, + val `value`: kotlin.ULong, + val `fee`: kotlin.ULong, + val `feeRate`: kotlin.ULong, + val `address`: kotlin.String, + val `confirmed`: kotlin.Boolean, + val `timestamp`: kotlin.ULong, + val `isBoosted`: kotlin.Boolean, + val `boostTxIds`: List, + val `isTransfer`: kotlin.Boolean, + val `doesExist`: kotlin.Boolean, + val `confirmTimestamp`: kotlin.ULong?, + val `channelId`: kotlin.String?, + val `transferTxId`: kotlin.String?, + val `contact`: kotlin.String?, + val `createdAt`: kotlin.ULong?, + val `updatedAt`: kotlin.ULong?, val `seenAt`: kotlin.ULong? ) { public companion object @@ -1388,15 +1391,16 @@ public data class OnchainActivity ( @kotlinx.serialization.Serializable public data class PreActivityMetadata ( - val `paymentId`: kotlin.String, - val `tags`: List, - val `paymentHash`: kotlin.String?, - val `txId`: kotlin.String?, - val `address`: kotlin.String?, - val `isReceive`: kotlin.Boolean, - val `feeRate`: kotlin.ULong, - val `isTransfer`: kotlin.Boolean, - val `channelId`: kotlin.String?, + val `walletId`: kotlin.String, + val `paymentId`: kotlin.String, + val `tags`: List, + val `paymentHash`: kotlin.String?, + val `txId`: kotlin.String?, + val `address`: kotlin.String?, + val `isReceive`: kotlin.Boolean, + val `feeRate`: kotlin.ULong, + val `isTransfer`: kotlin.Boolean, + val `channelId`: kotlin.String?, val `createdAt`: kotlin.ULong ) { public companion object @@ -1421,19 +1425,19 @@ public data class PubkyAuthDetails ( /** * Whether this is a signin or signup flow. */ - val `kind`: PubkyAuthKind, + val `kind`: PubkyAuthKind, /** * Requested capabilities (e.g. `"/pub/pubky.app/:rw"`). */ - val `capabilities`: kotlin.String, + val `capabilities`: kotlin.String, /** * Relay URL used for the auth exchange. */ - val `relay`: kotlin.String, + val `relay`: kotlin.String, /** * Homeserver public key (z32-encoded). Present only for signup flows. */ - val `homeserver`: kotlin.String?, + val `homeserver`: kotlin.String?, /** * Signup token. Present only for signup flows. */ @@ -1446,10 +1450,10 @@ public data class PubkyAuthDetails ( @kotlinx.serialization.Serializable public data class PubkyProfile ( - val `name`: kotlin.String, - val `bio`: kotlin.String?, - val `image`: kotlin.String?, - val `links`: List?, + val `name`: kotlin.String, + val `bio`: kotlin.String?, + val `image`: kotlin.String?, + val `links`: List?, val `status`: kotlin.String? ) { public companion object @@ -1459,7 +1463,7 @@ public data class PubkyProfile ( @kotlinx.serialization.Serializable public data class PubkyProfileLink ( - val `title`: kotlin.String, + val `title`: kotlin.String, val `url`: kotlin.String ) { public companion object @@ -1475,19 +1479,19 @@ public data class SingleAddressInfoResult ( /** * The queried address */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * Total confirmed balance in satoshis */ - val `balance`: kotlin.ULong, + val `balance`: kotlin.ULong, /** * UTXOs for this address */ - val `utxos`: List, + val `utxos`: List, /** * Number of transactions involving this address */ - val `transfers`: kotlin.UInt, + val `transfers`: kotlin.UInt, /** * Current blockchain tip height */ @@ -1503,15 +1507,15 @@ public data class SweepResult ( /** * The transaction ID of the sweep transaction */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * The total amount swept (in satoshis) */ - val `amountSwept`: kotlin.ULong, + val `amountSwept`: kotlin.ULong, /** * The fee paid (in satoshis) */ - val `feePaid`: kotlin.ULong, + val `feePaid`: kotlin.ULong, /** * The number of UTXOs swept */ @@ -1527,27 +1531,27 @@ public data class SweepTransactionPreview ( /** * The PSBT (Partially Signed Bitcoin Transaction) in base64 format */ - val `psbt`: kotlin.String, + val `psbt`: kotlin.String, /** * The total amount available to sweep (in satoshis) */ - val `totalAmount`: kotlin.ULong, + val `totalAmount`: kotlin.ULong, /** * The estimated fee for the transaction (in satoshis) */ - val `estimatedFee`: kotlin.ULong, + val `estimatedFee`: kotlin.ULong, /** * The estimated virtual size of the transaction (in vbytes) */ - val `estimatedVsize`: kotlin.ULong, + val `estimatedVsize`: kotlin.ULong, /** * The number of UTXOs that will be swept */ - val `utxosCount`: kotlin.UInt, + val `utxosCount`: kotlin.UInt, /** * The destination address */ - val `destinationAddress`: kotlin.String, + val `destinationAddress`: kotlin.String, /** * The amount that will be sent to destination after fees (in satoshis) */ @@ -1563,31 +1567,31 @@ public data class SweepableBalances ( /** * Balance in legacy (P2PKH) addresses (in satoshis) */ - val `legacyBalance`: kotlin.ULong, + val `legacyBalance`: kotlin.ULong, /** * Balance in P2SH-SegWit (P2SH-P2WPKH) addresses (in satoshis) */ - val `p2shBalance`: kotlin.ULong, + val `p2shBalance`: kotlin.ULong, /** * Balance in Taproot (P2TR) addresses (in satoshis) */ - val `taprootBalance`: kotlin.ULong, + val `taprootBalance`: kotlin.ULong, /** * Total balance across all wallet types (in satoshis) */ - val `totalBalance`: kotlin.ULong, + val `totalBalance`: kotlin.ULong, /** * Number of UTXOs in legacy wallet */ - val `legacyUtxosCount`: kotlin.UInt, + val `legacyUtxosCount`: kotlin.UInt, /** * Number of UTXOs in P2SH-SegWit wallet */ - val `p2shUtxosCount`: kotlin.UInt, + val `p2shUtxosCount`: kotlin.UInt, /** * Number of UTXOs in Taproot wallet */ - val `taprootUtxosCount`: kotlin.UInt, + val `taprootUtxosCount`: kotlin.UInt, /** * Total number of UTXOs across all wallet types */ @@ -1606,63 +1610,63 @@ public data class TransactionDetail ( /** * Transaction ID (hex) */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * Amount received by the wallet (sats) */ - val `received`: kotlin.ULong, + val `received`: kotlin.ULong, /** * Amount sent by the wallet (sats) — includes change sent back to self */ - val `sent`: kotlin.ULong, + val `sent`: kotlin.ULong, /** * Net value from wallet's perspective: received - sent (positive = inflow, negative = outflow) */ - val `net`: kotlin.Long, + val `net`: kotlin.Long, /** * Display amount in sats (same semantics as HistoryTransaction.amount) */ - val `amount`: kotlin.ULong, + val `amount`: kotlin.ULong, /** * Transaction fee in sats (None if not available) */ - val `fee`: kotlin.ULong?, + val `fee`: kotlin.ULong?, /** * Transaction direction */ - val `direction`: TxDirection, + val `direction`: TxDirection, /** * Block height (None if unconfirmed/mempool) */ - val `blockHeight`: kotlin.UInt?, + val `blockHeight`: kotlin.UInt?, /** * Block timestamp as unix epoch seconds (None if unconfirmed) */ - val `timestamp`: kotlin.ULong?, + val `timestamp`: kotlin.ULong?, /** * Number of confirmations (0 if unconfirmed) */ - val `confirmations`: kotlin.UInt, + val `confirmations`: kotlin.UInt, /** * Transaction inputs */ - val `inputs`: List, + val `inputs`: List, /** * Transaction outputs */ - val `outputs`: List, + val `outputs`: List, /** * Serialized transaction size in bytes */ - val `size`: kotlin.UInt, + val `size`: kotlin.UInt, /** * Virtual size in vbytes (ceil(weight / 4)) */ - val `vsize`: kotlin.UInt, + val `vsize`: kotlin.UInt, /** * Transaction weight in weight units */ - val `weight`: kotlin.UInt, + val `weight`: kotlin.UInt, /** * Fee rate in sat/vB (fee / vsize), None if fee is unavailable or vsize is zero */ @@ -1678,10 +1682,11 @@ public data class TransactionDetail ( */ @kotlinx.serialization.Serializable public data class TransactionDetails ( + val `walletId`: kotlin.String, /** * The transaction ID. */ - val `txId`: kotlin.String, + val `txId`: kotlin.String, /** * The net amount in this transaction (in satoshis). * @@ -1690,11 +1695,11 @@ public data class TransactionDetails ( * * Note: This amount does NOT include transaction fees. */ - val `amountSats`: kotlin.Long, + val `amountSats`: kotlin.Long, /** * The transaction inputs with full details. */ - val `inputs`: List, + val `inputs`: List, /** * The transaction outputs with full details. */ @@ -1713,19 +1718,19 @@ public data class TransactionHistoryResult ( /** * All transactions, sorted: unconfirmed first, then by timestamp descending */ - val `transactions`: List, + val `transactions`: List, /** * Balance breakdown */ - val `balance`: WalletBalance, + val `balance`: WalletBalance, /** * Total number of transactions */ - val `txCount`: kotlin.UInt, + val `txCount`: kotlin.UInt, /** * Current blockchain tip height */ - val `blockHeight`: kotlin.UInt, + val `blockHeight`: kotlin.UInt, /** * The detected or specified account type */ @@ -1744,7 +1749,7 @@ public data class TrezorAddressResponse ( /** * The Bitcoin address */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * The serialized path (e.g., "m/84'/0'/0'/0/0") */ @@ -1763,15 +1768,15 @@ public data class TrezorCallMessageResult ( /** * Whether the call succeeded */ - val `success`: kotlin.Boolean, + val `success`: kotlin.Boolean, /** * Response message type */ - val `messageType`: kotlin.UShort, + val `messageType`: kotlin.UShort, /** * Response protobuf data */ - val `data`: kotlin.ByteArray, + val `data`: kotlin.ByteArray, /** * Error message (empty on success) */ @@ -1809,27 +1814,27 @@ public data class TrezorDeviceInfo ( /** * Unique identifier for the device */ - val `id`: kotlin.String, + val `id`: kotlin.String, /** * Transport type (USB or Bluetooth) */ - val `transportType`: TrezorTransportType, + val `transportType`: TrezorTransportType, /** * Device name (from BLE advertisement or USB descriptor) */ - val `name`: kotlin.String?, + val `name`: kotlin.String?, /** * Transport-specific path (used internally for connection) */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Device label (set by user during device setup) */ - val `label`: kotlin.String?, + val `label`: kotlin.String?, /** * Device model (e.g., "T2", "Safe 5", "Safe 7") */ - val `model`: kotlin.String?, + val `model`: kotlin.String?, /** * Whether the device is in bootloader mode */ @@ -1848,47 +1853,47 @@ public data class TrezorFeatures ( /** * Vendor string */ - val `vendor`: kotlin.String?, + val `vendor`: kotlin.String?, /** * Device model */ - val `model`: kotlin.String?, + val `model`: kotlin.String?, /** * Device label (set by user during device setup) */ - val `label`: kotlin.String?, + val `label`: kotlin.String?, /** * Device ID (unique per device) */ - val `deviceId`: kotlin.String?, + val `deviceId`: kotlin.String?, /** * Major firmware version */ - val `majorVersion`: kotlin.UInt?, + val `majorVersion`: kotlin.UInt?, /** * Minor firmware version */ - val `minorVersion`: kotlin.UInt?, + val `minorVersion`: kotlin.UInt?, /** * Patch firmware version */ - val `patchVersion`: kotlin.UInt?, + val `patchVersion`: kotlin.UInt?, /** * Whether PIN protection is enabled */ - val `pinProtection`: kotlin.Boolean?, + val `pinProtection`: kotlin.Boolean?, /** * Whether passphrase protection is enabled */ - val `passphraseProtection`: kotlin.Boolean?, + val `passphraseProtection`: kotlin.Boolean?, /** * Whether the device is initialized with a seed */ - val `initialized`: kotlin.Boolean?, + val `initialized`: kotlin.Boolean?, /** * Whether the device needs backup */ - val `needsBackup`: kotlin.Boolean?, + val `needsBackup`: kotlin.Boolean?, /** * Whether the device can accept passphrase entry on the device itself * (`Capability_PassphraseEntry`). When false/None, use host entry only. @@ -1908,15 +1913,15 @@ public data class TrezorGetAddressParams ( /** * BIP32 path (e.g., "m/84'/0'/0'/0/0") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Coin network (default: Bitcoin) */ - val `coin`: TrezorCoinType?, + val `coin`: TrezorCoinType?, /** * Whether to display the address on the device for confirmation */ - val `showOnTrezor`: kotlin.Boolean, + val `showOnTrezor`: kotlin.Boolean, /** * Script type (auto-detected from path if not specified) */ @@ -1935,11 +1940,11 @@ public data class TrezorGetPublicKeyParams ( /** * BIP32 path (e.g., "m/84'/0'/0'") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Coin network (default: Bitcoin) */ - val `coin`: TrezorCoinType?, + val `coin`: TrezorCoinType?, /** * Whether to display on device for confirmation */ @@ -1958,19 +1963,19 @@ public data class TrezorPrevTx ( /** * Transaction hash (hex encoded) */ - val `hash`: kotlin.String, + val `hash`: kotlin.String, /** * Transaction version */ - val `version`: kotlin.UInt, + val `version`: kotlin.UInt, /** * Lock time */ - val `lockTime`: kotlin.UInt, + val `lockTime`: kotlin.UInt, /** * Transaction inputs */ - val `inputs`: List, + val `inputs`: List, /** * Transaction outputs */ @@ -1989,15 +1994,15 @@ public data class TrezorPrevTxInput ( /** * Previous transaction hash (hex encoded) */ - val `prevHash`: kotlin.String, + val `prevHash`: kotlin.String, /** * Previous output index */ - val `prevIndex`: kotlin.UInt, + val `prevIndex`: kotlin.UInt, /** * Script signature (hex encoded) */ - val `scriptSig`: kotlin.String, + val `scriptSig`: kotlin.String, /** * Sequence number */ @@ -2016,7 +2021,7 @@ public data class TrezorPrevTxOutput ( /** * Amount in satoshis */ - val `amount`: kotlin.ULong, + val `amount`: kotlin.ULong, /** * Script pubkey (hex encoded) */ @@ -2035,27 +2040,27 @@ public data class TrezorPublicKeyResponse ( /** * Extended public key (xpub) */ - val `xpub`: kotlin.String, + val `xpub`: kotlin.String, /** * The serialized path (e.g., "m/84'/0'/0'") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Compressed public key (hex encoded) */ - val `publicKey`: kotlin.String, + val `publicKey`: kotlin.String, /** * Chain code (hex encoded) */ - val `chainCode`: kotlin.String, + val `chainCode`: kotlin.String, /** * Parent key fingerprint */ - val `fingerprint`: kotlin.UInt, + val `fingerprint`: kotlin.UInt, /** * Derivation depth */ - val `depth`: kotlin.UInt, + val `depth`: kotlin.UInt, /** * Master root fingerprint (from the device's master seed) */ @@ -2074,11 +2079,11 @@ public data class TrezorSignMessageParams ( /** * BIP32 path for the signing key (e.g., "m/84'/0'/0'/0/0") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Message to sign */ - val `message`: kotlin.String, + val `message`: kotlin.String, /** * Coin network (default: Bitcoin) */ @@ -2097,23 +2102,23 @@ public data class TrezorSignTxParams ( /** * Transaction inputs */ - val `inputs`: List, + val `inputs`: List, /** * Transaction outputs */ - val `outputs`: List, + val `outputs`: List, /** * Coin network (default: Bitcoin) */ - val `coin`: TrezorCoinType?, + val `coin`: TrezorCoinType?, /** * Lock time (default: 0) */ - val `lockTime`: kotlin.UInt?, + val `lockTime`: kotlin.UInt?, /** * Version (default: 2) */ - val `version`: kotlin.UInt?, + val `version`: kotlin.UInt?, /** * Previous transactions (for non-SegWit input verification) */ @@ -2132,7 +2137,7 @@ public data class TrezorSignedMessageResponse ( /** * Bitcoin address that signed the message */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * Signature (base64 encoded) */ @@ -2151,11 +2156,11 @@ public data class TrezorSignedTx ( /** * Signatures for each input (hex encoded) */ - val `signatures`: List, + val `signatures`: List, /** * Serialized transaction (hex) */ - val `serializedTx`: kotlin.String, + val `serializedTx`: kotlin.String, /** * Broadcast transaction ID (populated when push=true) */ @@ -2174,11 +2179,11 @@ public data class TrezorTransportReadResult ( /** * Whether the read succeeded */ - val `success`: kotlin.Boolean, + val `success`: kotlin.Boolean, /** * Data read (empty on failure) */ - val `data`: kotlin.ByteArray, + val `data`: kotlin.ByteArray, /** * Error message (empty on success) */ @@ -2214,7 +2219,7 @@ public data class TrezorTransportWriteResult ( /** * Whether the operation succeeded */ - val `success`: kotlin.Boolean, + val `success`: kotlin.Boolean, /** * Error message (empty on success) */ @@ -2233,31 +2238,31 @@ public data class TrezorTxInput ( /** * Previous transaction hash (hex, 32 bytes) */ - val `prevHash`: kotlin.String, + val `prevHash`: kotlin.String, /** * Previous output index */ - val `prevIndex`: kotlin.UInt, + val `prevIndex`: kotlin.UInt, /** * BIP32 derivation path (e.g., "m/84'/0'/0'/0/0") */ - val `path`: kotlin.String, + val `path`: kotlin.String, /** * Amount in satoshis */ - val `amount`: kotlin.ULong, + val `amount`: kotlin.ULong, /** * Script type */ - val `scriptType`: TrezorScriptType, + val `scriptType`: TrezorScriptType, /** * Sequence number (default: 0xFFFFFFFD for RBF) */ - val `sequence`: kotlin.UInt?, + val `sequence`: kotlin.UInt?, /** * Original transaction hash for RBF replacement (hex encoded) */ - val `origHash`: kotlin.String?, + val `origHash`: kotlin.String?, /** * Original input index for RBF replacement */ @@ -2276,27 +2281,27 @@ public data class TrezorTxOutput ( /** * Destination address (for external outputs) */ - val `address`: kotlin.String?, + val `address`: kotlin.String?, /** * BIP32 path (for change outputs) */ - val `path`: kotlin.String?, + val `path`: kotlin.String?, /** * Amount in satoshis */ - val `amount`: kotlin.ULong, + val `amount`: kotlin.ULong, /** * Script type (for change outputs) */ - val `scriptType`: TrezorScriptType?, + val `scriptType`: TrezorScriptType?, /** * OP_RETURN data (hex encoded, for data outputs) */ - val `opReturnData`: kotlin.String?, + val `opReturnData`: kotlin.String?, /** * Original transaction hash for RBF replacement (hex encoded) */ - val `origHash`: kotlin.String?, + val `origHash`: kotlin.String?, /** * Original output index for RBF replacement */ @@ -2315,15 +2320,15 @@ public data class TrezorVerifyMessageParams ( /** * Bitcoin address that signed the message */ - val `address`: kotlin.String, + val `address`: kotlin.String, /** * Signature (base64 encoded) */ - val `signature`: kotlin.String, + val `signature`: kotlin.String, /** * Original message */ - val `message`: kotlin.String, + val `message`: kotlin.String, /** * Coin network (default: Bitcoin) */ @@ -2342,19 +2347,19 @@ public data class TxDetailInput ( /** * Previous output transaction ID (hex) */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * Previous output index */ - val `vout`: kotlin.UInt, + val `vout`: kotlin.UInt, /** * Sequence number */ - val `sequence`: kotlin.UInt, + val `sequence`: kotlin.UInt, /** * Script signature (hex-encoded) */ - val `scriptSig`: kotlin.String, + val `scriptSig`: kotlin.String, /** * Witness stack (each element hex-encoded) */ @@ -2373,15 +2378,15 @@ public data class TxDetailOutput ( /** * Output value in sats */ - val `value`: kotlin.ULong, + val `value`: kotlin.ULong, /** * Script public key (hex-encoded) */ - val `scriptPubkey`: kotlin.String, + val `scriptPubkey`: kotlin.String, /** * Decoded address (None if script is not decodable to an address) */ - val `address`: kotlin.String?, + val `address`: kotlin.String?, /** * Whether this output belongs to the queried wallet */ @@ -2400,19 +2405,19 @@ public data class TxInput ( /** * The transaction ID of the previous output being spent. */ - val `txid`: kotlin.String, + val `txid`: kotlin.String, /** * The output index of the previous output being spent. */ - val `vout`: kotlin.UInt, + val `vout`: kotlin.UInt, /** * The script signature (hex-encoded). */ - val `scriptsig`: kotlin.String, + val `scriptsig`: kotlin.String, /** * The witness stack (hex-encoded strings). */ - val `witness`: List, + val `witness`: List, /** * The sequence number. */ @@ -2431,19 +2436,19 @@ public data class TxOutput ( /** * The script public key (hex-encoded). */ - val `scriptpubkey`: kotlin.String, + val `scriptpubkey`: kotlin.String, /** * The script public key type (e.g., "p2pkh", "p2sh", "p2wpkh", "p2wsh", "p2tr"). */ - val `scriptpubkeyType`: kotlin.String?, + val `scriptpubkeyType`: kotlin.String?, /** * The address corresponding to this script (if decodable). */ - val `scriptpubkeyAddress`: kotlin.String?, + val `scriptpubkeyAddress`: kotlin.String?, /** * The value in satoshis. */ - val `value`: kotlin.Long, + val `value`: kotlin.Long, /** * The output index in the transaction. */ @@ -2456,8 +2461,8 @@ public data class TxOutput ( @kotlinx.serialization.Serializable public data class ValidationResult ( - val `address`: kotlin.String, - val `network`: NetworkType, + val `address`: kotlin.String, + val `network`: NetworkType, val `addressType`: AddressType ) { public companion object @@ -2473,23 +2478,23 @@ public data class WalletBalance ( /** * Confirmed and spendable balance (sats) */ - val `confirmed`: kotlin.ULong, + val `confirmed`: kotlin.ULong, /** * Immature coinbase outputs (sats) */ - val `immature`: kotlin.ULong, + val `immature`: kotlin.ULong, /** * Unconfirmed UTXOs from trusted sources (own change) (sats) */ - val `trustedPending`: kotlin.ULong, + val `trustedPending`: kotlin.ULong, /** * Unconfirmed UTXOs from external sources (sats) */ - val `untrustedPending`: kotlin.ULong, + val `untrustedPending`: kotlin.ULong, /** * Total spendable: confirmed + trusted_pending (sats) */ - val `spendable`: kotlin.ULong, + val `spendable`: kotlin.ULong, /** * Grand total: all categories (sats) */ @@ -2508,19 +2513,19 @@ public data class WalletParams ( /** * Extended public key (xpub/ypub/zpub/tpub/upub/vpub) */ - val `extendedKey`: kotlin.String, + val `extendedKey`: kotlin.String, /** * Electrum server URL for wallet sync */ - val `electrumUrl`: kotlin.String, + val `electrumUrl`: kotlin.String, /** * Root fingerprint hex (e.g. "73c5da0a"). Required for hardware wallet signing. */ - val `fingerprint`: kotlin.String?, + val `fingerprint`: kotlin.String?, /** * Bitcoin network (auto-detected from key prefix if not specified) */ - val `network`: Network?, + val `network`: Network?, /** * Override account type for ambiguous key prefixes (xpub/tpub) */ @@ -2539,23 +2544,23 @@ public data class WatcherParams ( /** * Caller-supplied identifier for this watcher. */ - val `watcherId`: kotlin.String, + val `watcherId`: kotlin.String, /** * Extended public key (xpub/ypub/zpub/tpub/upub/vpub). */ - val `extendedKey`: kotlin.String, + val `extendedKey`: kotlin.String, /** * Electrum server URL (e.g. "ssl://electrum.example.com:50002"). */ - val `electrumUrl`: kotlin.String, + val `electrumUrl`: kotlin.String, /** * Bitcoin network override (auto-detected from key prefix if None). */ - val `network`: Network?, + val `network`: Network?, /** * Account type override (auto-detected from key prefix if None). */ - val `accountType`: AccountType?, + val `accountType`: AccountType?, /** * Number of unused addresses to monitor beyond the last used (default 20). */ @@ -2572,7 +2577,7 @@ public data class WatcherParams ( * Errors specific to account info operations (BDK/Electrum-based). */ public sealed class AccountInfoException: kotlin.Exception() { - + /** * The provided extended public key is invalid or cannot be parsed */ @@ -2582,7 +2587,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * The provided address is invalid */ @@ -2592,7 +2597,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Electrum connection or query failed */ @@ -2602,7 +2607,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * BDK wallet creation or operation error */ @@ -2612,7 +2617,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Wallet sync with Electrum failed */ @@ -2622,7 +2627,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * The key type/prefix is not recognized */ @@ -2632,7 +2637,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Network mismatch between key prefix and specified network */ @@ -2642,7 +2647,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Invalid transaction ID provided */ @@ -2652,7 +2657,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * A valid transaction ID was not found in the wallet */ @@ -2662,7 +2667,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Watcher lifecycle or subscription error */ @@ -2672,7 +2677,7 @@ public sealed class AccountInfoException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + } @@ -2686,7 +2691,7 @@ public sealed class AccountInfoException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class AccountType { - + /** * BIP44 legacy (P2PKH) — xpub/tpub prefix */ @@ -2723,7 +2728,7 @@ public sealed class Activity { val v1: LightningActivity, ) : Activity() { } - + } @@ -2733,56 +2738,56 @@ public sealed class Activity { public sealed class ActivityException: kotlin.Exception() { - + public class InvalidActivity( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InitializationException( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InsertException( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class RetrievalException( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class DataException( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class ConnectionException( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class SerializationException( public val `errorDetails`: kotlin.String, ) : ActivityException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + } @@ -2791,7 +2796,7 @@ public sealed class ActivityException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class ActivityFilter { - + ALL, LIGHTNING, ONCHAIN; @@ -2806,7 +2811,7 @@ public enum class ActivityFilter { @kotlinx.serialization.Serializable public enum class ActivityType { - + ONCHAIN, LIGHTNING; public companion object @@ -2819,43 +2824,43 @@ public enum class ActivityType { public sealed class AddressException: kotlin.Exception() { - + public class InvalidAddress( ) : AddressException() { override val message: String get() = "" } - + public class InvalidNetwork( ) : AddressException() { override val message: String get() = "" } - + public class MnemonicGenerationFailed( ) : AddressException() { override val message: String get() = "" } - + public class InvalidMnemonic( ) : AddressException() { override val message: String get() = "" } - + public class InvalidEntropy( ) : AddressException() { override val message: String get() = "" } - + public class AddressDerivationFailed( ) : AddressException() { override val message: String get() = "" } - + } @@ -2864,7 +2869,7 @@ public sealed class AddressException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class AddressType { - + P2PKH, P2SH, P2WPKH, @@ -2882,7 +2887,7 @@ public enum class AddressType { @kotlinx.serialization.Serializable public enum class BitcoinNetworkEnum { - + MAINNET, TESTNET, SIGNET, @@ -2897,70 +2902,70 @@ public enum class BitcoinNetworkEnum { public sealed class BlocktankException: kotlin.Exception() { - + public class HttpClient( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class BlocktankClient( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InvalidBlocktank( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InitializationException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InsertException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class RetrievalException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class DataException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class ConnectionException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class SerializationException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class ChannelOpen( public val `errorType`: BtChannelOrderErrorType, public val `errorDetails`: kotlin.String, @@ -2968,28 +2973,28 @@ public sealed class BlocktankException: kotlin.Exception() { override val message: String get() = "errorType=${ `errorType` }, errorDetails=${ `errorDetails` }" } - + public class OrderState( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InvalidParameter( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class DatabaseException( public val `errorDetails`: kotlin.String, ) : BlocktankException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + } @@ -2997,35 +3002,35 @@ public sealed class BlocktankException: kotlin.Exception() { public sealed class BroadcastException: kotlin.Exception() { - + public class InvalidHex( public val `errorDetails`: kotlin.String, ) : BroadcastException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InvalidTransaction( public val `errorDetails`: kotlin.String, ) : BroadcastException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class ElectrumException( public val `errorDetails`: kotlin.String, ) : BroadcastException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class TaskException( public val `errorDetails`: kotlin.String, ) : BroadcastException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + } @@ -3034,7 +3039,7 @@ public sealed class BroadcastException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class BtBolt11InvoiceState { - + PENDING, HOLDING, PAID, @@ -3050,7 +3055,7 @@ public enum class BtBolt11InvoiceState { @kotlinx.serialization.Serializable public enum class BtChannelOrderErrorType { - + WRONG_ORDER_STATE, PEER_NOT_REACHABLE, CHANNEL_REJECTED_BY_DESTINATION, @@ -3067,7 +3072,7 @@ public enum class BtChannelOrderErrorType { @kotlinx.serialization.Serializable public enum class BtOpenChannelState { - + OPENING, OPEN, CLOSED; @@ -3082,7 +3087,7 @@ public enum class BtOpenChannelState { @kotlinx.serialization.Serializable public enum class BtOrderState { - + CREATED, EXPIRED, OPEN, @@ -3098,7 +3103,7 @@ public enum class BtOrderState { @kotlinx.serialization.Serializable public enum class BtOrderState2 { - + CREATED, EXPIRED, EXECUTED, @@ -3114,7 +3119,7 @@ public enum class BtOrderState2 { @kotlinx.serialization.Serializable public enum class BtPaymentState { - + CREATED, PARTIALLY_PAID, PAID, @@ -3131,7 +3136,7 @@ public enum class BtPaymentState { @kotlinx.serialization.Serializable public enum class BtPaymentState2 { - + CREATED, PAID, REFUNDED, @@ -3148,7 +3153,7 @@ public enum class BtPaymentState2 { @kotlinx.serialization.Serializable public enum class CJitStateEnum { - + CREATED, COMPLETED, EXPIRED, @@ -3167,7 +3172,7 @@ public enum class CJitStateEnum { @kotlinx.serialization.Serializable public enum class CoinSelection { - + /** * Branch-and-bound (default). Minimizes change by searching for exact matches. */ @@ -3193,7 +3198,7 @@ public enum class CoinSelection { */ @kotlinx.serialization.Serializable public sealed class ComposeOutput { - + /** * Payment to a specific address with a fixed amount (satoshis) */@kotlinx.serialization.Serializable @@ -3202,7 +3207,7 @@ public sealed class ComposeOutput { val `amountSats`: kotlin.ULong, ) : ComposeOutput() { } - + /** * Send all remaining funds (after fees) to an address */@kotlinx.serialization.Serializable @@ -3210,7 +3215,7 @@ public sealed class ComposeOutput { val `address`: kotlin.String, ) : ComposeOutput() { } - + /** * OP_RETURN data output (hex-encoded payload) */@kotlinx.serialization.Serializable @@ -3218,7 +3223,7 @@ public sealed class ComposeOutput { val `dataHex`: kotlin.String, ) : ComposeOutput() { } - + } @@ -3231,7 +3236,7 @@ public sealed class ComposeOutput { */ @kotlinx.serialization.Serializable public sealed class ComposeResult { - + /** * Successfully built a signable PSBT */@kotlinx.serialization.Serializable @@ -3256,7 +3261,7 @@ public sealed class ComposeResult { val `totalSpent`: kotlin.ULong, ) : ComposeResult() { } - + /** * Composition failed (e.g. insufficient funds) */@kotlinx.serialization.Serializable @@ -3264,7 +3269,7 @@ public sealed class ComposeResult { val `error`: kotlin.String, ) : ComposeResult() { } - + } @@ -3274,28 +3279,28 @@ public sealed class ComposeResult { public sealed class DbException: kotlin.Exception() { - + public class DbActivityException( public val `errorDetails`: ActivityException, ) : DbException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class DbBlocktankException( public val `errorDetails`: BlocktankException, ) : DbException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class InitializationException( public val `errorDetails`: kotlin.String, ) : DbException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + } @@ -3303,25 +3308,25 @@ public sealed class DbException: kotlin.Exception() { public sealed class DecodingException: kotlin.Exception() { - + public class InvalidFormat( ) : DecodingException() { override val message: String get() = "" } - + public class InvalidNetwork( ) : DecodingException() { override val message: String get() = "" } - + public class InvalidAmount( ) : DecodingException() { override val message: String get() = "" } - + public class InvalidLnurlPayAmount( public val `amountSatoshis`: kotlin.ULong, public val `min`: kotlin.ULong, @@ -3330,56 +3335,56 @@ public sealed class DecodingException: kotlin.Exception() { override val message: String get() = "amountSatoshis=${ `amountSatoshis` }, min=${ `min` }, max=${ `max` }" } - + public class InvalidTimestamp( ) : DecodingException() { override val message: String get() = "" } - + public class InvalidChecksum( ) : DecodingException() { override val message: String get() = "" } - + public class InvalidResponse( ) : DecodingException() { override val message: String get() = "" } - + public class UnsupportedType( ) : DecodingException() { override val message: String get() = "" } - + public class InvalidAddress( ) : DecodingException() { override val message: String get() = "" } - + public class RequestFailed( ) : DecodingException() { override val message: String get() = "" } - + public class ClientCreationFailed( ) : DecodingException() { override val message: String get() = "" } - + public class InvoiceCreationFailed( public val `errorMessage`: kotlin.String, ) : DecodingException() { override val message: String get() = "errorMessage=${ `errorMessage` }" } - + } @@ -3387,31 +3392,31 @@ public sealed class DecodingException: kotlin.Exception() { public sealed class LnurlException: kotlin.Exception() { - + public class InvalidAddress( ) : LnurlException() { override val message: String get() = "" } - + public class ClientCreationFailed( ) : LnurlException() { override val message: String get() = "" } - + public class RequestFailed( ) : LnurlException() { override val message: String get() = "" } - + public class InvalidResponse( ) : LnurlException() { override val message: String get() = "" } - + public class InvalidAmount( public val `amountSatoshis`: kotlin.ULong, public val `min`: kotlin.ULong, @@ -3420,20 +3425,20 @@ public sealed class LnurlException: kotlin.Exception() { override val message: String get() = "amountSatoshis=${ `amountSatoshis` }, min=${ `min` }, max=${ `max` }" } - + public class InvoiceCreationFailed( public val `errorDetails`: kotlin.String, ) : LnurlException() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + public class AuthenticationFailed( ) : LnurlException() { override val message: String get() = "" } - + } @@ -3442,7 +3447,7 @@ public sealed class LnurlException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class ManualRefundStateEnum { - + CREATED, APPROVED, REJECTED, @@ -3458,7 +3463,7 @@ public enum class ManualRefundStateEnum { @kotlinx.serialization.Serializable public enum class Network { - + /** * Mainnet Bitcoin. */ @@ -3490,7 +3495,7 @@ public enum class Network { @kotlinx.serialization.Serializable public enum class NetworkType { - + BITCOIN, TESTNET, REGTEST, @@ -3505,21 +3510,21 @@ public enum class NetworkType { @kotlinx.serialization.Serializable public sealed class PassphraseResponse { - + /** * User cancelled — aborts the pending operation. */ @kotlinx.serialization.Serializable - public data object Cancel : PassphraseResponse() - - + public data object Cancel : PassphraseResponse() + + /** * Standard wallet — no passphrase, equivalent to `Some("")` on the device. */ @kotlinx.serialization.Serializable - public data object Standard : PassphraseResponse() - - + public data object Standard : PassphraseResponse() + + /** * Hidden wallet — derived from the passphrase entered on the host. */@kotlinx.serialization.Serializable @@ -3527,14 +3532,14 @@ public sealed class PassphraseResponse { val `value`: kotlin.String, ) : PassphraseResponse() { } - + /** * Enter the passphrase on the Trezor device itself instead of on the host. */ @kotlinx.serialization.Serializable - public data object OnDevice : PassphraseResponse() - - + public data object OnDevice : PassphraseResponse() + + } @@ -3545,7 +3550,7 @@ public sealed class PassphraseResponse { @kotlinx.serialization.Serializable public enum class PaymentState { - + PENDING, SUCCEEDED, FAILED; @@ -3560,7 +3565,7 @@ public enum class PaymentState { @kotlinx.serialization.Serializable public enum class PaymentType { - + SENT, RECEIVED; public companion object @@ -3577,7 +3582,7 @@ public enum class PaymentType { @kotlinx.serialization.Serializable public enum class PubkyAuthKind { - + SIGNIN, SIGNUP; public companion object @@ -3590,68 +3595,68 @@ public enum class PubkyAuthKind { public sealed class PubkyException: kotlin.Exception() { - + public class InvalidCapabilities( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + public class AuthFailed( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + public class NoActiveFlow( ) : PubkyException() { override val message: String get() = "" } - + public class ResolutionFailed( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + public class FetchFailed( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + public class ProfileNotFound( ) : PubkyException() { override val message: String get() = "" } - + public class ProfileParseFailed( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + public class KeyException( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + public class WriteFailed( public val `reason`: kotlin.String, ) : PubkyException() { override val message: String get() = "reason=${ `reason` }" } - + } @@ -3711,7 +3716,7 @@ public sealed class Scanner { val `amount`: kotlin.ULong, ) : Scanner() { } - + } @@ -3722,7 +3727,7 @@ public sealed class Scanner { @kotlinx.serialization.Serializable public enum class SortDirection { - + ASC, DESC; public companion object @@ -3735,26 +3740,26 @@ public enum class SortDirection { public sealed class SweepException: kotlin.Exception() { - + public class SweepFailed( public val v1: kotlin.String, ) : SweepException() { override val message: String get() = "v1=${ v1 }" } - + public class NoUtxosFound( ) : SweepException() { override val message: String get() = "" } - + public class InvalidMnemonic( ) : SweepException() { override val message: String get() = "" } - + } @@ -3766,7 +3771,7 @@ public sealed class SweepException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class TrezorCoinType { - + /** * Bitcoin mainnet */ @@ -3796,7 +3801,7 @@ public enum class TrezorCoinType { * Trezor-related errors exposed via FFI. */ public sealed class TrezorException: kotlin.Exception() { - + /** * Transport layer error (USB/Bluetooth communication) */ @@ -3806,7 +3811,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * No Trezor device found */ @@ -3815,7 +3820,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Device disconnected during operation */ @@ -3824,7 +3829,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Connection error */ @@ -3834,7 +3839,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Protocol error (encoding/decoding) */ @@ -3844,7 +3849,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Pairing required for Bluetooth connection */ @@ -3853,7 +3858,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Pairing failed */ @@ -3863,7 +3868,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * PIN is required */ @@ -3872,7 +3877,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * PIN entry cancelled */ @@ -3881,7 +3886,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Invalid PIN entered */ @@ -3890,7 +3895,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Passphrase is required */ @@ -3899,7 +3904,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Passphrase entry cancelled */ @@ -3908,7 +3913,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Action cancelled by user on device */ @@ -3917,7 +3922,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Operation timed out */ @@ -3926,7 +3931,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Invalid derivation path */ @@ -3936,7 +3941,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Device returned an error */ @@ -3946,7 +3951,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * Trezor manager not initialized */ @@ -3955,7 +3960,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * No device connected */ @@ -3964,7 +3969,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "" } - + /** * Session error */ @@ -3974,7 +3979,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + /** * IO error */ @@ -3984,7 +3989,7 @@ public sealed class TrezorException: kotlin.Exception() { override val message: String get() = "errorDetails=${ `errorDetails` }" } - + } @@ -3996,7 +4001,7 @@ public sealed class TrezorException: kotlin.Exception() { @kotlinx.serialization.Serializable public enum class TrezorScriptType { - + /** * P2PKH (legacy) */ @@ -4035,7 +4040,7 @@ public enum class TrezorScriptType { @kotlinx.serialization.Serializable public enum class TrezorTransportType { - + /** * USB connection */ @@ -4058,7 +4063,7 @@ public enum class TrezorTransportType { @kotlinx.serialization.Serializable public enum class TxDirection { - + /** * Wallet sent funds to an external address */ @@ -4090,14 +4095,14 @@ public enum class TxDirection { */ @kotlinx.serialization.Serializable public sealed class WalletSelection { - + /** * The standard wallet — no passphrase. */ @kotlinx.serialization.Serializable - public data object Standard : WalletSelection() - - + public data object Standard : WalletSelection() + + /** * A hidden wallet whose passphrase is entered on the host. */@kotlinx.serialization.Serializable @@ -4105,14 +4110,14 @@ public sealed class WalletSelection { val `passphrase`: kotlin.String, ) : WalletSelection() { } - + /** * A hidden wallet whose passphrase is entered on the Trezor itself. */ @kotlinx.serialization.Serializable - public data object OnDevice : WalletSelection() - - + public data object OnDevice : WalletSelection() + + } @@ -4125,7 +4130,7 @@ public sealed class WalletSelection { */ @kotlinx.serialization.Serializable public sealed class WatcherEvent { - + /** * Transaction activity changed — contains full updated state. */@kotlinx.serialization.Serializable @@ -4137,7 +4142,7 @@ public sealed class WatcherEvent { val `accountType`: AccountType, ) : WatcherEvent() { } - + /** * An error occurred in the watcher loop. */@kotlinx.serialization.Serializable @@ -4145,7 +4150,7 @@ public sealed class WatcherEvent { val `message`: kotlin.String, ) : WatcherEvent() { } - + /** * Connection to the Electrum server was lost. */@kotlinx.serialization.Serializable @@ -4153,14 +4158,14 @@ public sealed class WatcherEvent { val `message`: kotlin.String, ) : WatcherEvent() { } - + /** * Connection to the Electrum server was restored. */ @kotlinx.serialization.Serializable - public data object Reconnected : WatcherEvent() - - + public data object Reconnected : WatcherEvent() + + } @@ -4171,7 +4176,7 @@ public sealed class WatcherEvent { @kotlinx.serialization.Serializable public enum class WordCount { - + /** * 12-word mnemonic (128 bits of entropy) */ diff --git a/bindings/ios/BitkitCore.xcframework.zip b/bindings/ios/BitkitCore.xcframework.zip index 1f09de5..b735c4f 100644 Binary files a/bindings/ios/BitkitCore.xcframework.zip and b/bindings/ios/BitkitCore.xcframework.zip differ diff --git a/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/Headers/bitkitcoreFFI.h b/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/Headers/bitkitcoreFFI.h index adc6b27..f28c6c6 100644 --- a/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/Headers/bitkitcoreFFI.h +++ b/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/Headers/bitkitcoreFFI.h @@ -253,98 +253,98 @@ typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStr #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 -typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, +typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD0 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD1 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD1 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod1)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod1)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD2 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD2 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod2)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod2)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD3 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD3 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod3)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod3)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD4 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD4 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod4)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod4)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD5 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD5 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod5)(uint64_t, RustBuffer, uint32_t* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod5)(uint64_t, RustBuffer, uint32_t* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD6 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD6 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod6)(uint64_t, RustBuffer, uint16_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod6)(uint64_t, RustBuffer, uint16_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD7 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD7 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod7)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod7)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD8 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD8 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod8)(uint64_t, RustBuffer, RustBuffer, int8_t* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod8)(uint64_t, RustBuffer, RustBuffer, int8_t* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD9 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD9 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod9)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod9)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD10 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD10 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod10)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod10)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD0 -typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD1 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD1 -typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod1)(uint64_t, int8_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod1)(uint64_t, int8_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); @@ -502,7 +502,7 @@ RustBuffer uniffi_bitkitcore_fn_method_trezoruicallback_on_passphrase_request(vo #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ACTIVITY_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ACTIVITY_WIPE_ALL void uniffi_bitkitcore_fn_func_activity_wipe_all(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA @@ -512,12 +512,12 @@ void uniffi_bitkitcore_fn_func_add_pre_activity_metadata(RustBuffer pre_activity #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags(RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_TAGS -void uniffi_bitkitcore_fn_func_add_tags(RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_add_tags(RustBuffer wallet_id, RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_APPROVE_PUBKY_AUTH @@ -528,19 +528,19 @@ uint64_t uniffi_bitkitcore_fn_func_approve_pubky_auth(RustBuffer auth_url, RustB #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES uint64_t uniffi_bitkitcore_fn_func_blocktank_remove_all_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS uint64_t uniffi_bitkitcore_fn_func_blocktank_remove_all_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_WIPE_ALL uint64_t uniffi_bitkitcore_fn_func_blocktank_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BROADCAST_SWEEP_TRANSACTION @@ -556,7 +556,7 @@ RustBuffer uniffi_bitkitcore_fn_func_calculate_channel_liquidity_options(RustBuf #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CANCEL_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CANCEL_PUBKY_AUTH uint64_t uniffi_bitkitcore_fn_func_cancel_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CHECK_SWEEPABLE_BALANCES @@ -567,7 +567,7 @@ uint64_t uniffi_bitkitcore_fn_func_check_sweepable_balances(RustBuffer mnemonic_ #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_COMPLETE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_COMPLETE_PUBKY_AUTH uint64_t uniffi_bitkitcore_fn_func_complete_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CREATE_CHANNEL_REQUEST_URL @@ -595,19 +595,24 @@ RustBuffer uniffi_bitkitcore_fn_func_create_withdraw_callback_url(RustBuffer k1, uint64_t uniffi_bitkitcore_fn_func_decode(RustBuffer invoice ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +uint32_t uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id(RustBuffer wallet_id, RustCallStatus *_Nonnull out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITY_BY_ID -int8_t uniffi_bitkitcore_fn_func_delete_activity_by_id(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +int8_t uniffi_bitkitcore_fn_func_delete_activity_by_id(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_PRE_ACTIVITY_METADATA -void uniffi_bitkitcore_fn_func_delete_pre_activity_metadata(RustBuffer payment_id, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_delete_pre_activity_metadata(RustBuffer wallet_id, RustBuffer payment_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_TRANSACTION_DETAILS -int8_t uniffi_bitkitcore_fn_func_delete_transaction_details(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +int8_t uniffi_bitkitcore_fn_func_delete_transaction_details(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DERIVE_BITCOIN_ADDRESS @@ -677,28 +682,28 @@ RustBuffer uniffi_bitkitcore_fn_func_generate_mnemonic(RustBuffer word_count, Ru #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES -RustBuffer uniffi_bitkitcore_fn_func_get_activities(RustBuffer filter, RustBuffer tx_type, RustBuffer tags, RustBuffer search, RustBuffer min_date, RustBuffer max_date, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activities(RustBuffer wallet_id, RustBuffer filter, RustBuffer tx_type, RustBuffer tags, RustBuffer search, RustBuffer min_date, RustBuffer max_date, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES_BY_TAG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES_BY_TAG -RustBuffer uniffi_bitkitcore_fn_func_get_activities_by_tag(RustBuffer tag, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activities_by_tag(RustBuffer wallet_id, RustBuffer tag, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_ID -RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_id(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_id(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_TX_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_TX_ID -RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_tx_id(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_tx_id(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_ACTIVITIES_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_ACTIVITIES_TAGS RustBuffer uniffi_bitkitcore_fn_func_get_all_activities_tags(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_CLOSED_CHANNELS @@ -709,19 +714,19 @@ RustBuffer uniffi_bitkitcore_fn_func_get_all_closed_channels(RustBuffer sort_dir #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_PRE_ACTIVITY_METADATA RustBuffer uniffi_bitkitcore_fn_func_get_all_pre_activity_metadata(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_TRANSACTION_DETAILS RustBuffer uniffi_bitkitcore_fn_func_get_all_transaction_details(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_UNIQUE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_UNIQUE_TAGS RustBuffer uniffi_bitkitcore_fn_func_get_all_unique_tags(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_SUGGESTIONS @@ -732,7 +737,7 @@ RustBuffer uniffi_bitkitcore_fn_func_get_bip39_suggestions(RustBuffer partial_wo #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_WORDLIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_WORDLIST RustBuffer uniffi_bitkitcore_fn_func_get_bip39_wordlist(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_CJIT_ENTRIES @@ -748,6 +753,12 @@ RustBuffer uniffi_bitkitcore_fn_func_get_closed_channel_by_id(RustBuffer channel #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_LSP_BALANCE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_LSP_BALANCE uint64_t uniffi_bitkitcore_fn_func_get_default_lsp_balance(RustBuffer params, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_WALLET_ID +RustBuffer uniffi_bitkitcore_fn_func_get_default_wallet_id(RustCallStatus *_Nonnull out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_GIFT @@ -782,17 +793,17 @@ uint64_t uniffi_bitkitcore_fn_func_get_payment(RustBuffer payment_id #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_PRE_ACTIVITY_METADATA -RustBuffer uniffi_bitkitcore_fn_func_get_pre_activity_metadata(RustBuffer search_key, int8_t search_by_address, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_pre_activity_metadata(RustBuffer wallet_id, RustBuffer search_key, int8_t search_by_address, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TAGS -RustBuffer uniffi_bitkitcore_fn_func_get_tags(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_tags(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TRANSACTION_DETAILS -RustBuffer uniffi_bitkitcore_fn_func_get_transaction_details(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_transaction_details(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GIFT_ORDER @@ -832,7 +843,7 @@ uint64_t uniffi_bitkitcore_fn_func_lnurl_auth(RustBuffer domain, RustBuffer k1, #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MARK_ACTIVITY_AS_SEEN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MARK_ACTIVITY_AS_SEEN -void uniffi_bitkitcore_fn_func_mark_activity_as_seen(RustBuffer activity_id, uint64_t seen_at, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_mark_activity_as_seen(RustBuffer wallet_id, RustBuffer activity_id, uint64_t seen_at, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MNEMONIC_TO_ENTROPY @@ -883,7 +894,7 @@ uint64_t uniffi_bitkitcore_fn_func_onchain_start_watcher(RustBuffer params, void #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_ALL_WATCHERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_ALL_WATCHERS void uniffi_bitkitcore_fn_func_onchain_stop_all_watchers(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_WATCHER @@ -949,13 +960,13 @@ uint64_t uniffi_bitkitcore_fn_func_pubky_sign_up(RustBuffer secret_key_hex, Rust #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES uint64_t uniffi_bitkitcore_fn_func_refresh_active_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_ORDERS uint64_t uniffi_bitkitcore_fn_func_refresh_active_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REGISTER_DEVICE @@ -995,17 +1006,17 @@ int8_t uniffi_bitkitcore_fn_func_remove_closed_channel_by_id(RustBuffer channel_ #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags(RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_TAGS -void uniffi_bitkitcore_fn_func_remove_tags(RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_remove_tags(RustBuffer wallet_id, RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags(RustBuffer payment_id, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESOLVE_PUBKY_URL @@ -1046,7 +1057,7 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_connect(RustBuffer device_id, RustBuff #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_DISCONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_DISCONNECT uint64_t uniffi_bitkitcore_fn_func_trezor_disconnect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_ADDRESS @@ -1057,19 +1068,19 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_get_address(RustBuffer params #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_CONNECTED_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_CONNECTED_DEVICE uint64_t uniffi_bitkitcore_fn_func_trezor_get_connected_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_DEVICE_FINGERPRINT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_DEVICE_FINGERPRINT uint64_t uniffi_bitkitcore_fn_func_trezor_get_device_fingerprint(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_FEATURES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_FEATURES uint64_t uniffi_bitkitcore_fn_func_trezor_get_features(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_PUBLIC_KEY @@ -1085,31 +1096,31 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_initialize(RustBuffer credential_path #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_BLE_AVAILABLE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_BLE_AVAILABLE int8_t uniffi_bitkitcore_fn_func_trezor_is_ble_available(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_CONNECTED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_CONNECTED uint64_t uniffi_bitkitcore_fn_func_trezor_is_connected(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_INITIALIZED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_INITIALIZED uint64_t uniffi_bitkitcore_fn_func_trezor_is_initialized(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_LIST_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_LIST_DEVICES uint64_t uniffi_bitkitcore_fn_func_trezor_list_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SCAN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SCAN uint64_t uniffi_bitkitcore_fn_func_trezor_scan(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SET_TRANSPORT_CALLBACK @@ -1225,19 +1236,19 @@ void uniffi_bitkitcore_fn_func_validate_mnemonic(RustBuffer mnemonic_phrase, Rus #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_CLOSED_CHANNELS void uniffi_bitkitcore_fn_func_wipe_all_closed_channels(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_DATABASES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_DATABASES uint64_t uniffi_bitkitcore_fn_func_wipe_all_databases(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_TRANSACTION_DETAILS void uniffi_bitkitcore_fn_func_wipe_all_transaction_details(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_FFI_BITKITCORE_RUSTBUFFER_ALLOC @@ -1523,949 +1534,961 @@ void ffi_bitkitcore_rust_future_complete_void(uint64_t handle, RustCallStatus *_ #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ACTIVITY_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ACTIVITY_WIPE_ALL uint16_t uniffi_bitkitcore_checksum_func_activity_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_add_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_TAGS uint16_t uniffi_bitkitcore_checksum_func_add_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_APPROVE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_APPROVE_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_approve_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_blocktank_remove_all_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS uint16_t uniffi_bitkitcore_checksum_func_blocktank_remove_all_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_WIPE_ALL uint16_t uniffi_bitkitcore_checksum_func_blocktank_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BROADCAST_SWEEP_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BROADCAST_SWEEP_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_broadcast_sweep_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CALCULATE_CHANNEL_LIQUIDITY_OPTIONS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CALCULATE_CHANNEL_LIQUIDITY_OPTIONS uint16_t uniffi_bitkitcore_checksum_func_calculate_channel_liquidity_options(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CANCEL_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CANCEL_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_cancel_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CHECK_SWEEPABLE_BALANCES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CHECK_SWEEPABLE_BALANCES uint16_t uniffi_bitkitcore_checksum_func_check_sweepable_balances(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_COMPLETE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_COMPLETE_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_complete_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CHANNEL_REQUEST_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CHANNEL_REQUEST_URL uint16_t uniffi_bitkitcore_checksum_func_create_channel_request_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CJIT_ENTRY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CJIT_ENTRY uint16_t uniffi_bitkitcore_checksum_func_create_cjit_entry(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_ORDER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_ORDER uint16_t uniffi_bitkitcore_checksum_func_create_order(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_WITHDRAW_CALLBACK_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_WITHDRAW_CALLBACK_URL uint16_t uniffi_bitkitcore_checksum_func_create_withdraw_callback_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DECODE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DECODE uint16_t uniffi_bitkitcore_checksum_func_decode(void - + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +uint16_t uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITY_BY_ID uint16_t uniffi_bitkitcore_checksum_func_delete_activity_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_delete_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_derive_bitcoin_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESSES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESSES uint16_t uniffi_bitkitcore_checksum_func_derive_bitcoin_addresses(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_ONCHAIN_DESCRIPTOR #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_ONCHAIN_DESCRIPTOR uint16_t uniffi_bitkitcore_checksum_func_derive_onchain_descriptor(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PRIVATE_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PRIVATE_KEY uint16_t uniffi_bitkitcore_checksum_func_derive_private_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PUBKY_SECRET_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PUBKY_SECRET_KEY uint16_t uniffi_bitkitcore_checksum_func_derive_pubky_secret_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ENTROPY_TO_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ENTROPY_TO_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_entropy_to_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE uint16_t uniffi_bitkitcore_checksum_func_estimate_order_fee(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE_FULL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE_FULL uint16_t uniffi_bitkitcore_checksum_func_estimate_order_fee_full(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_CONTACTS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_CONTACTS uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_contacts(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_file(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE_STRING #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE_STRING uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_file_string(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_PROFILE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_PROFILE uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_profile(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GENERATE_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GENERATE_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_generate_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_get_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES_BY_TAG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES_BY_TAG uint16_t uniffi_bitkitcore_checksum_func_get_activities_by_tag(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_ID uint16_t uniffi_bitkitcore_checksum_func_get_activity_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_TX_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_TX_ID uint16_t uniffi_bitkitcore_checksum_func_get_activity_by_tx_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_ACTIVITIES_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_ACTIVITIES_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_all_activities_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_get_all_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_get_all_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_get_all_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_UNIQUE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_UNIQUE_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_all_unique_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_SUGGESTIONS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_SUGGESTIONS uint16_t uniffi_bitkitcore_checksum_func_get_bip39_suggestions(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_WORDLIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_WORDLIST uint16_t uniffi_bitkitcore_checksum_func_get_bip39_wordlist(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_get_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CLOSED_CHANNEL_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CLOSED_CHANNEL_BY_ID uint16_t uniffi_bitkitcore_checksum_func_get_closed_channel_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_LSP_BALANCE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_LSP_BALANCE uint16_t uniffi_bitkitcore_checksum_func_get_default_lsp_balance(void - + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_WALLET_ID +uint16_t uniffi_bitkitcore_checksum_func_get_default_wallet_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_GIFT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_GIFT uint16_t uniffi_bitkitcore_checksum_func_get_gift(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_INFO uint16_t uniffi_bitkitcore_checksum_func_get_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_LNURL_INVOICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_LNURL_INVOICE uint16_t uniffi_bitkitcore_checksum_func_get_lnurl_invoice(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_MIN_ZERO_CONF_TX_FEE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_MIN_ZERO_CONF_TX_FEE uint16_t uniffi_bitkitcore_checksum_func_get_min_zero_conf_tx_fee(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ORDERS uint16_t uniffi_bitkitcore_checksum_func_get_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PAYMENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PAYMENT uint16_t uniffi_bitkitcore_checksum_func_get_payment(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_get_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_get_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_ORDER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_ORDER uint16_t uniffi_bitkitcore_checksum_func_gift_order(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_PAY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_PAY uint16_t uniffi_bitkitcore_checksum_func_gift_pay(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INIT_DB #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INIT_DB uint16_t uniffi_bitkitcore_checksum_func_init_db(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INSERT_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INSERT_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_insert_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_ADDRESS_USED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_ADDRESS_USED uint16_t uniffi_bitkitcore_checksum_func_is_address_used(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_VALID_BIP39_WORD #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_VALID_BIP39_WORD uint16_t uniffi_bitkitcore_checksum_func_is_valid_bip39_word(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_LNURL_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_LNURL_AUTH uint16_t uniffi_bitkitcore_checksum_func_lnurl_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MARK_ACTIVITY_AS_SEEN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MARK_ACTIVITY_AS_SEEN uint16_t uniffi_bitkitcore_checksum_func_mark_activity_as_seen(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_ENTROPY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_ENTROPY uint16_t uniffi_bitkitcore_checksum_func_mnemonic_to_entropy(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_SEED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_SEED uint16_t uniffi_bitkitcore_checksum_func_mnemonic_to_seed(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_BROADCAST_RAW_TX #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_BROADCAST_RAW_TX uint16_t uniffi_bitkitcore_checksum_func_onchain_broadcast_raw_tx(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_COMPOSE_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_COMPOSE_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_onchain_compose_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ACCOUNT_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ACCOUNT_INFO uint16_t uniffi_bitkitcore_checksum_func_onchain_get_account_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ADDRESS_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ADDRESS_INFO uint16_t uniffi_bitkitcore_checksum_func_onchain_get_address_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_DETAIL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_DETAIL uint16_t uniffi_bitkitcore_checksum_func_onchain_get_transaction_detail(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_HISTORY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_HISTORY uint16_t uniffi_bitkitcore_checksum_func_onchain_get_transaction_history(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_START_WATCHER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_START_WATCHER uint16_t uniffi_bitkitcore_checksum_func_onchain_start_watcher(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_ALL_WATCHERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_ALL_WATCHERS uint16_t uniffi_bitkitcore_checksum_func_onchain_stop_all_watchers(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_WATCHER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_WATCHER uint16_t uniffi_bitkitcore_checksum_func_onchain_stop_watcher(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_OPEN_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_OPEN_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_open_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PARSE_PUBKY_AUTH_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PARSE_PUBKY_AUTH_URL uint16_t uniffi_bitkitcore_checksum_func_parse_pubky_auth_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_SWEEP #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_SWEEP uint16_t uniffi_bitkitcore_checksum_func_prepare_legacy_rn_native_segwit_recovery_sweep(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_SWEEP_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_SWEEP_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_prepare_sweep_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUBLIC_KEY_FROM_SECRET #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUBLIC_KEY_FROM_SECRET uint16_t uniffi_bitkitcore_checksum_func_pubky_public_key_from_secret(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUT_WITH_SECRET_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUT_WITH_SECRET_KEY uint16_t uniffi_bitkitcore_checksum_func_pubky_put_with_secret_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_DELETE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_DELETE uint16_t uniffi_bitkitcore_checksum_func_pubky_session_delete(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_LIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_LIST uint16_t uniffi_bitkitcore_checksum_func_pubky_session_list(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_PUT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_PUT uint16_t uniffi_bitkitcore_checksum_func_pubky_session_put(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_IN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_IN uint16_t uniffi_bitkitcore_checksum_func_pubky_sign_in(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_UP #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_UP uint16_t uniffi_bitkitcore_checksum_func_pubky_sign_up(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_refresh_active_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_ORDERS uint16_t uniffi_bitkitcore_checksum_func_refresh_active_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGISTER_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGISTER_DEVICE uint16_t uniffi_bitkitcore_checksum_func_register_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_CLOSE_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_CLOSE_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_regtest_close_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_DEPOSIT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_DEPOSIT uint16_t uniffi_bitkitcore_checksum_func_regtest_deposit(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_GET_PAYMENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_GET_PAYMENT uint16_t uniffi_bitkitcore_checksum_func_regtest_get_payment(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_MINE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_MINE uint16_t uniffi_bitkitcore_checksum_func_regtest_mine(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_PAY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_PAY uint16_t uniffi_bitkitcore_checksum_func_regtest_pay(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_CLOSED_CHANNEL_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_CLOSED_CHANNEL_BY_ID uint16_t uniffi_bitkitcore_checksum_func_remove_closed_channel_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_TAGS uint16_t uniffi_bitkitcore_checksum_func_remove_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESOLVE_PUBKY_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESOLVE_PUBKY_URL uint16_t uniffi_bitkitcore_checksum_func_resolve_pubky_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_SCAN_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_FUNDS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_SCAN_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_FUNDS uint16_t uniffi_bitkitcore_checksum_func_scan_legacy_rn_native_segwit_recovery_funds(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_START_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_START_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_start_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TEST_NOTIFICATION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TEST_NOTIFICATION uint16_t uniffi_bitkitcore_checksum_func_test_notification(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_ACCOUNT_TYPE_TO_SCRIPT_TYPE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_ACCOUNT_TYPE_TO_SCRIPT_TYPE uint16_t uniffi_bitkitcore_checksum_func_trezor_account_type_to_script_type(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CLEAR_CREDENTIALS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CLEAR_CREDENTIALS uint16_t uniffi_bitkitcore_checksum_func_trezor_clear_credentials(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CONNECT uint16_t uniffi_bitkitcore_checksum_func_trezor_connect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_DISCONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_DISCONNECT uint16_t uniffi_bitkitcore_checksum_func_trezor_disconnect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_trezor_get_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_CONNECTED_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_CONNECTED_DEVICE uint16_t uniffi_bitkitcore_checksum_func_trezor_get_connected_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_DEVICE_FINGERPRINT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_DEVICE_FINGERPRINT uint16_t uniffi_bitkitcore_checksum_func_trezor_get_device_fingerprint(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_FEATURES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_FEATURES uint16_t uniffi_bitkitcore_checksum_func_trezor_get_features(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_PUBLIC_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_PUBLIC_KEY uint16_t uniffi_bitkitcore_checksum_func_trezor_get_public_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_INITIALIZE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_INITIALIZE uint16_t uniffi_bitkitcore_checksum_func_trezor_initialize(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_BLE_AVAILABLE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_BLE_AVAILABLE uint16_t uniffi_bitkitcore_checksum_func_trezor_is_ble_available(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_CONNECTED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_CONNECTED uint16_t uniffi_bitkitcore_checksum_func_trezor_is_connected(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_INITIALIZED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_INITIALIZED uint16_t uniffi_bitkitcore_checksum_func_trezor_is_initialized(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_LIST_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_LIST_DEVICES uint16_t uniffi_bitkitcore_checksum_func_trezor_list_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SCAN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SCAN uint16_t uniffi_bitkitcore_checksum_func_trezor_scan(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_TRANSPORT_CALLBACK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_TRANSPORT_CALLBACK uint16_t uniffi_bitkitcore_checksum_func_trezor_set_transport_callback(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_UI_CALLBACK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_UI_CALLBACK uint16_t uniffi_bitkitcore_checksum_func_trezor_set_ui_callback(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_MESSAGE uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_tx(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX_FROM_PSBT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX_FROM_PSBT uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_tx_from_psbt(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_VERIFY_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_VERIFY_MESSAGE uint16_t uniffi_bitkitcore_checksum_func_trezor_verify_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_update_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_BLOCKTANK_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_BLOCKTANK_URL uint16_t uniffi_bitkitcore_checksum_func_update_blocktank_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_upsert_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_upsert_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_upsert_closed_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_upsert_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_INFO uint16_t uniffi_bitkitcore_checksum_func_upsert_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_LIGHTNING_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_LIGHTNING_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_lightning_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ONCHAIN_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ONCHAIN_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_onchain_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ORDERS uint16_t uniffi_bitkitcore_checksum_func_upsert_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_upsert_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TAGS uint16_t uniffi_bitkitcore_checksum_func_upsert_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_upsert_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_BITCOIN_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_BITCOIN_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_validate_bitcoin_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_validate_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_wipe_all_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_DATABASES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_DATABASES uint16_t uniffi_bitkitcore_checksum_func_wipe_all_databases(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_wipe_all_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_EVENTLISTENER_ON_EVENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_EVENTLISTENER_ON_EVENT uint16_t uniffi_bitkitcore_checksum_method_eventlistener_on_event(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_ENUMERATE_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_ENUMERATE_DEVICES uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_enumerate_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_OPEN_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_OPEN_DEVICE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_open_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CLOSE_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CLOSE_DEVICE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_close_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_READ_CHUNK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_READ_CHUNK uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_read_chunk(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_WRITE_CHUNK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_WRITE_CHUNK uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_write_chunk(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_CHUNK_SIZE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_CHUNK_SIZE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_get_chunk_size(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CALL_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CALL_MESSAGE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_call_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_PAIRING_CODE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_PAIRING_CODE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_get_pairing_code(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_SAVE_THP_CREDENTIAL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_SAVE_THP_CREDENTIAL uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_save_thp_credential(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOAD_THP_CREDENTIAL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOAD_THP_CREDENTIAL uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_load_thp_credential(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOG_DEBUG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOG_DEBUG uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_log_debug(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PIN_REQUEST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PIN_REQUEST uint16_t uniffi_bitkitcore_checksum_method_trezoruicallback_on_pin_request(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PASSPHRASE_REQUEST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PASSPHRASE_REQUEST uint16_t uniffi_bitkitcore_checksum_method_trezoruicallback_on_passphrase_request(void - + ); #endif #ifndef UNIFFI_FFIDEF_FFI_BITKITCORE_UNIFFI_CONTRACT_VERSION #define UNIFFI_FFIDEF_FFI_BITKITCORE_UNIFFI_CONTRACT_VERSION uint32_t ffi_bitkitcore_uniffi_contract_version(void - + ); #endif diff --git a/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/libbitkitcore.a b/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/libbitkitcore.a index 0f62ccb..38be0dc 100644 Binary files a/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/libbitkitcore.a and b/bindings/ios/BitkitCore.xcframework/ios-arm64-simulator/libbitkitcore.a differ diff --git a/bindings/ios/BitkitCore.xcframework/ios-arm64/Headers/bitkitcoreFFI.h b/bindings/ios/BitkitCore.xcframework/ios-arm64/Headers/bitkitcoreFFI.h index adc6b27..f28c6c6 100644 --- a/bindings/ios/BitkitCore.xcframework/ios-arm64/Headers/bitkitcoreFFI.h +++ b/bindings/ios/BitkitCore.xcframework/ios-arm64/Headers/bitkitcoreFFI.h @@ -253,98 +253,98 @@ typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStr #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 -typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, +typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD0 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD1 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD1 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod1)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod1)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD2 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD2 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod2)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod2)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD3 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD3 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod3)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod3)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD4 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD4 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod4)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod4)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD5 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD5 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod5)(uint64_t, RustBuffer, uint32_t* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod5)(uint64_t, RustBuffer, uint32_t* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD6 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD6 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod6)(uint64_t, RustBuffer, uint16_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod6)(uint64_t, RustBuffer, uint16_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD7 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD7 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod7)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod7)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD8 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD8 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod8)(uint64_t, RustBuffer, RustBuffer, int8_t* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod8)(uint64_t, RustBuffer, RustBuffer, int8_t* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD9 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD9 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod9)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod9)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD10 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD10 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod10)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod10)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD0 -typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD1 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD1 -typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod1)(uint64_t, int8_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod1)(uint64_t, int8_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); @@ -502,7 +502,7 @@ RustBuffer uniffi_bitkitcore_fn_method_trezoruicallback_on_passphrase_request(vo #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ACTIVITY_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ACTIVITY_WIPE_ALL void uniffi_bitkitcore_fn_func_activity_wipe_all(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA @@ -512,12 +512,12 @@ void uniffi_bitkitcore_fn_func_add_pre_activity_metadata(RustBuffer pre_activity #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags(RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_TAGS -void uniffi_bitkitcore_fn_func_add_tags(RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_add_tags(RustBuffer wallet_id, RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_APPROVE_PUBKY_AUTH @@ -528,19 +528,19 @@ uint64_t uniffi_bitkitcore_fn_func_approve_pubky_auth(RustBuffer auth_url, RustB #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES uint64_t uniffi_bitkitcore_fn_func_blocktank_remove_all_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS uint64_t uniffi_bitkitcore_fn_func_blocktank_remove_all_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_WIPE_ALL uint64_t uniffi_bitkitcore_fn_func_blocktank_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BROADCAST_SWEEP_TRANSACTION @@ -556,7 +556,7 @@ RustBuffer uniffi_bitkitcore_fn_func_calculate_channel_liquidity_options(RustBuf #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CANCEL_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CANCEL_PUBKY_AUTH uint64_t uniffi_bitkitcore_fn_func_cancel_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CHECK_SWEEPABLE_BALANCES @@ -567,7 +567,7 @@ uint64_t uniffi_bitkitcore_fn_func_check_sweepable_balances(RustBuffer mnemonic_ #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_COMPLETE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_COMPLETE_PUBKY_AUTH uint64_t uniffi_bitkitcore_fn_func_complete_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CREATE_CHANNEL_REQUEST_URL @@ -595,19 +595,24 @@ RustBuffer uniffi_bitkitcore_fn_func_create_withdraw_callback_url(RustBuffer k1, uint64_t uniffi_bitkitcore_fn_func_decode(RustBuffer invoice ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +uint32_t uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id(RustBuffer wallet_id, RustCallStatus *_Nonnull out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITY_BY_ID -int8_t uniffi_bitkitcore_fn_func_delete_activity_by_id(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +int8_t uniffi_bitkitcore_fn_func_delete_activity_by_id(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_PRE_ACTIVITY_METADATA -void uniffi_bitkitcore_fn_func_delete_pre_activity_metadata(RustBuffer payment_id, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_delete_pre_activity_metadata(RustBuffer wallet_id, RustBuffer payment_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_TRANSACTION_DETAILS -int8_t uniffi_bitkitcore_fn_func_delete_transaction_details(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +int8_t uniffi_bitkitcore_fn_func_delete_transaction_details(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DERIVE_BITCOIN_ADDRESS @@ -677,28 +682,28 @@ RustBuffer uniffi_bitkitcore_fn_func_generate_mnemonic(RustBuffer word_count, Ru #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES -RustBuffer uniffi_bitkitcore_fn_func_get_activities(RustBuffer filter, RustBuffer tx_type, RustBuffer tags, RustBuffer search, RustBuffer min_date, RustBuffer max_date, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activities(RustBuffer wallet_id, RustBuffer filter, RustBuffer tx_type, RustBuffer tags, RustBuffer search, RustBuffer min_date, RustBuffer max_date, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES_BY_TAG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES_BY_TAG -RustBuffer uniffi_bitkitcore_fn_func_get_activities_by_tag(RustBuffer tag, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activities_by_tag(RustBuffer wallet_id, RustBuffer tag, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_ID -RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_id(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_id(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_TX_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_TX_ID -RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_tx_id(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_tx_id(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_ACTIVITIES_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_ACTIVITIES_TAGS RustBuffer uniffi_bitkitcore_fn_func_get_all_activities_tags(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_CLOSED_CHANNELS @@ -709,19 +714,19 @@ RustBuffer uniffi_bitkitcore_fn_func_get_all_closed_channels(RustBuffer sort_dir #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_PRE_ACTIVITY_METADATA RustBuffer uniffi_bitkitcore_fn_func_get_all_pre_activity_metadata(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_TRANSACTION_DETAILS RustBuffer uniffi_bitkitcore_fn_func_get_all_transaction_details(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_UNIQUE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_UNIQUE_TAGS RustBuffer uniffi_bitkitcore_fn_func_get_all_unique_tags(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_SUGGESTIONS @@ -732,7 +737,7 @@ RustBuffer uniffi_bitkitcore_fn_func_get_bip39_suggestions(RustBuffer partial_wo #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_WORDLIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_WORDLIST RustBuffer uniffi_bitkitcore_fn_func_get_bip39_wordlist(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_CJIT_ENTRIES @@ -748,6 +753,12 @@ RustBuffer uniffi_bitkitcore_fn_func_get_closed_channel_by_id(RustBuffer channel #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_LSP_BALANCE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_LSP_BALANCE uint64_t uniffi_bitkitcore_fn_func_get_default_lsp_balance(RustBuffer params, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_WALLET_ID +RustBuffer uniffi_bitkitcore_fn_func_get_default_wallet_id(RustCallStatus *_Nonnull out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_GIFT @@ -782,17 +793,17 @@ uint64_t uniffi_bitkitcore_fn_func_get_payment(RustBuffer payment_id #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_PRE_ACTIVITY_METADATA -RustBuffer uniffi_bitkitcore_fn_func_get_pre_activity_metadata(RustBuffer search_key, int8_t search_by_address, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_pre_activity_metadata(RustBuffer wallet_id, RustBuffer search_key, int8_t search_by_address, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TAGS -RustBuffer uniffi_bitkitcore_fn_func_get_tags(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_tags(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TRANSACTION_DETAILS -RustBuffer uniffi_bitkitcore_fn_func_get_transaction_details(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_transaction_details(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GIFT_ORDER @@ -832,7 +843,7 @@ uint64_t uniffi_bitkitcore_fn_func_lnurl_auth(RustBuffer domain, RustBuffer k1, #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MARK_ACTIVITY_AS_SEEN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MARK_ACTIVITY_AS_SEEN -void uniffi_bitkitcore_fn_func_mark_activity_as_seen(RustBuffer activity_id, uint64_t seen_at, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_mark_activity_as_seen(RustBuffer wallet_id, RustBuffer activity_id, uint64_t seen_at, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MNEMONIC_TO_ENTROPY @@ -883,7 +894,7 @@ uint64_t uniffi_bitkitcore_fn_func_onchain_start_watcher(RustBuffer params, void #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_ALL_WATCHERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_ALL_WATCHERS void uniffi_bitkitcore_fn_func_onchain_stop_all_watchers(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_WATCHER @@ -949,13 +960,13 @@ uint64_t uniffi_bitkitcore_fn_func_pubky_sign_up(RustBuffer secret_key_hex, Rust #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES uint64_t uniffi_bitkitcore_fn_func_refresh_active_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_ORDERS uint64_t uniffi_bitkitcore_fn_func_refresh_active_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REGISTER_DEVICE @@ -995,17 +1006,17 @@ int8_t uniffi_bitkitcore_fn_func_remove_closed_channel_by_id(RustBuffer channel_ #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags(RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_TAGS -void uniffi_bitkitcore_fn_func_remove_tags(RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_remove_tags(RustBuffer wallet_id, RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags(RustBuffer payment_id, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESOLVE_PUBKY_URL @@ -1046,7 +1057,7 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_connect(RustBuffer device_id, RustBuff #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_DISCONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_DISCONNECT uint64_t uniffi_bitkitcore_fn_func_trezor_disconnect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_ADDRESS @@ -1057,19 +1068,19 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_get_address(RustBuffer params #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_CONNECTED_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_CONNECTED_DEVICE uint64_t uniffi_bitkitcore_fn_func_trezor_get_connected_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_DEVICE_FINGERPRINT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_DEVICE_FINGERPRINT uint64_t uniffi_bitkitcore_fn_func_trezor_get_device_fingerprint(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_FEATURES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_FEATURES uint64_t uniffi_bitkitcore_fn_func_trezor_get_features(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_PUBLIC_KEY @@ -1085,31 +1096,31 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_initialize(RustBuffer credential_path #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_BLE_AVAILABLE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_BLE_AVAILABLE int8_t uniffi_bitkitcore_fn_func_trezor_is_ble_available(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_CONNECTED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_CONNECTED uint64_t uniffi_bitkitcore_fn_func_trezor_is_connected(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_INITIALIZED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_INITIALIZED uint64_t uniffi_bitkitcore_fn_func_trezor_is_initialized(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_LIST_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_LIST_DEVICES uint64_t uniffi_bitkitcore_fn_func_trezor_list_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SCAN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SCAN uint64_t uniffi_bitkitcore_fn_func_trezor_scan(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SET_TRANSPORT_CALLBACK @@ -1225,19 +1236,19 @@ void uniffi_bitkitcore_fn_func_validate_mnemonic(RustBuffer mnemonic_phrase, Rus #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_CLOSED_CHANNELS void uniffi_bitkitcore_fn_func_wipe_all_closed_channels(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_DATABASES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_DATABASES uint64_t uniffi_bitkitcore_fn_func_wipe_all_databases(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_TRANSACTION_DETAILS void uniffi_bitkitcore_fn_func_wipe_all_transaction_details(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_FFI_BITKITCORE_RUSTBUFFER_ALLOC @@ -1523,949 +1534,961 @@ void ffi_bitkitcore_rust_future_complete_void(uint64_t handle, RustCallStatus *_ #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ACTIVITY_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ACTIVITY_WIPE_ALL uint16_t uniffi_bitkitcore_checksum_func_activity_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_add_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_TAGS uint16_t uniffi_bitkitcore_checksum_func_add_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_APPROVE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_APPROVE_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_approve_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_blocktank_remove_all_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS uint16_t uniffi_bitkitcore_checksum_func_blocktank_remove_all_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_WIPE_ALL uint16_t uniffi_bitkitcore_checksum_func_blocktank_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BROADCAST_SWEEP_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BROADCAST_SWEEP_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_broadcast_sweep_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CALCULATE_CHANNEL_LIQUIDITY_OPTIONS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CALCULATE_CHANNEL_LIQUIDITY_OPTIONS uint16_t uniffi_bitkitcore_checksum_func_calculate_channel_liquidity_options(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CANCEL_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CANCEL_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_cancel_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CHECK_SWEEPABLE_BALANCES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CHECK_SWEEPABLE_BALANCES uint16_t uniffi_bitkitcore_checksum_func_check_sweepable_balances(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_COMPLETE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_COMPLETE_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_complete_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CHANNEL_REQUEST_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CHANNEL_REQUEST_URL uint16_t uniffi_bitkitcore_checksum_func_create_channel_request_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CJIT_ENTRY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CJIT_ENTRY uint16_t uniffi_bitkitcore_checksum_func_create_cjit_entry(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_ORDER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_ORDER uint16_t uniffi_bitkitcore_checksum_func_create_order(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_WITHDRAW_CALLBACK_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_WITHDRAW_CALLBACK_URL uint16_t uniffi_bitkitcore_checksum_func_create_withdraw_callback_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DECODE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DECODE uint16_t uniffi_bitkitcore_checksum_func_decode(void - + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +uint16_t uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITY_BY_ID uint16_t uniffi_bitkitcore_checksum_func_delete_activity_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_delete_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_derive_bitcoin_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESSES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESSES uint16_t uniffi_bitkitcore_checksum_func_derive_bitcoin_addresses(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_ONCHAIN_DESCRIPTOR #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_ONCHAIN_DESCRIPTOR uint16_t uniffi_bitkitcore_checksum_func_derive_onchain_descriptor(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PRIVATE_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PRIVATE_KEY uint16_t uniffi_bitkitcore_checksum_func_derive_private_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PUBKY_SECRET_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PUBKY_SECRET_KEY uint16_t uniffi_bitkitcore_checksum_func_derive_pubky_secret_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ENTROPY_TO_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ENTROPY_TO_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_entropy_to_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE uint16_t uniffi_bitkitcore_checksum_func_estimate_order_fee(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE_FULL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE_FULL uint16_t uniffi_bitkitcore_checksum_func_estimate_order_fee_full(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_CONTACTS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_CONTACTS uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_contacts(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_file(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE_STRING #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE_STRING uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_file_string(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_PROFILE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_PROFILE uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_profile(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GENERATE_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GENERATE_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_generate_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_get_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES_BY_TAG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES_BY_TAG uint16_t uniffi_bitkitcore_checksum_func_get_activities_by_tag(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_ID uint16_t uniffi_bitkitcore_checksum_func_get_activity_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_TX_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_TX_ID uint16_t uniffi_bitkitcore_checksum_func_get_activity_by_tx_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_ACTIVITIES_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_ACTIVITIES_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_all_activities_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_get_all_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_get_all_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_get_all_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_UNIQUE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_UNIQUE_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_all_unique_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_SUGGESTIONS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_SUGGESTIONS uint16_t uniffi_bitkitcore_checksum_func_get_bip39_suggestions(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_WORDLIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_WORDLIST uint16_t uniffi_bitkitcore_checksum_func_get_bip39_wordlist(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_get_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CLOSED_CHANNEL_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CLOSED_CHANNEL_BY_ID uint16_t uniffi_bitkitcore_checksum_func_get_closed_channel_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_LSP_BALANCE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_LSP_BALANCE uint16_t uniffi_bitkitcore_checksum_func_get_default_lsp_balance(void - + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_WALLET_ID +uint16_t uniffi_bitkitcore_checksum_func_get_default_wallet_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_GIFT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_GIFT uint16_t uniffi_bitkitcore_checksum_func_get_gift(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_INFO uint16_t uniffi_bitkitcore_checksum_func_get_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_LNURL_INVOICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_LNURL_INVOICE uint16_t uniffi_bitkitcore_checksum_func_get_lnurl_invoice(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_MIN_ZERO_CONF_TX_FEE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_MIN_ZERO_CONF_TX_FEE uint16_t uniffi_bitkitcore_checksum_func_get_min_zero_conf_tx_fee(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ORDERS uint16_t uniffi_bitkitcore_checksum_func_get_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PAYMENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PAYMENT uint16_t uniffi_bitkitcore_checksum_func_get_payment(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_get_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_get_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_ORDER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_ORDER uint16_t uniffi_bitkitcore_checksum_func_gift_order(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_PAY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_PAY uint16_t uniffi_bitkitcore_checksum_func_gift_pay(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INIT_DB #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INIT_DB uint16_t uniffi_bitkitcore_checksum_func_init_db(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INSERT_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INSERT_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_insert_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_ADDRESS_USED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_ADDRESS_USED uint16_t uniffi_bitkitcore_checksum_func_is_address_used(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_VALID_BIP39_WORD #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_VALID_BIP39_WORD uint16_t uniffi_bitkitcore_checksum_func_is_valid_bip39_word(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_LNURL_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_LNURL_AUTH uint16_t uniffi_bitkitcore_checksum_func_lnurl_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MARK_ACTIVITY_AS_SEEN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MARK_ACTIVITY_AS_SEEN uint16_t uniffi_bitkitcore_checksum_func_mark_activity_as_seen(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_ENTROPY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_ENTROPY uint16_t uniffi_bitkitcore_checksum_func_mnemonic_to_entropy(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_SEED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_SEED uint16_t uniffi_bitkitcore_checksum_func_mnemonic_to_seed(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_BROADCAST_RAW_TX #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_BROADCAST_RAW_TX uint16_t uniffi_bitkitcore_checksum_func_onchain_broadcast_raw_tx(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_COMPOSE_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_COMPOSE_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_onchain_compose_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ACCOUNT_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ACCOUNT_INFO uint16_t uniffi_bitkitcore_checksum_func_onchain_get_account_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ADDRESS_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ADDRESS_INFO uint16_t uniffi_bitkitcore_checksum_func_onchain_get_address_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_DETAIL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_DETAIL uint16_t uniffi_bitkitcore_checksum_func_onchain_get_transaction_detail(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_HISTORY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_HISTORY uint16_t uniffi_bitkitcore_checksum_func_onchain_get_transaction_history(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_START_WATCHER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_START_WATCHER uint16_t uniffi_bitkitcore_checksum_func_onchain_start_watcher(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_ALL_WATCHERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_ALL_WATCHERS uint16_t uniffi_bitkitcore_checksum_func_onchain_stop_all_watchers(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_WATCHER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_WATCHER uint16_t uniffi_bitkitcore_checksum_func_onchain_stop_watcher(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_OPEN_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_OPEN_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_open_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PARSE_PUBKY_AUTH_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PARSE_PUBKY_AUTH_URL uint16_t uniffi_bitkitcore_checksum_func_parse_pubky_auth_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_SWEEP #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_SWEEP uint16_t uniffi_bitkitcore_checksum_func_prepare_legacy_rn_native_segwit_recovery_sweep(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_SWEEP_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_SWEEP_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_prepare_sweep_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUBLIC_KEY_FROM_SECRET #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUBLIC_KEY_FROM_SECRET uint16_t uniffi_bitkitcore_checksum_func_pubky_public_key_from_secret(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUT_WITH_SECRET_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUT_WITH_SECRET_KEY uint16_t uniffi_bitkitcore_checksum_func_pubky_put_with_secret_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_DELETE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_DELETE uint16_t uniffi_bitkitcore_checksum_func_pubky_session_delete(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_LIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_LIST uint16_t uniffi_bitkitcore_checksum_func_pubky_session_list(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_PUT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_PUT uint16_t uniffi_bitkitcore_checksum_func_pubky_session_put(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_IN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_IN uint16_t uniffi_bitkitcore_checksum_func_pubky_sign_in(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_UP #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_UP uint16_t uniffi_bitkitcore_checksum_func_pubky_sign_up(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_refresh_active_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_ORDERS uint16_t uniffi_bitkitcore_checksum_func_refresh_active_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGISTER_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGISTER_DEVICE uint16_t uniffi_bitkitcore_checksum_func_register_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_CLOSE_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_CLOSE_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_regtest_close_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_DEPOSIT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_DEPOSIT uint16_t uniffi_bitkitcore_checksum_func_regtest_deposit(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_GET_PAYMENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_GET_PAYMENT uint16_t uniffi_bitkitcore_checksum_func_regtest_get_payment(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_MINE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_MINE uint16_t uniffi_bitkitcore_checksum_func_regtest_mine(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_PAY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_PAY uint16_t uniffi_bitkitcore_checksum_func_regtest_pay(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_CLOSED_CHANNEL_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_CLOSED_CHANNEL_BY_ID uint16_t uniffi_bitkitcore_checksum_func_remove_closed_channel_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_TAGS uint16_t uniffi_bitkitcore_checksum_func_remove_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESOLVE_PUBKY_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESOLVE_PUBKY_URL uint16_t uniffi_bitkitcore_checksum_func_resolve_pubky_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_SCAN_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_FUNDS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_SCAN_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_FUNDS uint16_t uniffi_bitkitcore_checksum_func_scan_legacy_rn_native_segwit_recovery_funds(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_START_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_START_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_start_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TEST_NOTIFICATION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TEST_NOTIFICATION uint16_t uniffi_bitkitcore_checksum_func_test_notification(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_ACCOUNT_TYPE_TO_SCRIPT_TYPE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_ACCOUNT_TYPE_TO_SCRIPT_TYPE uint16_t uniffi_bitkitcore_checksum_func_trezor_account_type_to_script_type(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CLEAR_CREDENTIALS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CLEAR_CREDENTIALS uint16_t uniffi_bitkitcore_checksum_func_trezor_clear_credentials(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CONNECT uint16_t uniffi_bitkitcore_checksum_func_trezor_connect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_DISCONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_DISCONNECT uint16_t uniffi_bitkitcore_checksum_func_trezor_disconnect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_trezor_get_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_CONNECTED_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_CONNECTED_DEVICE uint16_t uniffi_bitkitcore_checksum_func_trezor_get_connected_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_DEVICE_FINGERPRINT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_DEVICE_FINGERPRINT uint16_t uniffi_bitkitcore_checksum_func_trezor_get_device_fingerprint(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_FEATURES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_FEATURES uint16_t uniffi_bitkitcore_checksum_func_trezor_get_features(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_PUBLIC_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_PUBLIC_KEY uint16_t uniffi_bitkitcore_checksum_func_trezor_get_public_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_INITIALIZE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_INITIALIZE uint16_t uniffi_bitkitcore_checksum_func_trezor_initialize(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_BLE_AVAILABLE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_BLE_AVAILABLE uint16_t uniffi_bitkitcore_checksum_func_trezor_is_ble_available(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_CONNECTED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_CONNECTED uint16_t uniffi_bitkitcore_checksum_func_trezor_is_connected(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_INITIALIZED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_INITIALIZED uint16_t uniffi_bitkitcore_checksum_func_trezor_is_initialized(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_LIST_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_LIST_DEVICES uint16_t uniffi_bitkitcore_checksum_func_trezor_list_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SCAN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SCAN uint16_t uniffi_bitkitcore_checksum_func_trezor_scan(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_TRANSPORT_CALLBACK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_TRANSPORT_CALLBACK uint16_t uniffi_bitkitcore_checksum_func_trezor_set_transport_callback(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_UI_CALLBACK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_UI_CALLBACK uint16_t uniffi_bitkitcore_checksum_func_trezor_set_ui_callback(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_MESSAGE uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_tx(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX_FROM_PSBT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX_FROM_PSBT uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_tx_from_psbt(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_VERIFY_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_VERIFY_MESSAGE uint16_t uniffi_bitkitcore_checksum_func_trezor_verify_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_update_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_BLOCKTANK_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_BLOCKTANK_URL uint16_t uniffi_bitkitcore_checksum_func_update_blocktank_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_upsert_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_upsert_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_upsert_closed_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_upsert_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_INFO uint16_t uniffi_bitkitcore_checksum_func_upsert_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_LIGHTNING_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_LIGHTNING_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_lightning_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ONCHAIN_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ONCHAIN_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_onchain_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ORDERS uint16_t uniffi_bitkitcore_checksum_func_upsert_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_upsert_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TAGS uint16_t uniffi_bitkitcore_checksum_func_upsert_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_upsert_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_BITCOIN_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_BITCOIN_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_validate_bitcoin_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_validate_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_wipe_all_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_DATABASES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_DATABASES uint16_t uniffi_bitkitcore_checksum_func_wipe_all_databases(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_wipe_all_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_EVENTLISTENER_ON_EVENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_EVENTLISTENER_ON_EVENT uint16_t uniffi_bitkitcore_checksum_method_eventlistener_on_event(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_ENUMERATE_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_ENUMERATE_DEVICES uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_enumerate_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_OPEN_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_OPEN_DEVICE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_open_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CLOSE_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CLOSE_DEVICE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_close_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_READ_CHUNK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_READ_CHUNK uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_read_chunk(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_WRITE_CHUNK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_WRITE_CHUNK uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_write_chunk(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_CHUNK_SIZE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_CHUNK_SIZE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_get_chunk_size(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CALL_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CALL_MESSAGE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_call_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_PAIRING_CODE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_PAIRING_CODE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_get_pairing_code(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_SAVE_THP_CREDENTIAL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_SAVE_THP_CREDENTIAL uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_save_thp_credential(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOAD_THP_CREDENTIAL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOAD_THP_CREDENTIAL uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_load_thp_credential(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOG_DEBUG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOG_DEBUG uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_log_debug(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PIN_REQUEST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PIN_REQUEST uint16_t uniffi_bitkitcore_checksum_method_trezoruicallback_on_pin_request(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PASSPHRASE_REQUEST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PASSPHRASE_REQUEST uint16_t uniffi_bitkitcore_checksum_method_trezoruicallback_on_passphrase_request(void - + ); #endif #ifndef UNIFFI_FFIDEF_FFI_BITKITCORE_UNIFFI_CONTRACT_VERSION #define UNIFFI_FFIDEF_FFI_BITKITCORE_UNIFFI_CONTRACT_VERSION uint32_t ffi_bitkitcore_uniffi_contract_version(void - + ); #endif diff --git a/bindings/ios/BitkitCore.xcframework/ios-arm64/libbitkitcore.a b/bindings/ios/BitkitCore.xcframework/ios-arm64/libbitkitcore.a index a23a1b3..83364cb 100644 Binary files a/bindings/ios/BitkitCore.xcframework/ios-arm64/libbitkitcore.a and b/bindings/ios/BitkitCore.xcframework/ios-arm64/libbitkitcore.a differ diff --git a/bindings/ios/bitkitcore.swift b/bindings/ios/bitkitcore.swift index c3e006b..1381385 100644 --- a/bindings/ios/bitkitcore.swift +++ b/bindings/ios/bitkitcore.swift @@ -592,15 +592,15 @@ fileprivate struct FfiConverterData: FfiConverterRustBuffer { * from xpub watchers. */ public protocol EventListener: AnyObject, Sendable { - + /** * Called when a watcher event occurs. * * `watcher_id` identifies which watcher produced the event. * `event` is a typed enum — no JSON parsing needed. */ - func onEvent(watcherId: String, event: WatcherEvent) - + func onEvent(watcherId: String, event: WatcherEvent) + } /** * Callback interface for receiving watcher events. @@ -657,9 +657,9 @@ open class EventListenerImpl: EventListener, @unchecked Sendable { try! rustCall { uniffi_bitkitcore_fn_free_eventlistener(pointer, $0) } } - - + + /** * Called when a watcher event occurs. * @@ -673,7 +673,7 @@ open func onEvent(watcherId: String, event: WatcherEvent) {try! rustCall() { ) } } - + } @@ -705,7 +705,7 @@ fileprivate struct UniffiCallbackInterfaceEventListener { ) } - + let writeReturn = { () } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -808,37 +808,37 @@ public func FfiConverterTypeEventListener_lower(_ value: EventListener) -> Unsaf * Use IOKit/CoreBluetooth with same service/characteristic UUIDs. */ public protocol TrezorTransportCallback: AnyObject, Sendable { - + /** * Enumerate all connected Trezor devices */ func enumerateDevices() -> [NativeDeviceInfo] - + /** * Open a connection to a device */ func openDevice(path: String) -> TrezorTransportWriteResult - + /** * Close the connection to a device */ func closeDevice(path: String) -> TrezorTransportWriteResult - + /** * Read a chunk of data from the device */ func readChunk(path: String) -> TrezorTransportReadResult - + /** * Write a chunk of data to the device */ func writeChunk(path: String, data: Data) -> TrezorTransportWriteResult - + /** * Get the chunk size for a device (64 for USB, 244 for Bluetooth) */ func getChunkSize(path: String) -> UInt32 - + /** * High-level message call for BLE/THP devices. * @@ -855,7 +855,7 @@ public protocol TrezorTransportCallback: AnyObject, Sendable { * * `data` - Serialized protobuf message data */ func callMessage(path: String, messageType: UInt16, data: Data) -> TrezorCallMessageResult? - + /** * Get pairing code from user during BLE THP pairing. * @@ -868,7 +868,7 @@ public protocol TrezorTransportCallback: AnyObject, Sendable { * Returns the 6-digit code as a string, or empty string to cancel. */ func getPairingCode() -> String - + /** * Save THP pairing credentials for a device. * @@ -882,7 +882,7 @@ public protocol TrezorTransportCallback: AnyObject, Sendable { * Returns true if credentials were saved successfully. */ func saveThpCredential(deviceId: String, credentialJson: String) -> Bool - + /** * Load THP pairing credentials for a device. * @@ -895,7 +895,7 @@ public protocol TrezorTransportCallback: AnyObject, Sendable { * Returns the JSON string containing ThpCredentials, or None if not found. */ func loadThpCredential(deviceId: String) -> String? - + /** * Log a debug message from the Rust THP handshake layer. * @@ -907,8 +907,8 @@ public protocol TrezorTransportCallback: AnyObject, Sendable { * * `tag` - Short tag identifying the subsystem (e.g., "HANDSHAKE", "THP") * * `message` - Human-readable debug message */ - func logDebug(tag: String, message: String) - + func logDebug(tag: String, message: String) + } /** * Callback interface for native Trezor transport operations @@ -981,9 +981,9 @@ open class TrezorTransportCallbackImpl: TrezorTransportCallback, @unchecked Send try! rustCall { uniffi_bitkitcore_fn_free_trezortransportcallback(pointer, $0) } } - - + + /** * Enumerate all connected Trezor devices */ @@ -993,7 +993,7 @@ open func enumerateDevices() -> [NativeDeviceInfo] { ) }) } - + /** * Open a connection to a device */ @@ -1004,7 +1004,7 @@ open func openDevice(path: String) -> TrezorTransportWriteResult { ) }) } - + /** * Close the connection to a device */ @@ -1015,7 +1015,7 @@ open func closeDevice(path: String) -> TrezorTransportWriteResult { ) }) } - + /** * Read a chunk of data from the device */ @@ -1026,7 +1026,7 @@ open func readChunk(path: String) -> TrezorTransportReadResult { ) }) } - + /** * Write a chunk of data to the device */ @@ -1038,7 +1038,7 @@ open func writeChunk(path: String, data: Data) -> TrezorTransportWriteResult { ) }) } - + /** * Get the chunk size for a device (64 for USB, 244 for Bluetooth) */ @@ -1049,7 +1049,7 @@ open func getChunkSize(path: String) -> UInt32 { ) }) } - + /** * High-level message call for BLE/THP devices. * @@ -1074,7 +1074,7 @@ open func callMessage(path: String, messageType: UInt16, data: Data) -> TrezorCa ) }) } - + /** * Get pairing code from user during BLE THP pairing. * @@ -1092,7 +1092,7 @@ open func getPairingCode() -> String { ) }) } - + /** * Save THP pairing credentials for a device. * @@ -1113,7 +1113,7 @@ open func saveThpCredential(deviceId: String, credentialJson: String) -> Bool { ) }) } - + /** * Load THP pairing credentials for a device. * @@ -1132,7 +1132,7 @@ open func loadThpCredential(deviceId: String) -> String? { ) }) } - + /** * Log a debug message from the Rust THP handshake layer. * @@ -1151,7 +1151,7 @@ open func logDebug(tag: String, message: String) {try! rustCall() { ) } } - + } @@ -1179,7 +1179,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterSequenceTypeNativeDeviceInfo.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1203,7 +1203,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypeTrezorTransportWriteResult_lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1227,7 +1227,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypeTrezorTransportWriteResult_lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1251,7 +1251,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypeTrezorTransportReadResult_lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1277,7 +1277,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypeTrezorTransportWriteResult_lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1301,7 +1301,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterUInt32.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1329,7 +1329,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterOptionTypeTrezorCallMessageResult.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1351,7 +1351,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterString.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1377,7 +1377,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterBool.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1401,7 +1401,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterOptionString.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1427,7 +1427,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorTransportCallback { ) } - + let writeReturn = { () } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1514,7 +1514,7 @@ public func FfiConverterTypeTrezorTransportCallback_lower(_ value: TrezorTranspo * input UI when the device requests it during operations like signing. */ public protocol TrezorUiCallback: AnyObject, Sendable { - + /** * Called when the device requests a PIN. * @@ -1522,7 +1522,7 @@ public protocol TrezorUiCallback: AnyObject, Sendable { * Return empty string to cancel. */ func onPinRequest() -> String - + /** * Called when the device requests a passphrase. * @@ -1534,7 +1534,7 @@ public protocol TrezorUiCallback: AnyObject, Sendable { * `OnDevice` (defer entry to the Trezor), or `Cancel`. */ func onPassphraseRequest(onDevice: Bool) -> PassphraseResponse - + } /** * Callback interface for handling PIN and passphrase requests from the Trezor device. @@ -1591,9 +1591,9 @@ open class TrezorUiCallbackImpl: TrezorUiCallback, @unchecked Sendable { try! rustCall { uniffi_bitkitcore_fn_free_trezoruicallback(pointer, $0) } } - - + + /** * Called when the device requests a PIN. * @@ -1606,7 +1606,7 @@ open func onPinRequest() -> String { ) }) } - + /** * Called when the device requests a passphrase. * @@ -1624,7 +1624,7 @@ open func onPassphraseRequest(onDevice: Bool) -> PassphraseResponse { ) }) } - + } @@ -1652,7 +1652,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorUiCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterString.lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1676,7 +1676,7 @@ fileprivate struct UniffiCallbackInterfaceTrezorUiCallback { ) } - + let writeReturn = { uniffiOutReturn.pointee = FfiConverterTypePassphraseResponse_lower($0) } uniffiTraitInterfaceCall( callStatus: uniffiCallStatus, @@ -1776,10 +1776,10 @@ public struct AccountAddresses { public init( /** * Used receive addresses (have at least one transaction) - */used: [AddressInfo], + */used: [AddressInfo], /** * Unused receive addresses (no transactions yet) - */unused: [AddressInfo], + */unused: [AddressInfo], /** * Change addresses */change: [AddressInfo]) { @@ -1826,8 +1826,8 @@ public struct FfiConverterTypeAccountAddresses: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountAddresses { return try AccountAddresses( - used: FfiConverterSequenceTypeAddressInfo.read(from: &buf), - unused: FfiConverterSequenceTypeAddressInfo.read(from: &buf), + used: FfiConverterSequenceTypeAddressInfo.read(from: &buf), + unused: FfiConverterSequenceTypeAddressInfo.read(from: &buf), change: FfiConverterSequenceTypeAddressInfo.read(from: &buf) ) } @@ -1885,16 +1885,16 @@ public struct AccountInfoResult { public init( /** * The account structure with addresses and UTXOs - */account: ComposeAccount, + */account: ComposeAccount, /** * Total confirmed balance in satoshis - */balance: UInt64, + */balance: UInt64, /** * Number of UTXOs - */utxoCount: UInt32, + */utxoCount: UInt32, /** * The detected or specified account type - */accountType: AccountType, + */accountType: AccountType, /** * The current blockchain tip height */blockHeight: UInt32) { @@ -1951,10 +1951,10 @@ public struct FfiConverterTypeAccountInfoResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountInfoResult { return try AccountInfoResult( - account: FfiConverterTypeComposeAccount.read(from: &buf), - balance: FfiConverterUInt64.read(from: &buf), - utxoCount: FfiConverterUInt32.read(from: &buf), - accountType: FfiConverterTypeAccountType.read(from: &buf), + account: FfiConverterTypeComposeAccount.read(from: &buf), + balance: FfiConverterUInt64.read(from: &buf), + utxoCount: FfiConverterUInt32.read(from: &buf), + accountType: FfiConverterTypeAccountType.read(from: &buf), blockHeight: FfiConverterUInt32.read(from: &buf) ) } @@ -2034,31 +2034,31 @@ public struct AccountUtxo { public init( /** * Transaction ID (hex) - */txid: String, + */txid: String, /** * Output index - */vout: UInt32, + */vout: UInt32, /** * Amount in satoshis - */amount: UInt64, + */amount: UInt64, /** * Block height where the UTXO was confirmed (0 if unconfirmed) - */blockHeight: UInt32, + */blockHeight: UInt32, /** * Address holding this UTXO - */address: String, + */address: String, /** * BIP32 derivation path (e.g., "m/84'/0'/0'/0/0") - */path: String, + */path: String, /** * Number of confirmations (0 if unconfirmed) - */confirmations: UInt32, + */confirmations: UInt32, /** * Whether this is a coinbase output - */coinbase: Bool, + */coinbase: Bool, /** * Whether this UTXO is owned by the account - */own: Bool, + */own: Bool, /** * Whether this UTXO must be included in the transaction */required: Bool?) { @@ -2140,15 +2140,15 @@ public struct FfiConverterTypeAccountUtxo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountUtxo { return try AccountUtxo( - txid: FfiConverterString.read(from: &buf), - vout: FfiConverterUInt32.read(from: &buf), - amount: FfiConverterUInt64.read(from: &buf), - blockHeight: FfiConverterUInt32.read(from: &buf), - address: FfiConverterString.read(from: &buf), - path: FfiConverterString.read(from: &buf), - confirmations: FfiConverterUInt32.read(from: &buf), - coinbase: FfiConverterBool.read(from: &buf), - own: FfiConverterBool.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + vout: FfiConverterUInt32.read(from: &buf), + amount: FfiConverterUInt64.read(from: &buf), + blockHeight: FfiConverterUInt32.read(from: &buf), + address: FfiConverterString.read(from: &buf), + path: FfiConverterString.read(from: &buf), + confirmations: FfiConverterUInt32.read(from: &buf), + coinbase: FfiConverterBool.read(from: &buf), + own: FfiConverterBool.read(from: &buf), required: FfiConverterOptionBool.read(from: &buf) ) } @@ -2184,12 +2184,14 @@ public func FfiConverterTypeAccountUtxo_lower(_ value: AccountUtxo) -> RustBuffe public struct ActivityTags { + public var walletId: String public var activityId: String public var tags: [String] // Default memberwise initializers are never public by default, so we // declare one manually. - public init(activityId: String, tags: [String]) { + public init(walletId: String, activityId: String, tags: [String]) { + self.walletId = walletId self.activityId = activityId self.tags = tags } @@ -2202,6 +2204,9 @@ extension ActivityTags: Sendable {} extension ActivityTags: Equatable, Hashable { public static func ==(lhs: ActivityTags, rhs: ActivityTags) -> Bool { + if lhs.walletId != rhs.walletId { + return false + } if lhs.activityId != rhs.activityId { return false } @@ -2212,6 +2217,7 @@ extension ActivityTags: Equatable, Hashable { } public func hash(into hasher: inout Hasher) { + hasher.combine(walletId) hasher.combine(activityId) hasher.combine(tags) } @@ -2228,12 +2234,14 @@ public struct FfiConverterTypeActivityTags: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ActivityTags { return try ActivityTags( - activityId: FfiConverterString.read(from: &buf), + walletId: FfiConverterString.read(from: &buf), + activityId: FfiConverterString.read(from: &buf), tags: FfiConverterSequenceString.read(from: &buf) ) } public static func write(_ value: ActivityTags, into buf: inout [UInt8]) { + FfiConverterString.write(value.walletId, into: &buf) FfiConverterString.write(value.activityId, into: &buf) FfiConverterSequenceString.write(value.tags, into: &buf) } @@ -2277,10 +2285,10 @@ public struct AddressInfo { public init( /** * The Bitcoin address - */address: String, + */address: String, /** * BIP32 derivation path - */path: String, + */path: String, /** * Number of transfers (real count in `get_address_info`, 1/0 presence flag in `get_account_info`) */transfers: UInt32) { @@ -2327,8 +2335,8 @@ public struct FfiConverterTypeAddressInfo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressInfo { return try AddressInfo( - address: FfiConverterString.read(from: &buf), - path: FfiConverterString.read(from: &buf), + address: FfiConverterString.read(from: &buf), + path: FfiConverterString.read(from: &buf), transfers: FfiConverterUInt32.read(from: &buf) ) } @@ -2413,9 +2421,9 @@ public struct FfiConverterTypeChannelLiquidityOptions: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ChannelLiquidityOptions { return try ChannelLiquidityOptions( - defaultLspBalanceSat: FfiConverterUInt64.read(from: &buf), - minLspBalanceSat: FfiConverterUInt64.read(from: &buf), - maxLspBalanceSat: FfiConverterUInt64.read(from: &buf), + defaultLspBalanceSat: FfiConverterUInt64.read(from: &buf), + minLspBalanceSat: FfiConverterUInt64.read(from: &buf), + maxLspBalanceSat: FfiConverterUInt64.read(from: &buf), maxClientBalanceSat: FfiConverterUInt64.read(from: &buf) ) } @@ -2507,10 +2515,10 @@ public struct FfiConverterTypeChannelLiquidityParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ChannelLiquidityParams { return try ChannelLiquidityParams( - clientBalanceSat: FfiConverterUInt64.read(from: &buf), - existingChannelsTotalSat: FfiConverterUInt64.read(from: &buf), - minChannelSizeSat: FfiConverterUInt64.read(from: &buf), - maxChannelSizeSat: FfiConverterUInt64.read(from: &buf), + clientBalanceSat: FfiConverterUInt64.read(from: &buf), + existingChannelsTotalSat: FfiConverterUInt64.read(from: &buf), + minChannelSizeSat: FfiConverterUInt64.read(from: &buf), + maxChannelSizeSat: FfiConverterUInt64.read(from: &buf), satsPerEur: FfiConverterUInt64.read(from: &buf) ) } @@ -2657,19 +2665,19 @@ public struct FfiConverterTypeClosedChannelDetails: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ClosedChannelDetails { return try ClosedChannelDetails( - channelId: FfiConverterString.read(from: &buf), - counterpartyNodeId: FfiConverterString.read(from: &buf), - fundingTxoTxid: FfiConverterString.read(from: &buf), - fundingTxoIndex: FfiConverterUInt32.read(from: &buf), - channelValueSats: FfiConverterUInt64.read(from: &buf), - closedAt: FfiConverterUInt64.read(from: &buf), - outboundCapacityMsat: FfiConverterUInt64.read(from: &buf), - inboundCapacityMsat: FfiConverterUInt64.read(from: &buf), - counterpartyUnspendablePunishmentReserve: FfiConverterUInt64.read(from: &buf), - unspendablePunishmentReserve: FfiConverterUInt64.read(from: &buf), - forwardingFeeProportionalMillionths: FfiConverterUInt32.read(from: &buf), - forwardingFeeBaseMsat: FfiConverterUInt32.read(from: &buf), - channelName: FfiConverterString.read(from: &buf), + channelId: FfiConverterString.read(from: &buf), + counterpartyNodeId: FfiConverterString.read(from: &buf), + fundingTxoTxid: FfiConverterString.read(from: &buf), + fundingTxoIndex: FfiConverterUInt32.read(from: &buf), + channelValueSats: FfiConverterUInt64.read(from: &buf), + closedAt: FfiConverterUInt64.read(from: &buf), + outboundCapacityMsat: FfiConverterUInt64.read(from: &buf), + inboundCapacityMsat: FfiConverterUInt64.read(from: &buf), + counterpartyUnspendablePunishmentReserve: FfiConverterUInt64.read(from: &buf), + unspendablePunishmentReserve: FfiConverterUInt64.read(from: &buf), + forwardingFeeProportionalMillionths: FfiConverterUInt32.read(from: &buf), + forwardingFeeBaseMsat: FfiConverterUInt32.read(from: &buf), + channelName: FfiConverterString.read(from: &buf), channelClosureReason: FfiConverterString.read(from: &buf) ) } @@ -2730,10 +2738,10 @@ public struct ComposeAccount { public init( /** * Account derivation path (e.g., "m/84'/0'/0'") - */path: String, + */path: String, /** * Categorized addresses - */addresses: AccountAddresses, + */addresses: AccountAddresses, /** * Unspent transaction outputs */utxo: [AccountUtxo]) { @@ -2780,8 +2788,8 @@ public struct FfiConverterTypeComposeAccount: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ComposeAccount { return try ComposeAccount( - path: FfiConverterString.read(from: &buf), - addresses: FfiConverterTypeAccountAddresses.read(from: &buf), + path: FfiConverterString.read(from: &buf), + addresses: FfiConverterTypeAccountAddresses.read(from: &buf), utxo: FfiConverterSequenceTypeAccountUtxo.read(from: &buf) ) } @@ -2835,13 +2843,13 @@ public struct ComposeParams { public init( /** * Wallet configuration (key, server, network) - */wallet: WalletParams, + */wallet: WalletParams, /** * Desired transaction outputs - */outputs: [ComposeOutput], + */outputs: [ComposeOutput], /** * Fee rates to evaluate (sat/vB), one PSBT per rate - */feeRates: [Float], + */feeRates: [Float], /** * UTXO selection strategy (defaults to BranchAndBound) */coinSelection: CoinSelection?) { @@ -2893,9 +2901,9 @@ public struct FfiConverterTypeComposeParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ComposeParams { return try ComposeParams( - wallet: FfiConverterTypeWalletParams.read(from: &buf), - outputs: FfiConverterSequenceTypeComposeOutput.read(from: &buf), - feeRates: FfiConverterSequenceFloat.read(from: &buf), + wallet: FfiConverterTypeWalletParams.read(from: &buf), + outputs: FfiConverterSequenceTypeComposeOutput.read(from: &buf), + feeRates: FfiConverterSequenceFloat.read(from: &buf), coinSelection: FfiConverterOptionTypeCoinSelection.read(from: &buf) ) } @@ -2969,7 +2977,7 @@ public struct FfiConverterTypeCreateCjitOptions: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreateCjitOptions { return try CreateCjitOptions( - source: FfiConverterOptionString.read(from: &buf), + source: FfiConverterOptionString.read(from: &buf), discountCode: FfiConverterOptionString.read(from: &buf) ) } @@ -3107,18 +3115,18 @@ public struct FfiConverterTypeCreateOrderOptions: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CreateOrderOptions { return try CreateOrderOptions( - clientBalanceSat: FfiConverterUInt64.read(from: &buf), - lspNodeId: FfiConverterOptionString.read(from: &buf), - couponCode: FfiConverterString.read(from: &buf), - source: FfiConverterOptionString.read(from: &buf), - discountCode: FfiConverterOptionString.read(from: &buf), - zeroConf: FfiConverterBool.read(from: &buf), - zeroConfPayment: FfiConverterOptionBool.read(from: &buf), - zeroReserve: FfiConverterBool.read(from: &buf), - clientNodeId: FfiConverterOptionString.read(from: &buf), - signature: FfiConverterOptionString.read(from: &buf), - timestamp: FfiConverterOptionString.read(from: &buf), - refundOnchainAddress: FfiConverterOptionString.read(from: &buf), + clientBalanceSat: FfiConverterUInt64.read(from: &buf), + lspNodeId: FfiConverterOptionString.read(from: &buf), + couponCode: FfiConverterString.read(from: &buf), + source: FfiConverterOptionString.read(from: &buf), + discountCode: FfiConverterOptionString.read(from: &buf), + zeroConf: FfiConverterBool.read(from: &buf), + zeroConfPayment: FfiConverterOptionBool.read(from: &buf), + zeroReserve: FfiConverterBool.read(from: &buf), + clientNodeId: FfiConverterOptionString.read(from: &buf), + signature: FfiConverterOptionString.read(from: &buf), + timestamp: FfiConverterOptionString.read(from: &buf), + refundOnchainAddress: FfiConverterOptionString.read(from: &buf), announceChannel: FfiConverterBool.read(from: &buf) ) } @@ -3207,8 +3215,8 @@ public struct FfiConverterTypeDefaultLspBalanceParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> DefaultLspBalanceParams { return try DefaultLspBalanceParams( - clientBalanceSat: FfiConverterUInt64.read(from: &buf), - maxChannelSizeSat: FfiConverterUInt64.read(from: &buf), + clientBalanceSat: FfiConverterUInt64.read(from: &buf), + maxChannelSizeSat: FfiConverterUInt64.read(from: &buf), satsPerEur: FfiConverterUInt64.read(from: &buf) ) } @@ -3351,8 +3359,8 @@ public struct FfiConverterTypeFeeRates: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FeeRates { return try FeeRates( - fast: FfiConverterUInt32.read(from: &buf), - mid: FfiConverterUInt32.read(from: &buf), + fast: FfiConverterUInt32.read(from: &buf), + mid: FfiConverterUInt32.read(from: &buf), slow: FfiConverterUInt32.read(from: &buf) ) } @@ -3425,7 +3433,7 @@ public struct FfiConverterTypeFundingTx: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> FundingTx { return try FundingTx( - id: FfiConverterString.read(from: &buf), + id: FfiConverterString.read(from: &buf), vout: FfiConverterUInt64.read(from: &buf) ) } @@ -3471,10 +3479,10 @@ public struct GetAddressResponse { public init( /** * The generated Bitcoin address as a string - */address: String, + */address: String, /** * The derivation path used to generate the address - */path: String, + */path: String, /** * The hexadecimal representation of the public key */publicKey: String) { @@ -3521,8 +3529,8 @@ public struct FfiConverterTypeGetAddressResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> GetAddressResponse { return try GetAddressResponse( - address: FfiConverterString.read(from: &buf), - path: FfiConverterString.read(from: &buf), + address: FfiConverterString.read(from: &buf), + path: FfiConverterString.read(from: &buf), publicKey: FfiConverterString.read(from: &buf) ) } @@ -3673,34 +3681,34 @@ public struct HistoryTransaction { public init( /** * Transaction ID (hex) - */txid: String, + */txid: String, /** * Amount received by the wallet (sats) - */received: UInt64, + */received: UInt64, /** * Amount sent by the wallet (sats) — includes change sent back to self - */sent: UInt64, + */sent: UInt64, /** * Net value from wallet's perspective: received - sent (positive = inflow, negative = outflow) - */net: Int64, + */net: Int64, /** * Transaction fee in sats (None if not available, e.g. for received-only txs) - */fee: UInt64?, + */fee: UInt64?, /** * Display amount in sats: * - Received: the received value * - Sent: amount that left the wallet (sent - received - fee) * - SelfTransfer: the fee paid - */amount: UInt64, + */amount: UInt64, /** * Transaction direction - */direction: TxDirection, + */direction: TxDirection, /** * Block height (None if unconfirmed/mempool) - */blockHeight: UInt32?, + */blockHeight: UInt32?, /** * Block timestamp as unix epoch seconds (None if unconfirmed) - */timestamp: UInt64?, + */timestamp: UInt64?, /** * Number of confirmations (0 if unconfirmed) */confirmations: UInt32) { @@ -3782,15 +3790,15 @@ public struct FfiConverterTypeHistoryTransaction: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> HistoryTransaction { return try HistoryTransaction( - txid: FfiConverterString.read(from: &buf), - received: FfiConverterUInt64.read(from: &buf), - sent: FfiConverterUInt64.read(from: &buf), - net: FfiConverterInt64.read(from: &buf), - fee: FfiConverterOptionUInt64.read(from: &buf), - amount: FfiConverterUInt64.read(from: &buf), - direction: FfiConverterTypeTxDirection.read(from: &buf), - blockHeight: FfiConverterOptionUInt32.read(from: &buf), - timestamp: FfiConverterOptionUInt64.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + received: FfiConverterUInt64.read(from: &buf), + sent: FfiConverterUInt64.read(from: &buf), + net: FfiConverterInt64.read(from: &buf), + fee: FfiConverterOptionUInt64.read(from: &buf), + amount: FfiConverterUInt64.read(from: &buf), + direction: FfiConverterTypeTxDirection.read(from: &buf), + blockHeight: FfiConverterOptionUInt32.read(from: &buf), + timestamp: FfiConverterOptionUInt64.read(from: &buf), confirmations: FfiConverterUInt32.read(from: &buf) ) } @@ -3870,7 +3878,7 @@ public struct FfiConverterTypeIBt0ConfMinTxFeeWindow: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBt0ConfMinTxFeeWindow { return try IBt0ConfMinTxFeeWindow( - satPerVbyte: FfiConverterDouble.read(from: &buf), + satPerVbyte: FfiConverterDouble.read(from: &buf), validityEndsAt: FfiConverterString.read(from: &buf) ) } @@ -3954,9 +3962,9 @@ public struct FfiConverterTypeIBtBolt11Invoice: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtBolt11Invoice { return try IBtBolt11Invoice( - request: FfiConverterString.read(from: &buf), - state: FfiConverterTypeBtBolt11InvoiceState.read(from: &buf), - expiresAt: FfiConverterString.read(from: &buf), + request: FfiConverterString.read(from: &buf), + state: FfiConverterTypeBtBolt11InvoiceState.read(from: &buf), + expiresAt: FfiConverterString.read(from: &buf), updatedAt: FfiConverterString.read(from: &buf) ) } @@ -4066,13 +4074,13 @@ public struct FfiConverterTypeIBtChannel: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtChannel { return try IBtChannel( - state: FfiConverterTypeBtOpenChannelState.read(from: &buf), - lspNodePubkey: FfiConverterString.read(from: &buf), - clientNodePubkey: FfiConverterString.read(from: &buf), - announceChannel: FfiConverterBool.read(from: &buf), - fundingTx: FfiConverterTypeFundingTx.read(from: &buf), - closingTxId: FfiConverterOptionString.read(from: &buf), - close: FfiConverterOptionTypeIBtChannelClose.read(from: &buf), + state: FfiConverterTypeBtOpenChannelState.read(from: &buf), + lspNodePubkey: FfiConverterString.read(from: &buf), + clientNodePubkey: FfiConverterString.read(from: &buf), + announceChannel: FfiConverterBool.read(from: &buf), + fundingTx: FfiConverterTypeFundingTx.read(from: &buf), + closingTxId: FfiConverterOptionString.read(from: &buf), + close: FfiConverterOptionTypeIBtChannelClose.read(from: &buf), shortChannelId: FfiConverterOptionString.read(from: &buf) ) } @@ -4162,9 +4170,9 @@ public struct FfiConverterTypeIBtChannelClose: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtChannelClose { return try IBtChannelClose( - txId: FfiConverterString.read(from: &buf), - closeType: FfiConverterString.read(from: &buf), - initiator: FfiConverterString.read(from: &buf), + txId: FfiConverterString.read(from: &buf), + closeType: FfiConverterString.read(from: &buf), + initiator: FfiConverterString.read(from: &buf), registeredAt: FfiConverterString.read(from: &buf) ) } @@ -4238,7 +4246,7 @@ public struct FfiConverterTypeIBtEstimateFeeResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtEstimateFeeResponse { return try IBtEstimateFeeResponse( - feeSat: FfiConverterUInt64.read(from: &buf), + feeSat: FfiConverterUInt64.read(from: &buf), min0ConfTxFee: FfiConverterTypeIBt0ConfMinTxFeeWindow.read(from: &buf) ) } @@ -4322,9 +4330,9 @@ public struct FfiConverterTypeIBtEstimateFeeResponse2: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtEstimateFeeResponse2 { return try IBtEstimateFeeResponse2( - feeSat: FfiConverterUInt64.read(from: &buf), - networkFeeSat: FfiConverterUInt64.read(from: &buf), - serviceFeeSat: FfiConverterUInt64.read(from: &buf), + feeSat: FfiConverterUInt64.read(from: &buf), + networkFeeSat: FfiConverterUInt64.read(from: &buf), + serviceFeeSat: FfiConverterUInt64.read(from: &buf), min0ConfTxFee: FfiConverterTypeIBt0ConfMinTxFeeWindow.read(from: &buf) ) } @@ -4416,10 +4424,10 @@ public struct FfiConverterTypeIBtInfo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtInfo { return try IBtInfo( - version: FfiConverterUInt32.read(from: &buf), - nodes: FfiConverterSequenceTypeILspNode.read(from: &buf), - options: FfiConverterTypeIBtInfoOptions.read(from: &buf), - versions: FfiConverterTypeIBtInfoVersions.read(from: &buf), + version: FfiConverterUInt32.read(from: &buf), + nodes: FfiConverterSequenceTypeILspNode.read(from: &buf), + options: FfiConverterTypeIBtInfoOptions.read(from: &buf), + versions: FfiConverterTypeIBtInfoVersions.read(from: &buf), onchain: FfiConverterTypeIBtInfoOnchain.read(from: &buf) ) } @@ -4494,7 +4502,7 @@ public struct FfiConverterTypeIBtInfoOnchain: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtInfoOnchain { return try IBtInfoOnchain( - network: FfiConverterTypeBitcoinNetworkEnum.read(from: &buf), + network: FfiConverterTypeBitcoinNetworkEnum.read(from: &buf), feeRates: FfiConverterTypeFeeRates.read(from: &buf) ) } @@ -4602,13 +4610,13 @@ public struct FfiConverterTypeIBtInfoOptions: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtInfoOptions { return try IBtInfoOptions( - minChannelSizeSat: FfiConverterUInt64.read(from: &buf), - maxChannelSizeSat: FfiConverterUInt64.read(from: &buf), - minExpiryWeeks: FfiConverterUInt32.read(from: &buf), - maxExpiryWeeks: FfiConverterUInt32.read(from: &buf), - minPaymentConfirmations: FfiConverterUInt32.read(from: &buf), - minHighRiskPaymentConfirmations: FfiConverterUInt32.read(from: &buf), - max0ConfClientBalanceSat: FfiConverterUInt64.read(from: &buf), + minChannelSizeSat: FfiConverterUInt64.read(from: &buf), + maxChannelSizeSat: FfiConverterUInt64.read(from: &buf), + minExpiryWeeks: FfiConverterUInt32.read(from: &buf), + maxExpiryWeeks: FfiConverterUInt32.read(from: &buf), + minPaymentConfirmations: FfiConverterUInt32.read(from: &buf), + minHighRiskPaymentConfirmations: FfiConverterUInt32.read(from: &buf), + max0ConfClientBalanceSat: FfiConverterUInt64.read(from: &buf), maxClientBalanceSat: FfiConverterUInt64.read(from: &buf) ) } @@ -4692,8 +4700,8 @@ public struct FfiConverterTypeIBtInfoVersions: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtInfoVersions { return try IBtInfoVersions( - http: FfiConverterString.read(from: &buf), - btc: FfiConverterString.read(from: &buf), + http: FfiConverterString.read(from: &buf), + btc: FfiConverterString.read(from: &buf), ln2: FfiConverterString.read(from: &buf) ) } @@ -4802,13 +4810,13 @@ public struct FfiConverterTypeIBtOnchainTransaction: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtOnchainTransaction { return try IBtOnchainTransaction( - amountSat: FfiConverterUInt64.read(from: &buf), - txId: FfiConverterString.read(from: &buf), - vout: FfiConverterUInt32.read(from: &buf), - blockHeight: FfiConverterOptionUInt32.read(from: &buf), - blockConfirmationCount: FfiConverterUInt32.read(from: &buf), - feeRateSatPerVbyte: FfiConverterDouble.read(from: &buf), - confirmed: FfiConverterBool.read(from: &buf), + amountSat: FfiConverterUInt64.read(from: &buf), + txId: FfiConverterString.read(from: &buf), + vout: FfiConverterUInt32.read(from: &buf), + blockHeight: FfiConverterOptionUInt32.read(from: &buf), + blockConfirmationCount: FfiConverterUInt32.read(from: &buf), + feeRateSatPerVbyte: FfiConverterDouble.read(from: &buf), + confirmed: FfiConverterBool.read(from: &buf), suspicious0ConfReason: FfiConverterString.read(from: &buf) ) } @@ -4898,9 +4906,9 @@ public struct FfiConverterTypeIBtOnchainTransactions: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtOnchainTransactions { return try IBtOnchainTransactions( - address: FfiConverterString.read(from: &buf), - confirmedSat: FfiConverterUInt64.read(from: &buf), - requiredConfirmations: FfiConverterUInt32.read(from: &buf), + address: FfiConverterString.read(from: &buf), + confirmedSat: FfiConverterUInt64.read(from: &buf), + requiredConfirmations: FfiConverterUInt32.read(from: &buf), transactions: FfiConverterSequenceTypeIBtOnchainTransaction.read(from: &buf) ) } @@ -5100,28 +5108,28 @@ public struct FfiConverterTypeIBtOrder: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtOrder { return try IBtOrder( - id: FfiConverterString.read(from: &buf), - state: FfiConverterTypeBtOrderState.read(from: &buf), - state2: FfiConverterOptionTypeBtOrderState2.read(from: &buf), - feeSat: FfiConverterUInt64.read(from: &buf), - networkFeeSat: FfiConverterUInt64.read(from: &buf), - serviceFeeSat: FfiConverterUInt64.read(from: &buf), - lspBalanceSat: FfiConverterUInt64.read(from: &buf), - clientBalanceSat: FfiConverterUInt64.read(from: &buf), - zeroConf: FfiConverterBool.read(from: &buf), - zeroReserve: FfiConverterBool.read(from: &buf), - clientNodeId: FfiConverterOptionString.read(from: &buf), - channelExpiryWeeks: FfiConverterUInt32.read(from: &buf), - channelExpiresAt: FfiConverterString.read(from: &buf), - orderExpiresAt: FfiConverterString.read(from: &buf), - channel: FfiConverterOptionTypeIBtChannel.read(from: &buf), - lspNode: FfiConverterOptionTypeILspNode.read(from: &buf), - lnurl: FfiConverterOptionString.read(from: &buf), - payment: FfiConverterOptionTypeIBtPayment.read(from: &buf), - couponCode: FfiConverterOptionString.read(from: &buf), - source: FfiConverterOptionString.read(from: &buf), - discount: FfiConverterOptionTypeIDiscount.read(from: &buf), - updatedAt: FfiConverterString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + state: FfiConverterTypeBtOrderState.read(from: &buf), + state2: FfiConverterOptionTypeBtOrderState2.read(from: &buf), + feeSat: FfiConverterUInt64.read(from: &buf), + networkFeeSat: FfiConverterUInt64.read(from: &buf), + serviceFeeSat: FfiConverterUInt64.read(from: &buf), + lspBalanceSat: FfiConverterUInt64.read(from: &buf), + clientBalanceSat: FfiConverterUInt64.read(from: &buf), + zeroConf: FfiConverterBool.read(from: &buf), + zeroReserve: FfiConverterBool.read(from: &buf), + clientNodeId: FfiConverterOptionString.read(from: &buf), + channelExpiryWeeks: FfiConverterUInt32.read(from: &buf), + channelExpiresAt: FfiConverterString.read(from: &buf), + orderExpiresAt: FfiConverterString.read(from: &buf), + channel: FfiConverterOptionTypeIBtChannel.read(from: &buf), + lspNode: FfiConverterOptionTypeILspNode.read(from: &buf), + lnurl: FfiConverterOptionString.read(from: &buf), + payment: FfiConverterOptionTypeIBtPayment.read(from: &buf), + couponCode: FfiConverterOptionString.read(from: &buf), + source: FfiConverterOptionString.read(from: &buf), + discount: FfiConverterOptionTypeIDiscount.read(from: &buf), + updatedAt: FfiConverterString.read(from: &buf), createdAt: FfiConverterString.read(from: &buf) ) } @@ -5244,12 +5252,12 @@ public struct FfiConverterTypeIBtPayment: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IBtPayment { return try IBtPayment( - state: FfiConverterTypeBtPaymentState.read(from: &buf), - state2: FfiConverterOptionTypeBtPaymentState2.read(from: &buf), - paidSat: FfiConverterUInt64.read(from: &buf), - bolt11Invoice: FfiConverterOptionTypeIBtBolt11Invoice.read(from: &buf), - onchain: FfiConverterOptionTypeIBtOnchainTransactions.read(from: &buf), - isManuallyPaid: FfiConverterOptionBool.read(from: &buf), + state: FfiConverterTypeBtPaymentState.read(from: &buf), + state2: FfiConverterOptionTypeBtPaymentState2.read(from: &buf), + paidSat: FfiConverterUInt64.read(from: &buf), + bolt11Invoice: FfiConverterOptionTypeIBtBolt11Invoice.read(from: &buf), + onchain: FfiConverterOptionTypeIBtOnchainTransactions.read(from: &buf), + isManuallyPaid: FfiConverterOptionBool.read(from: &buf), manualRefunds: FfiConverterOptionSequenceTypeIManualRefund.read(from: &buf) ) } @@ -5422,23 +5430,23 @@ public struct FfiConverterTypeICJitEntry: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IcJitEntry { return try IcJitEntry( - id: FfiConverterString.read(from: &buf), - state: FfiConverterTypeCJitStateEnum.read(from: &buf), - feeSat: FfiConverterUInt64.read(from: &buf), - networkFeeSat: FfiConverterUInt64.read(from: &buf), - serviceFeeSat: FfiConverterUInt64.read(from: &buf), - channelSizeSat: FfiConverterUInt64.read(from: &buf), - channelExpiryWeeks: FfiConverterUInt32.read(from: &buf), - channelOpenError: FfiConverterOptionString.read(from: &buf), - nodeId: FfiConverterString.read(from: &buf), - invoice: FfiConverterTypeIBtBolt11Invoice.read(from: &buf), - channel: FfiConverterOptionTypeIBtChannel.read(from: &buf), - lspNode: FfiConverterTypeILspNode.read(from: &buf), - couponCode: FfiConverterString.read(from: &buf), - source: FfiConverterOptionString.read(from: &buf), - discount: FfiConverterOptionTypeIDiscount.read(from: &buf), - expiresAt: FfiConverterString.read(from: &buf), - updatedAt: FfiConverterString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + state: FfiConverterTypeCJitStateEnum.read(from: &buf), + feeSat: FfiConverterUInt64.read(from: &buf), + networkFeeSat: FfiConverterUInt64.read(from: &buf), + serviceFeeSat: FfiConverterUInt64.read(from: &buf), + channelSizeSat: FfiConverterUInt64.read(from: &buf), + channelExpiryWeeks: FfiConverterUInt32.read(from: &buf), + channelOpenError: FfiConverterOptionString.read(from: &buf), + nodeId: FfiConverterString.read(from: &buf), + invoice: FfiConverterTypeIBtBolt11Invoice.read(from: &buf), + channel: FfiConverterOptionTypeIBtChannel.read(from: &buf), + lspNode: FfiConverterTypeILspNode.read(from: &buf), + couponCode: FfiConverterString.read(from: &buf), + source: FfiConverterOptionString.read(from: &buf), + discount: FfiConverterOptionTypeIDiscount.read(from: &buf), + expiresAt: FfiConverterString.read(from: &buf), + updatedAt: FfiConverterString.read(from: &buf), createdAt: FfiConverterString.read(from: &buf) ) } @@ -5538,9 +5546,9 @@ public struct FfiConverterTypeIDiscount: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IDiscount { return try IDiscount( - code: FfiConverterString.read(from: &buf), - absoluteSat: FfiConverterUInt64.read(from: &buf), - relative: FfiConverterDouble.read(from: &buf), + code: FfiConverterString.read(from: &buf), + absoluteSat: FfiConverterUInt64.read(from: &buf), + relative: FfiConverterDouble.read(from: &buf), overallSat: FfiConverterUInt64.read(from: &buf) ) } @@ -5662,15 +5670,15 @@ public struct FfiConverterTypeIGift: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGift { return try IGift( - id: FfiConverterString.read(from: &buf), - nodeId: FfiConverterString.read(from: &buf), - orderId: FfiConverterOptionString.read(from: &buf), - order: FfiConverterOptionTypeIGiftOrder.read(from: &buf), - bolt11PaymentId: FfiConverterOptionString.read(from: &buf), - bolt11Payment: FfiConverterOptionTypeIGiftPayment.read(from: &buf), - appliedGiftCodeId: FfiConverterOptionString.read(from: &buf), - appliedGiftCode: FfiConverterOptionTypeIGiftCode.read(from: &buf), - createdAt: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + nodeId: FfiConverterString.read(from: &buf), + orderId: FfiConverterOptionString.read(from: &buf), + order: FfiConverterOptionTypeIGiftOrder.read(from: &buf), + bolt11PaymentId: FfiConverterOptionString.read(from: &buf), + bolt11Payment: FfiConverterOptionTypeIGiftPayment.read(from: &buf), + appliedGiftCodeId: FfiConverterOptionString.read(from: &buf), + appliedGiftCode: FfiConverterOptionTypeIGiftCode.read(from: &buf), + createdAt: FfiConverterOptionString.read(from: &buf), updatedAt: FfiConverterOptionString.read(from: &buf) ) } @@ -5804,16 +5812,16 @@ public struct FfiConverterTypeIGiftBolt11Invoice: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGiftBolt11Invoice { return try IGiftBolt11Invoice( - id: FfiConverterString.read(from: &buf), - request: FfiConverterString.read(from: &buf), - state: FfiConverterString.read(from: &buf), - isHodlInvoice: FfiConverterOptionBool.read(from: &buf), - paymentHash: FfiConverterOptionString.read(from: &buf), - amountSat: FfiConverterOptionUInt64.read(from: &buf), - amountMsat: FfiConverterOptionString.read(from: &buf), - internalNodePubkey: FfiConverterOptionString.read(from: &buf), - updatedAt: FfiConverterOptionString.read(from: &buf), - createdAt: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + request: FfiConverterString.read(from: &buf), + state: FfiConverterString.read(from: &buf), + isHodlInvoice: FfiConverterOptionBool.read(from: &buf), + paymentHash: FfiConverterOptionString.read(from: &buf), + amountSat: FfiConverterOptionUInt64.read(from: &buf), + amountMsat: FfiConverterOptionString.read(from: &buf), + internalNodePubkey: FfiConverterOptionString.read(from: &buf), + updatedAt: FfiConverterOptionString.read(from: &buf), + createdAt: FfiConverterOptionString.read(from: &buf), expiresAt: FfiConverterOptionString.read(from: &buf) ) } @@ -5936,14 +5944,14 @@ public struct FfiConverterTypeIGiftBtcAddress: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGiftBtcAddress { return try IGiftBtcAddress( - id: FfiConverterString.read(from: &buf), - address: FfiConverterString.read(from: &buf), - transactions: FfiConverterSequenceString.read(from: &buf), - allTransactions: FfiConverterSequenceString.read(from: &buf), - isBlacklisted: FfiConverterOptionBool.read(from: &buf), - watchUntil: FfiConverterOptionString.read(from: &buf), - watchForBlockConfirmations: FfiConverterOptionUInt32.read(from: &buf), - updatedAt: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + address: FfiConverterString.read(from: &buf), + transactions: FfiConverterSequenceString.read(from: &buf), + allTransactions: FfiConverterSequenceString.read(from: &buf), + isBlacklisted: FfiConverterOptionBool.read(from: &buf), + watchUntil: FfiConverterOptionString.read(from: &buf), + watchForBlockConfirmations: FfiConverterOptionUInt32.read(from: &buf), + updatedAt: FfiConverterOptionString.read(from: &buf), createdAt: FfiConverterOptionString.read(from: &buf) ) } @@ -6058,13 +6066,13 @@ public struct FfiConverterTypeIGiftCode: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGiftCode { return try IGiftCode( - id: FfiConverterString.read(from: &buf), - code: FfiConverterString.read(from: &buf), - createdAt: FfiConverterString.read(from: &buf), - updatedAt: FfiConverterString.read(from: &buf), - expiresAt: FfiConverterString.read(from: &buf), - giftSat: FfiConverterOptionUInt64.read(from: &buf), - scope: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + code: FfiConverterString.read(from: &buf), + createdAt: FfiConverterString.read(from: &buf), + updatedAt: FfiConverterString.read(from: &buf), + expiresAt: FfiConverterString.read(from: &buf), + giftSat: FfiConverterOptionUInt64.read(from: &buf), + scope: FfiConverterOptionString.read(from: &buf), maxCount: FfiConverterOptionUInt32.read(from: &buf) ) } @@ -6148,8 +6156,8 @@ public struct FfiConverterTypeIGiftLspNode: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGiftLspNode { return try IGiftLspNode( - alias: FfiConverterString.read(from: &buf), - pubkey: FfiConverterString.read(from: &buf), + alias: FfiConverterString.read(from: &buf), + pubkey: FfiConverterString.read(from: &buf), connectionStrings: FfiConverterSequenceString.read(from: &buf) ) } @@ -6342,27 +6350,27 @@ public struct FfiConverterTypeIGiftOrder: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGiftOrder { return try IGiftOrder( - id: FfiConverterString.read(from: &buf), - state: FfiConverterString.read(from: &buf), - oldState: FfiConverterOptionString.read(from: &buf), - isChannelExpired: FfiConverterOptionBool.read(from: &buf), - isOrderExpired: FfiConverterOptionBool.read(from: &buf), - lspBalanceSat: FfiConverterOptionUInt64.read(from: &buf), - clientBalanceSat: FfiConverterOptionUInt64.read(from: &buf), - channelExpiryWeeks: FfiConverterOptionUInt32.read(from: &buf), - zeroConf: FfiConverterOptionBool.read(from: &buf), - zeroReserve: FfiConverterOptionBool.read(from: &buf), - announced: FfiConverterOptionBool.read(from: &buf), - clientNodeId: FfiConverterOptionString.read(from: &buf), - channelExpiresAt: FfiConverterOptionString.read(from: &buf), - orderExpiresAt: FfiConverterOptionString.read(from: &buf), - feeSat: FfiConverterOptionUInt64.read(from: &buf), - networkFeeSat: FfiConverterOptionUInt64.read(from: &buf), - serviceFeeSat: FfiConverterOptionUInt64.read(from: &buf), - payment: FfiConverterOptionTypeIGiftPayment.read(from: &buf), - lspNode: FfiConverterOptionTypeIGiftLspNode.read(from: &buf), - updatedAt: FfiConverterOptionString.read(from: &buf), - createdAt: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + state: FfiConverterString.read(from: &buf), + oldState: FfiConverterOptionString.read(from: &buf), + isChannelExpired: FfiConverterOptionBool.read(from: &buf), + isOrderExpired: FfiConverterOptionBool.read(from: &buf), + lspBalanceSat: FfiConverterOptionUInt64.read(from: &buf), + clientBalanceSat: FfiConverterOptionUInt64.read(from: &buf), + channelExpiryWeeks: FfiConverterOptionUInt32.read(from: &buf), + zeroConf: FfiConverterOptionBool.read(from: &buf), + zeroReserve: FfiConverterOptionBool.read(from: &buf), + announced: FfiConverterOptionBool.read(from: &buf), + clientNodeId: FfiConverterOptionString.read(from: &buf), + channelExpiresAt: FfiConverterOptionString.read(from: &buf), + orderExpiresAt: FfiConverterOptionString.read(from: &buf), + feeSat: FfiConverterOptionUInt64.read(from: &buf), + networkFeeSat: FfiConverterOptionUInt64.read(from: &buf), + serviceFeeSat: FfiConverterOptionUInt64.read(from: &buf), + payment: FfiConverterOptionTypeIGiftPayment.read(from: &buf), + lspNode: FfiConverterOptionTypeIGiftLspNode.read(from: &buf), + updatedAt: FfiConverterOptionString.read(from: &buf), + createdAt: FfiConverterOptionString.read(from: &buf), nodeIdVerified: FfiConverterOptionBool.read(from: &buf) ) } @@ -6562,25 +6570,25 @@ public struct FfiConverterTypeIGiftPayment: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IGiftPayment { return try IGiftPayment( - id: FfiConverterString.read(from: &buf), - state: FfiConverterString.read(from: &buf), - oldState: FfiConverterOptionString.read(from: &buf), - onchainState: FfiConverterOptionString.read(from: &buf), - lnState: FfiConverterOptionString.read(from: &buf), - paidOnchainSat: FfiConverterOptionUInt64.read(from: &buf), - paidLnSat: FfiConverterOptionUInt64.read(from: &buf), - paidSat: FfiConverterOptionUInt64.read(from: &buf), - isOverpaid: FfiConverterOptionBool.read(from: &buf), - isRefunded: FfiConverterOptionBool.read(from: &buf), - overpaidAmountSat: FfiConverterOptionUInt64.read(from: &buf), - requiredOnchainConfirmations: FfiConverterOptionUInt32.read(from: &buf), - settlementState: FfiConverterOptionString.read(from: &buf), - expectedAmountSat: FfiConverterOptionUInt64.read(from: &buf), - isManuallyPaid: FfiConverterOptionBool.read(from: &buf), - btcAddress: FfiConverterOptionTypeIGiftBtcAddress.read(from: &buf), - btcAddressId: FfiConverterOptionString.read(from: &buf), - bolt11Invoice: FfiConverterOptionTypeIGiftBolt11Invoice.read(from: &buf), - bolt11InvoiceId: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + state: FfiConverterString.read(from: &buf), + oldState: FfiConverterOptionString.read(from: &buf), + onchainState: FfiConverterOptionString.read(from: &buf), + lnState: FfiConverterOptionString.read(from: &buf), + paidOnchainSat: FfiConverterOptionUInt64.read(from: &buf), + paidLnSat: FfiConverterOptionUInt64.read(from: &buf), + paidSat: FfiConverterOptionUInt64.read(from: &buf), + isOverpaid: FfiConverterOptionBool.read(from: &buf), + isRefunded: FfiConverterOptionBool.read(from: &buf), + overpaidAmountSat: FfiConverterOptionUInt64.read(from: &buf), + requiredOnchainConfirmations: FfiConverterOptionUInt32.read(from: &buf), + settlementState: FfiConverterOptionString.read(from: &buf), + expectedAmountSat: FfiConverterOptionUInt64.read(from: &buf), + isManuallyPaid: FfiConverterOptionBool.read(from: &buf), + btcAddress: FfiConverterOptionTypeIGiftBtcAddress.read(from: &buf), + btcAddressId: FfiConverterOptionString.read(from: &buf), + bolt11Invoice: FfiConverterOptionTypeIGiftBolt11Invoice.read(from: &buf), + bolt11InvoiceId: FfiConverterOptionString.read(from: &buf), manualRefunds: FfiConverterSequenceString.read(from: &buf) ) } @@ -6682,9 +6690,9 @@ public struct FfiConverterTypeILspNode: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ILspNode { return try ILspNode( - alias: FfiConverterString.read(from: &buf), - pubkey: FfiConverterString.read(from: &buf), - connectionStrings: FfiConverterSequenceString.read(from: &buf), + alias: FfiConverterString.read(from: &buf), + pubkey: FfiConverterString.read(from: &buf), + connectionStrings: FfiConverterSequenceString.read(from: &buf), readonly: FfiConverterOptionBool.read(from: &buf) ) } @@ -6788,12 +6796,12 @@ public struct FfiConverterTypeIManualRefund: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> IManualRefund { return try IManualRefund( - amountSat: FfiConverterUInt64.read(from: &buf), - target: FfiConverterString.read(from: &buf), - state: FfiConverterTypeManualRefundStateEnum.read(from: &buf), - createdByName: FfiConverterString.read(from: &buf), - votedByName: FfiConverterOptionString.read(from: &buf), - reason: FfiConverterOptionString.read(from: &buf), + amountSat: FfiConverterUInt64.read(from: &buf), + target: FfiConverterString.read(from: &buf), + state: FfiConverterTypeManualRefundStateEnum.read(from: &buf), + createdByName: FfiConverterString.read(from: &buf), + votedByName: FfiConverterOptionString.read(from: &buf), + reason: FfiConverterOptionString.read(from: &buf), targetType: FfiConverterString.read(from: &buf) ) } @@ -6840,7 +6848,7 @@ public struct LegacyRnCloseRecoveryScanResult { public init( /** * Total balance found in legacy RN P2WPKH close outputs (in satoshis). - */totalAmount: UInt64, + */totalAmount: UInt64, /** * Number of P2WPKH outputs found. */outputsCount: UInt32) { @@ -6882,7 +6890,7 @@ public struct FfiConverterTypeLegacyRnCloseRecoveryScanResult: FfiConverterRustB public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LegacyRnCloseRecoveryScanResult { return try LegacyRnCloseRecoveryScanResult( - totalAmount: FfiConverterUInt64.read(from: &buf), + totalAmount: FfiConverterUInt64.read(from: &buf), outputsCount: FfiConverterUInt32.read(from: &buf) ) } @@ -6948,25 +6956,25 @@ public struct LegacyRnCloseRecoverySweepPreview { public init( /** * Fully signed raw sweep transaction hex. Broadcast only after user confirmation. - */txHex: String, + */txHex: String, /** * Transaction id of the sweep transaction. - */txid: String, + */txid: String, /** * Total input amount in satoshis. - */totalAmount: UInt64, + */totalAmount: UInt64, /** * Fee in satoshis. - */estimatedFee: UInt64, + */estimatedFee: UInt64, /** * Transaction virtual size in vbytes. - */estimatedVsize: UInt64, + */estimatedVsize: UInt64, /** * Number of recovered outputs swept. - */outputsCount: UInt32, + */outputsCount: UInt32, /** * Destination address receiving the sweep. - */destinationAddress: String, + */destinationAddress: String, /** * Amount sent to destination after fees. */amountAfterFees: UInt64) { @@ -7038,13 +7046,13 @@ public struct FfiConverterTypeLegacyRnCloseRecoverySweepPreview: FfiConverterRus public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LegacyRnCloseRecoverySweepPreview { return try LegacyRnCloseRecoverySweepPreview( - txHex: FfiConverterString.read(from: &buf), - txid: FfiConverterString.read(from: &buf), - totalAmount: FfiConverterUInt64.read(from: &buf), - estimatedFee: FfiConverterUInt64.read(from: &buf), - estimatedVsize: FfiConverterUInt64.read(from: &buf), - outputsCount: FfiConverterUInt32.read(from: &buf), - destinationAddress: FfiConverterString.read(from: &buf), + txHex: FfiConverterString.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + totalAmount: FfiConverterUInt64.read(from: &buf), + estimatedFee: FfiConverterUInt64.read(from: &buf), + estimatedVsize: FfiConverterUInt64.read(from: &buf), + outputsCount: FfiConverterUInt32.read(from: &buf), + destinationAddress: FfiConverterString.read(from: &buf), amountAfterFees: FfiConverterUInt64.read(from: &buf) ) } @@ -7078,6 +7086,7 @@ public func FfiConverterTypeLegacyRnCloseRecoverySweepPreview_lower(_ value: Leg public struct LightningActivity { + public var walletId: String public var id: String public var txType: PaymentType public var status: PaymentState @@ -7094,7 +7103,8 @@ public struct LightningActivity { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: String, txType: PaymentType, status: PaymentState, value: UInt64, fee: UInt64?, invoice: String, message: String, timestamp: UInt64, preimage: String?, contact: String?, createdAt: UInt64?, updatedAt: UInt64?, seenAt: UInt64?) { + public init(walletId: String, id: String, txType: PaymentType, status: PaymentState, value: UInt64, fee: UInt64?, invoice: String, message: String, timestamp: UInt64, preimage: String?, contact: String?, createdAt: UInt64?, updatedAt: UInt64?, seenAt: UInt64?) { + self.walletId = walletId self.id = id self.txType = txType self.status = status @@ -7118,6 +7128,9 @@ extension LightningActivity: Sendable {} extension LightningActivity: Equatable, Hashable { public static func ==(lhs: LightningActivity, rhs: LightningActivity) -> Bool { + if lhs.walletId != rhs.walletId { + return false + } if lhs.id != rhs.id { return false } @@ -7161,6 +7174,7 @@ extension LightningActivity: Equatable, Hashable { } public func hash(into hasher: inout Hasher) { + hasher.combine(walletId) hasher.combine(id) hasher.combine(txType) hasher.combine(status) @@ -7188,23 +7202,25 @@ public struct FfiConverterTypeLightningActivity: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LightningActivity { return try LightningActivity( - id: FfiConverterString.read(from: &buf), - txType: FfiConverterTypePaymentType.read(from: &buf), - status: FfiConverterTypePaymentState.read(from: &buf), - value: FfiConverterUInt64.read(from: &buf), - fee: FfiConverterOptionUInt64.read(from: &buf), - invoice: FfiConverterString.read(from: &buf), - message: FfiConverterString.read(from: &buf), - timestamp: FfiConverterUInt64.read(from: &buf), - preimage: FfiConverterOptionString.read(from: &buf), - contact: FfiConverterOptionString.read(from: &buf), - createdAt: FfiConverterOptionUInt64.read(from: &buf), - updatedAt: FfiConverterOptionUInt64.read(from: &buf), + walletId: FfiConverterString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + txType: FfiConverterTypePaymentType.read(from: &buf), + status: FfiConverterTypePaymentState.read(from: &buf), + value: FfiConverterUInt64.read(from: &buf), + fee: FfiConverterOptionUInt64.read(from: &buf), + invoice: FfiConverterString.read(from: &buf), + message: FfiConverterString.read(from: &buf), + timestamp: FfiConverterUInt64.read(from: &buf), + preimage: FfiConverterOptionString.read(from: &buf), + contact: FfiConverterOptionString.read(from: &buf), + createdAt: FfiConverterOptionUInt64.read(from: &buf), + updatedAt: FfiConverterOptionUInt64.read(from: &buf), seenAt: FfiConverterOptionUInt64.read(from: &buf) ) } public static func write(_ value: LightningActivity, into buf: inout [UInt8]) { + FfiConverterString.write(value.walletId, into: &buf) FfiConverterString.write(value.id, into: &buf) FfiConverterTypePaymentType.write(value.txType, into: &buf) FfiConverterTypePaymentState.write(value.status, into: &buf) @@ -7324,14 +7340,14 @@ public struct FfiConverterTypeLightningInvoice: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LightningInvoice { return try LightningInvoice( - bolt11: FfiConverterString.read(from: &buf), - paymentHash: FfiConverterData.read(from: &buf), - amountSatoshis: FfiConverterUInt64.read(from: &buf), - timestampSeconds: FfiConverterUInt64.read(from: &buf), - expirySeconds: FfiConverterUInt64.read(from: &buf), - isExpired: FfiConverterBool.read(from: &buf), - description: FfiConverterOptionString.read(from: &buf), - networkType: FfiConverterTypeNetworkType.read(from: &buf), + bolt11: FfiConverterString.read(from: &buf), + paymentHash: FfiConverterData.read(from: &buf), + amountSatoshis: FfiConverterUInt64.read(from: &buf), + timestampSeconds: FfiConverterUInt64.read(from: &buf), + expirySeconds: FfiConverterUInt64.read(from: &buf), + isExpired: FfiConverterBool.read(from: &buf), + description: FfiConverterOptionString.read(from: &buf), + networkType: FfiConverterTypeNetworkType.read(from: &buf), payeeNodeId: FfiConverterOptionData.read(from: &buf) ) } @@ -7416,8 +7432,8 @@ public struct FfiConverterTypeLnurlAddressData: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LnurlAddressData { return try LnurlAddressData( - uri: FfiConverterString.read(from: &buf), - domain: FfiConverterString.read(from: &buf), + uri: FfiConverterString.read(from: &buf), + domain: FfiConverterString.read(from: &buf), username: FfiConverterString.read(from: &buf) ) } @@ -7502,9 +7518,9 @@ public struct FfiConverterTypeLnurlAuthData: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LnurlAuthData { return try LnurlAuthData( - uri: FfiConverterString.read(from: &buf), - tag: FfiConverterString.read(from: &buf), - k1: FfiConverterString.read(from: &buf), + uri: FfiConverterString.read(from: &buf), + tag: FfiConverterString.read(from: &buf), + k1: FfiConverterString.read(from: &buf), domain: FfiConverterString.read(from: &buf) ) } @@ -7590,9 +7606,9 @@ public struct FfiConverterTypeLnurlChannelData: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LnurlChannelData { return try LnurlChannelData( - uri: FfiConverterString.read(from: &buf), - callback: FfiConverterString.read(from: &buf), - k1: FfiConverterString.read(from: &buf), + uri: FfiConverterString.read(from: &buf), + callback: FfiConverterString.read(from: &buf), + k1: FfiConverterString.read(from: &buf), tag: FfiConverterString.read(from: &buf) ) } @@ -7702,13 +7718,13 @@ public struct FfiConverterTypeLnurlPayData: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LnurlPayData { return try LnurlPayData( - uri: FfiConverterString.read(from: &buf), - callback: FfiConverterString.read(from: &buf), - minSendable: FfiConverterUInt64.read(from: &buf), - maxSendable: FfiConverterUInt64.read(from: &buf), - metadataStr: FfiConverterString.read(from: &buf), - commentAllowed: FfiConverterOptionUInt32.read(from: &buf), - allowsNostr: FfiConverterBool.read(from: &buf), + uri: FfiConverterString.read(from: &buf), + callback: FfiConverterString.read(from: &buf), + minSendable: FfiConverterUInt64.read(from: &buf), + maxSendable: FfiConverterUInt64.read(from: &buf), + metadataStr: FfiConverterString.read(from: &buf), + commentAllowed: FfiConverterOptionUInt32.read(from: &buf), + allowsNostr: FfiConverterBool.read(from: &buf), nostrPubkey: FfiConverterOptionData.read(from: &buf) ) } @@ -7816,12 +7832,12 @@ public struct FfiConverterTypeLnurlWithdrawData: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> LnurlWithdrawData { return try LnurlWithdrawData( - uri: FfiConverterString.read(from: &buf), - callback: FfiConverterString.read(from: &buf), - k1: FfiConverterString.read(from: &buf), - defaultDescription: FfiConverterString.read(from: &buf), - minWithdrawable: FfiConverterOptionUInt64.read(from: &buf), - maxWithdrawable: FfiConverterUInt64.read(from: &buf), + uri: FfiConverterString.read(from: &buf), + callback: FfiConverterString.read(from: &buf), + k1: FfiConverterString.read(from: &buf), + defaultDescription: FfiConverterString.read(from: &buf), + minWithdrawable: FfiConverterOptionUInt64.read(from: &buf), + maxWithdrawable: FfiConverterUInt64.read(from: &buf), tag: FfiConverterString.read(from: &buf) ) } @@ -7883,16 +7899,16 @@ public struct NativeDeviceInfo { public init( /** * Unique path/identifier for this device - */path: String, + */path: String, /** * Transport type: "usb" or "bluetooth" - */transportType: String, + */transportType: String, /** * Optional device name (from BLE advertisement or USB descriptor) - */name: String?, + */name: String?, /** * USB Vendor ID (for USB devices) - */vendorId: UInt16?, + */vendorId: UInt16?, /** * USB Product ID (for USB devices) */productId: UInt16?) { @@ -7949,10 +7965,10 @@ public struct FfiConverterTypeNativeDeviceInfo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NativeDeviceInfo { return try NativeDeviceInfo( - path: FfiConverterString.read(from: &buf), - transportType: FfiConverterString.read(from: &buf), - name: FfiConverterOptionString.read(from: &buf), - vendorId: FfiConverterOptionUInt16.read(from: &buf), + path: FfiConverterString.read(from: &buf), + transportType: FfiConverterString.read(from: &buf), + name: FfiConverterOptionString.read(from: &buf), + vendorId: FfiConverterOptionUInt16.read(from: &buf), productId: FfiConverterOptionUInt16.read(from: &buf) ) } @@ -8045,10 +8061,10 @@ public struct FfiConverterTypeOnChainInvoice: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnChainInvoice { return try OnChainInvoice( - address: FfiConverterString.read(from: &buf), - amountSatoshis: FfiConverterUInt64.read(from: &buf), - label: FfiConverterOptionString.read(from: &buf), - message: FfiConverterOptionString.read(from: &buf), + address: FfiConverterString.read(from: &buf), + amountSatoshis: FfiConverterUInt64.read(from: &buf), + label: FfiConverterOptionString.read(from: &buf), + message: FfiConverterOptionString.read(from: &buf), params: FfiConverterOptionDictionaryStringString.read(from: &buf) ) } @@ -8079,6 +8095,7 @@ public func FfiConverterTypeOnChainInvoice_lower(_ value: OnChainInvoice) -> Rus public struct OnchainActivity { + public var walletId: String public var id: String public var txType: PaymentType public var txId: String @@ -8102,7 +8119,8 @@ public struct OnchainActivity { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(id: String, txType: PaymentType, txId: String, value: UInt64, fee: UInt64, feeRate: UInt64, address: String, confirmed: Bool, timestamp: UInt64, isBoosted: Bool, boostTxIds: [String], isTransfer: Bool, doesExist: Bool, confirmTimestamp: UInt64?, channelId: String?, transferTxId: String?, contact: String?, createdAt: UInt64?, updatedAt: UInt64?, seenAt: UInt64?) { + public init(walletId: String, id: String, txType: PaymentType, txId: String, value: UInt64, fee: UInt64, feeRate: UInt64, address: String, confirmed: Bool, timestamp: UInt64, isBoosted: Bool, boostTxIds: [String], isTransfer: Bool, doesExist: Bool, confirmTimestamp: UInt64?, channelId: String?, transferTxId: String?, contact: String?, createdAt: UInt64?, updatedAt: UInt64?, seenAt: UInt64?) { + self.walletId = walletId self.id = id self.txType = txType self.txId = txId @@ -8133,6 +8151,9 @@ extension OnchainActivity: Sendable {} extension OnchainActivity: Equatable, Hashable { public static func ==(lhs: OnchainActivity, rhs: OnchainActivity) -> Bool { + if lhs.walletId != rhs.walletId { + return false + } if lhs.id != rhs.id { return false } @@ -8197,6 +8218,7 @@ extension OnchainActivity: Equatable, Hashable { } public func hash(into hasher: inout Hasher) { + hasher.combine(walletId) hasher.combine(id) hasher.combine(txType) hasher.combine(txId) @@ -8231,30 +8253,32 @@ public struct FfiConverterTypeOnchainActivity: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> OnchainActivity { return try OnchainActivity( - id: FfiConverterString.read(from: &buf), - txType: FfiConverterTypePaymentType.read(from: &buf), - txId: FfiConverterString.read(from: &buf), - value: FfiConverterUInt64.read(from: &buf), - fee: FfiConverterUInt64.read(from: &buf), - feeRate: FfiConverterUInt64.read(from: &buf), - address: FfiConverterString.read(from: &buf), - confirmed: FfiConverterBool.read(from: &buf), - timestamp: FfiConverterUInt64.read(from: &buf), - isBoosted: FfiConverterBool.read(from: &buf), - boostTxIds: FfiConverterSequenceString.read(from: &buf), - isTransfer: FfiConverterBool.read(from: &buf), - doesExist: FfiConverterBool.read(from: &buf), - confirmTimestamp: FfiConverterOptionUInt64.read(from: &buf), - channelId: FfiConverterOptionString.read(from: &buf), - transferTxId: FfiConverterOptionString.read(from: &buf), - contact: FfiConverterOptionString.read(from: &buf), - createdAt: FfiConverterOptionUInt64.read(from: &buf), - updatedAt: FfiConverterOptionUInt64.read(from: &buf), + walletId: FfiConverterString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + txType: FfiConverterTypePaymentType.read(from: &buf), + txId: FfiConverterString.read(from: &buf), + value: FfiConverterUInt64.read(from: &buf), + fee: FfiConverterUInt64.read(from: &buf), + feeRate: FfiConverterUInt64.read(from: &buf), + address: FfiConverterString.read(from: &buf), + confirmed: FfiConverterBool.read(from: &buf), + timestamp: FfiConverterUInt64.read(from: &buf), + isBoosted: FfiConverterBool.read(from: &buf), + boostTxIds: FfiConverterSequenceString.read(from: &buf), + isTransfer: FfiConverterBool.read(from: &buf), + doesExist: FfiConverterBool.read(from: &buf), + confirmTimestamp: FfiConverterOptionUInt64.read(from: &buf), + channelId: FfiConverterOptionString.read(from: &buf), + transferTxId: FfiConverterOptionString.read(from: &buf), + contact: FfiConverterOptionString.read(from: &buf), + createdAt: FfiConverterOptionUInt64.read(from: &buf), + updatedAt: FfiConverterOptionUInt64.read(from: &buf), seenAt: FfiConverterOptionUInt64.read(from: &buf) ) } public static func write(_ value: OnchainActivity, into buf: inout [UInt8]) { + FfiConverterString.write(value.walletId, into: &buf) FfiConverterString.write(value.id, into: &buf) FfiConverterTypePaymentType.write(value.txType, into: &buf) FfiConverterString.write(value.txId, into: &buf) @@ -8295,6 +8319,7 @@ public func FfiConverterTypeOnchainActivity_lower(_ value: OnchainActivity) -> R public struct PreActivityMetadata { + public var walletId: String public var paymentId: String public var tags: [String] public var paymentHash: String? @@ -8308,7 +8333,8 @@ public struct PreActivityMetadata { // Default memberwise initializers are never public by default, so we // declare one manually. - public init(paymentId: String, tags: [String], paymentHash: String?, txId: String?, address: String?, isReceive: Bool, feeRate: UInt64, isTransfer: Bool, channelId: String?, createdAt: UInt64) { + public init(walletId: String, paymentId: String, tags: [String], paymentHash: String?, txId: String?, address: String?, isReceive: Bool, feeRate: UInt64, isTransfer: Bool, channelId: String?, createdAt: UInt64) { + self.walletId = walletId self.paymentId = paymentId self.tags = tags self.paymentHash = paymentHash @@ -8329,6 +8355,9 @@ extension PreActivityMetadata: Sendable {} extension PreActivityMetadata: Equatable, Hashable { public static func ==(lhs: PreActivityMetadata, rhs: PreActivityMetadata) -> Bool { + if lhs.walletId != rhs.walletId { + return false + } if lhs.paymentId != rhs.paymentId { return false } @@ -8363,6 +8392,7 @@ extension PreActivityMetadata: Equatable, Hashable { } public func hash(into hasher: inout Hasher) { + hasher.combine(walletId) hasher.combine(paymentId) hasher.combine(tags) hasher.combine(paymentHash) @@ -8387,20 +8417,22 @@ public struct FfiConverterTypePreActivityMetadata: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PreActivityMetadata { return try PreActivityMetadata( - paymentId: FfiConverterString.read(from: &buf), - tags: FfiConverterSequenceString.read(from: &buf), - paymentHash: FfiConverterOptionString.read(from: &buf), - txId: FfiConverterOptionString.read(from: &buf), - address: FfiConverterOptionString.read(from: &buf), - isReceive: FfiConverterBool.read(from: &buf), - feeRate: FfiConverterUInt64.read(from: &buf), - isTransfer: FfiConverterBool.read(from: &buf), - channelId: FfiConverterOptionString.read(from: &buf), + walletId: FfiConverterString.read(from: &buf), + paymentId: FfiConverterString.read(from: &buf), + tags: FfiConverterSequenceString.read(from: &buf), + paymentHash: FfiConverterOptionString.read(from: &buf), + txId: FfiConverterOptionString.read(from: &buf), + address: FfiConverterOptionString.read(from: &buf), + isReceive: FfiConverterBool.read(from: &buf), + feeRate: FfiConverterUInt64.read(from: &buf), + isTransfer: FfiConverterBool.read(from: &buf), + channelId: FfiConverterOptionString.read(from: &buf), createdAt: FfiConverterUInt64.read(from: &buf) ) } public static func write(_ value: PreActivityMetadata, into buf: inout [UInt8]) { + FfiConverterString.write(value.walletId, into: &buf) FfiConverterString.write(value.paymentId, into: &buf) FfiConverterSequenceString.write(value.tags, into: &buf) FfiConverterOptionString.write(value.paymentHash, into: &buf) @@ -8524,16 +8556,16 @@ public struct PubkyAuthDetails { public init( /** * Whether this is a signin or signup flow. - */kind: PubkyAuthKind, + */kind: PubkyAuthKind, /** * Requested capabilities (e.g. `"/pub/pubky.app/:rw"`). - */capabilities: String, + */capabilities: String, /** * Relay URL used for the auth exchange. - */relay: String, + */relay: String, /** * Homeserver public key (z32-encoded). Present only for signup flows. - */homeserver: String?, + */homeserver: String?, /** * Signup token. Present only for signup flows. */signupToken: String?) { @@ -8590,10 +8622,10 @@ public struct FfiConverterTypePubkyAuthDetails: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PubkyAuthDetails { return try PubkyAuthDetails( - kind: FfiConverterTypePubkyAuthKind.read(from: &buf), - capabilities: FfiConverterString.read(from: &buf), - relay: FfiConverterString.read(from: &buf), - homeserver: FfiConverterOptionString.read(from: &buf), + kind: FfiConverterTypePubkyAuthKind.read(from: &buf), + capabilities: FfiConverterString.read(from: &buf), + relay: FfiConverterString.read(from: &buf), + homeserver: FfiConverterOptionString.read(from: &buf), signupToken: FfiConverterOptionString.read(from: &buf) ) } @@ -8686,10 +8718,10 @@ public struct FfiConverterTypePubkyProfile: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PubkyProfile { return try PubkyProfile( - name: FfiConverterString.read(from: &buf), - bio: FfiConverterOptionString.read(from: &buf), - image: FfiConverterOptionString.read(from: &buf), - links: FfiConverterOptionSequenceTypePubkyProfileLink.read(from: &buf), + name: FfiConverterString.read(from: &buf), + bio: FfiConverterOptionString.read(from: &buf), + image: FfiConverterOptionString.read(from: &buf), + links: FfiConverterOptionSequenceTypePubkyProfileLink.read(from: &buf), status: FfiConverterOptionString.read(from: &buf) ) } @@ -8764,7 +8796,7 @@ public struct FfiConverterTypePubkyProfileLink: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PubkyProfileLink { return try PubkyProfileLink( - title: FfiConverterString.read(from: &buf), + title: FfiConverterString.read(from: &buf), url: FfiConverterString.read(from: &buf) ) } @@ -8821,16 +8853,16 @@ public struct SingleAddressInfoResult { public init( /** * The queried address - */address: String, + */address: String, /** * Total confirmed balance in satoshis - */balance: UInt64, + */balance: UInt64, /** * UTXOs for this address - */utxos: [AccountUtxo], + */utxos: [AccountUtxo], /** * Number of transactions involving this address - */transfers: UInt32, + */transfers: UInt32, /** * Current blockchain tip height */blockHeight: UInt32) { @@ -8887,10 +8919,10 @@ public struct FfiConverterTypeSingleAddressInfoResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SingleAddressInfoResult { return try SingleAddressInfoResult( - address: FfiConverterString.read(from: &buf), - balance: FfiConverterUInt64.read(from: &buf), - utxos: FfiConverterSequenceTypeAccountUtxo.read(from: &buf), - transfers: FfiConverterUInt32.read(from: &buf), + address: FfiConverterString.read(from: &buf), + balance: FfiConverterUInt64.read(from: &buf), + utxos: FfiConverterSequenceTypeAccountUtxo.read(from: &buf), + transfers: FfiConverterUInt32.read(from: &buf), blockHeight: FfiConverterUInt32.read(from: &buf) ) } @@ -8943,13 +8975,13 @@ public struct SweepResult { public init( /** * The transaction ID of the sweep transaction - */txid: String, + */txid: String, /** * The total amount swept (in satoshis) - */amountSwept: UInt64, + */amountSwept: UInt64, /** * The fee paid (in satoshis) - */feePaid: UInt64, + */feePaid: UInt64, /** * The number of UTXOs swept */utxosSwept: UInt32) { @@ -9001,9 +9033,9 @@ public struct FfiConverterTypeSweepResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SweepResult { return try SweepResult( - txid: FfiConverterString.read(from: &buf), - amountSwept: FfiConverterUInt64.read(from: &buf), - feePaid: FfiConverterUInt64.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + amountSwept: FfiConverterUInt64.read(from: &buf), + feePaid: FfiConverterUInt64.read(from: &buf), utxosSwept: FfiConverterUInt32.read(from: &buf) ) } @@ -9067,22 +9099,22 @@ public struct SweepTransactionPreview { public init( /** * The PSBT (Partially Signed Bitcoin Transaction) in base64 format - */psbt: String, + */psbt: String, /** * The total amount available to sweep (in satoshis) - */totalAmount: UInt64, + */totalAmount: UInt64, /** * The estimated fee for the transaction (in satoshis) - */estimatedFee: UInt64, + */estimatedFee: UInt64, /** * The estimated virtual size of the transaction (in vbytes) - */estimatedVsize: UInt64, + */estimatedVsize: UInt64, /** * The number of UTXOs that will be swept - */utxosCount: UInt32, + */utxosCount: UInt32, /** * The destination address - */destinationAddress: String, + */destinationAddress: String, /** * The amount that will be sent to destination after fees (in satoshis) */amountAfterFees: UInt64) { @@ -9149,12 +9181,12 @@ public struct FfiConverterTypeSweepTransactionPreview: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SweepTransactionPreview { return try SweepTransactionPreview( - psbt: FfiConverterString.read(from: &buf), - totalAmount: FfiConverterUInt64.read(from: &buf), - estimatedFee: FfiConverterUInt64.read(from: &buf), - estimatedVsize: FfiConverterUInt64.read(from: &buf), - utxosCount: FfiConverterUInt32.read(from: &buf), - destinationAddress: FfiConverterString.read(from: &buf), + psbt: FfiConverterString.read(from: &buf), + totalAmount: FfiConverterUInt64.read(from: &buf), + estimatedFee: FfiConverterUInt64.read(from: &buf), + estimatedVsize: FfiConverterUInt64.read(from: &buf), + utxosCount: FfiConverterUInt32.read(from: &buf), + destinationAddress: FfiConverterString.read(from: &buf), amountAfterFees: FfiConverterUInt64.read(from: &buf) ) } @@ -9225,25 +9257,25 @@ public struct SweepableBalances { public init( /** * Balance in legacy (P2PKH) addresses (in satoshis) - */legacyBalance: UInt64, + */legacyBalance: UInt64, /** * Balance in P2SH-SegWit (P2SH-P2WPKH) addresses (in satoshis) - */p2shBalance: UInt64, + */p2shBalance: UInt64, /** * Balance in Taproot (P2TR) addresses (in satoshis) - */taprootBalance: UInt64, + */taprootBalance: UInt64, /** * Total balance across all wallet types (in satoshis) - */totalBalance: UInt64, + */totalBalance: UInt64, /** * Number of UTXOs in legacy wallet - */legacyUtxosCount: UInt32, + */legacyUtxosCount: UInt32, /** * Number of UTXOs in P2SH-SegWit wallet - */p2shUtxosCount: UInt32, + */p2shUtxosCount: UInt32, /** * Number of UTXOs in Taproot wallet - */taprootUtxosCount: UInt32, + */taprootUtxosCount: UInt32, /** * Total number of UTXOs across all wallet types */totalUtxosCount: UInt32) { @@ -9315,13 +9347,13 @@ public struct FfiConverterTypeSweepableBalances: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SweepableBalances { return try SweepableBalances( - legacyBalance: FfiConverterUInt64.read(from: &buf), - p2shBalance: FfiConverterUInt64.read(from: &buf), - taprootBalance: FfiConverterUInt64.read(from: &buf), - totalBalance: FfiConverterUInt64.read(from: &buf), - legacyUtxosCount: FfiConverterUInt32.read(from: &buf), - p2shUtxosCount: FfiConverterUInt32.read(from: &buf), - taprootUtxosCount: FfiConverterUInt32.read(from: &buf), + legacyBalance: FfiConverterUInt64.read(from: &buf), + p2shBalance: FfiConverterUInt64.read(from: &buf), + taprootBalance: FfiConverterUInt64.read(from: &buf), + totalBalance: FfiConverterUInt64.read(from: &buf), + legacyUtxosCount: FfiConverterUInt32.read(from: &buf), + p2shUtxosCount: FfiConverterUInt32.read(from: &buf), + taprootUtxosCount: FfiConverterUInt32.read(from: &buf), totalUtxosCount: FfiConverterUInt32.read(from: &buf) ) } @@ -9428,49 +9460,49 @@ public struct TransactionDetail { public init( /** * Transaction ID (hex) - */txid: String, + */txid: String, /** * Amount received by the wallet (sats) - */received: UInt64, + */received: UInt64, /** * Amount sent by the wallet (sats) — includes change sent back to self - */sent: UInt64, + */sent: UInt64, /** * Net value from wallet's perspective: received - sent (positive = inflow, negative = outflow) - */net: Int64, + */net: Int64, /** * Display amount in sats (same semantics as HistoryTransaction.amount) - */amount: UInt64, + */amount: UInt64, /** * Transaction fee in sats (None if not available) - */fee: UInt64?, + */fee: UInt64?, /** * Transaction direction - */direction: TxDirection, + */direction: TxDirection, /** * Block height (None if unconfirmed/mempool) - */blockHeight: UInt32?, + */blockHeight: UInt32?, /** * Block timestamp as unix epoch seconds (None if unconfirmed) - */timestamp: UInt64?, + */timestamp: UInt64?, /** * Number of confirmations (0 if unconfirmed) - */confirmations: UInt32, + */confirmations: UInt32, /** * Transaction inputs - */inputs: [TxDetailInput], + */inputs: [TxDetailInput], /** * Transaction outputs - */outputs: [TxDetailOutput], + */outputs: [TxDetailOutput], /** * Serialized transaction size in bytes - */size: UInt32, + */size: UInt32, /** * Virtual size in vbytes (ceil(weight / 4)) - */vsize: UInt32, + */vsize: UInt32, /** * Transaction weight in weight units - */weight: UInt32, + */weight: UInt32, /** * Fee rate in sat/vB (fee / vsize), None if fee is unavailable or vsize is zero */feeRate: Double?) { @@ -9582,21 +9614,21 @@ public struct FfiConverterTypeTransactionDetail: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionDetail { return try TransactionDetail( - txid: FfiConverterString.read(from: &buf), - received: FfiConverterUInt64.read(from: &buf), - sent: FfiConverterUInt64.read(from: &buf), - net: FfiConverterInt64.read(from: &buf), - amount: FfiConverterUInt64.read(from: &buf), - fee: FfiConverterOptionUInt64.read(from: &buf), - direction: FfiConverterTypeTxDirection.read(from: &buf), - blockHeight: FfiConverterOptionUInt32.read(from: &buf), - timestamp: FfiConverterOptionUInt64.read(from: &buf), - confirmations: FfiConverterUInt32.read(from: &buf), - inputs: FfiConverterSequenceTypeTxDetailInput.read(from: &buf), - outputs: FfiConverterSequenceTypeTxDetailOutput.read(from: &buf), - size: FfiConverterUInt32.read(from: &buf), - vsize: FfiConverterUInt32.read(from: &buf), - weight: FfiConverterUInt32.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + received: FfiConverterUInt64.read(from: &buf), + sent: FfiConverterUInt64.read(from: &buf), + net: FfiConverterInt64.read(from: &buf), + amount: FfiConverterUInt64.read(from: &buf), + fee: FfiConverterOptionUInt64.read(from: &buf), + direction: FfiConverterTypeTxDirection.read(from: &buf), + blockHeight: FfiConverterOptionUInt32.read(from: &buf), + timestamp: FfiConverterOptionUInt64.read(from: &buf), + confirmations: FfiConverterUInt32.read(from: &buf), + inputs: FfiConverterSequenceTypeTxDetailInput.read(from: &buf), + outputs: FfiConverterSequenceTypeTxDetailOutput.read(from: &buf), + size: FfiConverterUInt32.read(from: &buf), + vsize: FfiConverterUInt32.read(from: &buf), + weight: FfiConverterUInt32.read(from: &buf), feeRate: FfiConverterOptionDouble.read(from: &buf) ) } @@ -9641,6 +9673,7 @@ public func FfiConverterTypeTransactionDetail_lower(_ value: TransactionDetail) * Details about an onchain transaction. */ public struct TransactionDetails { + public var walletId: String /** * The transaction ID. */ @@ -9665,10 +9698,10 @@ public struct TransactionDetails { // Default memberwise initializers are never public by default, so we // declare one manually. - public init( + public init(walletId: String, /** * The transaction ID. - */txId: String, + */txId: String, /** * The net amount in this transaction (in satoshis). * @@ -9676,13 +9709,14 @@ public struct TransactionDetails { * this will be positive. For outgoing payments, this will be negative. * * Note: This amount does NOT include transaction fees. - */amountSats: Int64, + */amountSats: Int64, /** * The transaction inputs with full details. - */inputs: [TxInput], + */inputs: [TxInput], /** * The transaction outputs with full details. */outputs: [TxOutput]) { + self.walletId = walletId self.txId = txId self.amountSats = amountSats self.inputs = inputs @@ -9697,6 +9731,9 @@ extension TransactionDetails: Sendable {} extension TransactionDetails: Equatable, Hashable { public static func ==(lhs: TransactionDetails, rhs: TransactionDetails) -> Bool { + if lhs.walletId != rhs.walletId { + return false + } if lhs.txId != rhs.txId { return false } @@ -9713,6 +9750,7 @@ extension TransactionDetails: Equatable, Hashable { } public func hash(into hasher: inout Hasher) { + hasher.combine(walletId) hasher.combine(txId) hasher.combine(amountSats) hasher.combine(inputs) @@ -9731,14 +9769,16 @@ public struct FfiConverterTypeTransactionDetails: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionDetails { return try TransactionDetails( - txId: FfiConverterString.read(from: &buf), - amountSats: FfiConverterInt64.read(from: &buf), - inputs: FfiConverterSequenceTypeTxInput.read(from: &buf), + walletId: FfiConverterString.read(from: &buf), + txId: FfiConverterString.read(from: &buf), + amountSats: FfiConverterInt64.read(from: &buf), + inputs: FfiConverterSequenceTypeTxInput.read(from: &buf), outputs: FfiConverterSequenceTypeTxOutput.read(from: &buf) ) } public static func write(_ value: TransactionDetails, into buf: inout [UInt8]) { + FfiConverterString.write(value.walletId, into: &buf) FfiConverterString.write(value.txId, into: &buf) FfiConverterInt64.write(value.amountSats, into: &buf) FfiConverterSequenceTypeTxInput.write(value.inputs, into: &buf) @@ -9792,16 +9832,16 @@ public struct TransactionHistoryResult { public init( /** * All transactions, sorted: unconfirmed first, then by timestamp descending - */transactions: [HistoryTransaction], + */transactions: [HistoryTransaction], /** * Balance breakdown - */balance: WalletBalance, + */balance: WalletBalance, /** * Total number of transactions - */txCount: UInt32, + */txCount: UInt32, /** * Current blockchain tip height - */blockHeight: UInt32, + */blockHeight: UInt32, /** * The detected or specified account type */accountType: AccountType) { @@ -9858,10 +9898,10 @@ public struct FfiConverterTypeTransactionHistoryResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TransactionHistoryResult { return try TransactionHistoryResult( - transactions: FfiConverterSequenceTypeHistoryTransaction.read(from: &buf), - balance: FfiConverterTypeWalletBalance.read(from: &buf), - txCount: FfiConverterUInt32.read(from: &buf), - blockHeight: FfiConverterUInt32.read(from: &buf), + transactions: FfiConverterSequenceTypeHistoryTransaction.read(from: &buf), + balance: FfiConverterTypeWalletBalance.read(from: &buf), + txCount: FfiConverterUInt32.read(from: &buf), + blockHeight: FfiConverterUInt32.read(from: &buf), accountType: FfiConverterTypeAccountType.read(from: &buf) ) } @@ -9909,7 +9949,7 @@ public struct TrezorAddressResponse { public init( /** * The Bitcoin address - */address: String, + */address: String, /** * The serialized path (e.g., "m/84'/0'/0'/0/0") */path: String) { @@ -9951,7 +9991,7 @@ public struct FfiConverterTypeTrezorAddressResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorAddressResponse { return try TrezorAddressResponse( - address: FfiConverterString.read(from: &buf), + address: FfiConverterString.read(from: &buf), path: FfiConverterString.read(from: &buf) ) } @@ -10004,13 +10044,13 @@ public struct TrezorCallMessageResult { public init( /** * Whether the call succeeded - */success: Bool, + */success: Bool, /** * Response message type - */messageType: UInt16, + */messageType: UInt16, /** * Response protobuf data - */data: Data, + */data: Data, /** * Error message (empty on success) */error: String) { @@ -10062,9 +10102,9 @@ public struct FfiConverterTypeTrezorCallMessageResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorCallMessageResult { return try TrezorCallMessageResult( - success: FfiConverterBool.read(from: &buf), - messageType: FfiConverterUInt16.read(from: &buf), - data: FfiConverterData.read(from: &buf), + success: FfiConverterBool.read(from: &buf), + messageType: FfiConverterUInt16.read(from: &buf), + data: FfiConverterData.read(from: &buf), error: FfiConverterString.read(from: &buf) ) } @@ -10131,22 +10171,22 @@ public struct TrezorDeviceInfo { public init( /** * Unique identifier for the device - */id: String, + */id: String, /** * Transport type (USB or Bluetooth) - */transportType: TrezorTransportType, + */transportType: TrezorTransportType, /** * Device name (from BLE advertisement or USB descriptor) - */name: String?, + */name: String?, /** * Transport-specific path (used internally for connection) - */path: String, + */path: String, /** * Device label (set by user during device setup) - */label: String?, + */label: String?, /** * Device model (e.g., "T2", "Safe 5", "Safe 7") - */model: String?, + */model: String?, /** * Whether the device is in bootloader mode */isBootloader: Bool) { @@ -10213,12 +10253,12 @@ public struct FfiConverterTypeTrezorDeviceInfo: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorDeviceInfo { return try TrezorDeviceInfo( - id: FfiConverterString.read(from: &buf), - transportType: FfiConverterTypeTrezorTransportType.read(from: &buf), - name: FfiConverterOptionString.read(from: &buf), - path: FfiConverterString.read(from: &buf), - label: FfiConverterOptionString.read(from: &buf), - model: FfiConverterOptionString.read(from: &buf), + id: FfiConverterString.read(from: &buf), + transportType: FfiConverterTypeTrezorTransportType.read(from: &buf), + name: FfiConverterOptionString.read(from: &buf), + path: FfiConverterString.read(from: &buf), + label: FfiConverterOptionString.read(from: &buf), + model: FfiConverterOptionString.read(from: &buf), isBootloader: FfiConverterBool.read(from: &buf) ) } @@ -10309,37 +10349,37 @@ public struct TrezorFeatures { public init( /** * Vendor string - */vendor: String?, + */vendor: String?, /** * Device model - */model: String?, + */model: String?, /** * Device label (set by user during device setup) - */label: String?, + */label: String?, /** * Device ID (unique per device) - */deviceId: String?, + */deviceId: String?, /** * Major firmware version - */majorVersion: UInt32?, + */majorVersion: UInt32?, /** * Minor firmware version - */minorVersion: UInt32?, + */minorVersion: UInt32?, /** * Patch firmware version - */patchVersion: UInt32?, + */patchVersion: UInt32?, /** * Whether PIN protection is enabled - */pinProtection: Bool?, + */pinProtection: Bool?, /** * Whether passphrase protection is enabled - */passphraseProtection: Bool?, + */passphraseProtection: Bool?, /** * Whether the device is initialized with a seed - */initialized: Bool?, + */initialized: Bool?, /** * Whether the device needs backup - */needsBackup: Bool?, + */needsBackup: Bool?, /** * Whether the device can accept passphrase entry on the device itself * (`Capability_PassphraseEntry`). When false/None, use host entry only. @@ -10432,17 +10472,17 @@ public struct FfiConverterTypeTrezorFeatures: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorFeatures { return try TrezorFeatures( - vendor: FfiConverterOptionString.read(from: &buf), - model: FfiConverterOptionString.read(from: &buf), - label: FfiConverterOptionString.read(from: &buf), - deviceId: FfiConverterOptionString.read(from: &buf), - majorVersion: FfiConverterOptionUInt32.read(from: &buf), - minorVersion: FfiConverterOptionUInt32.read(from: &buf), - patchVersion: FfiConverterOptionUInt32.read(from: &buf), - pinProtection: FfiConverterOptionBool.read(from: &buf), - passphraseProtection: FfiConverterOptionBool.read(from: &buf), - initialized: FfiConverterOptionBool.read(from: &buf), - needsBackup: FfiConverterOptionBool.read(from: &buf), + vendor: FfiConverterOptionString.read(from: &buf), + model: FfiConverterOptionString.read(from: &buf), + label: FfiConverterOptionString.read(from: &buf), + deviceId: FfiConverterOptionString.read(from: &buf), + majorVersion: FfiConverterOptionUInt32.read(from: &buf), + minorVersion: FfiConverterOptionUInt32.read(from: &buf), + patchVersion: FfiConverterOptionUInt32.read(from: &buf), + pinProtection: FfiConverterOptionBool.read(from: &buf), + passphraseProtection: FfiConverterOptionBool.read(from: &buf), + initialized: FfiConverterOptionBool.read(from: &buf), + needsBackup: FfiConverterOptionBool.read(from: &buf), passphraseEntryCapable: FfiConverterOptionBool.read(from: &buf) ) } @@ -10505,13 +10545,13 @@ public struct TrezorGetAddressParams { public init( /** * BIP32 path (e.g., "m/84'/0'/0'/0/0") - */path: String, + */path: String, /** * Coin network (default: Bitcoin) - */coin: TrezorCoinType?, + */coin: TrezorCoinType?, /** * Whether to display the address on the device for confirmation - */showOnTrezor: Bool, + */showOnTrezor: Bool, /** * Script type (auto-detected from path if not specified) */scriptType: TrezorScriptType?) { @@ -10563,9 +10603,9 @@ public struct FfiConverterTypeTrezorGetAddressParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorGetAddressParams { return try TrezorGetAddressParams( - path: FfiConverterString.read(from: &buf), - coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf), - showOnTrezor: FfiConverterBool.read(from: &buf), + path: FfiConverterString.read(from: &buf), + coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf), + showOnTrezor: FfiConverterBool.read(from: &buf), scriptType: FfiConverterOptionTypeTrezorScriptType.read(from: &buf) ) } @@ -10616,10 +10656,10 @@ public struct TrezorGetPublicKeyParams { public init( /** * BIP32 path (e.g., "m/84'/0'/0'") - */path: String, + */path: String, /** * Coin network (default: Bitcoin) - */coin: TrezorCoinType?, + */coin: TrezorCoinType?, /** * Whether to display on device for confirmation */showOnTrezor: Bool) { @@ -10666,8 +10706,8 @@ public struct FfiConverterTypeTrezorGetPublicKeyParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorGetPublicKeyParams { return try TrezorGetPublicKeyParams( - path: FfiConverterString.read(from: &buf), - coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf), + path: FfiConverterString.read(from: &buf), + coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf), showOnTrezor: FfiConverterBool.read(from: &buf) ) } @@ -10725,16 +10765,16 @@ public struct TrezorPrevTx { public init( /** * Transaction hash (hex encoded) - */hash: String, + */hash: String, /** * Transaction version - */version: UInt32, + */version: UInt32, /** * Lock time - */lockTime: UInt32, + */lockTime: UInt32, /** * Transaction inputs - */inputs: [TrezorPrevTxInput], + */inputs: [TrezorPrevTxInput], /** * Transaction outputs */outputs: [TrezorPrevTxOutput]) { @@ -10791,10 +10831,10 @@ public struct FfiConverterTypeTrezorPrevTx: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorPrevTx { return try TrezorPrevTx( - hash: FfiConverterString.read(from: &buf), - version: FfiConverterUInt32.read(from: &buf), - lockTime: FfiConverterUInt32.read(from: &buf), - inputs: FfiConverterSequenceTypeTrezorPrevTxInput.read(from: &buf), + hash: FfiConverterString.read(from: &buf), + version: FfiConverterUInt32.read(from: &buf), + lockTime: FfiConverterUInt32.read(from: &buf), + inputs: FfiConverterSequenceTypeTrezorPrevTxInput.read(from: &buf), outputs: FfiConverterSequenceTypeTrezorPrevTxOutput.read(from: &buf) ) } @@ -10850,13 +10890,13 @@ public struct TrezorPrevTxInput { public init( /** * Previous transaction hash (hex encoded) - */prevHash: String, + */prevHash: String, /** * Previous output index - */prevIndex: UInt32, + */prevIndex: UInt32, /** * Script signature (hex encoded) - */scriptSig: String, + */scriptSig: String, /** * Sequence number */sequence: UInt32) { @@ -10908,9 +10948,9 @@ public struct FfiConverterTypeTrezorPrevTxInput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorPrevTxInput { return try TrezorPrevTxInput( - prevHash: FfiConverterString.read(from: &buf), - prevIndex: FfiConverterUInt32.read(from: &buf), - scriptSig: FfiConverterString.read(from: &buf), + prevHash: FfiConverterString.read(from: &buf), + prevIndex: FfiConverterUInt32.read(from: &buf), + scriptSig: FfiConverterString.read(from: &buf), sequence: FfiConverterUInt32.read(from: &buf) ) } @@ -10957,7 +10997,7 @@ public struct TrezorPrevTxOutput { public init( /** * Amount in satoshis - */amount: UInt64, + */amount: UInt64, /** * Script pubkey (hex encoded) */scriptPubkey: String) { @@ -10999,7 +11039,7 @@ public struct FfiConverterTypeTrezorPrevTxOutput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorPrevTxOutput { return try TrezorPrevTxOutput( - amount: FfiConverterUInt64.read(from: &buf), + amount: FfiConverterUInt64.read(from: &buf), scriptPubkey: FfiConverterString.read(from: &buf) ) } @@ -11064,22 +11104,22 @@ public struct TrezorPublicKeyResponse { public init( /** * Extended public key (xpub) - */xpub: String, + */xpub: String, /** * The serialized path (e.g., "m/84'/0'/0'") - */path: String, + */path: String, /** * Compressed public key (hex encoded) - */publicKey: String, + */publicKey: String, /** * Chain code (hex encoded) - */chainCode: String, + */chainCode: String, /** * Parent key fingerprint - */fingerprint: UInt32, + */fingerprint: UInt32, /** * Derivation depth - */depth: UInt32, + */depth: UInt32, /** * Master root fingerprint (from the device's master seed) */rootFingerprint: UInt32?) { @@ -11146,12 +11186,12 @@ public struct FfiConverterTypeTrezorPublicKeyResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorPublicKeyResponse { return try TrezorPublicKeyResponse( - xpub: FfiConverterString.read(from: &buf), - path: FfiConverterString.read(from: &buf), - publicKey: FfiConverterString.read(from: &buf), - chainCode: FfiConverterString.read(from: &buf), - fingerprint: FfiConverterUInt32.read(from: &buf), - depth: FfiConverterUInt32.read(from: &buf), + xpub: FfiConverterString.read(from: &buf), + path: FfiConverterString.read(from: &buf), + publicKey: FfiConverterString.read(from: &buf), + chainCode: FfiConverterString.read(from: &buf), + fingerprint: FfiConverterUInt32.read(from: &buf), + depth: FfiConverterUInt32.read(from: &buf), rootFingerprint: FfiConverterOptionUInt32.read(from: &buf) ) } @@ -11205,10 +11245,10 @@ public struct TrezorSignMessageParams { public init( /** * BIP32 path for the signing key (e.g., "m/84'/0'/0'/0/0") - */path: String, + */path: String, /** * Message to sign - */message: String, + */message: String, /** * Coin network (default: Bitcoin) */coin: TrezorCoinType?) { @@ -11255,8 +11295,8 @@ public struct FfiConverterTypeTrezorSignMessageParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorSignMessageParams { return try TrezorSignMessageParams( - path: FfiConverterString.read(from: &buf), - message: FfiConverterString.read(from: &buf), + path: FfiConverterString.read(from: &buf), + message: FfiConverterString.read(from: &buf), coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf) ) } @@ -11318,19 +11358,19 @@ public struct TrezorSignTxParams { public init( /** * Transaction inputs - */inputs: [TrezorTxInput], + */inputs: [TrezorTxInput], /** * Transaction outputs - */outputs: [TrezorTxOutput], + */outputs: [TrezorTxOutput], /** * Coin network (default: Bitcoin) - */coin: TrezorCoinType?, + */coin: TrezorCoinType?, /** * Lock time (default: 0) - */lockTime: UInt32?, + */lockTime: UInt32?, /** * Version (default: 2) - */version: UInt32?, + */version: UInt32?, /** * Previous transactions (for non-SegWit input verification) */prevTxs: [TrezorPrevTx]) { @@ -11392,11 +11432,11 @@ public struct FfiConverterTypeTrezorSignTxParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorSignTxParams { return try TrezorSignTxParams( - inputs: FfiConverterSequenceTypeTrezorTxInput.read(from: &buf), - outputs: FfiConverterSequenceTypeTrezorTxOutput.read(from: &buf), - coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf), - lockTime: FfiConverterOptionUInt32.read(from: &buf), - version: FfiConverterOptionUInt32.read(from: &buf), + inputs: FfiConverterSequenceTypeTrezorTxInput.read(from: &buf), + outputs: FfiConverterSequenceTypeTrezorTxOutput.read(from: &buf), + coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf), + lockTime: FfiConverterOptionUInt32.read(from: &buf), + version: FfiConverterOptionUInt32.read(from: &buf), prevTxs: FfiConverterSequenceTypeTrezorPrevTx.read(from: &buf) ) } @@ -11445,7 +11485,7 @@ public struct TrezorSignedMessageResponse { public init( /** * Bitcoin address that signed the message - */address: String, + */address: String, /** * Signature (base64 encoded) */signature: String) { @@ -11487,7 +11527,7 @@ public struct FfiConverterTypeTrezorSignedMessageResponse: FfiConverterRustBuffe public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorSignedMessageResponse { return try TrezorSignedMessageResponse( - address: FfiConverterString.read(from: &buf), + address: FfiConverterString.read(from: &buf), signature: FfiConverterString.read(from: &buf) ) } @@ -11536,10 +11576,10 @@ public struct TrezorSignedTx { public init( /** * Signatures for each input (hex encoded) - */signatures: [String], + */signatures: [String], /** * Serialized transaction (hex) - */serializedTx: String, + */serializedTx: String, /** * Broadcast transaction ID (populated when push=true) */txid: String?) { @@ -11586,8 +11626,8 @@ public struct FfiConverterTypeTrezorSignedTx: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorSignedTx { return try TrezorSignedTx( - signatures: FfiConverterSequenceString.read(from: &buf), - serializedTx: FfiConverterString.read(from: &buf), + signatures: FfiConverterSequenceString.read(from: &buf), + serializedTx: FfiConverterString.read(from: &buf), txid: FfiConverterOptionString.read(from: &buf) ) } @@ -11637,10 +11677,10 @@ public struct TrezorTransportReadResult { public init( /** * Whether the read succeeded - */success: Bool, + */success: Bool, /** * Data read (empty on failure) - */data: Data, + */data: Data, /** * Error message (empty on success) */error: String) { @@ -11687,8 +11727,8 @@ public struct FfiConverterTypeTrezorTransportReadResult: FfiConverterRustBuffer public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorTransportReadResult { return try TrezorTransportReadResult( - success: FfiConverterBool.read(from: &buf), - data: FfiConverterData.read(from: &buf), + success: FfiConverterBool.read(from: &buf), + data: FfiConverterData.read(from: &buf), error: FfiConverterString.read(from: &buf) ) } @@ -11734,7 +11774,7 @@ public struct TrezorTransportWriteResult { public init( /** * Whether the operation succeeded - */success: Bool, + */success: Bool, /** * Error message (empty on success) */error: String) { @@ -11776,7 +11816,7 @@ public struct FfiConverterTypeTrezorTransportWriteResult: FfiConverterRustBuffer public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorTransportWriteResult { return try TrezorTransportWriteResult( - success: FfiConverterBool.read(from: &buf), + success: FfiConverterBool.read(from: &buf), error: FfiConverterString.read(from: &buf) ) } @@ -11845,25 +11885,25 @@ public struct TrezorTxInput { public init( /** * Previous transaction hash (hex, 32 bytes) - */prevHash: String, + */prevHash: String, /** * Previous output index - */prevIndex: UInt32, + */prevIndex: UInt32, /** * BIP32 derivation path (e.g., "m/84'/0'/0'/0/0") - */path: String, + */path: String, /** * Amount in satoshis - */amount: UInt64, + */amount: UInt64, /** * Script type - */scriptType: TrezorScriptType, + */scriptType: TrezorScriptType, /** * Sequence number (default: 0xFFFFFFFD for RBF) - */sequence: UInt32?, + */sequence: UInt32?, /** * Original transaction hash for RBF replacement (hex encoded) - */origHash: String?, + */origHash: String?, /** * Original input index for RBF replacement */origIndex: UInt32?) { @@ -11935,13 +11975,13 @@ public struct FfiConverterTypeTrezorTxInput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorTxInput { return try TrezorTxInput( - prevHash: FfiConverterString.read(from: &buf), - prevIndex: FfiConverterUInt32.read(from: &buf), - path: FfiConverterString.read(from: &buf), - amount: FfiConverterUInt64.read(from: &buf), - scriptType: FfiConverterTypeTrezorScriptType.read(from: &buf), - sequence: FfiConverterOptionUInt32.read(from: &buf), - origHash: FfiConverterOptionString.read(from: &buf), + prevHash: FfiConverterString.read(from: &buf), + prevIndex: FfiConverterUInt32.read(from: &buf), + path: FfiConverterString.read(from: &buf), + amount: FfiConverterUInt64.read(from: &buf), + scriptType: FfiConverterTypeTrezorScriptType.read(from: &buf), + sequence: FfiConverterOptionUInt32.read(from: &buf), + origHash: FfiConverterOptionString.read(from: &buf), origIndex: FfiConverterOptionUInt32.read(from: &buf) ) } @@ -12012,22 +12052,22 @@ public struct TrezorTxOutput { public init( /** * Destination address (for external outputs) - */address: String?, + */address: String?, /** * BIP32 path (for change outputs) - */path: String?, + */path: String?, /** * Amount in satoshis - */amount: UInt64, + */amount: UInt64, /** * Script type (for change outputs) - */scriptType: TrezorScriptType?, + */scriptType: TrezorScriptType?, /** * OP_RETURN data (hex encoded, for data outputs) - */opReturnData: String?, + */opReturnData: String?, /** * Original transaction hash for RBF replacement (hex encoded) - */origHash: String?, + */origHash: String?, /** * Original output index for RBF replacement */origIndex: UInt32?) { @@ -12094,12 +12134,12 @@ public struct FfiConverterTypeTrezorTxOutput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorTxOutput { return try TrezorTxOutput( - address: FfiConverterOptionString.read(from: &buf), - path: FfiConverterOptionString.read(from: &buf), - amount: FfiConverterUInt64.read(from: &buf), - scriptType: FfiConverterOptionTypeTrezorScriptType.read(from: &buf), - opReturnData: FfiConverterOptionString.read(from: &buf), - origHash: FfiConverterOptionString.read(from: &buf), + address: FfiConverterOptionString.read(from: &buf), + path: FfiConverterOptionString.read(from: &buf), + amount: FfiConverterUInt64.read(from: &buf), + scriptType: FfiConverterOptionTypeTrezorScriptType.read(from: &buf), + opReturnData: FfiConverterOptionString.read(from: &buf), + origHash: FfiConverterOptionString.read(from: &buf), origIndex: FfiConverterOptionUInt32.read(from: &buf) ) } @@ -12157,13 +12197,13 @@ public struct TrezorVerifyMessageParams { public init( /** * Bitcoin address that signed the message - */address: String, + */address: String, /** * Signature (base64 encoded) - */signature: String, + */signature: String, /** * Original message - */message: String, + */message: String, /** * Coin network (default: Bitcoin) */coin: TrezorCoinType?) { @@ -12215,9 +12255,9 @@ public struct FfiConverterTypeTrezorVerifyMessageParams: FfiConverterRustBuffer public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorVerifyMessageParams { return try TrezorVerifyMessageParams( - address: FfiConverterString.read(from: &buf), - signature: FfiConverterString.read(from: &buf), - message: FfiConverterString.read(from: &buf), + address: FfiConverterString.read(from: &buf), + signature: FfiConverterString.read(from: &buf), + message: FfiConverterString.read(from: &buf), coin: FfiConverterOptionTypeTrezorCoinType.read(from: &buf) ) } @@ -12276,16 +12316,16 @@ public struct TxDetailInput { public init( /** * Previous output transaction ID (hex) - */txid: String, + */txid: String, /** * Previous output index - */vout: UInt32, + */vout: UInt32, /** * Sequence number - */sequence: UInt32, + */sequence: UInt32, /** * Script signature (hex-encoded) - */scriptSig: String, + */scriptSig: String, /** * Witness stack (each element hex-encoded) */witness: [String]) { @@ -12342,10 +12382,10 @@ public struct FfiConverterTypeTxDetailInput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxDetailInput { return try TxDetailInput( - txid: FfiConverterString.read(from: &buf), - vout: FfiConverterUInt32.read(from: &buf), - sequence: FfiConverterUInt32.read(from: &buf), - scriptSig: FfiConverterString.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + vout: FfiConverterUInt32.read(from: &buf), + sequence: FfiConverterUInt32.read(from: &buf), + scriptSig: FfiConverterString.read(from: &buf), witness: FfiConverterSequenceString.read(from: &buf) ) } @@ -12401,13 +12441,13 @@ public struct TxDetailOutput { public init( /** * Output value in sats - */value: UInt64, + */value: UInt64, /** * Script public key (hex-encoded) - */scriptPubkey: String, + */scriptPubkey: String, /** * Decoded address (None if script is not decodable to an address) - */address: String?, + */address: String?, /** * Whether this output belongs to the queried wallet */isMine: Bool) { @@ -12459,9 +12499,9 @@ public struct FfiConverterTypeTxDetailOutput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxDetailOutput { return try TxDetailOutput( - value: FfiConverterUInt64.read(from: &buf), - scriptPubkey: FfiConverterString.read(from: &buf), - address: FfiConverterOptionString.read(from: &buf), + value: FfiConverterUInt64.read(from: &buf), + scriptPubkey: FfiConverterString.read(from: &buf), + address: FfiConverterOptionString.read(from: &buf), isMine: FfiConverterBool.read(from: &buf) ) } @@ -12520,16 +12560,16 @@ public struct TxInput { public init( /** * The transaction ID of the previous output being spent. - */txid: String, + */txid: String, /** * The output index of the previous output being spent. - */vout: UInt32, + */vout: UInt32, /** * The script signature (hex-encoded). - */scriptsig: String, + */scriptsig: String, /** * The witness stack (hex-encoded strings). - */witness: [String], + */witness: [String], /** * The sequence number. */sequence: UInt32) { @@ -12586,10 +12626,10 @@ public struct FfiConverterTypeTxInput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxInput { return try TxInput( - txid: FfiConverterString.read(from: &buf), - vout: FfiConverterUInt32.read(from: &buf), - scriptsig: FfiConverterString.read(from: &buf), - witness: FfiConverterSequenceString.read(from: &buf), + txid: FfiConverterString.read(from: &buf), + vout: FfiConverterUInt32.read(from: &buf), + scriptsig: FfiConverterString.read(from: &buf), + witness: FfiConverterSequenceString.read(from: &buf), sequence: FfiConverterUInt32.read(from: &buf) ) } @@ -12649,16 +12689,16 @@ public struct TxOutput { public init( /** * The script public key (hex-encoded). - */scriptpubkey: String, + */scriptpubkey: String, /** * The script public key type (e.g., "p2pkh", "p2sh", "p2wpkh", "p2wsh", "p2tr"). - */scriptpubkeyType: String?, + */scriptpubkeyType: String?, /** * The address corresponding to this script (if decodable). - */scriptpubkeyAddress: String?, + */scriptpubkeyAddress: String?, /** * The value in satoshis. - */value: Int64, + */value: Int64, /** * The output index in the transaction. */n: UInt32) { @@ -12715,10 +12755,10 @@ public struct FfiConverterTypeTxOutput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxOutput { return try TxOutput( - scriptpubkey: FfiConverterString.read(from: &buf), - scriptpubkeyType: FfiConverterOptionString.read(from: &buf), - scriptpubkeyAddress: FfiConverterOptionString.read(from: &buf), - value: FfiConverterInt64.read(from: &buf), + scriptpubkey: FfiConverterString.read(from: &buf), + scriptpubkeyType: FfiConverterOptionString.read(from: &buf), + scriptpubkeyAddress: FfiConverterOptionString.read(from: &buf), + value: FfiConverterInt64.read(from: &buf), n: FfiConverterUInt32.read(from: &buf) ) } @@ -12799,8 +12839,8 @@ public struct FfiConverterTypeValidationResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ValidationResult { return try ValidationResult( - address: FfiConverterString.read(from: &buf), - network: FfiConverterTypeNetworkType.read(from: &buf), + address: FfiConverterString.read(from: &buf), + network: FfiConverterTypeNetworkType.read(from: &buf), addressType: FfiConverterTypeAddressType.read(from: &buf) ) } @@ -12862,19 +12902,19 @@ public struct WalletBalance { public init( /** * Confirmed and spendable balance (sats) - */confirmed: UInt64, + */confirmed: UInt64, /** * Immature coinbase outputs (sats) - */immature: UInt64, + */immature: UInt64, /** * Unconfirmed UTXOs from trusted sources (own change) (sats) - */trustedPending: UInt64, + */trustedPending: UInt64, /** * Unconfirmed UTXOs from external sources (sats) - */untrustedPending: UInt64, + */untrustedPending: UInt64, /** * Total spendable: confirmed + trusted_pending (sats) - */spendable: UInt64, + */spendable: UInt64, /** * Grand total: all categories (sats) */total: UInt64) { @@ -12936,11 +12976,11 @@ public struct FfiConverterTypeWalletBalance: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletBalance { return try WalletBalance( - confirmed: FfiConverterUInt64.read(from: &buf), - immature: FfiConverterUInt64.read(from: &buf), - trustedPending: FfiConverterUInt64.read(from: &buf), - untrustedPending: FfiConverterUInt64.read(from: &buf), - spendable: FfiConverterUInt64.read(from: &buf), + confirmed: FfiConverterUInt64.read(from: &buf), + immature: FfiConverterUInt64.read(from: &buf), + trustedPending: FfiConverterUInt64.read(from: &buf), + untrustedPending: FfiConverterUInt64.read(from: &buf), + spendable: FfiConverterUInt64.read(from: &buf), total: FfiConverterUInt64.read(from: &buf) ) } @@ -13001,16 +13041,16 @@ public struct WalletParams { public init( /** * Extended public key (xpub/ypub/zpub/tpub/upub/vpub) - */extendedKey: String, + */extendedKey: String, /** * Electrum server URL for wallet sync - */electrumUrl: String, + */electrumUrl: String, /** * Root fingerprint hex (e.g. "73c5da0a"). Required for hardware wallet signing. - */fingerprint: String?, + */fingerprint: String?, /** * Bitcoin network (auto-detected from key prefix if not specified) - */network: Network?, + */network: Network?, /** * Override account type for ambiguous key prefixes (xpub/tpub) */accountType: AccountType?) { @@ -13067,10 +13107,10 @@ public struct FfiConverterTypeWalletParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletParams { return try WalletParams( - extendedKey: FfiConverterString.read(from: &buf), - electrumUrl: FfiConverterString.read(from: &buf), - fingerprint: FfiConverterOptionString.read(from: &buf), - network: FfiConverterOptionTypeNetwork.read(from: &buf), + extendedKey: FfiConverterString.read(from: &buf), + electrumUrl: FfiConverterString.read(from: &buf), + fingerprint: FfiConverterOptionString.read(from: &buf), + network: FfiConverterOptionTypeNetwork.read(from: &buf), accountType: FfiConverterOptionTypeAccountType.read(from: &buf) ) } @@ -13134,19 +13174,19 @@ public struct WatcherParams { public init( /** * Caller-supplied identifier for this watcher. - */watcherId: String, + */watcherId: String, /** * Extended public key (xpub/ypub/zpub/tpub/upub/vpub). - */extendedKey: String, + */extendedKey: String, /** * Electrum server URL (e.g. "ssl://electrum.example.com:50002"). - */electrumUrl: String, + */electrumUrl: String, /** * Bitcoin network override (auto-detected from key prefix if None). - */network: Network?, + */network: Network?, /** * Account type override (auto-detected from key prefix if None). - */accountType: AccountType?, + */accountType: AccountType?, /** * Number of unused addresses to monitor beyond the last used (default 20). */gapLimit: UInt32?) { @@ -13208,11 +13248,11 @@ public struct FfiConverterTypeWatcherParams: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WatcherParams { return try WatcherParams( - watcherId: FfiConverterString.read(from: &buf), - extendedKey: FfiConverterString.read(from: &buf), - electrumUrl: FfiConverterString.read(from: &buf), - network: FfiConverterOptionTypeNetwork.read(from: &buf), - accountType: FfiConverterOptionTypeAccountType.read(from: &buf), + watcherId: FfiConverterString.read(from: &buf), + extendedKey: FfiConverterString.read(from: &buf), + electrumUrl: FfiConverterString.read(from: &buf), + network: FfiConverterOptionTypeNetwork.read(from: &buf), + accountType: FfiConverterOptionTypeAccountType.read(from: &buf), gapLimit: FfiConverterOptionUInt32.read(from: &buf) ) } @@ -13248,8 +13288,8 @@ public func FfiConverterTypeWatcherParams_lower(_ value: WatcherParams) -> RustB */ public enum AccountInfoError: Swift.Error { - - + + /** * The provided extended public key is invalid or cannot be parsed */ @@ -13313,9 +13353,9 @@ public struct FfiConverterTypeAccountInfoError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidExtendedKey( errorDetails: try FfiConverterString.read(from: &buf) ) @@ -13354,59 +13394,59 @@ public struct FfiConverterTypeAccountInfoError: FfiConverterRustBuffer { public static func write(_ value: AccountInfoError, into buf: inout [UInt8]) { switch value { - - - + + + case let .InvalidExtendedKey(errorDetails): writeInt(&buf, Int32(1)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InvalidAddress(errorDetails): writeInt(&buf, Int32(2)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .ElectrumError(errorDetails): writeInt(&buf, Int32(3)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .WalletError(errorDetails): writeInt(&buf, Int32(4)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .SyncError(errorDetails): writeInt(&buf, Int32(5)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .UnsupportedKeyType(errorDetails): writeInt(&buf, Int32(6)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .NetworkMismatch(errorDetails): writeInt(&buf, Int32(7)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InvalidTxid(errorDetails): writeInt(&buf, Int32(8)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .TransactionNotFound(errorDetails): writeInt(&buf, Int32(9)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .WatcherError(errorDetails): writeInt(&buf, Int32(10)) FfiConverterString.write(errorDetails, into: &buf) - + } } } @@ -13452,7 +13492,7 @@ extension AccountInfoError: Foundation.LocalizedError { */ public enum AccountType { - + /** * BIP44 legacy (P2PKH) — xpub/tpub prefix */ @@ -13485,38 +13525,38 @@ public struct FfiConverterTypeAccountType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AccountType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .legacy - + case 2: return .wrappedSegwit - + case 3: return .nativeSegwit - + case 4: return .taproot - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: AccountType, into buf: inout [UInt8]) { switch value { - - + + case .legacy: writeInt(&buf, Int32(1)) - - + + case .wrappedSegwit: writeInt(&buf, Int32(2)) - - + + case .nativeSegwit: writeInt(&buf, Int32(3)) - - + + case .taproot: writeInt(&buf, Int32(4)) - + } } } @@ -13550,7 +13590,7 @@ extension AccountType: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Activity { - + case onchain(OnchainActivity ) case lightning(LightningActivity @@ -13571,30 +13611,30 @@ public struct FfiConverterTypeActivity: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Activity { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .onchain(try FfiConverterTypeOnchainActivity.read(from: &buf) ) - + case 2: return .lightning(try FfiConverterTypeLightningActivity.read(from: &buf) ) - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Activity, into buf: inout [UInt8]) { switch value { - - + + case let .onchain(v1): writeInt(&buf, Int32(1)) FfiConverterTypeOnchainActivity.write(v1, into: &buf) - - + + case let .lightning(v1): writeInt(&buf, Int32(2)) FfiConverterTypeLightningActivity.write(v1, into: &buf) - + } } } @@ -13627,8 +13667,8 @@ extension Activity: Codable {} public enum ActivityError: Swift.Error { - - + + case InvalidActivity(errorDetails: String ) case InitializationError(errorDetails: String @@ -13656,9 +13696,9 @@ public struct FfiConverterTypeActivityError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidActivity( errorDetails: try FfiConverterString.read(from: &buf) ) @@ -13688,44 +13728,44 @@ public struct FfiConverterTypeActivityError: FfiConverterRustBuffer { public static func write(_ value: ActivityError, into buf: inout [UInt8]) { switch value { - - - + + + case let .InvalidActivity(errorDetails): writeInt(&buf, Int32(1)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InitializationError(errorDetails): writeInt(&buf, Int32(2)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InsertError(errorDetails): writeInt(&buf, Int32(3)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .RetrievalError(errorDetails): writeInt(&buf, Int32(4)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .DataError(errorDetails): writeInt(&buf, Int32(5)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .ConnectionError(errorDetails): writeInt(&buf, Int32(6)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .SerializationError(errorDetails): writeInt(&buf, Int32(7)) FfiConverterString.write(errorDetails, into: &buf) - + } } } @@ -13766,7 +13806,7 @@ extension ActivityError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ActivityFilter { - + case all case lightning case onchain @@ -13786,32 +13826,32 @@ public struct FfiConverterTypeActivityFilter: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ActivityFilter { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .all - + case 2: return .lightning - + case 3: return .onchain - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ActivityFilter, into buf: inout [UInt8]) { switch value { - - + + case .all: writeInt(&buf, Int32(1)) - - + + case .lightning: writeInt(&buf, Int32(2)) - - + + case .onchain: writeInt(&buf, Int32(3)) - + } } } @@ -13845,7 +13885,7 @@ extension ActivityFilter: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ActivityType { - + case onchain case lightning } @@ -13864,26 +13904,26 @@ public struct FfiConverterTypeActivityType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ActivityType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .onchain - + case 2: return .lightning - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ActivityType, into buf: inout [UInt8]) { switch value { - - + + case .onchain: writeInt(&buf, Int32(1)) - - + + case .lightning: writeInt(&buf, Int32(2)) - + } } } @@ -13916,8 +13956,8 @@ extension ActivityType: Codable {} public enum AddressError: Swift.Error { - - + + case InvalidAddress case InvalidNetwork case MnemonicGenerationFailed @@ -13937,9 +13977,9 @@ public struct FfiConverterTypeAddressError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidAddress case 2: return .InvalidNetwork case 3: return .MnemonicGenerationFailed @@ -13954,33 +13994,33 @@ public struct FfiConverterTypeAddressError: FfiConverterRustBuffer { public static func write(_ value: AddressError, into buf: inout [UInt8]) { switch value { - - - + + + case .InvalidAddress: writeInt(&buf, Int32(1)) - - + + case .InvalidNetwork: writeInt(&buf, Int32(2)) - - + + case .MnemonicGenerationFailed: writeInt(&buf, Int32(3)) - - + + case .InvalidMnemonic: writeInt(&buf, Int32(4)) - - + + case .InvalidEntropy: writeInt(&buf, Int32(5)) - - + + case .AddressDerivationFailed: writeInt(&buf, Int32(6)) - + } } } @@ -14021,7 +14061,7 @@ extension AddressError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum AddressType { - + case p2pkh case p2sh case p2wpkh @@ -14044,50 +14084,50 @@ public struct FfiConverterTypeAddressType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> AddressType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .p2pkh - + case 2: return .p2sh - + case 3: return .p2wpkh - + case 4: return .p2wsh - + case 5: return .p2tr - + case 6: return .unknown - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: AddressType, into buf: inout [UInt8]) { switch value { - - + + case .p2pkh: writeInt(&buf, Int32(1)) - - + + case .p2sh: writeInt(&buf, Int32(2)) - - + + case .p2wpkh: writeInt(&buf, Int32(3)) - - + + case .p2wsh: writeInt(&buf, Int32(4)) - - + + case .p2tr: writeInt(&buf, Int32(5)) - - + + case .unknown: writeInt(&buf, Int32(6)) - + } } } @@ -14121,7 +14161,7 @@ extension AddressType: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BitcoinNetworkEnum { - + case mainnet case testnet case signet @@ -14142,38 +14182,38 @@ public struct FfiConverterTypeBitcoinNetworkEnum: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BitcoinNetworkEnum { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .mainnet - + case 2: return .testnet - + case 3: return .signet - + case 4: return .regtest - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BitcoinNetworkEnum, into buf: inout [UInt8]) { switch value { - - + + case .mainnet: writeInt(&buf, Int32(1)) - - + + case .testnet: writeInt(&buf, Int32(2)) - - + + case .signet: writeInt(&buf, Int32(3)) - - + + case .regtest: writeInt(&buf, Int32(4)) - + } } } @@ -14206,8 +14246,8 @@ extension BitcoinNetworkEnum: Codable {} public enum BlocktankError: Swift.Error { - - + + case HttpClient(errorDetails: String ) case BlocktankClient(errorDetails: String @@ -14247,9 +14287,9 @@ public struct FfiConverterTypeBlocktankError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .HttpClient( errorDetails: try FfiConverterString.read(from: &buf) ) @@ -14278,7 +14318,7 @@ public struct FfiConverterTypeBlocktankError: FfiConverterRustBuffer { errorDetails: try FfiConverterString.read(from: &buf) ) case 10: return .ChannelOpen( - errorType: try FfiConverterTypeBtChannelOrderErrorType.read(from: &buf), + errorType: try FfiConverterTypeBtChannelOrderErrorType.read(from: &buf), errorDetails: try FfiConverterString.read(from: &buf) ) case 11: return .OrderState( @@ -14298,75 +14338,75 @@ public struct FfiConverterTypeBlocktankError: FfiConverterRustBuffer { public static func write(_ value: BlocktankError, into buf: inout [UInt8]) { switch value { - - - + + + case let .HttpClient(errorDetails): writeInt(&buf, Int32(1)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .BlocktankClient(errorDetails): writeInt(&buf, Int32(2)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InvalidBlocktank(errorDetails): writeInt(&buf, Int32(3)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InitializationError(errorDetails): writeInt(&buf, Int32(4)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InsertError(errorDetails): writeInt(&buf, Int32(5)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .RetrievalError(errorDetails): writeInt(&buf, Int32(6)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .DataError(errorDetails): writeInt(&buf, Int32(7)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .ConnectionError(errorDetails): writeInt(&buf, Int32(8)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .SerializationError(errorDetails): writeInt(&buf, Int32(9)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .ChannelOpen(errorType,errorDetails): writeInt(&buf, Int32(10)) FfiConverterTypeBtChannelOrderErrorType.write(errorType, into: &buf) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .OrderState(errorDetails): writeInt(&buf, Int32(11)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InvalidParameter(errorDetails): writeInt(&buf, Int32(12)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .DatabaseError(errorDetails): writeInt(&buf, Int32(13)) FfiConverterString.write(errorDetails, into: &buf) - + } } } @@ -14406,8 +14446,8 @@ extension BlocktankError: Foundation.LocalizedError { public enum BroadcastError: Swift.Error { - - + + case InvalidHex(errorDetails: String ) case InvalidTransaction(errorDetails: String @@ -14429,9 +14469,9 @@ public struct FfiConverterTypeBroadcastError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidHex( errorDetails: try FfiConverterString.read(from: &buf) ) @@ -14452,29 +14492,29 @@ public struct FfiConverterTypeBroadcastError: FfiConverterRustBuffer { public static func write(_ value: BroadcastError, into buf: inout [UInt8]) { switch value { - - - + + + case let .InvalidHex(errorDetails): writeInt(&buf, Int32(1)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .InvalidTransaction(errorDetails): writeInt(&buf, Int32(2)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .ElectrumError(errorDetails): writeInt(&buf, Int32(3)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .TaskError(errorDetails): writeInt(&buf, Int32(4)) FfiConverterString.write(errorDetails, into: &buf) - + } } } @@ -14515,7 +14555,7 @@ extension BroadcastError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtBolt11InvoiceState { - + case pending case holding case paid @@ -14536,38 +14576,38 @@ public struct FfiConverterTypeBtBolt11InvoiceState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtBolt11InvoiceState { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .pending - + case 2: return .holding - + case 3: return .paid - + case 4: return .canceled - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtBolt11InvoiceState, into buf: inout [UInt8]) { switch value { - - + + case .pending: writeInt(&buf, Int32(1)) - - + + case .holding: writeInt(&buf, Int32(2)) - - + + case .paid: writeInt(&buf, Int32(3)) - - + + case .canceled: writeInt(&buf, Int32(4)) - + } } } @@ -14601,7 +14641,7 @@ extension BtBolt11InvoiceState: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtChannelOrderErrorType { - + case wrongOrderState case peerNotReachable case channelRejectedByDestination @@ -14623,44 +14663,44 @@ public struct FfiConverterTypeBtChannelOrderErrorType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtChannelOrderErrorType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .wrongOrderState - + case 2: return .peerNotReachable - + case 3: return .channelRejectedByDestination - + case 4: return .channelRejectedByLsp - + case 5: return .blocktankNotReady - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtChannelOrderErrorType, into buf: inout [UInt8]) { switch value { - - + + case .wrongOrderState: writeInt(&buf, Int32(1)) - - + + case .peerNotReachable: writeInt(&buf, Int32(2)) - - + + case .channelRejectedByDestination: writeInt(&buf, Int32(3)) - - + + case .channelRejectedByLsp: writeInt(&buf, Int32(4)) - - + + case .blocktankNotReady: writeInt(&buf, Int32(5)) - + } } } @@ -14694,7 +14734,7 @@ extension BtChannelOrderErrorType: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtOpenChannelState { - + case opening case `open` case closed @@ -14714,32 +14754,32 @@ public struct FfiConverterTypeBtOpenChannelState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtOpenChannelState { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .opening - + case 2: return .`open` - + case 3: return .closed - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtOpenChannelState, into buf: inout [UInt8]) { switch value { - - + + case .opening: writeInt(&buf, Int32(1)) - - + + case .`open`: writeInt(&buf, Int32(2)) - - + + case .closed: writeInt(&buf, Int32(3)) - + } } } @@ -14773,7 +14813,7 @@ extension BtOpenChannelState: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtOrderState { - + case created case expired case `open` @@ -14794,38 +14834,38 @@ public struct FfiConverterTypeBtOrderState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtOrderState { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .created - + case 2: return .expired - + case 3: return .`open` - + case 4: return .closed - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtOrderState, into buf: inout [UInt8]) { switch value { - - + + case .created: writeInt(&buf, Int32(1)) - - + + case .expired: writeInt(&buf, Int32(2)) - - + + case .`open`: writeInt(&buf, Int32(3)) - - + + case .closed: writeInt(&buf, Int32(4)) - + } } } @@ -14859,7 +14899,7 @@ extension BtOrderState: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtOrderState2 { - + case created case expired case executed @@ -14880,38 +14920,38 @@ public struct FfiConverterTypeBtOrderState2: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtOrderState2 { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .created - + case 2: return .expired - + case 3: return .executed - + case 4: return .paid - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtOrderState2, into buf: inout [UInt8]) { switch value { - - + + case .created: writeInt(&buf, Int32(1)) - - + + case .expired: writeInt(&buf, Int32(2)) - - + + case .executed: writeInt(&buf, Int32(3)) - - + + case .paid: writeInt(&buf, Int32(4)) - + } } } @@ -14945,7 +14985,7 @@ extension BtOrderState2: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtPaymentState { - + case created case partiallyPaid case paid @@ -14967,44 +15007,44 @@ public struct FfiConverterTypeBtPaymentState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtPaymentState { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .created - + case 2: return .partiallyPaid - + case 3: return .paid - + case 4: return .refunded - + case 5: return .refundAvailable - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtPaymentState, into buf: inout [UInt8]) { switch value { - - + + case .created: writeInt(&buf, Int32(1)) - - + + case .partiallyPaid: writeInt(&buf, Int32(2)) - - + + case .paid: writeInt(&buf, Int32(3)) - - + + case .refunded: writeInt(&buf, Int32(4)) - - + + case .refundAvailable: writeInt(&buf, Int32(5)) - + } } } @@ -15038,7 +15078,7 @@ extension BtPaymentState: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum BtPaymentState2 { - + case created case paid case refunded @@ -15060,44 +15100,44 @@ public struct FfiConverterTypeBtPaymentState2: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> BtPaymentState2 { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .created - + case 2: return .paid - + case 3: return .refunded - + case 4: return .refundAvailable - + case 5: return .canceled - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: BtPaymentState2, into buf: inout [UInt8]) { switch value { - - + + case .created: writeInt(&buf, Int32(1)) - - + + case .paid: writeInt(&buf, Int32(2)) - - + + case .refunded: writeInt(&buf, Int32(3)) - - + + case .refundAvailable: writeInt(&buf, Int32(4)) - - + + case .canceled: writeInt(&buf, Int32(5)) - + } } } @@ -15131,7 +15171,7 @@ extension BtPaymentState2: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum CJitStateEnum { - + case created case completed case expired @@ -15152,38 +15192,38 @@ public struct FfiConverterTypeCJitStateEnum: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CJitStateEnum { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .created - + case 2: return .completed - + case 3: return .expired - + case 4: return .failed - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: CJitStateEnum, into buf: inout [UInt8]) { switch value { - - + + case .created: writeInt(&buf, Int32(1)) - - + + case .completed: writeInt(&buf, Int32(2)) - - + + case .expired: writeInt(&buf, Int32(3)) - - + + case .failed: writeInt(&buf, Int32(4)) - + } } } @@ -15220,7 +15260,7 @@ extension CJitStateEnum: Codable {} */ public enum CoinSelection { - + /** * Branch-and-bound (default). Minimizes change by searching for exact matches. */ @@ -15249,32 +15289,32 @@ public struct FfiConverterTypeCoinSelection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> CoinSelection { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .branchAndBound - + case 2: return .largestFirst - + case 3: return .oldestFirst - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: CoinSelection, into buf: inout [UInt8]) { switch value { - - + + case .branchAndBound: writeInt(&buf, Int32(1)) - - + + case .largestFirst: writeInt(&buf, Int32(2)) - - + + case .oldestFirst: writeInt(&buf, Int32(3)) - + } } } @@ -15311,7 +15351,7 @@ extension CoinSelection: Codable {} */ public enum ComposeOutput { - + /** * Payment to a specific address with a fixed amount (satoshis) */ @@ -15343,39 +15383,39 @@ public struct FfiConverterTypeComposeOutput: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ComposeOutput { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .payment(address: try FfiConverterString.read(from: &buf), amountSats: try FfiConverterUInt64.read(from: &buf) ) - + case 2: return .sendMax(address: try FfiConverterString.read(from: &buf) ) - + case 3: return .opReturn(dataHex: try FfiConverterString.read(from: &buf) ) - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ComposeOutput, into buf: inout [UInt8]) { switch value { - - + + case let .payment(address,amountSats): writeInt(&buf, Int32(1)) FfiConverterString.write(address, into: &buf) FfiConverterUInt64.write(amountSats, into: &buf) - - + + case let .sendMax(address): writeInt(&buf, Int32(2)) FfiConverterString.write(address, into: &buf) - - + + case let .opReturn(dataHex): writeInt(&buf, Int32(3)) FfiConverterString.write(dataHex, into: &buf) - + } } } @@ -15412,20 +15452,20 @@ extension ComposeOutput: Codable {} */ public enum ComposeResult { - + /** * Successfully built a signable PSBT */ case success( /** * Base64-encoded PSBT ready for signing - */psbt: String, + */psbt: String, /** * Total fee in satoshis - */fee: UInt64, + */fee: UInt64, /** * Target fee rate in sat/vB (actual may differ slightly due to rounding) - */feeRate: Float, + */feeRate: Float, /** * Total value spent (payments + fee, excluding change). * Uses BDK's `sent - received` semantics, which may undercount for @@ -15453,33 +15493,33 @@ public struct FfiConverterTypeComposeResult: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ComposeResult { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .success(psbt: try FfiConverterString.read(from: &buf), fee: try FfiConverterUInt64.read(from: &buf), feeRate: try FfiConverterFloat.read(from: &buf), totalSpent: try FfiConverterUInt64.read(from: &buf) ) - + case 2: return .error(error: try FfiConverterString.read(from: &buf) ) - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ComposeResult, into buf: inout [UInt8]) { switch value { - - + + case let .success(psbt,fee,feeRate,totalSpent): writeInt(&buf, Int32(1)) FfiConverterString.write(psbt, into: &buf) FfiConverterUInt64.write(fee, into: &buf) FfiConverterFloat.write(feeRate, into: &buf) FfiConverterUInt64.write(totalSpent, into: &buf) - - + + case let .error(error): writeInt(&buf, Int32(2)) FfiConverterString.write(error, into: &buf) - + } } } @@ -15512,8 +15552,8 @@ extension ComposeResult: Codable {} public enum DbError: Swift.Error { - - + + case DbActivityError(errorDetails: ActivityError ) case DbBlocktankError(errorDetails: BlocktankError @@ -15533,9 +15573,9 @@ public struct FfiConverterTypeDbError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .DbActivityError( errorDetails: try FfiConverterTypeActivityError.read(from: &buf) ) @@ -15553,24 +15593,24 @@ public struct FfiConverterTypeDbError: FfiConverterRustBuffer { public static func write(_ value: DbError, into buf: inout [UInt8]) { switch value { - - - + + + case let .DbActivityError(errorDetails): writeInt(&buf, Int32(1)) FfiConverterTypeActivityError.write(errorDetails, into: &buf) - - + + case let .DbBlocktankError(errorDetails): writeInt(&buf, Int32(2)) FfiConverterTypeBlocktankError.write(errorDetails, into: &buf) - - + + case let .InitializationError(errorDetails): writeInt(&buf, Int32(3)) FfiConverterString.write(errorDetails, into: &buf) - + } } } @@ -15610,8 +15650,8 @@ extension DbError: Foundation.LocalizedError { public enum DecodingError: Swift.Error { - - + + case InvalidFormat case InvalidNetwork case InvalidAmount @@ -15639,15 +15679,15 @@ public struct FfiConverterTypeDecodingError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidFormat case 2: return .InvalidNetwork case 3: return .InvalidAmount case 4: return .InvalidLnurlPayAmount( - amountSatoshis: try FfiConverterUInt64.read(from: &buf), - min: try FfiConverterUInt64.read(from: &buf), + amountSatoshis: try FfiConverterUInt64.read(from: &buf), + min: try FfiConverterUInt64.read(from: &buf), max: try FfiConverterUInt64.read(from: &buf) ) case 5: return .InvalidTimestamp @@ -15668,61 +15708,61 @@ public struct FfiConverterTypeDecodingError: FfiConverterRustBuffer { public static func write(_ value: DecodingError, into buf: inout [UInt8]) { switch value { - - - + + + case .InvalidFormat: writeInt(&buf, Int32(1)) - - + + case .InvalidNetwork: writeInt(&buf, Int32(2)) - - + + case .InvalidAmount: writeInt(&buf, Int32(3)) - - + + case let .InvalidLnurlPayAmount(amountSatoshis,min,max): writeInt(&buf, Int32(4)) FfiConverterUInt64.write(amountSatoshis, into: &buf) FfiConverterUInt64.write(min, into: &buf) FfiConverterUInt64.write(max, into: &buf) - - + + case .InvalidTimestamp: writeInt(&buf, Int32(5)) - - + + case .InvalidChecksum: writeInt(&buf, Int32(6)) - - + + case .InvalidResponse: writeInt(&buf, Int32(7)) - - + + case .UnsupportedType: writeInt(&buf, Int32(8)) - - + + case .InvalidAddress: writeInt(&buf, Int32(9)) - - + + case .RequestFailed: writeInt(&buf, Int32(10)) - - + + case .ClientCreationFailed: writeInt(&buf, Int32(11)) - - + + case let .InvoiceCreationFailed(errorMessage): writeInt(&buf, Int32(12)) FfiConverterString.write(errorMessage, into: &buf) - + } } } @@ -15762,8 +15802,8 @@ extension DecodingError: Foundation.LocalizedError { public enum LnurlError: Swift.Error { - - + + case InvalidAddress case ClientCreationFailed case RequestFailed @@ -15786,16 +15826,16 @@ public struct FfiConverterTypeLnurlError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidAddress case 2: return .ClientCreationFailed case 3: return .RequestFailed case 4: return .InvalidResponse case 5: return .InvalidAmount( - amountSatoshis: try FfiConverterUInt64.read(from: &buf), - min: try FfiConverterUInt64.read(from: &buf), + amountSatoshis: try FfiConverterUInt64.read(from: &buf), + min: try FfiConverterUInt64.read(from: &buf), max: try FfiConverterUInt64.read(from: &buf) ) case 6: return .InvoiceCreationFailed( @@ -15810,41 +15850,41 @@ public struct FfiConverterTypeLnurlError: FfiConverterRustBuffer { public static func write(_ value: LnurlError, into buf: inout [UInt8]) { switch value { - - - + + + case .InvalidAddress: writeInt(&buf, Int32(1)) - - + + case .ClientCreationFailed: writeInt(&buf, Int32(2)) - - + + case .RequestFailed: writeInt(&buf, Int32(3)) - - + + case .InvalidResponse: writeInt(&buf, Int32(4)) - - + + case let .InvalidAmount(amountSatoshis,min,max): writeInt(&buf, Int32(5)) FfiConverterUInt64.write(amountSatoshis, into: &buf) FfiConverterUInt64.write(min, into: &buf) FfiConverterUInt64.write(max, into: &buf) - - + + case let .InvoiceCreationFailed(errorDetails): writeInt(&buf, Int32(6)) FfiConverterString.write(errorDetails, into: &buf) - - + + case .AuthenticationFailed: writeInt(&buf, Int32(7)) - + } } } @@ -15885,7 +15925,7 @@ extension LnurlError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum ManualRefundStateEnum { - + case created case approved case rejected @@ -15906,38 +15946,38 @@ public struct FfiConverterTypeManualRefundStateEnum: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> ManualRefundStateEnum { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .created - + case 2: return .approved - + case 3: return .rejected - + case 4: return .sent - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: ManualRefundStateEnum, into buf: inout [UInt8]) { switch value { - - + + case .created: writeInt(&buf, Int32(1)) - - + + case .approved: writeInt(&buf, Int32(2)) - - + + case .rejected: writeInt(&buf, Int32(3)) - - + + case .sent: writeInt(&buf, Int32(4)) - + } } } @@ -15971,7 +16011,7 @@ extension ManualRefundStateEnum: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Network { - + /** * Mainnet Bitcoin. */ @@ -16008,44 +16048,44 @@ public struct FfiConverterTypeNetwork: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Network { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .bitcoin - + case 2: return .testnet - + case 3: return .testnet4 - + case 4: return .signet - + case 5: return .regtest - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Network, into buf: inout [UInt8]) { switch value { - - + + case .bitcoin: writeInt(&buf, Int32(1)) - - + + case .testnet: writeInt(&buf, Int32(2)) - - + + case .testnet4: writeInt(&buf, Int32(3)) - - + + case .signet: writeInt(&buf, Int32(4)) - - + + case .regtest: writeInt(&buf, Int32(5)) - + } } } @@ -16079,7 +16119,7 @@ extension Network: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum NetworkType { - + case bitcoin case testnet case regtest @@ -16100,38 +16140,38 @@ public struct FfiConverterTypeNetworkType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> NetworkType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .bitcoin - + case 2: return .testnet - + case 3: return .regtest - + case 4: return .signet - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: NetworkType, into buf: inout [UInt8]) { switch value { - - + + case .bitcoin: writeInt(&buf, Int32(1)) - - + + case .testnet: writeInt(&buf, Int32(2)) - - + + case .regtest: writeInt(&buf, Int32(3)) - - + + case .signet: writeInt(&buf, Int32(4)) - + } } } @@ -16165,7 +16205,7 @@ extension NetworkType: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum PassphraseResponse { - + /** * User cancelled — aborts the pending operation. */ @@ -16199,40 +16239,40 @@ public struct FfiConverterTypePassphraseResponse: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PassphraseResponse { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .cancel - + case 2: return .standard - + case 3: return .hidden(value: try FfiConverterString.read(from: &buf) ) - + case 4: return .onDevice - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PassphraseResponse, into buf: inout [UInt8]) { switch value { - - + + case .cancel: writeInt(&buf, Int32(1)) - - + + case .standard: writeInt(&buf, Int32(2)) - - + + case let .hidden(value): writeInt(&buf, Int32(3)) FfiConverterString.write(value, into: &buf) - - + + case .onDevice: writeInt(&buf, Int32(4)) - + } } } @@ -16266,7 +16306,7 @@ extension PassphraseResponse: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum PaymentState { - + case pending case succeeded case failed @@ -16286,32 +16326,32 @@ public struct FfiConverterTypePaymentState: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PaymentState { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .pending - + case 2: return .succeeded - + case 3: return .failed - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PaymentState, into buf: inout [UInt8]) { switch value { - - + + case .pending: writeInt(&buf, Int32(1)) - - + + case .succeeded: writeInt(&buf, Int32(2)) - - + + case .failed: writeInt(&buf, Int32(3)) - + } } } @@ -16345,7 +16385,7 @@ extension PaymentState: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum PaymentType { - + case sent case received } @@ -16364,26 +16404,26 @@ public struct FfiConverterTypePaymentType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PaymentType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .sent - + case 2: return .received - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PaymentType, into buf: inout [UInt8]) { switch value { - - + + case .sent: writeInt(&buf, Int32(1)) - - + + case .received: writeInt(&buf, Int32(2)) - + } } } @@ -16420,7 +16460,7 @@ extension PaymentType: Codable {} */ public enum PubkyAuthKind { - + case signin case signup } @@ -16439,26 +16479,26 @@ public struct FfiConverterTypePubkyAuthKind: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> PubkyAuthKind { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .signin - + case 2: return .signup - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: PubkyAuthKind, into buf: inout [UInt8]) { switch value { - - + + case .signin: writeInt(&buf, Int32(1)) - - + + case .signup: writeInt(&buf, Int32(2)) - + } } } @@ -16491,8 +16531,8 @@ extension PubkyAuthKind: Codable {} public enum PubkyError: Swift.Error { - - + + case InvalidCapabilities(reason: String ) case AuthFailed(reason: String @@ -16522,9 +16562,9 @@ public struct FfiConverterTypePubkyError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .InvalidCapabilities( reason: try FfiConverterString.read(from: &buf) ) @@ -16556,52 +16596,52 @@ public struct FfiConverterTypePubkyError: FfiConverterRustBuffer { public static func write(_ value: PubkyError, into buf: inout [UInt8]) { switch value { - - - + + + case let .InvalidCapabilities(reason): writeInt(&buf, Int32(1)) FfiConverterString.write(reason, into: &buf) - - + + case let .AuthFailed(reason): writeInt(&buf, Int32(2)) FfiConverterString.write(reason, into: &buf) - - + + case .NoActiveFlow: writeInt(&buf, Int32(3)) - - + + case let .ResolutionFailed(reason): writeInt(&buf, Int32(4)) FfiConverterString.write(reason, into: &buf) - - + + case let .FetchFailed(reason): writeInt(&buf, Int32(5)) FfiConverterString.write(reason, into: &buf) - - + + case .ProfileNotFound: writeInt(&buf, Int32(6)) - - + + case let .ProfileParseFailed(reason): writeInt(&buf, Int32(7)) FfiConverterString.write(reason, into: &buf) - - + + case let .KeyError(reason): writeInt(&buf, Int32(8)) FfiConverterString.write(reason, into: &buf) - - + + case let .WriteFailed(reason): writeInt(&buf, Int32(9)) FfiConverterString.write(reason, into: &buf) - + } } } @@ -16642,7 +16682,7 @@ extension PubkyError: Foundation.LocalizedError { // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum Scanner { - + case onChain(invoice: OnChainInvoice ) case lightning(invoice: LightningInvoice @@ -16679,96 +16719,96 @@ public struct FfiConverterTypeScanner: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> Scanner { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .onChain(invoice: try FfiConverterTypeOnChainInvoice.read(from: &buf) ) - + case 2: return .lightning(invoice: try FfiConverterTypeLightningInvoice.read(from: &buf) ) - + case 3: return .pubkyAuth(data: try FfiConverterString.read(from: &buf) ) - + case 4: return .lnurlChannel(data: try FfiConverterTypeLnurlChannelData.read(from: &buf) ) - + case 5: return .lnurlAuth(data: try FfiConverterTypeLnurlAuthData.read(from: &buf) ) - + case 6: return .lnurlWithdraw(data: try FfiConverterTypeLnurlWithdrawData.read(from: &buf) ) - + case 7: return .lnurlAddress(data: try FfiConverterTypeLnurlAddressData.read(from: &buf) ) - + case 8: return .lnurlPay(data: try FfiConverterTypeLnurlPayData.read(from: &buf) ) - + case 9: return .nodeId(url: try FfiConverterString.read(from: &buf), network: try FfiConverterTypeNetworkType.read(from: &buf) ) - + case 10: return .gift(code: try FfiConverterString.read(from: &buf), amount: try FfiConverterUInt64.read(from: &buf) ) - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: Scanner, into buf: inout [UInt8]) { switch value { - - + + case let .onChain(invoice): writeInt(&buf, Int32(1)) FfiConverterTypeOnChainInvoice.write(invoice, into: &buf) - - + + case let .lightning(invoice): writeInt(&buf, Int32(2)) FfiConverterTypeLightningInvoice.write(invoice, into: &buf) - - + + case let .pubkyAuth(data): writeInt(&buf, Int32(3)) FfiConverterString.write(data, into: &buf) - - + + case let .lnurlChannel(data): writeInt(&buf, Int32(4)) FfiConverterTypeLnurlChannelData.write(data, into: &buf) - - + + case let .lnurlAuth(data): writeInt(&buf, Int32(5)) FfiConverterTypeLnurlAuthData.write(data, into: &buf) - - + + case let .lnurlWithdraw(data): writeInt(&buf, Int32(6)) FfiConverterTypeLnurlWithdrawData.write(data, into: &buf) - - + + case let .lnurlAddress(data): writeInt(&buf, Int32(7)) FfiConverterTypeLnurlAddressData.write(data, into: &buf) - - + + case let .lnurlPay(data): writeInt(&buf, Int32(8)) FfiConverterTypeLnurlPayData.write(data, into: &buf) - - + + case let .nodeId(url,network): writeInt(&buf, Int32(9)) FfiConverterString.write(url, into: &buf) FfiConverterTypeNetworkType.write(network, into: &buf) - - + + case let .gift(code,amount): writeInt(&buf, Int32(10)) FfiConverterString.write(code, into: &buf) FfiConverterUInt64.write(amount, into: &buf) - + } } } @@ -16802,7 +16842,7 @@ extension Scanner: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum SortDirection { - + case asc case desc } @@ -16821,26 +16861,26 @@ public struct FfiConverterTypeSortDirection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> SortDirection { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .asc - + case 2: return .desc - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: SortDirection, into buf: inout [UInt8]) { switch value { - - + + case .asc: writeInt(&buf, Int32(1)) - - + + case .desc: writeInt(&buf, Int32(2)) - + } } } @@ -16873,8 +16913,8 @@ extension SortDirection: Codable {} public enum SweepError: Swift.Error { - - + + case SweepFailed(String ) case NoUtxosFound @@ -16892,9 +16932,9 @@ public struct FfiConverterTypeSweepError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .SweepFailed( try FfiConverterString.read(from: &buf) ) @@ -16908,22 +16948,22 @@ public struct FfiConverterTypeSweepError: FfiConverterRustBuffer { public static func write(_ value: SweepError, into buf: inout [UInt8]) { switch value { - - - + + + case let .SweepFailed(v1): writeInt(&buf, Int32(1)) FfiConverterString.write(v1, into: &buf) - - + + case .NoUtxosFound: writeInt(&buf, Int32(2)) - - + + case .InvalidMnemonic: writeInt(&buf, Int32(3)) - + } } } @@ -16967,7 +17007,7 @@ extension SweepError: Foundation.LocalizedError { */ public enum TrezorCoinType { - + /** * Bitcoin mainnet */ @@ -17000,38 +17040,38 @@ public struct FfiConverterTypeTrezorCoinType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorCoinType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .bitcoin - + case 2: return .testnet - + case 3: return .signet - + case 4: return .regtest - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TrezorCoinType, into buf: inout [UInt8]) { switch value { - - + + case .bitcoin: writeInt(&buf, Int32(1)) - - + + case .testnet: writeInt(&buf, Int32(2)) - - + + case .signet: writeInt(&buf, Int32(3)) - - + + case .regtest: writeInt(&buf, Int32(4)) - + } } } @@ -17067,8 +17107,8 @@ extension TrezorCoinType: Codable {} */ public enum TrezorError: Swift.Error { - - + + /** * Transport layer error (USB/Bluetooth communication) */ @@ -17170,9 +17210,9 @@ public struct FfiConverterTypeTrezorError: FfiConverterRustBuffer { let variant: Int32 = try readInt(&buf) switch variant { - - + + case 1: return .TransportError( errorDetails: try FfiConverterString.read(from: &buf) ) @@ -17217,97 +17257,97 @@ public struct FfiConverterTypeTrezorError: FfiConverterRustBuffer { public static func write(_ value: TrezorError, into buf: inout [UInt8]) { switch value { - - - + + + case let .TransportError(errorDetails): writeInt(&buf, Int32(1)) FfiConverterString.write(errorDetails, into: &buf) - - + + case .DeviceNotFound: writeInt(&buf, Int32(2)) - - + + case .DeviceDisconnected: writeInt(&buf, Int32(3)) - - + + case let .ConnectionError(errorDetails): writeInt(&buf, Int32(4)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .ProtocolError(errorDetails): writeInt(&buf, Int32(5)) FfiConverterString.write(errorDetails, into: &buf) - - + + case .PairingRequired: writeInt(&buf, Int32(6)) - - + + case let .PairingFailed(errorDetails): writeInt(&buf, Int32(7)) FfiConverterString.write(errorDetails, into: &buf) - - + + case .PinRequired: writeInt(&buf, Int32(8)) - - + + case .PinCancelled: writeInt(&buf, Int32(9)) - - + + case .InvalidPin: writeInt(&buf, Int32(10)) - - + + case .PassphraseRequired: writeInt(&buf, Int32(11)) - - + + case .PassphraseCancelled: writeInt(&buf, Int32(12)) - - + + case .UserCancelled: writeInt(&buf, Int32(13)) - - + + case .Timeout: writeInt(&buf, Int32(14)) - - + + case let .InvalidPath(errorDetails): writeInt(&buf, Int32(15)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .DeviceError(errorDetails): writeInt(&buf, Int32(16)) FfiConverterString.write(errorDetails, into: &buf) - - + + case .NotInitialized: writeInt(&buf, Int32(17)) - - + + case .NotConnected: writeInt(&buf, Int32(18)) - - + + case let .SessionError(errorDetails): writeInt(&buf, Int32(19)) FfiConverterString.write(errorDetails, into: &buf) - - + + case let .IoError(errorDetails): writeInt(&buf, Int32(20)) FfiConverterString.write(errorDetails, into: &buf) - + } } } @@ -17351,7 +17391,7 @@ extension TrezorError: Foundation.LocalizedError { */ public enum TrezorScriptType { - + /** * P2PKH (legacy) */ @@ -17392,50 +17432,50 @@ public struct FfiConverterTypeTrezorScriptType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorScriptType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .spendAddress - + case 2: return .spendP2shWitness - + case 3: return .spendWitness - + case 4: return .spendTaproot - + case 5: return .spendMultisig - + case 6: return .external - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TrezorScriptType, into buf: inout [UInt8]) { switch value { - - + + case .spendAddress: writeInt(&buf, Int32(1)) - - + + case .spendP2shWitness: writeInt(&buf, Int32(2)) - - + + case .spendWitness: writeInt(&buf, Int32(3)) - - + + case .spendTaproot: writeInt(&buf, Int32(4)) - - + + case .spendMultisig: writeInt(&buf, Int32(5)) - - + + case .external: writeInt(&buf, Int32(6)) - + } } } @@ -17472,7 +17512,7 @@ extension TrezorScriptType: Codable {} */ public enum TrezorTransportType { - + /** * USB connection */ @@ -17497,26 +17537,26 @@ public struct FfiConverterTypeTrezorTransportType: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TrezorTransportType { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .usb - + case 2: return .bluetooth - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TrezorTransportType, into buf: inout [UInt8]) { switch value { - - + + case .usb: writeInt(&buf, Int32(1)) - - + + case .bluetooth: writeInt(&buf, Int32(2)) - + } } } @@ -17553,7 +17593,7 @@ extension TrezorTransportType: Codable {} */ public enum TxDirection { - + /** * Wallet sent funds to an external address */ @@ -17582,32 +17622,32 @@ public struct FfiConverterTypeTxDirection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> TxDirection { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .sent - + case 2: return .received - + case 3: return .selfTransfer - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: TxDirection, into buf: inout [UInt8]) { switch value { - - + + case .sent: writeInt(&buf, Int32(1)) - - + + case .received: writeInt(&buf, Int32(2)) - - + + case .selfTransfer: writeInt(&buf, Int32(3)) - + } } } @@ -17650,7 +17690,7 @@ extension TxDirection: Codable {} */ public enum WalletSelection { - + /** * The standard wallet — no passphrase. */ @@ -17680,34 +17720,34 @@ public struct FfiConverterTypeWalletSelection: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WalletSelection { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .standard - + case 2: return .hidden(passphrase: try FfiConverterString.read(from: &buf) ) - + case 3: return .onDevice - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WalletSelection, into buf: inout [UInt8]) { switch value { - - + + case .standard: writeInt(&buf, Int32(1)) - - + + case let .hidden(passphrase): writeInt(&buf, Int32(2)) FfiConverterString.write(passphrase, into: &buf) - - + + case .onDevice: writeInt(&buf, Int32(3)) - + } } } @@ -17744,7 +17784,7 @@ extension WalletSelection: Codable {} */ public enum WatcherEvent { - + /** * Transaction activity changed — contains full updated state. */ @@ -17780,26 +17820,26 @@ public struct FfiConverterTypeWatcherEvent: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WatcherEvent { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .transactionsChanged(transactions: try FfiConverterSequenceTypeHistoryTransaction.read(from: &buf), balance: try FfiConverterTypeWalletBalance.read(from: &buf), txCount: try FfiConverterUInt32.read(from: &buf), blockHeight: try FfiConverterUInt32.read(from: &buf), accountType: try FfiConverterTypeAccountType.read(from: &buf) ) - + case 2: return .error(message: try FfiConverterString.read(from: &buf) ) - + case 3: return .disconnected(message: try FfiConverterString.read(from: &buf) ) - + case 4: return .reconnected - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WatcherEvent, into buf: inout [UInt8]) { switch value { - - + + case let .transactionsChanged(transactions,balance,txCount,blockHeight,accountType): writeInt(&buf, Int32(1)) FfiConverterSequenceTypeHistoryTransaction.write(transactions, into: &buf) @@ -17807,21 +17847,21 @@ public struct FfiConverterTypeWatcherEvent: FfiConverterRustBuffer { FfiConverterUInt32.write(txCount, into: &buf) FfiConverterUInt32.write(blockHeight, into: &buf) FfiConverterTypeAccountType.write(accountType, into: &buf) - - + + case let .error(message): writeInt(&buf, Int32(2)) FfiConverterString.write(message, into: &buf) - - + + case let .disconnected(message): writeInt(&buf, Int32(3)) FfiConverterString.write(message, into: &buf) - - + + case .reconnected: writeInt(&buf, Int32(4)) - + } } } @@ -17855,7 +17895,7 @@ extension WatcherEvent: Codable {} // See https://github.com/mozilla/uniffi-rs/issues/396 for further discussion. public enum WordCount { - + /** * 12-word mnemonic (128 bits of entropy) */ @@ -17892,44 +17932,44 @@ public struct FfiConverterTypeWordCount: FfiConverterRustBuffer { public static func read(from buf: inout (data: Data, offset: Data.Index)) throws -> WordCount { let variant: Int32 = try readInt(&buf) switch variant { - + case 1: return .words12 - + case 2: return .words15 - + case 3: return .words18 - + case 4: return .words21 - + case 5: return .words24 - + default: throw UniffiInternalError.unexpectedEnumCase } } public static func write(_ value: WordCount, into buf: inout [UInt8]) { switch value { - - + + case .words12: writeInt(&buf, Int32(1)) - - + + case .words15: writeInt(&buf, Int32(2)) - - + + case .words18: writeInt(&buf, Int32(3)) - - + + case .words21: writeInt(&buf, Int32(4)) - - + + case .words24: writeInt(&buf, Int32(5)) - + } } } @@ -19969,15 +20009,17 @@ public func addPreActivityMetadata(preActivityMetadata: PreActivityMetadata)thro ) } } -public func addPreActivityMetadataTags(paymentId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func addPreActivityMetadataTags(walletId: String, paymentId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags( + FfiConverterString.lower(walletId), FfiConverterString.lower(paymentId), FfiConverterSequenceString.lower(tags),$0 ) } } -public func addTags(activityId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func addTags(walletId: String, activityId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_add_tags( + FfiConverterString.lower(walletId), FfiConverterString.lower(activityId), FfiConverterSequenceString.lower(tags),$0 ) @@ -20164,22 +20206,32 @@ public func decode(invoice: String)async throws -> Scanner { errorHandler: FfiConverterTypeDecodingError_lift ) } -public func deleteActivityById(activityId: String)throws -> Bool { +public func deleteActivitiesByWalletId(walletId: String)throws -> UInt32 { + return try FfiConverterUInt32.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { + uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id( + FfiConverterString.lower(walletId),$0 + ) +}) +} +public func deleteActivityById(walletId: String, activityId: String)throws -> Bool { return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_delete_activity_by_id( + FfiConverterString.lower(walletId), FfiConverterString.lower(activityId),$0 ) }) } -public func deletePreActivityMetadata(paymentId: String)throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func deletePreActivityMetadata(walletId: String, paymentId: String)throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_delete_pre_activity_metadata( + FfiConverterString.lower(walletId), FfiConverterString.lower(paymentId),$0 ) } } -public func deleteTransactionDetails(txId: String)throws -> Bool { +public func deleteTransactionDetails(walletId: String, txId: String)throws -> Bool { return try FfiConverterBool.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_delete_transaction_details( + FfiConverterString.lower(walletId), FfiConverterString.lower(txId),$0 ) }) @@ -20333,9 +20385,10 @@ public func generateMnemonic(wordCount: WordCount?)throws -> String { ) }) } -public func getActivities(filter: ActivityFilter?, txType: PaymentType?, tags: [String]?, search: String?, minDate: UInt64?, maxDate: UInt64?, limit: UInt32?, sortDirection: SortDirection?)throws -> [Activity] { +public func getActivities(walletId: String?, filter: ActivityFilter?, txType: PaymentType?, tags: [String]?, search: String?, minDate: UInt64?, maxDate: UInt64?, limit: UInt32?, sortDirection: SortDirection?)throws -> [Activity] { return try FfiConverterSequenceTypeActivity.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_activities( + FfiConverterOptionString.lower(walletId), FfiConverterOptionTypeActivityFilter.lower(filter), FfiConverterOptionTypePaymentType.lower(txType), FfiConverterOptionSequenceString.lower(tags), @@ -20347,25 +20400,28 @@ public func getActivities(filter: ActivityFilter?, txType: PaymentType?, tags: [ ) }) } -public func getActivitiesByTag(tag: String, limit: UInt32?, sortDirection: SortDirection?)throws -> [Activity] { +public func getActivitiesByTag(walletId: String?, tag: String, limit: UInt32?, sortDirection: SortDirection?)throws -> [Activity] { return try FfiConverterSequenceTypeActivity.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_activities_by_tag( + FfiConverterOptionString.lower(walletId), FfiConverterString.lower(tag), FfiConverterOptionUInt32.lower(limit), FfiConverterOptionTypeSortDirection.lower(sortDirection),$0 ) }) } -public func getActivityById(activityId: String)throws -> Activity? { +public func getActivityById(walletId: String, activityId: String)throws -> Activity? { return try FfiConverterOptionTypeActivity.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_activity_by_id( + FfiConverterString.lower(walletId), FfiConverterString.lower(activityId),$0 ) }) } -public func getActivityByTxId(txId: String)throws -> OnchainActivity? { +public func getActivityByTxId(walletId: String, txId: String)throws -> OnchainActivity? { return try FfiConverterOptionTypeOnchainActivity.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_activity_by_tx_id( + FfiConverterString.lower(walletId), FfiConverterString.lower(txId),$0 ) }) @@ -20443,6 +20499,12 @@ public func getDefaultLspBalance(params: DefaultLspBalanceParams) -> UInt64 { ) }) } +public func getDefaultWalletId() -> String { + return try! FfiConverterString.lift(try! rustCall() { + uniffi_bitkitcore_fn_func_get_default_wallet_id($0 + ) +}) +} public func getGift(giftId: String)async throws -> IGift { return try await uniffiRustCallAsync( @@ -20527,24 +20589,27 @@ public func getPayment(paymentId: String)async throws -> IBtBolt11Invoice { errorHandler: FfiConverterTypeBlocktankError_lift ) } -public func getPreActivityMetadata(searchKey: String, searchByAddress: Bool)throws -> PreActivityMetadata? { +public func getPreActivityMetadata(walletId: String, searchKey: String, searchByAddress: Bool)throws -> PreActivityMetadata? { return try FfiConverterOptionTypePreActivityMetadata.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_pre_activity_metadata( + FfiConverterString.lower(walletId), FfiConverterString.lower(searchKey), FfiConverterBool.lower(searchByAddress),$0 ) }) } -public func getTags(activityId: String)throws -> [String] { +public func getTags(walletId: String, activityId: String)throws -> [String] { return try FfiConverterSequenceString.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_tags( + FfiConverterString.lower(walletId), FfiConverterString.lower(activityId),$0 ) }) } -public func getTransactionDetails(txId: String)throws -> TransactionDetails? { +public func getTransactionDetails(walletId: String, txId: String)throws -> TransactionDetails? { return try FfiConverterOptionTypeTransactionDetails.lift(try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_get_transaction_details( + FfiConverterString.lower(walletId), FfiConverterString.lower(txId),$0 ) }) @@ -20618,8 +20683,9 @@ public func lnurlAuth(domain: String, k1: String, callback: String, bip32Mnemoni errorHandler: FfiConverterTypeLnurlError_lift ) } -public func markActivityAsSeen(activityId: String, seenAt: UInt64)throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func markActivityAsSeen(walletId: String, activityId: String, seenAt: UInt64)throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_mark_activity_as_seen( + FfiConverterString.lower(walletId), FfiConverterString.lower(activityId), FfiConverterUInt64.lower(seenAt),$0 ) @@ -20680,7 +20746,7 @@ public func onchainComposeTransaction(params: ComposeParams)async -> [ComposeRe freeFunc: ffi_bitkitcore_rust_future_free_rust_buffer, liftFunc: FfiConverterSequenceTypeComposeResult.lift, errorHandler: nil - + ) } /** @@ -21052,22 +21118,25 @@ public func removeClosedChannelById(channelId: String)throws -> Bool { ) }) } -public func removePreActivityMetadataTags(paymentId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func removePreActivityMetadataTags(walletId: String, paymentId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags( + FfiConverterString.lower(walletId), FfiConverterString.lower(paymentId), FfiConverterSequenceString.lower(tags),$0 ) } } -public func removeTags(activityId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func removeTags(walletId: String, activityId: String, tags: [String])throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_remove_tags( + FfiConverterString.lower(walletId), FfiConverterString.lower(activityId), FfiConverterSequenceString.lower(tags),$0 ) } } -public func resetPreActivityMetadataTags(paymentId: String)throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { +public func resetPreActivityMetadataTags(walletId: String, paymentId: String)throws {try rustCallWithError(FfiConverterTypeActivityError_lift) { uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags( + FfiConverterString.lower(walletId), FfiConverterString.lower(paymentId),$0 ) } @@ -21225,7 +21294,7 @@ public func trezorGetConnectedDevice()async -> TrezorDeviceInfo? { freeFunc: ffi_bitkitcore_rust_future_free_rust_buffer, liftFunc: FfiConverterOptionTypeTrezorDeviceInfo.lift, errorHandler: nil - + ) } /** @@ -21266,7 +21335,7 @@ public func trezorGetFeatures()async -> TrezorFeatures? { freeFunc: ffi_bitkitcore_rust_future_free_rust_buffer, liftFunc: FfiConverterOptionTypeTrezorFeatures.lift, errorHandler: nil - + ) } /** @@ -21335,7 +21404,7 @@ public func trezorIsConnected()async -> Bool { freeFunc: ffi_bitkitcore_rust_future_free_i8, liftFunc: FfiConverterBool.lift, errorHandler: nil - + ) } /** @@ -21353,7 +21422,7 @@ public func trezorIsInitialized()async -> Bool { freeFunc: ffi_bitkitcore_rust_future_free_i8, liftFunc: FfiConverterBool.lift, errorHandler: nil - + ) } /** @@ -21669,10 +21738,10 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_add_pre_activity_metadata() != 17211) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags() != 28081) { + if (uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags() != 5813) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_add_tags() != 63739) { + if (uniffi_bitkitcore_checksum_func_add_tags() != 61276) { return InitializationResult.apiChecksumMismatch } if (uniffi_bitkitcore_checksum_func_approve_pubky_auth() != 22222) { @@ -21717,13 +21786,16 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_decode() != 28437) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_delete_activity_by_id() != 29867) { + if (uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id() != 15848) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata() != 46621) { + if (uniffi_bitkitcore_checksum_func_delete_activity_by_id() != 13256) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_delete_transaction_details() != 21670) { + if (uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata() != 63740) { + return InitializationResult.apiChecksumMismatch + } + if (uniffi_bitkitcore_checksum_func_delete_transaction_details() != 43443) { return InitializationResult.apiChecksumMismatch } if (uniffi_bitkitcore_checksum_func_derive_bitcoin_address() != 35090) { @@ -21765,16 +21837,16 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_generate_mnemonic() != 19292) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_activities() != 21347) { + if (uniffi_bitkitcore_checksum_func_get_activities() != 9879) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_activities_by_tag() != 52823) { + if (uniffi_bitkitcore_checksum_func_get_activities_by_tag() != 16182) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_activity_by_id() != 44227) { + if (uniffi_bitkitcore_checksum_func_get_activity_by_id() != 28490) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_activity_by_tx_id() != 2520) { + if (uniffi_bitkitcore_checksum_func_get_activity_by_tx_id() != 28432) { return InitializationResult.apiChecksumMismatch } if (uniffi_bitkitcore_checksum_func_get_all_activities_tags() != 29245) { @@ -21807,6 +21879,9 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_get_default_lsp_balance() != 35903) { return InitializationResult.apiChecksumMismatch } + if (uniffi_bitkitcore_checksum_func_get_default_wallet_id() != 19552) { + return InitializationResult.apiChecksumMismatch + } if (uniffi_bitkitcore_checksum_func_get_gift() != 386) { return InitializationResult.apiChecksumMismatch } @@ -21825,13 +21900,13 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_get_payment() != 29170) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_pre_activity_metadata() != 53126) { + if (uniffi_bitkitcore_checksum_func_get_pre_activity_metadata() != 24738) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_tags() != 11308) { + if (uniffi_bitkitcore_checksum_func_get_tags() != 8596) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_get_transaction_details() != 6118) { + if (uniffi_bitkitcore_checksum_func_get_transaction_details() != 4810) { return InitializationResult.apiChecksumMismatch } if (uniffi_bitkitcore_checksum_func_gift_order() != 22040) { @@ -21855,7 +21930,7 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_lnurl_auth() != 58593) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_mark_activity_as_seen() != 65086) { + if (uniffi_bitkitcore_checksum_func_mark_activity_as_seen() != 36622) { return InitializationResult.apiChecksumMismatch } if (uniffi_bitkitcore_checksum_func_mnemonic_to_entropy() != 36669) { @@ -21951,13 +22026,13 @@ private let initializationResult: InitializationResult = { if (uniffi_bitkitcore_checksum_func_remove_closed_channel_by_id() != 17150) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags() != 1991) { + if (uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags() != 37046) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_remove_tags() != 58873) { + if (uniffi_bitkitcore_checksum_func_remove_tags() != 53863) { return InitializationResult.apiChecksumMismatch } - if (uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags() != 34703) { + if (uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags() != 49760) { return InitializationResult.apiChecksumMismatch } if (uniffi_bitkitcore_checksum_func_resolve_pubky_url() != 43253) { diff --git a/bindings/ios/bitkitcoreFFI.h b/bindings/ios/bitkitcoreFFI.h index adc6b27..f28c6c6 100644 --- a/bindings/ios/bitkitcoreFFI.h +++ b/bindings/ios/bitkitcoreFFI.h @@ -253,98 +253,98 @@ typedef void (*UniffiForeignFutureCompleteVoid)(uint64_t, UniffiForeignFutureStr #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_EVENT_LISTENER_METHOD0 -typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, +typedef void (*UniffiCallbackInterfaceEventListenerMethod0)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD0 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD1 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD1 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod1)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod1)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD2 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD2 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod2)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod2)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD3 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD3 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod3)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod3)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD4 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD4 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod4)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod4)(uint64_t, RustBuffer, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD5 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD5 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod5)(uint64_t, RustBuffer, uint32_t* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod5)(uint64_t, RustBuffer, uint32_t* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD6 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD6 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod6)(uint64_t, RustBuffer, uint16_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod6)(uint64_t, RustBuffer, uint16_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD7 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD7 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod7)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod7)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD8 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD8 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod8)(uint64_t, RustBuffer, RustBuffer, int8_t* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod8)(uint64_t, RustBuffer, RustBuffer, int8_t* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD9 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD9 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod9)(uint64_t, RustBuffer, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod9)(uint64_t, RustBuffer, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD10 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_TRANSPORT_CALLBACK_METHOD10 -typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod10)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorTransportCallbackMethod10)(uint64_t, RustBuffer, RustBuffer, void* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD0 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD0 -typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod0)(uint64_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); #endif #ifndef UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD1 #define UNIFFI_FFIDEF_CALLBACK_INTERFACE_TREZOR_UI_CALLBACK_METHOD1 -typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod1)(uint64_t, int8_t, RustBuffer* _Nonnull, +typedef void (*UniffiCallbackInterfaceTrezorUiCallbackMethod1)(uint64_t, int8_t, RustBuffer* _Nonnull, RustCallStatus *_Nonnull uniffiCallStatus ); @@ -502,7 +502,7 @@ RustBuffer uniffi_bitkitcore_fn_method_trezoruicallback_on_passphrase_request(vo #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ACTIVITY_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ACTIVITY_WIPE_ALL void uniffi_bitkitcore_fn_func_activity_wipe_all(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA @@ -512,12 +512,12 @@ void uniffi_bitkitcore_fn_func_add_pre_activity_metadata(RustBuffer pre_activity #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags(RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ADD_TAGS -void uniffi_bitkitcore_fn_func_add_tags(RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_add_tags(RustBuffer wallet_id, RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_APPROVE_PUBKY_AUTH @@ -528,19 +528,19 @@ uint64_t uniffi_bitkitcore_fn_func_approve_pubky_auth(RustBuffer auth_url, RustB #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES uint64_t uniffi_bitkitcore_fn_func_blocktank_remove_all_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS uint64_t uniffi_bitkitcore_fn_func_blocktank_remove_all_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BLOCKTANK_WIPE_ALL uint64_t uniffi_bitkitcore_fn_func_blocktank_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_BROADCAST_SWEEP_TRANSACTION @@ -556,7 +556,7 @@ RustBuffer uniffi_bitkitcore_fn_func_calculate_channel_liquidity_options(RustBuf #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CANCEL_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CANCEL_PUBKY_AUTH uint64_t uniffi_bitkitcore_fn_func_cancel_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CHECK_SWEEPABLE_BALANCES @@ -567,7 +567,7 @@ uint64_t uniffi_bitkitcore_fn_func_check_sweepable_balances(RustBuffer mnemonic_ #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_COMPLETE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_COMPLETE_PUBKY_AUTH uint64_t uniffi_bitkitcore_fn_func_complete_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_CREATE_CHANNEL_REQUEST_URL @@ -595,19 +595,24 @@ RustBuffer uniffi_bitkitcore_fn_func_create_withdraw_callback_url(RustBuffer k1, uint64_t uniffi_bitkitcore_fn_func_decode(RustBuffer invoice ); #endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +uint32_t uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id(RustBuffer wallet_id, RustCallStatus *_Nonnull out_status +); +#endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_ACTIVITY_BY_ID -int8_t uniffi_bitkitcore_fn_func_delete_activity_by_id(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +int8_t uniffi_bitkitcore_fn_func_delete_activity_by_id(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_PRE_ACTIVITY_METADATA -void uniffi_bitkitcore_fn_func_delete_pre_activity_metadata(RustBuffer payment_id, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_delete_pre_activity_metadata(RustBuffer wallet_id, RustBuffer payment_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DELETE_TRANSACTION_DETAILS -int8_t uniffi_bitkitcore_fn_func_delete_transaction_details(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +int8_t uniffi_bitkitcore_fn_func_delete_transaction_details(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_DERIVE_BITCOIN_ADDRESS @@ -677,28 +682,28 @@ RustBuffer uniffi_bitkitcore_fn_func_generate_mnemonic(RustBuffer word_count, Ru #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES -RustBuffer uniffi_bitkitcore_fn_func_get_activities(RustBuffer filter, RustBuffer tx_type, RustBuffer tags, RustBuffer search, RustBuffer min_date, RustBuffer max_date, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activities(RustBuffer wallet_id, RustBuffer filter, RustBuffer tx_type, RustBuffer tags, RustBuffer search, RustBuffer min_date, RustBuffer max_date, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES_BY_TAG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITIES_BY_TAG -RustBuffer uniffi_bitkitcore_fn_func_get_activities_by_tag(RustBuffer tag, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activities_by_tag(RustBuffer wallet_id, RustBuffer tag, RustBuffer limit, RustBuffer sort_direction, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_ID -RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_id(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_id(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_TX_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ACTIVITY_BY_TX_ID -RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_tx_id(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_activity_by_tx_id(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_ACTIVITIES_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_ACTIVITIES_TAGS RustBuffer uniffi_bitkitcore_fn_func_get_all_activities_tags(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_CLOSED_CHANNELS @@ -709,19 +714,19 @@ RustBuffer uniffi_bitkitcore_fn_func_get_all_closed_channels(RustBuffer sort_dir #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_PRE_ACTIVITY_METADATA RustBuffer uniffi_bitkitcore_fn_func_get_all_pre_activity_metadata(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_TRANSACTION_DETAILS RustBuffer uniffi_bitkitcore_fn_func_get_all_transaction_details(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_UNIQUE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_ALL_UNIQUE_TAGS RustBuffer uniffi_bitkitcore_fn_func_get_all_unique_tags(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_SUGGESTIONS @@ -732,7 +737,7 @@ RustBuffer uniffi_bitkitcore_fn_func_get_bip39_suggestions(RustBuffer partial_wo #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_WORDLIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_BIP39_WORDLIST RustBuffer uniffi_bitkitcore_fn_func_get_bip39_wordlist(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_CJIT_ENTRIES @@ -748,6 +753,12 @@ RustBuffer uniffi_bitkitcore_fn_func_get_closed_channel_by_id(RustBuffer channel #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_LSP_BALANCE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_LSP_BALANCE uint64_t uniffi_bitkitcore_fn_func_get_default_lsp_balance(RustBuffer params, RustCallStatus *_Nonnull out_status +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_DEFAULT_WALLET_ID +RustBuffer uniffi_bitkitcore_fn_func_get_default_wallet_id(RustCallStatus *_Nonnull out_status + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_GIFT @@ -782,17 +793,17 @@ uint64_t uniffi_bitkitcore_fn_func_get_payment(RustBuffer payment_id #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_PRE_ACTIVITY_METADATA -RustBuffer uniffi_bitkitcore_fn_func_get_pre_activity_metadata(RustBuffer search_key, int8_t search_by_address, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_pre_activity_metadata(RustBuffer wallet_id, RustBuffer search_key, int8_t search_by_address, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TAGS -RustBuffer uniffi_bitkitcore_fn_func_get_tags(RustBuffer activity_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_tags(RustBuffer wallet_id, RustBuffer activity_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GET_TRANSACTION_DETAILS -RustBuffer uniffi_bitkitcore_fn_func_get_transaction_details(RustBuffer tx_id, RustCallStatus *_Nonnull out_status +RustBuffer uniffi_bitkitcore_fn_func_get_transaction_details(RustBuffer wallet_id, RustBuffer tx_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_GIFT_ORDER @@ -832,7 +843,7 @@ uint64_t uniffi_bitkitcore_fn_func_lnurl_auth(RustBuffer domain, RustBuffer k1, #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MARK_ACTIVITY_AS_SEEN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MARK_ACTIVITY_AS_SEEN -void uniffi_bitkitcore_fn_func_mark_activity_as_seen(RustBuffer activity_id, uint64_t seen_at, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_mark_activity_as_seen(RustBuffer wallet_id, RustBuffer activity_id, uint64_t seen_at, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_MNEMONIC_TO_ENTROPY @@ -883,7 +894,7 @@ uint64_t uniffi_bitkitcore_fn_func_onchain_start_watcher(RustBuffer params, void #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_ALL_WATCHERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_ALL_WATCHERS void uniffi_bitkitcore_fn_func_onchain_stop_all_watchers(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_ONCHAIN_STOP_WATCHER @@ -949,13 +960,13 @@ uint64_t uniffi_bitkitcore_fn_func_pubky_sign_up(RustBuffer secret_key_hex, Rust #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES uint64_t uniffi_bitkitcore_fn_func_refresh_active_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REFRESH_ACTIVE_ORDERS uint64_t uniffi_bitkitcore_fn_func_refresh_active_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REGISTER_DEVICE @@ -995,17 +1006,17 @@ int8_t uniffi_bitkitcore_fn_func_remove_closed_channel_by_id(RustBuffer channel_ #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags(RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_REMOVE_TAGS -void uniffi_bitkitcore_fn_func_remove_tags(RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_remove_tags(RustBuffer wallet_id, RustBuffer activity_id, RustBuffer tags, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS -void uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags(RustBuffer payment_id, RustCallStatus *_Nonnull out_status +void uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags(RustBuffer wallet_id, RustBuffer payment_id, RustCallStatus *_Nonnull out_status ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_RESOLVE_PUBKY_URL @@ -1046,7 +1057,7 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_connect(RustBuffer device_id, RustBuff #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_DISCONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_DISCONNECT uint64_t uniffi_bitkitcore_fn_func_trezor_disconnect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_ADDRESS @@ -1057,19 +1068,19 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_get_address(RustBuffer params #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_CONNECTED_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_CONNECTED_DEVICE uint64_t uniffi_bitkitcore_fn_func_trezor_get_connected_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_DEVICE_FINGERPRINT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_DEVICE_FINGERPRINT uint64_t uniffi_bitkitcore_fn_func_trezor_get_device_fingerprint(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_FEATURES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_FEATURES uint64_t uniffi_bitkitcore_fn_func_trezor_get_features(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_GET_PUBLIC_KEY @@ -1085,31 +1096,31 @@ uint64_t uniffi_bitkitcore_fn_func_trezor_initialize(RustBuffer credential_path #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_BLE_AVAILABLE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_BLE_AVAILABLE int8_t uniffi_bitkitcore_fn_func_trezor_is_ble_available(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_CONNECTED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_CONNECTED uint64_t uniffi_bitkitcore_fn_func_trezor_is_connected(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_INITIALIZED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_IS_INITIALIZED uint64_t uniffi_bitkitcore_fn_func_trezor_is_initialized(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_LIST_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_LIST_DEVICES uint64_t uniffi_bitkitcore_fn_func_trezor_list_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SCAN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SCAN uint64_t uniffi_bitkitcore_fn_func_trezor_scan(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_TREZOR_SET_TRANSPORT_CALLBACK @@ -1225,19 +1236,19 @@ void uniffi_bitkitcore_fn_func_validate_mnemonic(RustBuffer mnemonic_phrase, Rus #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_CLOSED_CHANNELS void uniffi_bitkitcore_fn_func_wipe_all_closed_channels(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_DATABASES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_DATABASES uint64_t uniffi_bitkitcore_fn_func_wipe_all_databases(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_FN_FUNC_WIPE_ALL_TRANSACTION_DETAILS void uniffi_bitkitcore_fn_func_wipe_all_transaction_details(RustCallStatus *_Nonnull out_status - + ); #endif #ifndef UNIFFI_FFIDEF_FFI_BITKITCORE_RUSTBUFFER_ALLOC @@ -1523,949 +1534,961 @@ void ffi_bitkitcore_rust_future_complete_void(uint64_t handle, RustCallStatus *_ #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ACTIVITY_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ACTIVITY_WIPE_ALL uint16_t uniffi_bitkitcore_checksum_func_activity_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_add_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ADD_TAGS uint16_t uniffi_bitkitcore_checksum_func_add_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_APPROVE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_APPROVE_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_approve_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_blocktank_remove_all_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_REMOVE_ALL_ORDERS uint16_t uniffi_bitkitcore_checksum_func_blocktank_remove_all_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_WIPE_ALL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BLOCKTANK_WIPE_ALL uint16_t uniffi_bitkitcore_checksum_func_blocktank_wipe_all(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BROADCAST_SWEEP_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_BROADCAST_SWEEP_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_broadcast_sweep_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CALCULATE_CHANNEL_LIQUIDITY_OPTIONS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CALCULATE_CHANNEL_LIQUIDITY_OPTIONS uint16_t uniffi_bitkitcore_checksum_func_calculate_channel_liquidity_options(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CANCEL_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CANCEL_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_cancel_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CHECK_SWEEPABLE_BALANCES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CHECK_SWEEPABLE_BALANCES uint16_t uniffi_bitkitcore_checksum_func_check_sweepable_balances(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_COMPLETE_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_COMPLETE_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_complete_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CHANNEL_REQUEST_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CHANNEL_REQUEST_URL uint16_t uniffi_bitkitcore_checksum_func_create_channel_request_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CJIT_ENTRY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_CJIT_ENTRY uint16_t uniffi_bitkitcore_checksum_func_create_cjit_entry(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_ORDER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_ORDER uint16_t uniffi_bitkitcore_checksum_func_create_order(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_WITHDRAW_CALLBACK_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_CREATE_WITHDRAW_CALLBACK_URL uint16_t uniffi_bitkitcore_checksum_func_create_withdraw_callback_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DECODE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DECODE uint16_t uniffi_bitkitcore_checksum_func_decode(void - + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITIES_BY_WALLET_ID +uint16_t uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_ACTIVITY_BY_ID uint16_t uniffi_bitkitcore_checksum_func_delete_activity_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DELETE_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_delete_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_derive_bitcoin_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESSES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_BITCOIN_ADDRESSES uint16_t uniffi_bitkitcore_checksum_func_derive_bitcoin_addresses(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_ONCHAIN_DESCRIPTOR #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_ONCHAIN_DESCRIPTOR uint16_t uniffi_bitkitcore_checksum_func_derive_onchain_descriptor(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PRIVATE_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PRIVATE_KEY uint16_t uniffi_bitkitcore_checksum_func_derive_private_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PUBKY_SECRET_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_DERIVE_PUBKY_SECRET_KEY uint16_t uniffi_bitkitcore_checksum_func_derive_pubky_secret_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ENTROPY_TO_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ENTROPY_TO_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_entropy_to_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE uint16_t uniffi_bitkitcore_checksum_func_estimate_order_fee(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE_FULL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ESTIMATE_ORDER_FEE_FULL uint16_t uniffi_bitkitcore_checksum_func_estimate_order_fee_full(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_CONTACTS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_CONTACTS uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_contacts(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_file(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE_STRING #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_FILE_STRING uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_file_string(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_PROFILE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_FETCH_PUBKY_PROFILE uint16_t uniffi_bitkitcore_checksum_func_fetch_pubky_profile(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GENERATE_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GENERATE_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_generate_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_get_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES_BY_TAG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITIES_BY_TAG uint16_t uniffi_bitkitcore_checksum_func_get_activities_by_tag(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_ID uint16_t uniffi_bitkitcore_checksum_func_get_activity_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_TX_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ACTIVITY_BY_TX_ID uint16_t uniffi_bitkitcore_checksum_func_get_activity_by_tx_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_ACTIVITIES_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_ACTIVITIES_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_all_activities_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_get_all_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_get_all_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_get_all_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_UNIQUE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ALL_UNIQUE_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_all_unique_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_SUGGESTIONS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_SUGGESTIONS uint16_t uniffi_bitkitcore_checksum_func_get_bip39_suggestions(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_WORDLIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_BIP39_WORDLIST uint16_t uniffi_bitkitcore_checksum_func_get_bip39_wordlist(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_get_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CLOSED_CHANNEL_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_CLOSED_CHANNEL_BY_ID uint16_t uniffi_bitkitcore_checksum_func_get_closed_channel_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_LSP_BALANCE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_LSP_BALANCE uint16_t uniffi_bitkitcore_checksum_func_get_default_lsp_balance(void - + +); +#endif +#ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_WALLET_ID +#define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_DEFAULT_WALLET_ID +uint16_t uniffi_bitkitcore_checksum_func_get_default_wallet_id(void + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_GIFT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_GIFT uint16_t uniffi_bitkitcore_checksum_func_get_gift(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_INFO uint16_t uniffi_bitkitcore_checksum_func_get_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_LNURL_INVOICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_LNURL_INVOICE uint16_t uniffi_bitkitcore_checksum_func_get_lnurl_invoice(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_MIN_ZERO_CONF_TX_FEE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_MIN_ZERO_CONF_TX_FEE uint16_t uniffi_bitkitcore_checksum_func_get_min_zero_conf_tx_fee(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_ORDERS uint16_t uniffi_bitkitcore_checksum_func_get_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PAYMENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PAYMENT uint16_t uniffi_bitkitcore_checksum_func_get_payment(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_get_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TAGS uint16_t uniffi_bitkitcore_checksum_func_get_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GET_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_get_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_ORDER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_ORDER uint16_t uniffi_bitkitcore_checksum_func_gift_order(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_PAY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_GIFT_PAY uint16_t uniffi_bitkitcore_checksum_func_gift_pay(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INIT_DB #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INIT_DB uint16_t uniffi_bitkitcore_checksum_func_init_db(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INSERT_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_INSERT_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_insert_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_ADDRESS_USED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_ADDRESS_USED uint16_t uniffi_bitkitcore_checksum_func_is_address_used(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_VALID_BIP39_WORD #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_IS_VALID_BIP39_WORD uint16_t uniffi_bitkitcore_checksum_func_is_valid_bip39_word(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_LNURL_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_LNURL_AUTH uint16_t uniffi_bitkitcore_checksum_func_lnurl_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MARK_ACTIVITY_AS_SEEN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MARK_ACTIVITY_AS_SEEN uint16_t uniffi_bitkitcore_checksum_func_mark_activity_as_seen(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_ENTROPY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_ENTROPY uint16_t uniffi_bitkitcore_checksum_func_mnemonic_to_entropy(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_SEED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_MNEMONIC_TO_SEED uint16_t uniffi_bitkitcore_checksum_func_mnemonic_to_seed(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_BROADCAST_RAW_TX #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_BROADCAST_RAW_TX uint16_t uniffi_bitkitcore_checksum_func_onchain_broadcast_raw_tx(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_COMPOSE_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_COMPOSE_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_onchain_compose_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ACCOUNT_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ACCOUNT_INFO uint16_t uniffi_bitkitcore_checksum_func_onchain_get_account_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ADDRESS_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_ADDRESS_INFO uint16_t uniffi_bitkitcore_checksum_func_onchain_get_address_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_DETAIL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_DETAIL uint16_t uniffi_bitkitcore_checksum_func_onchain_get_transaction_detail(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_HISTORY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_GET_TRANSACTION_HISTORY uint16_t uniffi_bitkitcore_checksum_func_onchain_get_transaction_history(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_START_WATCHER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_START_WATCHER uint16_t uniffi_bitkitcore_checksum_func_onchain_start_watcher(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_ALL_WATCHERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_ALL_WATCHERS uint16_t uniffi_bitkitcore_checksum_func_onchain_stop_all_watchers(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_WATCHER #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_ONCHAIN_STOP_WATCHER uint16_t uniffi_bitkitcore_checksum_func_onchain_stop_watcher(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_OPEN_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_OPEN_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_open_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PARSE_PUBKY_AUTH_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PARSE_PUBKY_AUTH_URL uint16_t uniffi_bitkitcore_checksum_func_parse_pubky_auth_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_SWEEP #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_SWEEP uint16_t uniffi_bitkitcore_checksum_func_prepare_legacy_rn_native_segwit_recovery_sweep(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_SWEEP_TRANSACTION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PREPARE_SWEEP_TRANSACTION uint16_t uniffi_bitkitcore_checksum_func_prepare_sweep_transaction(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUBLIC_KEY_FROM_SECRET #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUBLIC_KEY_FROM_SECRET uint16_t uniffi_bitkitcore_checksum_func_pubky_public_key_from_secret(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUT_WITH_SECRET_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_PUT_WITH_SECRET_KEY uint16_t uniffi_bitkitcore_checksum_func_pubky_put_with_secret_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_DELETE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_DELETE uint16_t uniffi_bitkitcore_checksum_func_pubky_session_delete(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_LIST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_LIST uint16_t uniffi_bitkitcore_checksum_func_pubky_session_list(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_PUT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SESSION_PUT uint16_t uniffi_bitkitcore_checksum_func_pubky_session_put(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_IN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_IN uint16_t uniffi_bitkitcore_checksum_func_pubky_sign_in(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_UP #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_PUBKY_SIGN_UP uint16_t uniffi_bitkitcore_checksum_func_pubky_sign_up(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_refresh_active_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REFRESH_ACTIVE_ORDERS uint16_t uniffi_bitkitcore_checksum_func_refresh_active_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGISTER_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGISTER_DEVICE uint16_t uniffi_bitkitcore_checksum_func_register_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_CLOSE_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_CLOSE_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_regtest_close_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_DEPOSIT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_DEPOSIT uint16_t uniffi_bitkitcore_checksum_func_regtest_deposit(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_GET_PAYMENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_GET_PAYMENT uint16_t uniffi_bitkitcore_checksum_func_regtest_get_payment(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_MINE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_MINE uint16_t uniffi_bitkitcore_checksum_func_regtest_mine(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_PAY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REGTEST_PAY uint16_t uniffi_bitkitcore_checksum_func_regtest_pay(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_CLOSED_CHANNEL_BY_ID #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_CLOSED_CHANNEL_BY_ID uint16_t uniffi_bitkitcore_checksum_func_remove_closed_channel_by_id(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_REMOVE_TAGS uint16_t uniffi_bitkitcore_checksum_func_remove_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESET_PRE_ACTIVITY_METADATA_TAGS uint16_t uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESOLVE_PUBKY_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_RESOLVE_PUBKY_URL uint16_t uniffi_bitkitcore_checksum_func_resolve_pubky_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_SCAN_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_FUNDS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_SCAN_LEGACY_RN_NATIVE_SEGWIT_RECOVERY_FUNDS uint16_t uniffi_bitkitcore_checksum_func_scan_legacy_rn_native_segwit_recovery_funds(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_START_PUBKY_AUTH #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_START_PUBKY_AUTH uint16_t uniffi_bitkitcore_checksum_func_start_pubky_auth(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TEST_NOTIFICATION #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TEST_NOTIFICATION uint16_t uniffi_bitkitcore_checksum_func_test_notification(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_ACCOUNT_TYPE_TO_SCRIPT_TYPE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_ACCOUNT_TYPE_TO_SCRIPT_TYPE uint16_t uniffi_bitkitcore_checksum_func_trezor_account_type_to_script_type(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CLEAR_CREDENTIALS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CLEAR_CREDENTIALS uint16_t uniffi_bitkitcore_checksum_func_trezor_clear_credentials(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_CONNECT uint16_t uniffi_bitkitcore_checksum_func_trezor_connect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_DISCONNECT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_DISCONNECT uint16_t uniffi_bitkitcore_checksum_func_trezor_disconnect(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_trezor_get_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_CONNECTED_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_CONNECTED_DEVICE uint16_t uniffi_bitkitcore_checksum_func_trezor_get_connected_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_DEVICE_FINGERPRINT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_DEVICE_FINGERPRINT uint16_t uniffi_bitkitcore_checksum_func_trezor_get_device_fingerprint(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_FEATURES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_FEATURES uint16_t uniffi_bitkitcore_checksum_func_trezor_get_features(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_PUBLIC_KEY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_GET_PUBLIC_KEY uint16_t uniffi_bitkitcore_checksum_func_trezor_get_public_key(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_INITIALIZE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_INITIALIZE uint16_t uniffi_bitkitcore_checksum_func_trezor_initialize(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_BLE_AVAILABLE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_BLE_AVAILABLE uint16_t uniffi_bitkitcore_checksum_func_trezor_is_ble_available(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_CONNECTED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_CONNECTED uint16_t uniffi_bitkitcore_checksum_func_trezor_is_connected(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_INITIALIZED #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_IS_INITIALIZED uint16_t uniffi_bitkitcore_checksum_func_trezor_is_initialized(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_LIST_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_LIST_DEVICES uint16_t uniffi_bitkitcore_checksum_func_trezor_list_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SCAN #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SCAN uint16_t uniffi_bitkitcore_checksum_func_trezor_scan(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_TRANSPORT_CALLBACK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_TRANSPORT_CALLBACK uint16_t uniffi_bitkitcore_checksum_func_trezor_set_transport_callback(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_UI_CALLBACK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SET_UI_CALLBACK uint16_t uniffi_bitkitcore_checksum_func_trezor_set_ui_callback(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_MESSAGE uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_tx(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX_FROM_PSBT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_SIGN_TX_FROM_PSBT uint16_t uniffi_bitkitcore_checksum_func_trezor_sign_tx_from_psbt(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_VERIFY_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_TREZOR_VERIFY_MESSAGE uint16_t uniffi_bitkitcore_checksum_func_trezor_verify_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_update_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_BLOCKTANK_URL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPDATE_BLOCKTANK_URL uint16_t uniffi_bitkitcore_checksum_func_update_blocktank_url(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITY #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ACTIVITY uint16_t uniffi_bitkitcore_checksum_func_upsert_activity(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CJIT_ENTRIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CJIT_ENTRIES uint16_t uniffi_bitkitcore_checksum_func_upsert_cjit_entries(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNEL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNEL uint16_t uniffi_bitkitcore_checksum_func_upsert_closed_channel(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_upsert_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_INFO #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_INFO uint16_t uniffi_bitkitcore_checksum_func_upsert_info(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_LIGHTNING_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_LIGHTNING_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_lightning_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ONCHAIN_ACTIVITIES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ONCHAIN_ACTIVITIES uint16_t uniffi_bitkitcore_checksum_func_upsert_onchain_activities(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ORDERS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_ORDERS uint16_t uniffi_bitkitcore_checksum_func_upsert_orders(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_PRE_ACTIVITY_METADATA #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_PRE_ACTIVITY_METADATA uint16_t uniffi_bitkitcore_checksum_func_upsert_pre_activity_metadata(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TAGS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TAGS uint16_t uniffi_bitkitcore_checksum_func_upsert_tags(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_UPSERT_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_upsert_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_BITCOIN_ADDRESS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_BITCOIN_ADDRESS uint16_t uniffi_bitkitcore_checksum_func_validate_bitcoin_address(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_MNEMONIC #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_VALIDATE_MNEMONIC uint16_t uniffi_bitkitcore_checksum_func_validate_mnemonic(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_CLOSED_CHANNELS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_CLOSED_CHANNELS uint16_t uniffi_bitkitcore_checksum_func_wipe_all_closed_channels(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_DATABASES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_DATABASES uint16_t uniffi_bitkitcore_checksum_func_wipe_all_databases(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_TRANSACTION_DETAILS #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_FUNC_WIPE_ALL_TRANSACTION_DETAILS uint16_t uniffi_bitkitcore_checksum_func_wipe_all_transaction_details(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_EVENTLISTENER_ON_EVENT #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_EVENTLISTENER_ON_EVENT uint16_t uniffi_bitkitcore_checksum_method_eventlistener_on_event(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_ENUMERATE_DEVICES #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_ENUMERATE_DEVICES uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_enumerate_devices(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_OPEN_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_OPEN_DEVICE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_open_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CLOSE_DEVICE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CLOSE_DEVICE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_close_device(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_READ_CHUNK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_READ_CHUNK uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_read_chunk(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_WRITE_CHUNK #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_WRITE_CHUNK uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_write_chunk(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_CHUNK_SIZE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_CHUNK_SIZE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_get_chunk_size(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CALL_MESSAGE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_CALL_MESSAGE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_call_message(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_PAIRING_CODE #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_GET_PAIRING_CODE uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_get_pairing_code(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_SAVE_THP_CREDENTIAL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_SAVE_THP_CREDENTIAL uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_save_thp_credential(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOAD_THP_CREDENTIAL #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOAD_THP_CREDENTIAL uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_load_thp_credential(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOG_DEBUG #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORTRANSPORTCALLBACK_LOG_DEBUG uint16_t uniffi_bitkitcore_checksum_method_trezortransportcallback_log_debug(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PIN_REQUEST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PIN_REQUEST uint16_t uniffi_bitkitcore_checksum_method_trezoruicallback_on_pin_request(void - + ); #endif #ifndef UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PASSPHRASE_REQUEST #define UNIFFI_FFIDEF_UNIFFI_BITKITCORE_CHECKSUM_METHOD_TREZORUICALLBACK_ON_PASSPHRASE_REQUEST uint16_t uniffi_bitkitcore_checksum_method_trezoruicallback_on_passphrase_request(void - + ); #endif #ifndef UNIFFI_FFIDEF_FFI_BITKITCORE_UNIFFI_CONTRACT_VERSION #define UNIFFI_FFIDEF_FFI_BITKITCORE_UNIFFI_CONTRACT_VERSION uint32_t ffi_bitkitcore_uniffi_contract_version(void - + ); #endif diff --git a/bindings/python/bitkitcore/__init__.py b/bindings/python/bitkitcore/__init__.py index e69de29..a7a3613 100644 --- a/bindings/python/bitkitcore/__init__.py +++ b/bindings/python/bitkitcore/__init__.py @@ -0,0 +1 @@ +from .bitkitcore import * diff --git a/bindings/python/bitkitcore/bitkitcore.py b/bindings/python/bitkitcore/bitkitcore.py index a258db5..0cbbf4d 100644 --- a/bindings/python/bitkitcore/bitkitcore.py +++ b/bindings/python/bitkitcore/bitkitcore.py @@ -465,9 +465,9 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_add_pre_activity_metadata() != 17211: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags() != 28081: + if lib.uniffi_bitkitcore_checksum_func_add_pre_activity_metadata_tags() != 5813: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_add_tags() != 63739: + if lib.uniffi_bitkitcore_checksum_func_add_tags() != 61276: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_approve_pubky_auth() != 22222: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -497,11 +497,13 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_decode() != 28437: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_delete_activity_by_id() != 29867: + if lib.uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id() != 15848: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata() != 46621: + if lib.uniffi_bitkitcore_checksum_func_delete_activity_by_id() != 13256: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_delete_transaction_details() != 21670: + if lib.uniffi_bitkitcore_checksum_func_delete_pre_activity_metadata() != 63740: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_bitkitcore_checksum_func_delete_transaction_details() != 43443: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_derive_bitcoin_address() != 35090: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -529,13 +531,13 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_generate_mnemonic() != 19292: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_activities() != 21347: + if lib.uniffi_bitkitcore_checksum_func_get_activities() != 9879: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_activities_by_tag() != 52823: + if lib.uniffi_bitkitcore_checksum_func_get_activities_by_tag() != 16182: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_activity_by_id() != 44227: + if lib.uniffi_bitkitcore_checksum_func_get_activity_by_id() != 28490: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_activity_by_tx_id() != 2520: + if lib.uniffi_bitkitcore_checksum_func_get_activity_by_tx_id() != 28432: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_get_all_activities_tags() != 29245: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -557,6 +559,8 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_get_default_lsp_balance() != 35903: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") + if lib.uniffi_bitkitcore_checksum_func_get_default_wallet_id() != 19552: + raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_get_gift() != 386: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_get_info() != 43607: @@ -569,11 +573,11 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_get_payment() != 29170: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_pre_activity_metadata() != 53126: + if lib.uniffi_bitkitcore_checksum_func_get_pre_activity_metadata() != 24738: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_tags() != 11308: + if lib.uniffi_bitkitcore_checksum_func_get_tags() != 8596: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_get_transaction_details() != 6118: + if lib.uniffi_bitkitcore_checksum_func_get_transaction_details() != 4810: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_gift_order() != 22040: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -589,7 +593,7 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_lnurl_auth() != 58593: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_mark_activity_as_seen() != 65086: + if lib.uniffi_bitkitcore_checksum_func_mark_activity_as_seen() != 36622: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_mnemonic_to_entropy() != 36669: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -653,11 +657,11 @@ def _uniffi_check_api_checksums(lib): raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_remove_closed_channel_by_id() != 17150: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags() != 1991: + if lib.uniffi_bitkitcore_checksum_func_remove_pre_activity_metadata_tags() != 37046: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_remove_tags() != 58873: + if lib.uniffi_bitkitcore_checksum_func_remove_tags() != 53863: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") - if lib.uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags() != 34703: + if lib.uniffi_bitkitcore_checksum_func_reset_pre_activity_metadata_tags() != 49760: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") if lib.uniffi_bitkitcore_checksum_func_resolve_pubky_url() != 43253: raise InternalError("UniFFI API checksum mismatch: try cleaning and rebuilding your project") @@ -1088,12 +1092,14 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): ) _UniffiLib.uniffi_bitkitcore_fn_func_add_pre_activity_metadata.restype = None _UniffiLib.uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags.restype = None _UniffiLib.uniffi_bitkitcore_fn_func_add_tags.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), @@ -1174,17 +1180,25 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): _UniffiRustBuffer, ) _UniffiLib.uniffi_bitkitcore_fn_func_decode.restype = ctypes.c_uint64 +_UniffiLib.uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id.argtypes = ( + _UniffiRustBuffer, + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id.restype = ctypes.c_uint32 _UniffiLib.uniffi_bitkitcore_fn_func_delete_activity_by_id.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_delete_activity_by_id.restype = ctypes.c_int8 _UniffiLib.uniffi_bitkitcore_fn_func_delete_pre_activity_metadata.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_delete_pre_activity_metadata.restype = None _UniffiLib.uniffi_bitkitcore_fn_func_delete_transaction_details.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) @@ -1277,6 +1291,7 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): _UniffiRustBuffer, _UniffiRustBuffer, _UniffiRustBuffer, + _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_get_activities.restype = _UniffiRustBuffer @@ -1284,15 +1299,18 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): _UniffiRustBuffer, _UniffiRustBuffer, _UniffiRustBuffer, + _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_get_activities_by_tag.restype = _UniffiRustBuffer _UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_id.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_id.restype = _UniffiRustBuffer _UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_tx_id.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) @@ -1344,6 +1362,10 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_get_default_lsp_balance.restype = ctypes.c_uint64 +_UniffiLib.uniffi_bitkitcore_fn_func_get_default_wallet_id.argtypes = ( + ctypes.POINTER(_UniffiRustCallStatus), +) +_UniffiLib.uniffi_bitkitcore_fn_func_get_default_wallet_id.restype = _UniffiRustBuffer _UniffiLib.uniffi_bitkitcore_fn_func_get_gift.argtypes = ( _UniffiRustBuffer, ) @@ -1372,17 +1394,20 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): ) _UniffiLib.uniffi_bitkitcore_fn_func_get_payment.restype = ctypes.c_uint64 _UniffiLib.uniffi_bitkitcore_fn_func_get_pre_activity_metadata.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.c_int8, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_get_pre_activity_metadata.restype = _UniffiRustBuffer _UniffiLib.uniffi_bitkitcore_fn_func_get_tags.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_get_tags.restype = _UniffiRustBuffer _UniffiLib.uniffi_bitkitcore_fn_func_get_transaction_details.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) @@ -1426,6 +1451,7 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): ) _UniffiLib.uniffi_bitkitcore_fn_func_lnurl_auth.restype = ctypes.c_uint64 _UniffiLib.uniffi_bitkitcore_fn_func_mark_activity_as_seen.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.c_uint64, ctypes.POINTER(_UniffiRustCallStatus), @@ -1607,18 +1633,21 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): ) _UniffiLib.uniffi_bitkitcore_fn_func_remove_closed_channel_by_id.restype = ctypes.c_int8 _UniffiLib.uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags.restype = None _UniffiLib.uniffi_bitkitcore_fn_func_remove_tags.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) _UniffiLib.uniffi_bitkitcore_fn_func_remove_tags.restype = None _UniffiLib.uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags.argtypes = ( + _UniffiRustBuffer, _UniffiRustBuffer, ctypes.POINTER(_UniffiRustCallStatus), ) @@ -2138,6 +2167,9 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): _UniffiLib.uniffi_bitkitcore_checksum_func_decode.argtypes = ( ) _UniffiLib.uniffi_bitkitcore_checksum_func_decode.restype = ctypes.c_uint16 +_UniffiLib.uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id.argtypes = ( +) +_UniffiLib.uniffi_bitkitcore_checksum_func_delete_activities_by_wallet_id.restype = ctypes.c_uint16 _UniffiLib.uniffi_bitkitcore_checksum_func_delete_activity_by_id.argtypes = ( ) _UniffiLib.uniffi_bitkitcore_checksum_func_delete_activity_by_id.restype = ctypes.c_uint16 @@ -2228,6 +2260,9 @@ class _UniffiVTableCallbackInterfaceTrezorUiCallback(ctypes.Structure): _UniffiLib.uniffi_bitkitcore_checksum_func_get_default_lsp_balance.argtypes = ( ) _UniffiLib.uniffi_bitkitcore_checksum_func_get_default_lsp_balance.restype = ctypes.c_uint16 +_UniffiLib.uniffi_bitkitcore_checksum_func_get_default_wallet_id.argtypes = ( +) +_UniffiLib.uniffi_bitkitcore_checksum_func_get_default_wallet_id.restype = ctypes.c_uint16 _UniffiLib.uniffi_bitkitcore_checksum_func_get_gift.argtypes = ( ) _UniffiLib.uniffi_bitkitcore_checksum_func_get_gift.restype = ctypes.c_uint16 @@ -3023,16 +3058,20 @@ def write(value, buf): class ActivityTags: + wallet_id: "str" activity_id: "str" tags: "typing.List[str]" - def __init__(self, *, activity_id: "str", tags: "typing.List[str]"): + def __init__(self, *, wallet_id: "str", activity_id: "str", tags: "typing.List[str]"): + self.wallet_id = wallet_id self.activity_id = activity_id self.tags = tags def __str__(self): - return "ActivityTags(activity_id={}, tags={})".format(self.activity_id, self.tags) + return "ActivityTags(wallet_id={}, activity_id={}, tags={})".format(self.wallet_id, self.activity_id, self.tags) def __eq__(self, other): + if self.wallet_id != other.wallet_id: + return False if self.activity_id != other.activity_id: return False if self.tags != other.tags: @@ -3043,17 +3082,20 @@ class _UniffiConverterTypeActivityTags(_UniffiConverterRustBuffer): @staticmethod def read(buf): return ActivityTags( + wallet_id=_UniffiConverterString.read(buf), activity_id=_UniffiConverterString.read(buf), tags=_UniffiConverterSequenceString.read(buf), ) @staticmethod def check_lower(value): + _UniffiConverterString.check_lower(value.wallet_id) _UniffiConverterString.check_lower(value.activity_id) _UniffiConverterSequenceString.check_lower(value.tags) @staticmethod def write(value, buf): + _UniffiConverterString.write(value.wallet_id, buf) _UniffiConverterString.write(value.activity_id, buf) _UniffiConverterSequenceString.write(value.tags, buf) @@ -6105,6 +6147,7 @@ def write(value, buf): class LightningActivity: + wallet_id: "str" id: "str" tx_type: "PaymentType" status: "PaymentState" @@ -6118,7 +6161,8 @@ class LightningActivity: created_at: "typing.Optional[int]" updated_at: "typing.Optional[int]" seen_at: "typing.Optional[int]" - def __init__(self, *, id: "str", tx_type: "PaymentType", status: "PaymentState", value: "int", fee: "typing.Optional[int]", invoice: "str", message: "str", timestamp: "int", preimage: "typing.Optional[str]", contact: "typing.Optional[str]", created_at: "typing.Optional[int]", updated_at: "typing.Optional[int]", seen_at: "typing.Optional[int]"): + def __init__(self, *, wallet_id: "str", id: "str", tx_type: "PaymentType", status: "PaymentState", value: "int", fee: "typing.Optional[int]", invoice: "str", message: "str", timestamp: "int", preimage: "typing.Optional[str]", contact: "typing.Optional[str]", created_at: "typing.Optional[int]", updated_at: "typing.Optional[int]", seen_at: "typing.Optional[int]"): + self.wallet_id = wallet_id self.id = id self.tx_type = tx_type self.status = status @@ -6134,9 +6178,11 @@ def __init__(self, *, id: "str", tx_type: "PaymentType", status: "PaymentState", self.seen_at = seen_at def __str__(self): - return "LightningActivity(id={}, tx_type={}, status={}, value={}, fee={}, invoice={}, message={}, timestamp={}, preimage={}, contact={}, created_at={}, updated_at={}, seen_at={})".format(self.id, self.tx_type, self.status, self.value, self.fee, self.invoice, self.message, self.timestamp, self.preimage, self.contact, self.created_at, self.updated_at, self.seen_at) + return "LightningActivity(wallet_id={}, id={}, tx_type={}, status={}, value={}, fee={}, invoice={}, message={}, timestamp={}, preimage={}, contact={}, created_at={}, updated_at={}, seen_at={})".format(self.wallet_id, self.id, self.tx_type, self.status, self.value, self.fee, self.invoice, self.message, self.timestamp, self.preimage, self.contact, self.created_at, self.updated_at, self.seen_at) def __eq__(self, other): + if self.wallet_id != other.wallet_id: + return False if self.id != other.id: return False if self.tx_type != other.tx_type: @@ -6169,6 +6215,7 @@ class _UniffiConverterTypeLightningActivity(_UniffiConverterRustBuffer): @staticmethod def read(buf): return LightningActivity( + wallet_id=_UniffiConverterString.read(buf), id=_UniffiConverterString.read(buf), tx_type=_UniffiConverterTypePaymentType.read(buf), status=_UniffiConverterTypePaymentState.read(buf), @@ -6186,6 +6233,7 @@ def read(buf): @staticmethod def check_lower(value): + _UniffiConverterString.check_lower(value.wallet_id) _UniffiConverterString.check_lower(value.id) _UniffiConverterTypePaymentType.check_lower(value.tx_type) _UniffiConverterTypePaymentState.check_lower(value.status) @@ -6202,6 +6250,7 @@ def check_lower(value): @staticmethod def write(value, buf): + _UniffiConverterString.write(value.wallet_id, buf) _UniffiConverterString.write(value.id, buf) _UniffiConverterTypePaymentType.write(value.tx_type, buf) _UniffiConverterTypePaymentState.write(value.status, buf) @@ -6733,6 +6782,7 @@ def write(value, buf): class OnchainActivity: + wallet_id: "str" id: "str" tx_type: "PaymentType" tx_id: "str" @@ -6753,7 +6803,8 @@ class OnchainActivity: created_at: "typing.Optional[int]" updated_at: "typing.Optional[int]" seen_at: "typing.Optional[int]" - def __init__(self, *, id: "str", tx_type: "PaymentType", tx_id: "str", value: "int", fee: "int", fee_rate: "int", address: "str", confirmed: "bool", timestamp: "int", is_boosted: "bool", boost_tx_ids: "typing.List[str]", is_transfer: "bool", does_exist: "bool", confirm_timestamp: "typing.Optional[int]", channel_id: "typing.Optional[str]", transfer_tx_id: "typing.Optional[str]", contact: "typing.Optional[str]", created_at: "typing.Optional[int]", updated_at: "typing.Optional[int]", seen_at: "typing.Optional[int]"): + def __init__(self, *, wallet_id: "str", id: "str", tx_type: "PaymentType", tx_id: "str", value: "int", fee: "int", fee_rate: "int", address: "str", confirmed: "bool", timestamp: "int", is_boosted: "bool", boost_tx_ids: "typing.List[str]", is_transfer: "bool", does_exist: "bool", confirm_timestamp: "typing.Optional[int]", channel_id: "typing.Optional[str]", transfer_tx_id: "typing.Optional[str]", contact: "typing.Optional[str]", created_at: "typing.Optional[int]", updated_at: "typing.Optional[int]", seen_at: "typing.Optional[int]"): + self.wallet_id = wallet_id self.id = id self.tx_type = tx_type self.tx_id = tx_id @@ -6776,9 +6827,11 @@ def __init__(self, *, id: "str", tx_type: "PaymentType", tx_id: "str", value: "i self.seen_at = seen_at def __str__(self): - return "OnchainActivity(id={}, tx_type={}, tx_id={}, value={}, fee={}, fee_rate={}, address={}, confirmed={}, timestamp={}, is_boosted={}, boost_tx_ids={}, is_transfer={}, does_exist={}, confirm_timestamp={}, channel_id={}, transfer_tx_id={}, contact={}, created_at={}, updated_at={}, seen_at={})".format(self.id, self.tx_type, self.tx_id, self.value, self.fee, self.fee_rate, self.address, self.confirmed, self.timestamp, self.is_boosted, self.boost_tx_ids, self.is_transfer, self.does_exist, self.confirm_timestamp, self.channel_id, self.transfer_tx_id, self.contact, self.created_at, self.updated_at, self.seen_at) + return "OnchainActivity(wallet_id={}, id={}, tx_type={}, tx_id={}, value={}, fee={}, fee_rate={}, address={}, confirmed={}, timestamp={}, is_boosted={}, boost_tx_ids={}, is_transfer={}, does_exist={}, confirm_timestamp={}, channel_id={}, transfer_tx_id={}, contact={}, created_at={}, updated_at={}, seen_at={})".format(self.wallet_id, self.id, self.tx_type, self.tx_id, self.value, self.fee, self.fee_rate, self.address, self.confirmed, self.timestamp, self.is_boosted, self.boost_tx_ids, self.is_transfer, self.does_exist, self.confirm_timestamp, self.channel_id, self.transfer_tx_id, self.contact, self.created_at, self.updated_at, self.seen_at) def __eq__(self, other): + if self.wallet_id != other.wallet_id: + return False if self.id != other.id: return False if self.tx_type != other.tx_type: @@ -6825,6 +6878,7 @@ class _UniffiConverterTypeOnchainActivity(_UniffiConverterRustBuffer): @staticmethod def read(buf): return OnchainActivity( + wallet_id=_UniffiConverterString.read(buf), id=_UniffiConverterString.read(buf), tx_type=_UniffiConverterTypePaymentType.read(buf), tx_id=_UniffiConverterString.read(buf), @@ -6849,6 +6903,7 @@ def read(buf): @staticmethod def check_lower(value): + _UniffiConverterString.check_lower(value.wallet_id) _UniffiConverterString.check_lower(value.id) _UniffiConverterTypePaymentType.check_lower(value.tx_type) _UniffiConverterString.check_lower(value.tx_id) @@ -6872,6 +6927,7 @@ def check_lower(value): @staticmethod def write(value, buf): + _UniffiConverterString.write(value.wallet_id, buf) _UniffiConverterString.write(value.id, buf) _UniffiConverterTypePaymentType.write(value.tx_type, buf) _UniffiConverterString.write(value.tx_id, buf) @@ -6895,6 +6951,7 @@ def write(value, buf): class PreActivityMetadata: + wallet_id: "str" payment_id: "str" tags: "typing.List[str]" payment_hash: "typing.Optional[str]" @@ -6905,7 +6962,8 @@ class PreActivityMetadata: is_transfer: "bool" channel_id: "typing.Optional[str]" created_at: "int" - def __init__(self, *, payment_id: "str", tags: "typing.List[str]", payment_hash: "typing.Optional[str]", tx_id: "typing.Optional[str]", address: "typing.Optional[str]", is_receive: "bool", fee_rate: "int", is_transfer: "bool", channel_id: "typing.Optional[str]", created_at: "int"): + def __init__(self, *, wallet_id: "str", payment_id: "str", tags: "typing.List[str]", payment_hash: "typing.Optional[str]", tx_id: "typing.Optional[str]", address: "typing.Optional[str]", is_receive: "bool", fee_rate: "int", is_transfer: "bool", channel_id: "typing.Optional[str]", created_at: "int"): + self.wallet_id = wallet_id self.payment_id = payment_id self.tags = tags self.payment_hash = payment_hash @@ -6918,9 +6976,11 @@ def __init__(self, *, payment_id: "str", tags: "typing.List[str]", payment_hash: self.created_at = created_at def __str__(self): - return "PreActivityMetadata(payment_id={}, tags={}, payment_hash={}, tx_id={}, address={}, is_receive={}, fee_rate={}, is_transfer={}, channel_id={}, created_at={})".format(self.payment_id, self.tags, self.payment_hash, self.tx_id, self.address, self.is_receive, self.fee_rate, self.is_transfer, self.channel_id, self.created_at) + return "PreActivityMetadata(wallet_id={}, payment_id={}, tags={}, payment_hash={}, tx_id={}, address={}, is_receive={}, fee_rate={}, is_transfer={}, channel_id={}, created_at={})".format(self.wallet_id, self.payment_id, self.tags, self.payment_hash, self.tx_id, self.address, self.is_receive, self.fee_rate, self.is_transfer, self.channel_id, self.created_at) def __eq__(self, other): + if self.wallet_id != other.wallet_id: + return False if self.payment_id != other.payment_id: return False if self.tags != other.tags: @@ -6947,6 +7007,7 @@ class _UniffiConverterTypePreActivityMetadata(_UniffiConverterRustBuffer): @staticmethod def read(buf): return PreActivityMetadata( + wallet_id=_UniffiConverterString.read(buf), payment_id=_UniffiConverterString.read(buf), tags=_UniffiConverterSequenceString.read(buf), payment_hash=_UniffiConverterOptionalString.read(buf), @@ -6961,6 +7022,7 @@ def read(buf): @staticmethod def check_lower(value): + _UniffiConverterString.check_lower(value.wallet_id) _UniffiConverterString.check_lower(value.payment_id) _UniffiConverterSequenceString.check_lower(value.tags) _UniffiConverterOptionalString.check_lower(value.payment_hash) @@ -6974,6 +7036,7 @@ def check_lower(value): @staticmethod def write(value, buf): + _UniffiConverterString.write(value.wallet_id, buf) _UniffiConverterString.write(value.payment_id, buf) _UniffiConverterSequenceString.write(value.tags, buf) _UniffiConverterOptionalString.write(value.payment_hash, buf) @@ -7752,6 +7815,7 @@ class TransactionDetails: Details about an onchain transaction. """ + wallet_id: "str" tx_id: "str" """ The transaction ID. @@ -7777,16 +7841,19 @@ class TransactionDetails: The transaction outputs with full details. """ - def __init__(self, *, tx_id: "str", amount_sats: "int", inputs: "typing.List[TxInput]", outputs: "typing.List[TxOutput]"): + def __init__(self, *, wallet_id: "str", tx_id: "str", amount_sats: "int", inputs: "typing.List[TxInput]", outputs: "typing.List[TxOutput]"): + self.wallet_id = wallet_id self.tx_id = tx_id self.amount_sats = amount_sats self.inputs = inputs self.outputs = outputs def __str__(self): - return "TransactionDetails(tx_id={}, amount_sats={}, inputs={}, outputs={})".format(self.tx_id, self.amount_sats, self.inputs, self.outputs) + return "TransactionDetails(wallet_id={}, tx_id={}, amount_sats={}, inputs={}, outputs={})".format(self.wallet_id, self.tx_id, self.amount_sats, self.inputs, self.outputs) def __eq__(self, other): + if self.wallet_id != other.wallet_id: + return False if self.tx_id != other.tx_id: return False if self.amount_sats != other.amount_sats: @@ -7801,6 +7868,7 @@ class _UniffiConverterTypeTransactionDetails(_UniffiConverterRustBuffer): @staticmethod def read(buf): return TransactionDetails( + wallet_id=_UniffiConverterString.read(buf), tx_id=_UniffiConverterString.read(buf), amount_sats=_UniffiConverterInt64.read(buf), inputs=_UniffiConverterSequenceTypeTxInput.read(buf), @@ -7809,6 +7877,7 @@ def read(buf): @staticmethod def check_lower(value): + _UniffiConverterString.check_lower(value.wallet_id) _UniffiConverterString.check_lower(value.tx_id) _UniffiConverterInt64.check_lower(value.amount_sats) _UniffiConverterSequenceTypeTxInput.check_lower(value.inputs) @@ -7816,6 +7885,7 @@ def check_lower(value): @staticmethod def write(value, buf): + _UniffiConverterString.write(value.wallet_id, buf) _UniffiConverterString.write(value.tx_id, buf) _UniffiConverterInt64.write(value.amount_sats, buf) _UniffiConverterSequenceTypeTxInput.write(value.inputs, buf) @@ -10280,25 +10350,25 @@ class AccountType(enum.Enum): BIP44 legacy (P2PKH) — xpub/tpub prefix """ - + WRAPPED_SEGWIT = 1 """ BIP49 wrapped segwit (P2SH-P2WPKH) — ypub/upub prefix """ - + NATIVE_SEGWIT = 2 """ BIP84 native segwit (P2WPKH) — zpub/vpub prefix """ - + TAPROOT = 3 """ BIP86 taproot (P2TR) """ - + class _UniffiConverterTypeAccountType(_UniffiConverterRustBuffer): @@ -10381,7 +10451,7 @@ def __eq__(self, other): if not other.is_LIGHTNING(): return False return self._values == other._values - + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -10393,7 +10463,7 @@ def is_LIGHTNING(self) -> bool: return isinstance(self, Activity.LIGHTNING) def is_lightning(self) -> bool: return isinstance(self, Activity.LIGHTNING) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -10615,11 +10685,11 @@ def write(value, buf): class ActivityFilter(enum.Enum): ALL = 0 - + LIGHTNING = 1 - + ONCHAIN = 2 - + class _UniffiConverterTypeActivityFilter(_UniffiConverterRustBuffer): @@ -10661,9 +10731,9 @@ def write(value, buf): class ActivityType(enum.Enum): ONCHAIN = 0 - + LIGHTNING = 1 - + class _UniffiConverterTypeActivityType(_UniffiConverterRustBuffer): @@ -10813,17 +10883,17 @@ def write(value, buf): class AddressType(enum.Enum): P2PKH = 0 - + P2SH = 1 - + P2WPKH = 2 - + P2WSH = 3 - + P2TR = 4 - + UNKNOWN = 5 - + class _UniffiConverterTypeAddressType(_UniffiConverterRustBuffer): @@ -10883,13 +10953,13 @@ def write(value, buf): class BitcoinNetworkEnum(enum.Enum): MAINNET = 0 - + TESTNET = 1 - + SIGNET = 2 - + REGTEST = 3 - + class _UniffiConverterTypeBitcoinNetworkEnum(_UniffiConverterRustBuffer): @@ -11342,13 +11412,13 @@ def write(value, buf): class BtBolt11InvoiceState(enum.Enum): PENDING = 0 - + HOLDING = 1 - + PAID = 2 - + CANCELED = 3 - + class _UniffiConverterTypeBtBolt11InvoiceState(_UniffiConverterRustBuffer): @@ -11396,15 +11466,15 @@ def write(value, buf): class BtChannelOrderErrorType(enum.Enum): WRONG_ORDER_STATE = 0 - + PEER_NOT_REACHABLE = 1 - + CHANNEL_REJECTED_BY_DESTINATION = 2 - + CHANNEL_REJECTED_BY_LSP = 3 - + BLOCKTANK_NOT_READY = 4 - + class _UniffiConverterTypeBtChannelOrderErrorType(_UniffiConverterRustBuffer): @@ -11458,11 +11528,11 @@ def write(value, buf): class BtOpenChannelState(enum.Enum): OPENING = 0 - + OPEN = 1 - + CLOSED = 2 - + class _UniffiConverterTypeBtOpenChannelState(_UniffiConverterRustBuffer): @@ -11504,13 +11574,13 @@ def write(value, buf): class BtOrderState(enum.Enum): CREATED = 0 - + EXPIRED = 1 - + OPEN = 2 - + CLOSED = 3 - + class _UniffiConverterTypeBtOrderState(_UniffiConverterRustBuffer): @@ -11558,13 +11628,13 @@ def write(value, buf): class BtOrderState2(enum.Enum): CREATED = 0 - + EXPIRED = 1 - + EXECUTED = 2 - + PAID = 3 - + class _UniffiConverterTypeBtOrderState2(_UniffiConverterRustBuffer): @@ -11612,15 +11682,15 @@ def write(value, buf): class BtPaymentState(enum.Enum): CREATED = 0 - + PARTIALLY_PAID = 1 - + PAID = 2 - + REFUNDED = 3 - + REFUND_AVAILABLE = 4 - + class _UniffiConverterTypeBtPaymentState(_UniffiConverterRustBuffer): @@ -11674,15 +11744,15 @@ def write(value, buf): class BtPaymentState2(enum.Enum): CREATED = 0 - + PAID = 1 - + REFUNDED = 2 - + REFUND_AVAILABLE = 3 - + CANCELED = 4 - + class _UniffiConverterTypeBtPaymentState2(_UniffiConverterRustBuffer): @@ -11736,13 +11806,13 @@ def write(value, buf): class CJitStateEnum(enum.Enum): CREATED = 0 - + COMPLETED = 1 - + EXPIRED = 2 - + FAILED = 3 - + class _UniffiConverterTypeCJitStateEnum(_UniffiConverterRustBuffer): @@ -11798,19 +11868,19 @@ class CoinSelection(enum.Enum): Branch-and-bound (default). Minimizes change by searching for exact matches. """ - + LARGEST_FIRST = 1 """ Selects largest UTXOs first. Useful for UTXO consolidation. """ - + OLDEST_FIRST = 2 """ Selects oldest UTXOs first. Maximizes coin-age spending. """ - + class _UniffiConverterTypeCoinSelection(_UniffiConverterRustBuffer): @@ -11882,7 +11952,7 @@ def __eq__(self, other): if self.amount_sats != other.amount_sats: return False return True - + class SEND_MAX: """ Send all remaining funds (after fees) to an address @@ -11902,7 +11972,7 @@ def __eq__(self, other): if self.address != other.address: return False return True - + class OP_RETURN: """ OP_RETURN data output (hex-encoded payload) @@ -11922,8 +11992,8 @@ def __eq__(self, other): if self.data_hex != other.data_hex: return False return True - - + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -11939,7 +12009,7 @@ def is_OP_RETURN(self) -> bool: return isinstance(self, ComposeOutput.OP_RETURN) def is_op_return(self) -> bool: return isinstance(self, ComposeOutput.OP_RETURN) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -12061,7 +12131,7 @@ def __eq__(self, other): if self.total_spent != other.total_spent: return False return True - + class ERROR: """ Composition failed (e.g. insufficient funds) @@ -12081,8 +12151,8 @@ def __eq__(self, other): if self.error != other.error: return False return True - - + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -12094,7 +12164,7 @@ def is_ERROR(self) -> bool: return isinstance(self, ComposeResult.ERROR) def is_error(self) -> bool: return isinstance(self, ComposeResult.ERROR) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -12615,13 +12685,13 @@ def write(value, buf): class ManualRefundStateEnum(enum.Enum): CREATED = 0 - + APPROVED = 1 - + REJECTED = 2 - + SENT = 3 - + class _UniffiConverterTypeManualRefundStateEnum(_UniffiConverterRustBuffer): @@ -12673,31 +12743,31 @@ class Network(enum.Enum): Mainnet Bitcoin. """ - + TESTNET = 1 """ Bitcoin's testnet network. """ - + TESTNET4 = 2 """ Bitcoin's testnet4 network. """ - + SIGNET = 3 """ Bitcoin's signet network. """ - + REGTEST = 4 """ Bitcoin's regtest network. """ - + class _UniffiConverterTypeNetwork(_UniffiConverterRustBuffer): @@ -12751,13 +12821,13 @@ def write(value, buf): class NetworkType(enum.Enum): BITCOIN = 0 - + TESTNET = 1 - + REGTEST = 2 - + SIGNET = 3 - + class _UniffiConverterTypeNetworkType(_UniffiConverterRustBuffer): @@ -12824,7 +12894,7 @@ def __eq__(self, other): if not other.is_CANCEL(): return False return True - + class STANDARD: """ Standard wallet — no passphrase, equivalent to `Some("")` on the device. @@ -12841,7 +12911,7 @@ def __eq__(self, other): if not other.is_STANDARD(): return False return True - + class HIDDEN: """ Hidden wallet — derived from the passphrase entered on the host. @@ -12861,7 +12931,7 @@ def __eq__(self, other): if self.value != other.value: return False return True - + class ON_DEVICE: """ Enter the passphrase on the Trezor device itself instead of on the host. @@ -12878,8 +12948,8 @@ def __eq__(self, other): if not other.is_ON_DEVICE(): return False return True - - + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -12899,7 +12969,7 @@ def is_ON_DEVICE(self) -> bool: return isinstance(self, PassphraseResponse.ON_DEVICE) def is_on_device(self) -> bool: return isinstance(self, PassphraseResponse.ON_DEVICE) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -12964,11 +13034,11 @@ def write(value, buf): class PaymentState(enum.Enum): PENDING = 0 - + SUCCEEDED = 1 - + FAILED = 2 - + class _UniffiConverterTypePaymentState(_UniffiConverterRustBuffer): @@ -13010,9 +13080,9 @@ def write(value, buf): class PaymentType(enum.Enum): SENT = 0 - + RECEIVED = 1 - + class _UniffiConverterTypePaymentType(_UniffiConverterRustBuffer): @@ -13052,9 +13122,9 @@ class PubkyAuthKind(enum.Enum): """ SIGNIN = 0 - + SIGNUP = 1 - + class _UniffiConverterTypePubkyAuthKind(_UniffiConverterRustBuffer): @@ -13306,7 +13376,7 @@ def __eq__(self, other): if self.invoice != other.invoice: return False return True - + class LIGHTNING: invoice: "LightningInvoice" @@ -13322,7 +13392,7 @@ def __eq__(self, other): if self.invoice != other.invoice: return False return True - + class PUBKY_AUTH: data: "str" @@ -13338,7 +13408,7 @@ def __eq__(self, other): if self.data != other.data: return False return True - + class LNURL_CHANNEL: data: "LnurlChannelData" @@ -13354,7 +13424,7 @@ def __eq__(self, other): if self.data != other.data: return False return True - + class LNURL_AUTH: data: "LnurlAuthData" @@ -13370,7 +13440,7 @@ def __eq__(self, other): if self.data != other.data: return False return True - + class LNURL_WITHDRAW: data: "LnurlWithdrawData" @@ -13386,7 +13456,7 @@ def __eq__(self, other): if self.data != other.data: return False return True - + class LNURL_ADDRESS: data: "LnurlAddressData" @@ -13402,7 +13472,7 @@ def __eq__(self, other): if self.data != other.data: return False return True - + class LNURL_PAY: data: "LnurlPayData" @@ -13418,7 +13488,7 @@ def __eq__(self, other): if self.data != other.data: return False return True - + class NODE_ID: url: "str" network: "NetworkType" @@ -13438,7 +13508,7 @@ def __eq__(self, other): if self.network != other.network: return False return True - + class GIFT: code: "str" amount: "int" @@ -13458,8 +13528,8 @@ def __eq__(self, other): if self.amount != other.amount: return False return True - - + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -13503,7 +13573,7 @@ def is_GIFT(self) -> bool: return isinstance(self, Scanner.GIFT) def is_gift(self) -> bool: return isinstance(self, Scanner.GIFT) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -13649,9 +13719,9 @@ def write(value, buf): class SortDirection(enum.Enum): ASC = 0 - + DESC = 1 - + class _UniffiConverterTypeSortDirection(_UniffiConverterRustBuffer): @@ -13778,25 +13848,25 @@ class TrezorCoinType(enum.Enum): Bitcoin mainnet """ - + TESTNET = 1 """ Bitcoin testnet """ - + SIGNET = 2 """ Bitcoin signet (treated as testnet by the device) """ - + REGTEST = 3 """ Bitcoin regtest """ - + class _UniffiConverterTypeTrezorCoinType(_UniffiConverterRustBuffer): @@ -14298,37 +14368,37 @@ class TrezorScriptType(enum.Enum): P2PKH (legacy) """ - + SPEND_P2SH_WITNESS = 1 """ P2SH-P2WPKH (nested SegWit) """ - + SPEND_WITNESS = 2 """ P2WPKH (native SegWit) """ - + SPEND_TAPROOT = 3 """ P2TR (Taproot) """ - + SPEND_MULTISIG = 4 """ P2SH multisig """ - + EXTERNAL = 5 """ External/watch-only input (not signed by device) """ - + class _UniffiConverterTypeTrezorScriptType(_UniffiConverterRustBuffer): @@ -14396,13 +14466,13 @@ class TrezorTransportType(enum.Enum): USB connection """ - + BLUETOOTH = 1 """ Bluetooth connection """ - + class _UniffiConverterTypeTrezorTransportType(_UniffiConverterRustBuffer): @@ -14446,19 +14516,19 @@ class TxDirection(enum.Enum): Wallet sent funds to an external address """ - + RECEIVED = 1 """ Wallet received funds from an external source """ - + SELF_TRANSFER = 2 """ Wallet sent funds to itself (e.g. consolidation, change-only) """ - + class _UniffiConverterTypeTxDirection(_UniffiConverterRustBuffer): @@ -14529,7 +14599,7 @@ def __eq__(self, other): if not other.is_STANDARD(): return False return True - + class HIDDEN: """ A hidden wallet whose passphrase is entered on the host. @@ -14549,7 +14619,7 @@ def __eq__(self, other): if self.passphrase != other.passphrase: return False return True - + class ON_DEVICE: """ A hidden wallet whose passphrase is entered on the Trezor itself. @@ -14566,8 +14636,8 @@ def __eq__(self, other): if not other.is_ON_DEVICE(): return False return True - - + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -14583,7 +14653,7 @@ def is_ON_DEVICE(self) -> bool: return isinstance(self, WalletSelection.ON_DEVICE) def is_on_device(self) -> bool: return isinstance(self, WalletSelection.ON_DEVICE) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -14682,7 +14752,7 @@ def __eq__(self, other): if self.account_type != other.account_type: return False return True - + class ERROR: """ An error occurred in the watcher loop. @@ -14702,7 +14772,7 @@ def __eq__(self, other): if self.message != other.message: return False return True - + class DISCONNECTED: """ Connection to the Electrum server was lost. @@ -14722,7 +14792,7 @@ def __eq__(self, other): if self.message != other.message: return False return True - + class RECONNECTED: """ Connection to the Electrum server was restored. @@ -14739,8 +14809,8 @@ def __eq__(self, other): if not other.is_RECONNECTED(): return False return True - - + + # For each variant, we have `is_NAME` and `is_name` methods for easily checking # whether an instance is that variant. @@ -14760,7 +14830,7 @@ def is_RECONNECTED(self) -> bool: return isinstance(self, WatcherEvent.RECONNECTED) def is_reconnected(self) -> bool: return isinstance(self, WatcherEvent.RECONNECTED) - + # Now, a little trick - we make each nested variant class be a subclass of the main # enum class, so that method calls and instance checks etc will work intuitively. @@ -14847,31 +14917,31 @@ class WordCount(enum.Enum): 12-word mnemonic (128 bits of entropy) """ - + WORDS15 = 15 """ 15-word mnemonic (160 bits of entropy) """ - + WORDS18 = 18 """ 18-word mnemonic (192 bits of entropy) """ - + WORDS21 = 21 """ 21-word mnemonic (224 bits of entropy) """ - + WORDS24 = 24 """ 24-word mnemonic (256 bits of entropy) """ - + class _UniffiConverterTypeWordCount(_UniffiConverterRustBuffer): @@ -17071,7 +17141,7 @@ class EventListenerImpl(): """ _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -17103,9 +17173,9 @@ def on_event(self, watcher_id: "str",event: "WatcherEvent") -> None: """ _UniffiConverterString.check_lower(watcher_id) - + _UniffiConverterTypeWatcherEvent.check_lower(event) - + _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_eventlistener_on_event,self._uniffi_clone_pointer(), _UniffiConverterString.lower(watcher_id), _UniffiConverterTypeWatcherEvent.lower(event)) @@ -17133,7 +17203,7 @@ def make_call(): method = uniffi_obj.on_event return method(*args) - + write_return_value = lambda v: None _uniffi_trait_interface_call( uniffi_call_status_ptr.contents, @@ -17482,7 +17552,7 @@ class TrezorTransportCallbackImpl(): """ _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -17524,7 +17594,7 @@ def open_device(self, path: "str") -> "TrezorTransportWriteResult": """ _UniffiConverterString.check_lower(path) - + return _UniffiConverterTypeTrezorTransportWriteResult.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_open_device,self._uniffi_clone_pointer(), _UniffiConverterString.lower(path)) @@ -17540,7 +17610,7 @@ def close_device(self, path: "str") -> "TrezorTransportWriteResult": """ _UniffiConverterString.check_lower(path) - + return _UniffiConverterTypeTrezorTransportWriteResult.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_close_device,self._uniffi_clone_pointer(), _UniffiConverterString.lower(path)) @@ -17556,7 +17626,7 @@ def read_chunk(self, path: "str") -> "TrezorTransportReadResult": """ _UniffiConverterString.check_lower(path) - + return _UniffiConverterTypeTrezorTransportReadResult.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_read_chunk,self._uniffi_clone_pointer(), _UniffiConverterString.lower(path)) @@ -17572,9 +17642,9 @@ def write_chunk(self, path: "str",data: "bytes") -> "TrezorTransportWriteResult" """ _UniffiConverterString.check_lower(path) - + _UniffiConverterBytes.check_lower(data) - + return _UniffiConverterTypeTrezorTransportWriteResult.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_write_chunk,self._uniffi_clone_pointer(), _UniffiConverterString.lower(path), @@ -17591,7 +17661,7 @@ def get_chunk_size(self, path: "str") -> "int": """ _UniffiConverterString.check_lower(path) - + return _UniffiConverterUInt32.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_get_chunk_size,self._uniffi_clone_pointer(), _UniffiConverterString.lower(path)) @@ -17619,11 +17689,11 @@ def call_message(self, path: "str",message_type: "int",data: "bytes") -> "typing """ _UniffiConverterString.check_lower(path) - + _UniffiConverterUInt16.check_lower(message_type) - + _UniffiConverterBytes.check_lower(data) - + return _UniffiConverterOptionalTypeTrezorCallMessageResult.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_call_message,self._uniffi_clone_pointer(), _UniffiConverterString.lower(path), @@ -17671,9 +17741,9 @@ def save_thp_credential(self, device_id: "str",credential_json: "str") -> "bool" """ _UniffiConverterString.check_lower(device_id) - + _UniffiConverterString.check_lower(credential_json) - + return _UniffiConverterBool.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_save_thp_credential,self._uniffi_clone_pointer(), _UniffiConverterString.lower(device_id), @@ -17698,7 +17768,7 @@ def load_thp_credential(self, device_id: "str") -> "typing.Optional[str]": """ _UniffiConverterString.check_lower(device_id) - + return _UniffiConverterOptionalString.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_load_thp_credential,self._uniffi_clone_pointer(), _UniffiConverterString.lower(device_id)) @@ -17722,9 +17792,9 @@ def log_debug(self, tag: "str",message: "str") -> None: """ _UniffiConverterString.check_lower(tag) - + _UniffiConverterString.check_lower(message) - + _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezortransportcallback_log_debug,self._uniffi_clone_pointer(), _UniffiConverterString.lower(tag), _UniffiConverterString.lower(message)) @@ -17750,7 +17820,7 @@ def make_call(): method = uniffi_obj.enumerate_devices return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterSequenceTypeNativeDeviceInfo.lower(v) _uniffi_trait_interface_call( @@ -17772,7 +17842,7 @@ def make_call(): method = uniffi_obj.open_device return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterTypeTrezorTransportWriteResult.lower(v) _uniffi_trait_interface_call( @@ -17794,7 +17864,7 @@ def make_call(): method = uniffi_obj.close_device return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterTypeTrezorTransportWriteResult.lower(v) _uniffi_trait_interface_call( @@ -17816,7 +17886,7 @@ def make_call(): method = uniffi_obj.read_chunk return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterTypeTrezorTransportReadResult.lower(v) _uniffi_trait_interface_call( @@ -17839,7 +17909,7 @@ def make_call(): method = uniffi_obj.write_chunk return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterTypeTrezorTransportWriteResult.lower(v) _uniffi_trait_interface_call( @@ -17861,7 +17931,7 @@ def make_call(): method = uniffi_obj.get_chunk_size return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterUInt32.lower(v) _uniffi_trait_interface_call( @@ -17885,7 +17955,7 @@ def make_call(): method = uniffi_obj.call_message return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterOptionalTypeTrezorCallMessageResult.lower(v) _uniffi_trait_interface_call( @@ -17906,7 +17976,7 @@ def make_call(): method = uniffi_obj.get_pairing_code return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterString.lower(v) _uniffi_trait_interface_call( @@ -17929,7 +17999,7 @@ def make_call(): method = uniffi_obj.save_thp_credential return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterBool.lower(v) _uniffi_trait_interface_call( @@ -17951,7 +18021,7 @@ def make_call(): method = uniffi_obj.load_thp_credential return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterOptionalString.lower(v) _uniffi_trait_interface_call( @@ -17974,7 +18044,7 @@ def make_call(): method = uniffi_obj.log_debug return method(*args) - + write_return_value = lambda v: None _uniffi_trait_interface_call( uniffi_call_status_ptr.contents, @@ -18107,7 +18177,7 @@ class TrezorUiCallbackImpl(): """ _pointer: ctypes.c_void_p - + def __init__(self, *args, **kwargs): raise ValueError("This class has no default constructor") @@ -18159,7 +18229,7 @@ def on_passphrase_request(self, on_device: "bool") -> "PassphraseResponse": """ _UniffiConverterBool.check_lower(on_device) - + return _UniffiConverterTypePassphraseResponse.lift( _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_method_trezoruicallback_on_passphrase_request,self._uniffi_clone_pointer(), _UniffiConverterBool.lower(on_device)) @@ -18185,7 +18255,7 @@ def make_call(): method = uniffi_obj.on_pin_request return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterString.lower(v) _uniffi_trait_interface_call( @@ -18207,7 +18277,7 @@ def make_call(): method = uniffi_obj.on_passphrase_request return method(*args) - + def write_return_value(v): uniffi_out_return[0] = _UniffiConverterTypePassphraseResponse.lower(v) _uniffi_trait_interface_call( @@ -18328,36 +18398,42 @@ def activity_wipe_all() -> None: def add_pre_activity_metadata(pre_activity_metadata: "PreActivityMetadata") -> None: _UniffiConverterTypePreActivityMetadata.check_lower(pre_activity_metadata) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_add_pre_activity_metadata, _UniffiConverterTypePreActivityMetadata.lower(pre_activity_metadata)) -def add_pre_activity_metadata_tags(payment_id: "str",tags: "typing.List[str]") -> None: +def add_pre_activity_metadata_tags(wallet_id: "str",payment_id: "str",tags: "typing.List[str]") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(payment_id) - + _UniffiConverterSequenceString.check_lower(tags) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_add_pre_activity_metadata_tags, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(payment_id), _UniffiConverterSequenceString.lower(tags)) -def add_tags(activity_id: "str",tags: "typing.List[str]") -> None: +def add_tags(wallet_id: "str",activity_id: "str",tags: "typing.List[str]") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(activity_id) - + _UniffiConverterSequenceString.check_lower(tags) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_add_tags, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(activity_id), _UniffiConverterSequenceString.lower(tags)) async def approve_pubky_auth(auth_url: "str",secret_key_hex: "str") -> None: _UniffiConverterString.check_lower(auth_url) - + _UniffiConverterString.check_lower(secret_key_hex) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_approve_pubky_auth( _UniffiConverterString.lower(auth_url), @@ -18367,8 +18443,8 @@ async def approve_pubky_auth(auth_url: "str",secret_key_hex: "str") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18382,8 +18458,8 @@ async def blocktank_remove_all_cjit_entries() -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18397,8 +18473,8 @@ async def blocktank_remove_all_orders() -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18412,8 +18488,8 @@ async def blocktank_wipe_all() -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18421,15 +18497,15 @@ async def blocktank_wipe_all() -> None: async def broadcast_sweep_transaction(psbt: "str",mnemonic_phrase: "str",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]",electrum_url: "str") -> "SweepResult": _UniffiConverterString.check_lower(psbt) - + _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + _UniffiConverterString.check_lower(electrum_url) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_broadcast_sweep_transaction( _UniffiConverterString.lower(psbt), @@ -18442,7 +18518,7 @@ async def broadcast_sweep_transaction(psbt: "str",mnemonic_phrase: "str",network _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeSweepResult.lift, - + # Error FFI converter _UniffiConverterTypeSweepError, @@ -18450,7 +18526,7 @@ async def broadcast_sweep_transaction(psbt: "str",mnemonic_phrase: "str",network def calculate_channel_liquidity_options(params: "ChannelLiquidityParams") -> "ChannelLiquidityOptions": _UniffiConverterTypeChannelLiquidityParams.check_lower(params) - + return _UniffiConverterTypeChannelLiquidityOptions.lift(_uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_calculate_channel_liquidity_options, _UniffiConverterTypeChannelLiquidityParams.lower(params))) @@ -18463,8 +18539,8 @@ async def cancel_pubky_auth() -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18472,13 +18548,13 @@ async def cancel_pubky_auth() -> None: async def check_sweepable_balances(mnemonic_phrase: "str",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]",electrum_url: "str") -> "SweepableBalances": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + _UniffiConverterString.check_lower(electrum_url) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_check_sweepable_balances( _UniffiConverterString.lower(mnemonic_phrase), @@ -18490,7 +18566,7 @@ async def check_sweepable_balances(mnemonic_phrase: "str",network: "typing.Optio _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeSweepableBalances.lift, - + # Error FFI converter _UniffiConverterTypeSweepError, @@ -18504,7 +18580,7 @@ async def complete_pubky_auth() -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18512,15 +18588,15 @@ async def complete_pubky_auth() -> "str": def create_channel_request_url(k1: "str",callback: "str",local_node_id: "str",is_private: "bool",cancel: "bool") -> "str": _UniffiConverterString.check_lower(k1) - + _UniffiConverterString.check_lower(callback) - + _UniffiConverterString.check_lower(local_node_id) - + _UniffiConverterBool.check_lower(is_private) - + _UniffiConverterBool.check_lower(cancel) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeLnurlError,_UniffiLib.uniffi_bitkitcore_fn_func_create_channel_request_url, _UniffiConverterString.lower(k1), _UniffiConverterString.lower(callback), @@ -18531,17 +18607,17 @@ def create_channel_request_url(k1: "str",callback: "str",local_node_id: "str",is async def create_cjit_entry(channel_size_sat: "int",invoice_sat: "int",invoice_description: "str",node_id: "str",channel_expiry_weeks: "int",options: "typing.Optional[CreateCjitOptions]") -> "IcJitEntry": _UniffiConverterUInt64.check_lower(channel_size_sat) - + _UniffiConverterUInt64.check_lower(invoice_sat) - + _UniffiConverterString.check_lower(invoice_description) - + _UniffiConverterString.check_lower(node_id) - + _UniffiConverterUInt32.check_lower(channel_expiry_weeks) - + _UniffiConverterOptionalTypeCreateCjitOptions.check_lower(options) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_create_cjit_entry( _UniffiConverterUInt64.lower(channel_size_sat), @@ -18555,7 +18631,7 @@ async def create_cjit_entry(channel_size_sat: "int",invoice_sat: "int",invoice_d _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIcJitEntry.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18563,11 +18639,11 @@ async def create_cjit_entry(channel_size_sat: "int",invoice_sat: "int",invoice_d async def create_order(lsp_balance_sat: "int",channel_expiry_weeks: "int",options: "typing.Optional[CreateOrderOptions]") -> "IBtOrder": _UniffiConverterUInt64.check_lower(lsp_balance_sat) - + _UniffiConverterUInt32.check_lower(channel_expiry_weeks) - + _UniffiConverterOptionalTypeCreateOrderOptions.check_lower(options) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_create_order( _UniffiConverterUInt64.lower(lsp_balance_sat), @@ -18578,7 +18654,7 @@ async def create_order(lsp_balance_sat: "int",channel_expiry_weeks: "int",option _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBtOrder.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18586,11 +18662,11 @@ async def create_order(lsp_balance_sat: "int",channel_expiry_weeks: "int",option def create_withdraw_callback_url(k1: "str",callback: "str",payment_request: "str") -> "str": _UniffiConverterString.check_lower(k1) - + _UniffiConverterString.check_lower(callback) - + _UniffiConverterString.check_lower(payment_request) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeLnurlError,_UniffiLib.uniffi_bitkitcore_fn_func_create_withdraw_callback_url, _UniffiConverterString.lower(k1), _UniffiConverterString.lower(callback), @@ -18599,7 +18675,7 @@ def create_withdraw_callback_url(k1: "str",callback: "str",payment_request: "str async def decode(invoice: "str") -> "Scanner": _UniffiConverterString.check_lower(invoice) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_decode( _UniffiConverterString.lower(invoice)), @@ -18608,42 +18684,58 @@ async def decode(invoice: "str") -> "Scanner": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeScanner.lift, - + # Error FFI converter _UniffiConverterTypeDecodingError, ) -def delete_activity_by_id(activity_id: "str") -> "bool": - _UniffiConverterString.check_lower(activity_id) - +def delete_activities_by_wallet_id(wallet_id: "str") -> "int": + _UniffiConverterString.check_lower(wallet_id) + + return _UniffiConverterUInt32.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_delete_activities_by_wallet_id, + _UniffiConverterString.lower(wallet_id))) + + +def delete_activity_by_id(wallet_id: "str",activity_id: "str") -> "bool": + _UniffiConverterString.check_lower(wallet_id) + + _UniffiConverterString.check_lower(activity_id) + return _UniffiConverterBool.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_delete_activity_by_id, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(activity_id))) -def delete_pre_activity_metadata(payment_id: "str") -> None: +def delete_pre_activity_metadata(wallet_id: "str",payment_id: "str") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(payment_id) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_delete_pre_activity_metadata, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(payment_id)) -def delete_transaction_details(tx_id: "str") -> "bool": +def delete_transaction_details(wallet_id: "str",tx_id: "str") -> "bool": + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(tx_id) - + return _UniffiConverterBool.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_delete_transaction_details, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(tx_id))) def derive_bitcoin_address(mnemonic_phrase: "str",derivation_path_str: "typing.Optional[str]",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]") -> "GetAddressResponse": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalString.check_lower(derivation_path_str) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + return _UniffiConverterTypeGetAddressResponse.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_derive_bitcoin_address, _UniffiConverterString.lower(mnemonic_phrase), _UniffiConverterOptionalString.lower(derivation_path_str), @@ -18653,19 +18745,19 @@ def derive_bitcoin_address(mnemonic_phrase: "str",derivation_path_str: "typing.O def derive_bitcoin_addresses(mnemonic_phrase: "str",derivation_path_str: "typing.Optional[str]",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]",is_change: "typing.Optional[bool]",start_index: "typing.Optional[int]",count: "typing.Optional[int]") -> "GetAddressesResponse": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalString.check_lower(derivation_path_str) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + _UniffiConverterOptionalBool.check_lower(is_change) - + _UniffiConverterOptionalUInt32.check_lower(start_index) - + _UniffiConverterOptionalUInt32.check_lower(count) - + return _UniffiConverterTypeGetAddressesResponse.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_derive_bitcoin_addresses, _UniffiConverterString.lower(mnemonic_phrase), _UniffiConverterOptionalString.lower(derivation_path_str), @@ -18678,15 +18770,15 @@ def derive_bitcoin_addresses(mnemonic_phrase: "str",derivation_path_str: "typing def derive_onchain_descriptor(mnemonic_phrase: "str",network: "Network",bip39_passphrase: "typing.Optional[str]",account_type: "AccountType",account_index: "int") -> "str": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + _UniffiConverterTypeAccountType.check_lower(account_type) - + _UniffiConverterUInt32.check_lower(account_index) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_derive_onchain_descriptor, _UniffiConverterString.lower(mnemonic_phrase), _UniffiConverterTypeNetwork.lower(network), @@ -18697,13 +18789,13 @@ def derive_onchain_descriptor(mnemonic_phrase: "str",network: "Network",bip39_pa def derive_private_key(mnemonic_phrase: "str",derivation_path_str: "typing.Optional[str]",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]") -> "str": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalString.check_lower(derivation_path_str) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_derive_private_key, _UniffiConverterString.lower(mnemonic_phrase), _UniffiConverterOptionalString.lower(derivation_path_str), @@ -18713,25 +18805,25 @@ def derive_private_key(mnemonic_phrase: "str",derivation_path_str: "typing.Optio def derive_pubky_secret_key(seed: "bytes") -> "str": _UniffiConverterBytes.check_lower(seed) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypePubkyError,_UniffiLib.uniffi_bitkitcore_fn_func_derive_pubky_secret_key, _UniffiConverterBytes.lower(seed))) def entropy_to_mnemonic(entropy: "bytes") -> "str": _UniffiConverterBytes.check_lower(entropy) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_entropy_to_mnemonic, _UniffiConverterBytes.lower(entropy))) async def estimate_order_fee(lsp_balance_sat: "int",channel_expiry_weeks: "int",options: "typing.Optional[CreateOrderOptions]") -> "IBtEstimateFeeResponse": _UniffiConverterUInt64.check_lower(lsp_balance_sat) - + _UniffiConverterUInt32.check_lower(channel_expiry_weeks) - + _UniffiConverterOptionalTypeCreateOrderOptions.check_lower(options) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_estimate_order_fee( _UniffiConverterUInt64.lower(lsp_balance_sat), @@ -18742,7 +18834,7 @@ async def estimate_order_fee(lsp_balance_sat: "int",channel_expiry_weeks: "int", _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBtEstimateFeeResponse.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18750,11 +18842,11 @@ async def estimate_order_fee(lsp_balance_sat: "int",channel_expiry_weeks: "int", async def estimate_order_fee_full(lsp_balance_sat: "int",channel_expiry_weeks: "int",options: "typing.Optional[CreateOrderOptions]") -> "IBtEstimateFeeResponse2": _UniffiConverterUInt64.check_lower(lsp_balance_sat) - + _UniffiConverterUInt32.check_lower(channel_expiry_weeks) - + _UniffiConverterOptionalTypeCreateOrderOptions.check_lower(options) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_estimate_order_fee_full( _UniffiConverterUInt64.lower(lsp_balance_sat), @@ -18765,7 +18857,7 @@ async def estimate_order_fee_full(lsp_balance_sat: "int",channel_expiry_weeks: " _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBtEstimateFeeResponse2.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18773,7 +18865,7 @@ async def estimate_order_fee_full(lsp_balance_sat: "int",channel_expiry_weeks: " async def fetch_pubky_contacts(public_key: "str") -> "typing.List[str]": _UniffiConverterString.check_lower(public_key) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_fetch_pubky_contacts( _UniffiConverterString.lower(public_key)), @@ -18782,7 +18874,7 @@ async def fetch_pubky_contacts(public_key: "str") -> "typing.List[str]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18790,7 +18882,7 @@ async def fetch_pubky_contacts(public_key: "str") -> "typing.List[str]": async def fetch_pubky_file(uri: "str") -> "bytes": _UniffiConverterString.check_lower(uri) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_fetch_pubky_file( _UniffiConverterString.lower(uri)), @@ -18799,7 +18891,7 @@ async def fetch_pubky_file(uri: "str") -> "bytes": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterBytes.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18807,7 +18899,7 @@ async def fetch_pubky_file(uri: "str") -> "bytes": async def fetch_pubky_file_string(uri: "str") -> "str": _UniffiConverterString.check_lower(uri) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_fetch_pubky_file_string( _UniffiConverterString.lower(uri)), @@ -18816,7 +18908,7 @@ async def fetch_pubky_file_string(uri: "str") -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18824,7 +18916,7 @@ async def fetch_pubky_file_string(uri: "str") -> "str": async def fetch_pubky_profile(public_key: "str") -> "PubkyProfile": _UniffiConverterString.check_lower(public_key) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_fetch_pubky_profile( _UniffiConverterString.lower(public_key)), @@ -18833,7 +18925,7 @@ async def fetch_pubky_profile(public_key: "str") -> "PubkyProfile": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypePubkyProfile.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -18841,29 +18933,32 @@ async def fetch_pubky_profile(public_key: "str") -> "PubkyProfile": def generate_mnemonic(word_count: "typing.Optional[WordCount]") -> "str": _UniffiConverterOptionalTypeWordCount.check_lower(word_count) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_generate_mnemonic, _UniffiConverterOptionalTypeWordCount.lower(word_count))) -def get_activities(filter: "typing.Optional[ActivityFilter]",tx_type: "typing.Optional[PaymentType]",tags: "typing.Optional[typing.List[str]]",search: "typing.Optional[str]",min_date: "typing.Optional[int]",max_date: "typing.Optional[int]",limit: "typing.Optional[int]",sort_direction: "typing.Optional[SortDirection]") -> "typing.List[Activity]": +def get_activities(wallet_id: "typing.Optional[str]",filter: "typing.Optional[ActivityFilter]",tx_type: "typing.Optional[PaymentType]",tags: "typing.Optional[typing.List[str]]",search: "typing.Optional[str]",min_date: "typing.Optional[int]",max_date: "typing.Optional[int]",limit: "typing.Optional[int]",sort_direction: "typing.Optional[SortDirection]") -> "typing.List[Activity]": + _UniffiConverterOptionalString.check_lower(wallet_id) + _UniffiConverterOptionalTypeActivityFilter.check_lower(filter) - + _UniffiConverterOptionalTypePaymentType.check_lower(tx_type) - + _UniffiConverterOptionalSequenceString.check_lower(tags) - + _UniffiConverterOptionalString.check_lower(search) - + _UniffiConverterOptionalUInt64.check_lower(min_date) - + _UniffiConverterOptionalUInt64.check_lower(max_date) - + _UniffiConverterOptionalUInt32.check_lower(limit) - + _UniffiConverterOptionalTypeSortDirection.check_lower(sort_direction) - + return _UniffiConverterSequenceTypeActivity.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_activities, + _UniffiConverterOptionalString.lower(wallet_id), _UniffiConverterOptionalTypeActivityFilter.lower(filter), _UniffiConverterOptionalTypePaymentType.lower(tx_type), _UniffiConverterOptionalSequenceString.lower(tags), @@ -18874,30 +18969,39 @@ def get_activities(filter: "typing.Optional[ActivityFilter]",tx_type: "typing.Op _UniffiConverterOptionalTypeSortDirection.lower(sort_direction))) -def get_activities_by_tag(tag: "str",limit: "typing.Optional[int]",sort_direction: "typing.Optional[SortDirection]") -> "typing.List[Activity]": +def get_activities_by_tag(wallet_id: "typing.Optional[str]",tag: "str",limit: "typing.Optional[int]",sort_direction: "typing.Optional[SortDirection]") -> "typing.List[Activity]": + _UniffiConverterOptionalString.check_lower(wallet_id) + _UniffiConverterString.check_lower(tag) - + _UniffiConverterOptionalUInt32.check_lower(limit) - + _UniffiConverterOptionalTypeSortDirection.check_lower(sort_direction) - + return _UniffiConverterSequenceTypeActivity.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_activities_by_tag, + _UniffiConverterOptionalString.lower(wallet_id), _UniffiConverterString.lower(tag), _UniffiConverterOptionalUInt32.lower(limit), _UniffiConverterOptionalTypeSortDirection.lower(sort_direction))) -def get_activity_by_id(activity_id: "str") -> "typing.Optional[Activity]": +def get_activity_by_id(wallet_id: "str",activity_id: "str") -> "typing.Optional[Activity]": + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(activity_id) - + return _UniffiConverterOptionalTypeActivity.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_id, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(activity_id))) -def get_activity_by_tx_id(tx_id: "str") -> "typing.Optional[OnchainActivity]": +def get_activity_by_tx_id(wallet_id: "str",tx_id: "str") -> "typing.Optional[OnchainActivity]": + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(tx_id) - + return _UniffiConverterOptionalTypeOnchainActivity.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_activity_by_tx_id, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(tx_id))) @@ -18907,7 +19011,7 @@ def get_all_activities_tags() -> "typing.List[ActivityTags]": def get_all_closed_channels(sort_direction: "typing.Optional[SortDirection]") -> "typing.List[ClosedChannelDetails]": _UniffiConverterOptionalTypeSortDirection.check_lower(sort_direction) - + return _UniffiConverterSequenceTypeClosedChannelDetails.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_all_closed_channels, _UniffiConverterOptionalTypeSortDirection.lower(sort_direction))) @@ -18926,9 +19030,9 @@ def get_all_unique_tags() -> "typing.List[str]": def get_bip39_suggestions(partial_word: "str",limit: "int") -> "typing.List[str]": _UniffiConverterString.check_lower(partial_word) - + _UniffiConverterUInt32.check_lower(limit) - + return _UniffiConverterSequenceString.lift(_uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_get_bip39_suggestions, _UniffiConverterString.lower(partial_word), _UniffiConverterUInt32.lower(limit))) @@ -18940,11 +19044,11 @@ def get_bip39_wordlist() -> "typing.List[str]": async def get_cjit_entries(entry_ids: "typing.Optional[typing.List[str]]",filter: "typing.Optional[CJitStateEnum]",refresh: "bool") -> "typing.List[IcJitEntry]": _UniffiConverterOptionalSequenceString.check_lower(entry_ids) - + _UniffiConverterOptionalTypeCJitStateEnum.check_lower(filter) - + _UniffiConverterBool.check_lower(refresh) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_cjit_entries( _UniffiConverterOptionalSequenceString.lower(entry_ids), @@ -18955,7 +19059,7 @@ async def get_cjit_entries(entry_ids: "typing.Optional[typing.List[str]]",filter _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeIcJitEntry.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18963,21 +19067,25 @@ async def get_cjit_entries(entry_ids: "typing.Optional[typing.List[str]]",filter def get_closed_channel_by_id(channel_id: "str") -> "typing.Optional[ClosedChannelDetails]": _UniffiConverterString.check_lower(channel_id) - + return _UniffiConverterOptionalTypeClosedChannelDetails.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_closed_channel_by_id, _UniffiConverterString.lower(channel_id))) def get_default_lsp_balance(params: "DefaultLspBalanceParams") -> "int": _UniffiConverterTypeDefaultLspBalanceParams.check_lower(params) - + return _UniffiConverterUInt64.lift(_uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_get_default_lsp_balance, _UniffiConverterTypeDefaultLspBalanceParams.lower(params))) + +def get_default_wallet_id() -> "str": + return _UniffiConverterString.lift(_uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_get_default_wallet_id,)) + async def get_gift(gift_id: "str") -> "IGift": _UniffiConverterString.check_lower(gift_id) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_gift( _UniffiConverterString.lower(gift_id)), @@ -18986,7 +19094,7 @@ async def get_gift(gift_id: "str") -> "IGift": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIGift.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -18994,7 +19102,7 @@ async def get_gift(gift_id: "str") -> "IGift": async def get_info(refresh: "typing.Optional[bool]") -> "typing.Optional[IBtInfo]": _UniffiConverterOptionalBool.check_lower(refresh) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_info( _UniffiConverterOptionalBool.lower(refresh)), @@ -19003,7 +19111,7 @@ async def get_info(refresh: "typing.Optional[bool]") -> "typing.Optional[IBtInfo _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterOptionalTypeIBtInfo.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19011,9 +19119,9 @@ async def get_info(refresh: "typing.Optional[bool]") -> "typing.Optional[IBtInfo async def get_lnurl_invoice(address: "str",amount_satoshis: "int") -> "str": _UniffiConverterString.check_lower(address) - + _UniffiConverterUInt64.check_lower(amount_satoshis) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_lnurl_invoice( _UniffiConverterString.lower(address), @@ -19023,7 +19131,7 @@ async def get_lnurl_invoice(address: "str",amount_satoshis: "int") -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeLnurlError, @@ -19031,7 +19139,7 @@ async def get_lnurl_invoice(address: "str",amount_satoshis: "int") -> "str": async def get_min_zero_conf_tx_fee(order_id: "str") -> "IBt0ConfMinTxFeeWindow": _UniffiConverterString.check_lower(order_id) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_min_zero_conf_tx_fee( _UniffiConverterString.lower(order_id)), @@ -19040,7 +19148,7 @@ async def get_min_zero_conf_tx_fee(order_id: "str") -> "IBt0ConfMinTxFeeWindow": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBt0ConfMinTxFeeWindow.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19048,11 +19156,11 @@ async def get_min_zero_conf_tx_fee(order_id: "str") -> "IBt0ConfMinTxFeeWindow": async def get_orders(order_ids: "typing.Optional[typing.List[str]]",filter: "typing.Optional[BtOrderState2]",refresh: "bool") -> "typing.List[IBtOrder]": _UniffiConverterOptionalSequenceString.check_lower(order_ids) - + _UniffiConverterOptionalTypeBtOrderState2.check_lower(filter) - + _UniffiConverterBool.check_lower(refresh) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_orders( _UniffiConverterOptionalSequenceString.lower(order_ids), @@ -19063,7 +19171,7 @@ async def get_orders(order_ids: "typing.Optional[typing.List[str]]",filter: "typ _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeIBtOrder.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19071,7 +19179,7 @@ async def get_orders(order_ids: "typing.Optional[typing.List[str]]",filter: "typ async def get_payment(payment_id: "str") -> "IBtBolt11Invoice": _UniffiConverterString.check_lower(payment_id) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_get_payment( _UniffiConverterString.lower(payment_id)), @@ -19080,41 +19188,50 @@ async def get_payment(payment_id: "str") -> "IBtBolt11Invoice": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBtBolt11Invoice.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, ) -def get_pre_activity_metadata(search_key: "str",search_by_address: "bool") -> "typing.Optional[PreActivityMetadata]": +def get_pre_activity_metadata(wallet_id: "str",search_key: "str",search_by_address: "bool") -> "typing.Optional[PreActivityMetadata]": + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(search_key) - + _UniffiConverterBool.check_lower(search_by_address) - + return _UniffiConverterOptionalTypePreActivityMetadata.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_pre_activity_metadata, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(search_key), _UniffiConverterBool.lower(search_by_address))) -def get_tags(activity_id: "str") -> "typing.List[str]": +def get_tags(wallet_id: "str",activity_id: "str") -> "typing.List[str]": + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(activity_id) - + return _UniffiConverterSequenceString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_tags, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(activity_id))) -def get_transaction_details(tx_id: "str") -> "typing.Optional[TransactionDetails]": +def get_transaction_details(wallet_id: "str",tx_id: "str") -> "typing.Optional[TransactionDetails]": + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(tx_id) - + return _UniffiConverterOptionalTypeTransactionDetails.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_get_transaction_details, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(tx_id))) async def gift_order(client_node_id: "str",code: "str") -> "IGift": _UniffiConverterString.check_lower(client_node_id) - + _UniffiConverterString.check_lower(code) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_gift_order( _UniffiConverterString.lower(client_node_id), @@ -19124,7 +19241,7 @@ async def gift_order(client_node_id: "str",code: "str") -> "IGift": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIGift.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19132,7 +19249,7 @@ async def gift_order(client_node_id: "str",code: "str") -> "IGift": async def gift_pay(invoice: "str") -> "IGift": _UniffiConverterString.check_lower(invoice) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_gift_pay( _UniffiConverterString.lower(invoice)), @@ -19141,7 +19258,7 @@ async def gift_pay(invoice: "str") -> "IGift": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIGift.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19149,45 +19266,45 @@ async def gift_pay(invoice: "str") -> "IGift": def init_db(base_path: "str") -> "str": _UniffiConverterString.check_lower(base_path) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeDbError,_UniffiLib.uniffi_bitkitcore_fn_func_init_db, _UniffiConverterString.lower(base_path))) def insert_activity(activity: "Activity") -> None: _UniffiConverterTypeActivity.check_lower(activity) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_insert_activity, _UniffiConverterTypeActivity.lower(activity)) def is_address_used(address: "str") -> "bool": _UniffiConverterString.check_lower(address) - + return _UniffiConverterBool.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_is_address_used, _UniffiConverterString.lower(address))) def is_valid_bip39_word(word: "str") -> "bool": _UniffiConverterString.check_lower(word) - + return _UniffiConverterBool.lift(_uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_is_valid_bip39_word, _UniffiConverterString.lower(word))) async def lnurl_auth(domain: "str",k1: "str",callback: "str",bip32_mnemonic: "str",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]") -> "str": _UniffiConverterString.check_lower(domain) - + _UniffiConverterString.check_lower(k1) - + _UniffiConverterString.check_lower(callback) - + _UniffiConverterString.check_lower(bip32_mnemonic) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_lnurl_auth( _UniffiConverterString.lower(domain), @@ -19201,34 +19318,37 @@ async def lnurl_auth(domain: "str",k1: "str",callback: "str",bip32_mnemonic: "st _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeLnurlError, ) -def mark_activity_as_seen(activity_id: "str",seen_at: "int") -> None: +def mark_activity_as_seen(wallet_id: "str",activity_id: "str",seen_at: "int") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(activity_id) - + _UniffiConverterUInt64.check_lower(seen_at) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_mark_activity_as_seen, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(activity_id), _UniffiConverterUInt64.lower(seen_at)) def mnemonic_to_entropy(mnemonic_phrase: "str") -> "bytes": _UniffiConverterString.check_lower(mnemonic_phrase) - + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_mnemonic_to_entropy, _UniffiConverterString.lower(mnemonic_phrase))) def mnemonic_to_seed(mnemonic_phrase: "str",passphrase: "typing.Optional[str]") -> "bytes": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalString.check_lower(passphrase) - + return _UniffiConverterBytes.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_mnemonic_to_seed, _UniffiConverterString.lower(mnemonic_phrase), _UniffiConverterOptionalString.lower(passphrase))) @@ -19243,9 +19363,9 @@ async def onchain_broadcast_raw_tx(serialized_tx: "str",electrum_url: "str") -> """ _UniffiConverterString.check_lower(serialized_tx) - + _UniffiConverterString.check_lower(electrum_url) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_broadcast_raw_tx( _UniffiConverterString.lower(serialized_tx), @@ -19255,7 +19375,7 @@ async def onchain_broadcast_raw_tx(serialized_tx: "str",electrum_url: "str") -> _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeBroadcastError, @@ -19272,7 +19392,7 @@ async def onchain_compose_transaction(params: "ComposeParams") -> "typing.List[C """ _UniffiConverterTypeComposeParams.check_lower(params) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_compose_transaction( _UniffiConverterTypeComposeParams.lower(params)), @@ -19281,7 +19401,7 @@ async def onchain_compose_transaction(params: "ComposeParams") -> "typing.List[C _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeComposeResult.lift, - + # Error FFI converter None, @@ -19294,15 +19414,15 @@ async def onchain_get_account_info(extended_key: "str",electrum_url: "str",netwo """ _UniffiConverterString.check_lower(extended_key) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalUInt32.check_lower(gap_limit) - + _UniffiConverterOptionalTypeAccountType.check_lower(script_type) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_get_account_info( _UniffiConverterString.lower(extended_key), @@ -19315,7 +19435,7 @@ async def onchain_get_account_info(extended_key: "str",electrum_url: "str",netwo _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeAccountInfoResult.lift, - + # Error FFI converter _UniffiConverterTypeAccountInfoError, @@ -19327,11 +19447,11 @@ async def onchain_get_address_info(address: "str",electrum_url: "str",network: " """ _UniffiConverterString.check_lower(address) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_get_address_info( _UniffiConverterString.lower(address), @@ -19342,7 +19462,7 @@ async def onchain_get_address_info(address: "str",electrum_url: "str",network: " _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeSingleAddressInfoResult.lift, - + # Error FFI converter _UniffiConverterTypeAccountInfoError, @@ -19354,15 +19474,15 @@ async def onchain_get_transaction_detail(extended_key: "str",electrum_url: "str" """ _UniffiConverterString.check_lower(extended_key) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterString.check_lower(txid) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalTypeAccountType.check_lower(script_type) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_get_transaction_detail( _UniffiConverterString.lower(extended_key), @@ -19375,7 +19495,7 @@ async def onchain_get_transaction_detail(extended_key: "str",electrum_url: "str" _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTransactionDetail.lift, - + # Error FFI converter _UniffiConverterTypeAccountInfoError, @@ -19387,13 +19507,13 @@ async def onchain_get_transaction_history(extended_key: "str",electrum_url: "str """ _UniffiConverterString.check_lower(extended_key) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalTypeAccountType.check_lower(script_type) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_get_transaction_history( _UniffiConverterString.lower(extended_key), @@ -19405,7 +19525,7 @@ async def onchain_get_transaction_history(extended_key: "str",electrum_url: "str _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTransactionHistoryResult.lift, - + # Error FFI converter _UniffiConverterTypeAccountInfoError, @@ -19419,9 +19539,9 @@ async def onchain_start_watcher(params: "WatcherParams",listener: "EventListener """ _UniffiConverterTypeWatcherParams.check_lower(params) - + _UniffiConverterTypeEventListener.check_lower(listener) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_onchain_start_watcher( _UniffiConverterTypeWatcherParams.lower(params), @@ -19431,8 +19551,8 @@ async def onchain_start_watcher(params: "WatcherParams",listener: "EventListener _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeAccountInfoError, @@ -19452,16 +19572,16 @@ def onchain_stop_watcher(watcher_id: "str") -> None: """ _UniffiConverterString.check_lower(watcher_id) - + _uniffi_rust_call_with_error(_UniffiConverterTypeAccountInfoError,_UniffiLib.uniffi_bitkitcore_fn_func_onchain_stop_watcher, _UniffiConverterString.lower(watcher_id)) async def open_channel(order_id: "str",connection_string: "str") -> "IBtOrder": _UniffiConverterString.check_lower(order_id) - + _UniffiConverterString.check_lower(connection_string) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_open_channel( _UniffiConverterString.lower(order_id), @@ -19471,7 +19591,7 @@ async def open_channel(order_id: "str",connection_string: "str") -> "IBtOrder": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBtOrder.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19479,26 +19599,26 @@ async def open_channel(order_id: "str",connection_string: "str") -> "IBtOrder": def parse_pubky_auth_url(auth_url: "str") -> "PubkyAuthDetails": _UniffiConverterString.check_lower(auth_url) - + return _UniffiConverterTypePubkyAuthDetails.lift(_uniffi_rust_call_with_error(_UniffiConverterTypePubkyError,_UniffiLib.uniffi_bitkitcore_fn_func_parse_pubky_auth_url, _UniffiConverterString.lower(auth_url))) async def prepare_legacy_rn_native_segwit_recovery_sweep(mnemonic_phrase: "str",network: "typing.Optional[Network]",electrum_url: "str",destination_address: "str",fee_rate_sats_per_vbyte: "typing.Optional[int]",index_limit: "int",bip39_passphrase: "typing.Optional[str]") -> "LegacyRnCloseRecoverySweepPreview": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterString.check_lower(destination_address) - + _UniffiConverterOptionalUInt32.check_lower(fee_rate_sats_per_vbyte) - + _UniffiConverterUInt32.check_lower(index_limit) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_prepare_legacy_rn_native_segwit_recovery_sweep( _UniffiConverterString.lower(mnemonic_phrase), @@ -19513,7 +19633,7 @@ async def prepare_legacy_rn_native_segwit_recovery_sweep(mnemonic_phrase: "str", _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeLegacyRnCloseRecoverySweepPreview.lift, - + # Error FFI converter _UniffiConverterTypeSweepError, @@ -19521,17 +19641,17 @@ async def prepare_legacy_rn_native_segwit_recovery_sweep(mnemonic_phrase: "str", async def prepare_sweep_transaction(mnemonic_phrase: "str",network: "typing.Optional[Network]",bip39_passphrase: "typing.Optional[str]",electrum_url: "str",destination_address: "str",fee_rate_sats_per_vbyte: "typing.Optional[int]") -> "SweepTransactionPreview": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterString.check_lower(destination_address) - + _UniffiConverterOptionalUInt32.check_lower(fee_rate_sats_per_vbyte) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_prepare_sweep_transaction( _UniffiConverterString.lower(mnemonic_phrase), @@ -19545,7 +19665,7 @@ async def prepare_sweep_transaction(mnemonic_phrase: "str",network: "typing.Opti _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeSweepTransactionPreview.lift, - + # Error FFI converter _UniffiConverterTypeSweepError, @@ -19553,18 +19673,18 @@ async def prepare_sweep_transaction(mnemonic_phrase: "str",network: "typing.Opti def pubky_public_key_from_secret(secret_key_hex: "str") -> "str": _UniffiConverterString.check_lower(secret_key_hex) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypePubkyError,_UniffiLib.uniffi_bitkitcore_fn_func_pubky_public_key_from_secret, _UniffiConverterString.lower(secret_key_hex))) async def pubky_put_with_secret_key(secret_key_hex: "str",path: "str",content: "bytes") -> None: _UniffiConverterString.check_lower(secret_key_hex) - + _UniffiConverterString.check_lower(path) - + _UniffiConverterBytes.check_lower(content) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_pubky_put_with_secret_key( _UniffiConverterString.lower(secret_key_hex), @@ -19575,8 +19695,8 @@ async def pubky_put_with_secret_key(secret_key_hex: "str",path: "str",content: " _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19584,9 +19704,9 @@ async def pubky_put_with_secret_key(secret_key_hex: "str",path: "str",content: " async def pubky_session_delete(session_secret: "str",path: "str") -> None: _UniffiConverterString.check_lower(session_secret) - + _UniffiConverterString.check_lower(path) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_pubky_session_delete( _UniffiConverterString.lower(session_secret), @@ -19596,8 +19716,8 @@ async def pubky_session_delete(session_secret: "str",path: "str") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19605,9 +19725,9 @@ async def pubky_session_delete(session_secret: "str",path: "str") -> None: async def pubky_session_list(session_secret: "str",dir_path: "str") -> "typing.List[str]": _UniffiConverterString.check_lower(session_secret) - + _UniffiConverterString.check_lower(dir_path) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_pubky_session_list( _UniffiConverterString.lower(session_secret), @@ -19617,7 +19737,7 @@ async def pubky_session_list(session_secret: "str",dir_path: "str") -> "typing.L _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19625,11 +19745,11 @@ async def pubky_session_list(session_secret: "str",dir_path: "str") -> "typing.L async def pubky_session_put(session_secret: "str",path: "str",content: "bytes") -> None: _UniffiConverterString.check_lower(session_secret) - + _UniffiConverterString.check_lower(path) - + _UniffiConverterBytes.check_lower(content) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_pubky_session_put( _UniffiConverterString.lower(session_secret), @@ -19640,8 +19760,8 @@ async def pubky_session_put(session_secret: "str",path: "str",content: "bytes") _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19649,7 +19769,7 @@ async def pubky_session_put(session_secret: "str",path: "str",content: "bytes") async def pubky_sign_in(secret_key_hex: "str") -> "str": _UniffiConverterString.check_lower(secret_key_hex) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_pubky_sign_in( _UniffiConverterString.lower(secret_key_hex)), @@ -19658,7 +19778,7 @@ async def pubky_sign_in(secret_key_hex: "str") -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19666,11 +19786,11 @@ async def pubky_sign_in(secret_key_hex: "str") -> "str": async def pubky_sign_up(secret_key_hex: "str",homeserver_public_key_z32: "str",signup_code: "typing.Optional[str]") -> "str": _UniffiConverterString.check_lower(secret_key_hex) - + _UniffiConverterString.check_lower(homeserver_public_key_z32) - + _UniffiConverterOptionalString.check_lower(signup_code) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_pubky_sign_up( _UniffiConverterString.lower(secret_key_hex), @@ -19681,7 +19801,7 @@ async def pubky_sign_up(secret_key_hex: "str",homeserver_public_key_z32: "str",s _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19699,7 +19819,7 @@ async def refresh_active_cjit_entries() -> "typing.List[IcJitEntry]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeIcJitEntry.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19717,7 +19837,7 @@ async def refresh_active_orders() -> "typing.List[IBtOrder]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeIBtOrder.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19725,21 +19845,21 @@ async def refresh_active_orders() -> "typing.List[IBtOrder]": async def register_device(device_token: "str",public_key: "str",features: "typing.List[str]",node_id: "str",iso_timestamp: "str",signature: "str",is_production: "typing.Optional[bool]",custom_url: "typing.Optional[str]") -> "str": _UniffiConverterString.check_lower(device_token) - + _UniffiConverterString.check_lower(public_key) - + _UniffiConverterSequenceString.check_lower(features) - + _UniffiConverterString.check_lower(node_id) - + _UniffiConverterString.check_lower(iso_timestamp) - + _UniffiConverterString.check_lower(signature) - + _UniffiConverterOptionalBool.check_lower(is_production) - + _UniffiConverterOptionalString.check_lower(custom_url) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_register_device( _UniffiConverterString.lower(device_token), @@ -19755,7 +19875,7 @@ async def register_device(device_token: "str",public_key: "str",features: "typin _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19763,11 +19883,11 @@ async def register_device(device_token: "str",public_key: "str",features: "typin async def regtest_close_channel(funding_tx_id: "str",vout: "int",force_close_after_s: "typing.Optional[int]") -> "str": _UniffiConverterString.check_lower(funding_tx_id) - + _UniffiConverterUInt32.check_lower(vout) - + _UniffiConverterOptionalUInt64.check_lower(force_close_after_s) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_regtest_close_channel( _UniffiConverterString.lower(funding_tx_id), @@ -19778,7 +19898,7 @@ async def regtest_close_channel(funding_tx_id: "str",vout: "int",force_close_aft _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19786,9 +19906,9 @@ async def regtest_close_channel(funding_tx_id: "str",vout: "int",force_close_aft async def regtest_deposit(address: "str",amount_sat: "typing.Optional[int]") -> "str": _UniffiConverterString.check_lower(address) - + _UniffiConverterOptionalUInt64.check_lower(amount_sat) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_regtest_deposit( _UniffiConverterString.lower(address), @@ -19798,7 +19918,7 @@ async def regtest_deposit(address: "str",amount_sat: "typing.Optional[int]") -> _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19806,7 +19926,7 @@ async def regtest_deposit(address: "str",amount_sat: "typing.Optional[int]") -> async def regtest_get_payment(payment_id: "str") -> "IBtBolt11Invoice": _UniffiConverterString.check_lower(payment_id) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_regtest_get_payment( _UniffiConverterString.lower(payment_id)), @@ -19815,7 +19935,7 @@ async def regtest_get_payment(payment_id: "str") -> "IBtBolt11Invoice": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeIBtBolt11Invoice.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19823,7 +19943,7 @@ async def regtest_get_payment(payment_id: "str") -> "IBtBolt11Invoice": async def regtest_mine(count: "typing.Optional[int]") -> None: _UniffiConverterOptionalUInt32.check_lower(count) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_regtest_mine( _UniffiConverterOptionalUInt32.lower(count)), @@ -19832,8 +19952,8 @@ async def regtest_mine(count: "typing.Optional[int]") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19841,9 +19961,9 @@ async def regtest_mine(count: "typing.Optional[int]") -> None: async def regtest_pay(invoice: "str",amount_sat: "typing.Optional[int]") -> "str": _UniffiConverterString.check_lower(invoice) - + _UniffiConverterOptionalUInt64.check_lower(amount_sat) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_regtest_pay( _UniffiConverterString.lower(invoice), @@ -19853,7 +19973,7 @@ async def regtest_pay(invoice: "str",amount_sat: "typing.Optional[int]") -> "str _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19861,56 +19981,65 @@ async def regtest_pay(invoice: "str",amount_sat: "typing.Optional[int]") -> "str def remove_closed_channel_by_id(channel_id: "str") -> "bool": _UniffiConverterString.check_lower(channel_id) - + return _UniffiConverterBool.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_remove_closed_channel_by_id, _UniffiConverterString.lower(channel_id))) -def remove_pre_activity_metadata_tags(payment_id: "str",tags: "typing.List[str]") -> None: +def remove_pre_activity_metadata_tags(wallet_id: "str",payment_id: "str",tags: "typing.List[str]") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(payment_id) - + _UniffiConverterSequenceString.check_lower(tags) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_remove_pre_activity_metadata_tags, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(payment_id), _UniffiConverterSequenceString.lower(tags)) -def remove_tags(activity_id: "str",tags: "typing.List[str]") -> None: +def remove_tags(wallet_id: "str",activity_id: "str",tags: "typing.List[str]") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(activity_id) - + _UniffiConverterSequenceString.check_lower(tags) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_remove_tags, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(activity_id), _UniffiConverterSequenceString.lower(tags)) -def reset_pre_activity_metadata_tags(payment_id: "str") -> None: +def reset_pre_activity_metadata_tags(wallet_id: "str",payment_id: "str") -> None: + _UniffiConverterString.check_lower(wallet_id) + _UniffiConverterString.check_lower(payment_id) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_reset_pre_activity_metadata_tags, + _UniffiConverterString.lower(wallet_id), _UniffiConverterString.lower(payment_id)) def resolve_pubky_url(uri: "str") -> "str": _UniffiConverterString.check_lower(uri) - + return _UniffiConverterString.lift(_uniffi_rust_call_with_error(_UniffiConverterTypePubkyError,_UniffiLib.uniffi_bitkitcore_fn_func_resolve_pubky_url, _UniffiConverterString.lower(uri))) async def scan_legacy_rn_native_segwit_recovery_funds(mnemonic_phrase: "str",network: "typing.Optional[Network]",electrum_url: "str",index_limit: "int",bip39_passphrase: "typing.Optional[str]") -> "LegacyRnCloseRecoveryScanResult": _UniffiConverterString.check_lower(mnemonic_phrase) - + _UniffiConverterOptionalTypeNetwork.check_lower(network) - + _UniffiConverterString.check_lower(electrum_url) - + _UniffiConverterUInt32.check_lower(index_limit) - + _UniffiConverterOptionalString.check_lower(bip39_passphrase) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_scan_legacy_rn_native_segwit_recovery_funds( _UniffiConverterString.lower(mnemonic_phrase), @@ -19923,7 +20052,7 @@ async def scan_legacy_rn_native_segwit_recovery_funds(mnemonic_phrase: "str",net _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeLegacyRnCloseRecoveryScanResult.lift, - + # Error FFI converter _UniffiConverterTypeSweepError, @@ -19931,7 +20060,7 @@ async def scan_legacy_rn_native_segwit_recovery_funds(mnemonic_phrase: "str",net async def start_pubky_auth(caps: "str") -> "str": _UniffiConverterString.check_lower(caps) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_start_pubky_auth( _UniffiConverterString.lower(caps)), @@ -19940,7 +20069,7 @@ async def start_pubky_auth(caps: "str") -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypePubkyError, @@ -19948,13 +20077,13 @@ async def start_pubky_auth(caps: "str") -> "str": async def test_notification(device_token: "str",secret_message: "str",notification_type: "typing.Optional[str]",custom_url: "typing.Optional[str]") -> "str": _UniffiConverterString.check_lower(device_token) - + _UniffiConverterString.check_lower(secret_message) - + _UniffiConverterOptionalString.check_lower(notification_type) - + _UniffiConverterOptionalString.check_lower(custom_url) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_test_notification( _UniffiConverterString.lower(device_token), @@ -19966,7 +20095,7 @@ async def test_notification(device_token: "str",secret_message: "str",notificati _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -19978,7 +20107,7 @@ def trezor_account_type_to_script_type(account_type: "AccountType") -> "TrezorSc """ _UniffiConverterTypeAccountType.check_lower(account_type) - + return _UniffiConverterTypeTrezorScriptType.lift(_uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_trezor_account_type_to_script_type, _UniffiConverterTypeAccountType.lower(account_type))) @@ -19992,7 +20121,7 @@ async def trezor_clear_credentials(device_id: "str") -> None: """ _UniffiConverterString.check_lower(device_id) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_clear_credentials( _UniffiConverterString.lower(device_id)), @@ -20001,8 +20130,8 @@ async def trezor_clear_credentials(device_id: "str") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20022,9 +20151,9 @@ async def trezor_connect(device_id: "str",selection: "WalletSelection") -> "Trez """ _UniffiConverterString.check_lower(device_id) - + _UniffiConverterTypeWalletSelection.check_lower(selection) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_connect( _UniffiConverterString.lower(device_id), @@ -20034,7 +20163,7 @@ async def trezor_connect(device_id: "str",selection: "WalletSelection") -> "Trez _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTrezorFeatures.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20052,8 +20181,8 @@ async def trezor_disconnect() -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20065,7 +20194,7 @@ async def trezor_get_address(params: "TrezorGetAddressParams") -> "TrezorAddress """ _UniffiConverterTypeTrezorGetAddressParams.check_lower(params) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_get_address( _UniffiConverterTypeTrezorGetAddressParams.lower(params)), @@ -20074,7 +20203,7 @@ async def trezor_get_address(params: "TrezorGetAddressParams") -> "TrezorAddress _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTrezorAddressResponse.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20092,7 +20221,7 @@ async def trezor_get_connected_device() -> "typing.Optional[TrezorDeviceInfo]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterOptionalTypeTrezorDeviceInfo.lift, - + # Error FFI converter None, @@ -20114,7 +20243,7 @@ async def trezor_get_device_fingerprint() -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20135,7 +20264,7 @@ async def trezor_get_features() -> "typing.Optional[TrezorFeatures]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterOptionalTypeTrezorFeatures.lift, - + # Error FFI converter None, @@ -20148,7 +20277,7 @@ async def trezor_get_public_key(params: "TrezorGetPublicKeyParams") -> "TrezorPu """ _UniffiConverterTypeTrezorGetPublicKeyParams.check_lower(params) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_get_public_key( _UniffiConverterTypeTrezorGetPublicKeyParams.lower(params)), @@ -20157,7 +20286,7 @@ async def trezor_get_public_key(params: "TrezorGetPublicKeyParams") -> "TrezorPu _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTrezorPublicKeyResponse.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20174,7 +20303,7 @@ async def trezor_initialize(credential_path: "typing.Optional[str]") -> None: """ _UniffiConverterOptionalString.check_lower(credential_path) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_initialize( _UniffiConverterOptionalString.lower(credential_path)), @@ -20183,8 +20312,8 @@ async def trezor_initialize(credential_path: "typing.Optional[str]") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20213,7 +20342,7 @@ async def trezor_is_connected() -> "bool": _UniffiLib.ffi_bitkitcore_rust_future_free_i8, # lift function _UniffiConverterBool.lift, - + # Error FFI converter None, @@ -20232,7 +20361,7 @@ async def trezor_is_initialized() -> "bool": _UniffiLib.ffi_bitkitcore_rust_future_free_i8, # lift function _UniffiConverterBool.lift, - + # Error FFI converter None, @@ -20251,7 +20380,7 @@ async def trezor_list_devices() -> "typing.List[TrezorDeviceInfo]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeTrezorDeviceInfo.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20272,7 +20401,7 @@ async def trezor_scan() -> "typing.List[TrezorDeviceInfo]": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterSequenceTypeTrezorDeviceInfo.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20287,7 +20416,7 @@ def trezor_set_transport_callback(callback: "TrezorTransportCallback") -> None: """ _UniffiConverterTypeTrezorTransportCallback.check_lower(callback) - + _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_trezor_set_transport_callback, _UniffiConverterTypeTrezorTransportCallback.lower(callback)) @@ -20302,7 +20431,7 @@ def trezor_set_ui_callback(callback: "TrezorUiCallback") -> None: """ _UniffiConverterTypeTrezorUiCallback.check_lower(callback) - + _uniffi_rust_call(_UniffiLib.uniffi_bitkitcore_fn_func_trezor_set_ui_callback, _UniffiConverterTypeTrezorUiCallback.lower(callback)) @@ -20313,7 +20442,7 @@ async def trezor_sign_message(params: "TrezorSignMessageParams") -> "TrezorSigne """ _UniffiConverterTypeTrezorSignMessageParams.check_lower(params) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_sign_message( _UniffiConverterTypeTrezorSignMessageParams.lower(params)), @@ -20322,7 +20451,7 @@ async def trezor_sign_message(params: "TrezorSignMessageParams") -> "TrezorSigne _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTrezorSignedMessageResponse.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20334,7 +20463,7 @@ async def trezor_sign_tx(params: "TrezorSignTxParams") -> "TrezorSignedTx": """ _UniffiConverterTypeTrezorSignTxParams.check_lower(params) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_sign_tx( _UniffiConverterTypeTrezorSignTxParams.lower(params)), @@ -20343,7 +20472,7 @@ async def trezor_sign_tx(params: "TrezorSignTxParams") -> "TrezorSignedTx": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTrezorSignedTx.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20362,9 +20491,9 @@ async def trezor_sign_tx_from_psbt(psbt_base64: "str",network: "typing.Optional[ """ _UniffiConverterString.check_lower(psbt_base64) - + _UniffiConverterOptionalTypeTrezorCoinType.check_lower(network) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_sign_tx_from_psbt( _UniffiConverterString.lower(psbt_base64), @@ -20374,7 +20503,7 @@ async def trezor_sign_tx_from_psbt(psbt_base64: "str",network: "typing.Optional[ _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterTypeTrezorSignedTx.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20386,7 +20515,7 @@ async def trezor_verify_message(params: "TrezorVerifyMessageParams") -> "bool": """ _UniffiConverterTypeTrezorVerifyMessageParams.check_lower(params) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_trezor_verify_message( _UniffiConverterTypeTrezorVerifyMessageParams.lower(params)), @@ -20395,7 +20524,7 @@ async def trezor_verify_message(params: "TrezorVerifyMessageParams") -> "bool": _UniffiLib.ffi_bitkitcore_rust_future_free_i8, # lift function _UniffiConverterBool.lift, - + # Error FFI converter _UniffiConverterTypeTrezorError, @@ -20403,9 +20532,9 @@ async def trezor_verify_message(params: "TrezorVerifyMessageParams") -> "bool": def update_activity(activity_id: "str",activity: "Activity") -> None: _UniffiConverterString.check_lower(activity_id) - + _UniffiConverterTypeActivity.check_lower(activity) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_update_activity, _UniffiConverterString.lower(activity_id), _UniffiConverterTypeActivity.lower(activity)) @@ -20413,7 +20542,7 @@ def update_activity(activity_id: "str",activity: "Activity") -> None: async def update_blocktank_url(new_url: "str") -> None: _UniffiConverterString.check_lower(new_url) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_update_blocktank_url( _UniffiConverterString.lower(new_url)), @@ -20422,8 +20551,8 @@ async def update_blocktank_url(new_url: "str") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -20431,21 +20560,21 @@ async def update_blocktank_url(new_url: "str") -> None: def upsert_activities(activities: "typing.List[Activity]") -> None: _UniffiConverterSequenceTypeActivity.check_lower(activities) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_activities, _UniffiConverterSequenceTypeActivity.lower(activities)) def upsert_activity(activity: "Activity") -> None: _UniffiConverterTypeActivity.check_lower(activity) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_activity, _UniffiConverterTypeActivity.lower(activity)) async def upsert_cjit_entries(entries: "typing.List[IcJitEntry]") -> None: _UniffiConverterSequenceTypeIcJitEntry.check_lower(entries) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_upsert_cjit_entries( _UniffiConverterSequenceTypeIcJitEntry.lower(entries)), @@ -20454,8 +20583,8 @@ async def upsert_cjit_entries(entries: "typing.List[IcJitEntry]") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -20463,21 +20592,21 @@ async def upsert_cjit_entries(entries: "typing.List[IcJitEntry]") -> None: def upsert_closed_channel(channel: "ClosedChannelDetails") -> None: _UniffiConverterTypeClosedChannelDetails.check_lower(channel) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_closed_channel, _UniffiConverterTypeClosedChannelDetails.lower(channel)) def upsert_closed_channels(channels: "typing.List[ClosedChannelDetails]") -> None: _UniffiConverterSequenceTypeClosedChannelDetails.check_lower(channels) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_closed_channels, _UniffiConverterSequenceTypeClosedChannelDetails.lower(channels)) async def upsert_info(info: "IBtInfo") -> None: _UniffiConverterTypeIBtInfo.check_lower(info) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_upsert_info( _UniffiConverterTypeIBtInfo.lower(info)), @@ -20486,8 +20615,8 @@ async def upsert_info(info: "IBtInfo") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -20495,21 +20624,21 @@ async def upsert_info(info: "IBtInfo") -> None: def upsert_lightning_activities(activities: "typing.List[LightningActivity]") -> None: _UniffiConverterSequenceTypeLightningActivity.check_lower(activities) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_lightning_activities, _UniffiConverterSequenceTypeLightningActivity.lower(activities)) def upsert_onchain_activities(activities: "typing.List[OnchainActivity]") -> None: _UniffiConverterSequenceTypeOnchainActivity.check_lower(activities) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_onchain_activities, _UniffiConverterSequenceTypeOnchainActivity.lower(activities)) async def upsert_orders(orders: "typing.List[IBtOrder]") -> None: _UniffiConverterSequenceTypeIBtOrder.check_lower(orders) - + return await _uniffi_rust_call_async( _UniffiLib.uniffi_bitkitcore_fn_func_upsert_orders( _UniffiConverterSequenceTypeIBtOrder.lower(orders)), @@ -20518,8 +20647,8 @@ async def upsert_orders(orders: "typing.List[IBtOrder]") -> None: _UniffiLib.ffi_bitkitcore_rust_future_free_void, # lift function lambda val: None, - - + + # Error FFI converter _UniffiConverterTypeBlocktankError, @@ -20527,35 +20656,35 @@ async def upsert_orders(orders: "typing.List[IBtOrder]") -> None: def upsert_pre_activity_metadata(pre_activity_metadata: "typing.List[PreActivityMetadata]") -> None: _UniffiConverterSequenceTypePreActivityMetadata.check_lower(pre_activity_metadata) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_pre_activity_metadata, _UniffiConverterSequenceTypePreActivityMetadata.lower(pre_activity_metadata)) def upsert_tags(activity_tags: "typing.List[ActivityTags]") -> None: _UniffiConverterSequenceTypeActivityTags.check_lower(activity_tags) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_tags, _UniffiConverterSequenceTypeActivityTags.lower(activity_tags)) def upsert_transaction_details(details_list: "typing.List[TransactionDetails]") -> None: _UniffiConverterSequenceTypeTransactionDetails.check_lower(details_list) - + _uniffi_rust_call_with_error(_UniffiConverterTypeActivityError,_UniffiLib.uniffi_bitkitcore_fn_func_upsert_transaction_details, _UniffiConverterSequenceTypeTransactionDetails.lower(details_list)) def validate_bitcoin_address(address: "str") -> "ValidationResult": _UniffiConverterString.check_lower(address) - + return _UniffiConverterTypeValidationResult.lift(_uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_validate_bitcoin_address, _UniffiConverterString.lower(address))) def validate_mnemonic(mnemonic_phrase: "str") -> None: _UniffiConverterString.check_lower(mnemonic_phrase) - + _uniffi_rust_call_with_error(_UniffiConverterTypeAddressError,_UniffiLib.uniffi_bitkitcore_fn_func_validate_mnemonic, _UniffiConverterString.lower(mnemonic_phrase)) @@ -20572,7 +20701,7 @@ async def wipe_all_databases() -> "str": _UniffiLib.ffi_bitkitcore_rust_future_free_rust_buffer, # lift function _UniffiConverterString.lift, - + # Error FFI converter _UniffiConverterTypeDbError, @@ -20741,6 +20870,7 @@ def wipe_all_transaction_details() -> None: "create_order", "create_withdraw_callback_url", "decode", + "delete_activities_by_wallet_id", "delete_activity_by_id", "delete_pre_activity_metadata", "delete_transaction_details", @@ -20771,6 +20901,7 @@ def wipe_all_transaction_details() -> None: "get_cjit_entries", "get_closed_channel_by_id", "get_default_lsp_balance", + "get_default_wallet_id", "get_gift", "get_info", "get_lnurl_invoice", diff --git a/bindings/python/bitkitcore/libbitkitcore.dylib b/bindings/python/bitkitcore/libbitkitcore.dylib index 7f6b374..c6a1ee1 100755 Binary files a/bindings/python/bitkitcore/libbitkitcore.dylib and b/bindings/python/bitkitcore/libbitkitcore.dylib differ diff --git a/bindings/python/setup.py b/bindings/python/setup.py index 1869fb3..f371901 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -2,7 +2,7 @@ setup( name="bitkitcore", - version="0.1.0", + version="0.3.0", packages=find_packages(), package_data={ "bitkitcore": ["*.so", "*.dylib", "*.dll"], diff --git a/build_python.sh b/build_python.sh index 9d216ed..2fbab92 100755 --- a/build_python.sh +++ b/build_python.sh @@ -8,6 +8,7 @@ echo "Starting Python build process..." PROJECT_NAME="bitkitcore" # Using underscore for Python package name BASE_DIR="./bindings/python" PACKAGE_DIR="$BASE_DIR/$PROJECT_NAME" +VERSION=$(grep '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/') # Create output directories mkdir -p "$BASE_DIR" @@ -49,7 +50,9 @@ cargo run --bin uniffi-bindgen generate \ --out-dir "$PACKAGE_DIR" # Create __init__.py -touch "$PACKAGE_DIR/__init__.py" +cat > "$PACKAGE_DIR/__init__.py" << EOL +from .bitkitcore import * +EOL # Create setup.py cat > "$BASE_DIR/setup.py" << EOL @@ -57,7 +60,7 @@ from setuptools import setup, find_packages setup( name="$PROJECT_NAME", - version="0.1.0", + version="$VERSION", packages=find_packages(), package_data={ "$PROJECT_NAME": ["*.so", "*.dylib", "*.dll"], @@ -144,4 +147,4 @@ case "$(uname)" in esac echo "Python build process completed successfully!" -echo "To install the package, cd into $BASE_DIR and run: pip install ." \ No newline at end of file +echo "To install the package, cd into $BASE_DIR and run: pip install ." diff --git a/src/lib.rs b/src/lib.rs index d6255c1..b5eea78 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ use once_cell::sync::OnceCell; use crate::activity::{ Activity, ActivityDB, ActivityError, ActivityFilter, ActivityTags, ClosedChannelDetails, DbError, LightningActivity, OnchainActivity, PaymentType, PreActivityMetadata, SortDirection, - TransactionDetails, + TransactionDetails, DEFAULT_WALLET_ID, }; use crate::modules::blocktank::{ BlocktankDB, BlocktankError, BtOrderState2, CJitStateEnum, ChannelLiquidityOptions, @@ -466,7 +466,14 @@ pub fn init_db(base_path: String) -> Result { } #[uniffi::export] +pub fn get_default_wallet_id() -> String { + DEFAULT_WALLET_ID.to_string() +} + +#[uniffi::export] +#[allow(clippy::too_many_arguments)] pub fn get_activities( + wallet_id: Option, filter: Option, tx_type: Option, tags: Option>, @@ -484,6 +491,7 @@ pub fn get_activities( error_details: "Database not initialized. Call init_db first.".to_string(), })?; db.get_activities( + wallet_id.as_deref(), filter, tx_type, tags, @@ -540,7 +548,10 @@ pub fn update_activity(activity_id: String, activity: Activity) -> Result<(), Ac } #[uniffi::export] -pub fn get_activity_by_id(activity_id: String) -> Result, ActivityError> { +pub fn get_activity_by_id( + wallet_id: String, + activity_id: String, +) -> Result, ActivityError> { let guard = get_activity_db()?; let db = guard .activity_db @@ -548,11 +559,14 @@ pub fn get_activity_by_id(activity_id: String) -> Result, Activ .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.get_activity_by_id(&activity_id) + db.get_activity_by_id(&wallet_id, &activity_id) } #[uniffi::export] -pub fn get_activity_by_tx_id(tx_id: String) -> Result, ActivityError> { +pub fn get_activity_by_tx_id( + wallet_id: String, + tx_id: String, +) -> Result, ActivityError> { let guard = get_activity_db()?; let db = guard .activity_db @@ -560,11 +574,26 @@ pub fn get_activity_by_tx_id(tx_id: String) -> Result, A .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.get_activity_by_tx_id(&tx_id) + db.get_activity_by_tx_id(&wallet_id, &tx_id) +} + +#[uniffi::export] +pub fn delete_activity_by_id( + wallet_id: String, + activity_id: String, +) -> Result { + let mut guard = get_activity_db()?; + let db = guard + .activity_db + .as_mut() + .ok_or(ActivityError::ConnectionError { + error_details: "Database not initialized. Call init_db first.".to_string(), + })?; + db.delete_activity_by_id(&wallet_id, &activity_id) } #[uniffi::export] -pub fn delete_activity_by_id(activity_id: String) -> Result { +pub fn delete_activities_by_wallet_id(wallet_id: String) -> Result { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -572,11 +601,15 @@ pub fn delete_activity_by_id(activity_id: String) -> Result .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.delete_activity_by_id(&activity_id) + db.delete_activities_by_wallet_id(&wallet_id) } #[uniffi::export] -pub fn add_tags(activity_id: String, tags: Vec) -> Result<(), ActivityError> { +pub fn add_tags( + wallet_id: String, + activity_id: String, + tags: Vec, +) -> Result<(), ActivityError> { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -584,11 +617,15 @@ pub fn add_tags(activity_id: String, tags: Vec) -> Result<(), ActivityEr .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.add_tags(&activity_id, &tags) + db.add_tags(&wallet_id, &activity_id, &tags) } #[uniffi::export] -pub fn remove_tags(activity_id: String, tags: Vec) -> Result<(), ActivityError> { +pub fn remove_tags( + wallet_id: String, + activity_id: String, + tags: Vec, +) -> Result<(), ActivityError> { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -596,11 +633,11 @@ pub fn remove_tags(activity_id: String, tags: Vec) -> Result<(), Activit .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.remove_tags(&activity_id, &tags) + db.remove_tags(&wallet_id, &activity_id, &tags) } #[uniffi::export] -pub fn get_tags(activity_id: String) -> Result, ActivityError> { +pub fn get_tags(wallet_id: String, activity_id: String) -> Result, ActivityError> { let guard = get_activity_db()?; let db = guard .activity_db @@ -608,11 +645,12 @@ pub fn get_tags(activity_id: String) -> Result, ActivityError> { .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.get_tags(&activity_id) + db.get_tags(&wallet_id, &activity_id) } #[uniffi::export] pub fn get_activities_by_tag( + wallet_id: Option, tag: String, limit: Option, sort_direction: Option, @@ -624,7 +662,7 @@ pub fn get_activities_by_tag( .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.get_activities_by_tag(&tag, limit, sort_direction) + db.get_activities_by_tag(wallet_id.as_deref(), &tag, limit, sort_direction) } #[uniffi::export] @@ -679,6 +717,7 @@ pub fn add_pre_activity_metadata( #[uniffi::export] pub fn add_pre_activity_metadata_tags( + wallet_id: String, payment_id: String, tags: Vec, ) -> Result<(), ActivityError> { @@ -689,11 +728,12 @@ pub fn add_pre_activity_metadata_tags( .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.add_pre_activity_metadata_tags(&payment_id, &tags) + db.add_pre_activity_metadata_tags(&wallet_id, &payment_id, &tags) } #[uniffi::export] pub fn remove_pre_activity_metadata_tags( + wallet_id: String, payment_id: String, tags: Vec, ) -> Result<(), ActivityError> { @@ -704,11 +744,14 @@ pub fn remove_pre_activity_metadata_tags( .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.remove_pre_activity_metadata_tags(&payment_id, &tags) + db.remove_pre_activity_metadata_tags(&wallet_id, &payment_id, &tags) } #[uniffi::export] -pub fn reset_pre_activity_metadata_tags(payment_id: String) -> Result<(), ActivityError> { +pub fn reset_pre_activity_metadata_tags( + wallet_id: String, + payment_id: String, +) -> Result<(), ActivityError> { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -716,11 +759,14 @@ pub fn reset_pre_activity_metadata_tags(payment_id: String) -> Result<(), Activi .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.reset_pre_activity_metadata_tags(&payment_id) + db.reset_pre_activity_metadata_tags(&wallet_id, &payment_id) } #[uniffi::export] -pub fn delete_pre_activity_metadata(payment_id: String) -> Result<(), ActivityError> { +pub fn delete_pre_activity_metadata( + wallet_id: String, + payment_id: String, +) -> Result<(), ActivityError> { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -728,7 +774,7 @@ pub fn delete_pre_activity_metadata(payment_id: String) -> Result<(), ActivityEr .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.delete_pre_activity_metadata(&payment_id) + db.delete_pre_activity_metadata(&wallet_id, &payment_id) } #[uniffi::export] @@ -747,6 +793,7 @@ pub fn upsert_pre_activity_metadata( #[uniffi::export] pub fn get_pre_activity_metadata( + wallet_id: String, search_key: String, search_by_address: bool, ) -> Result, ActivityError> { @@ -757,7 +804,7 @@ pub fn get_pre_activity_metadata( .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.get_pre_activity_metadata(&search_key, search_by_address) + db.get_pre_activity_metadata(&wallet_id, &search_key, search_by_address) } #[uniffi::export] @@ -1647,7 +1694,11 @@ pub fn is_address_used(address: String) -> Result { } #[uniffi::export] -pub fn mark_activity_as_seen(activity_id: String, seen_at: u64) -> Result<(), ActivityError> { +pub fn mark_activity_as_seen( + wallet_id: String, + activity_id: String, + seen_at: u64, +) -> Result<(), ActivityError> { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -1655,7 +1706,7 @@ pub fn mark_activity_as_seen(activity_id: String, seen_at: u64) -> Result<(), Ac .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.mark_activity_as_seen(&activity_id, seen_at) + db.mark_activity_as_seen(&wallet_id, &activity_id, seen_at) } #[uniffi::export] @@ -1673,7 +1724,10 @@ pub fn upsert_transaction_details( } #[uniffi::export] -pub fn get_transaction_details(tx_id: String) -> Result, ActivityError> { +pub fn get_transaction_details( + wallet_id: String, + tx_id: String, +) -> Result, ActivityError> { let guard = get_activity_db()?; let db = guard .activity_db @@ -1681,7 +1735,7 @@ pub fn get_transaction_details(tx_id: String) -> Result Result, Activity } #[uniffi::export] -pub fn delete_transaction_details(tx_id: String) -> Result { +pub fn delete_transaction_details(wallet_id: String, tx_id: String) -> Result { let mut guard = get_activity_db()?; let db = guard .activity_db @@ -1705,7 +1759,7 @@ pub fn delete_transaction_details(tx_id: String) -> Result .ok_or(ActivityError::ConnectionError { error_details: "Database not initialized. Call init_db first.".to_string(), })?; - db.delete_transaction_details(&tx_id) + db.delete_transaction_details(&wallet_id, &tx_id) } #[uniffi::export] diff --git a/src/modules/activity/README.md b/src/modules/activity/README.md index 5c4dad5..7c3ad6d 100644 --- a/src/modules/activity/README.md +++ b/src/modules/activity/README.md @@ -9,6 +9,8 @@ The Activity module is responsible for storing and managing transaction/activity - [`LightningActivity`](#lightningactivity-fields): Lightning Network transactions - Tags - Add or remove tags from activities and filter activities by tags. +- Pre-activity metadata + - Store pending metadata before an activity exists, scoped by wallet. ## Available Methods @@ -16,8 +18,12 @@ The Activity module is responsible for storing and managing transaction/activity // Initialize the database with a specified path fn init_db(base_path: String) -> Result -// Get activities with optional filter, tx_type, tags, search, min_date, max_date, limit, and sort direction +// Get the default wallet ID for the built-in Bitkit wallet +fn get_default_wallet_id() -> String + +// Get activities with optional wallet, filter, tx_type, tags, search, min_date, max_date, limit, and sort direction fn get_activities( + wallet_id: Option, filter: Option, tx_type: Option, tags: Option>, @@ -28,8 +34,9 @@ fn get_activities( sort_direction: Option ) -> Result, ActivityError> -// Get activities by tag with optional limit and sort direction +// Get activities by tag with optional wallet, limit, and sort direction fn get_activities_by_tag( + wallet_id: Option, tag: String, limit: Option, sort_direction: Option @@ -44,18 +51,48 @@ fn update_activity(activity_id: String, activity: Activity) -> Result<(), Activi // Insert or update an activity fn upsert_activity(activity: Activity) -> Result<(), ActivityError> -// Get a specific activity by ID -fn get_activity_by_id(activity_id: String) -> Result, ActivityError> +// Get a specific activity by wallet ID and activity ID +fn get_activity_by_id(wallet_id: String, activity_id: String) -> Result, ActivityError> + +// Get a specific onchain activity by wallet ID and transaction ID +fn get_activity_by_tx_id(wallet_id: String, tx_id: String) -> Result, ActivityError> + +// Delete an activity by wallet ID and activity ID +fn delete_activity_by_id(wallet_id: String, activity_id: String) -> Result -// Delete an activity by ID -fn delete_activity_by_id(activity_id: String) -> Result +// Delete all activity data for a wallet +fn delete_activities_by_wallet_id(wallet_id: String) -> Result + +// Mark an activity as seen +fn mark_activity_as_seen(wallet_id: String, activity_id: String, seen_at: u64) -> Result<(), ActivityError> // Tag management -fn add_tags(activity_id: String, tags: Vec) -> Result<(), ActivityError> -fn remove_tags(activity_id: String, tags: Vec) -> Result<(), ActivityError> -fn get_tags(activity_id: String) -> Result, ActivityError> +fn add_tags(wallet_id: String, activity_id: String, tags: Vec) -> Result<(), ActivityError> +fn remove_tags(wallet_id: String, activity_id: String, tags: Vec) -> Result<(), ActivityError> +fn get_tags(wallet_id: String, activity_id: String) -> Result, ActivityError> fn get_all_unique_tags() -> Result, ActivityError> +// Pre-activity metadata +fn add_pre_activity_metadata(pre_activity_metadata: PreActivityMetadata) -> Result<(), ActivityError> +fn add_pre_activity_metadata_tags(wallet_id: String, payment_id: String, tags: Vec) -> Result<(), ActivityError> +fn remove_pre_activity_metadata_tags(wallet_id: String, payment_id: String, tags: Vec) -> Result<(), ActivityError> +fn reset_pre_activity_metadata_tags(wallet_id: String, payment_id: String) -> Result<(), ActivityError> +fn delete_pre_activity_metadata(wallet_id: String, payment_id: String) -> Result<(), ActivityError> +fn upsert_pre_activity_metadata(pre_activity_metadata: Vec) -> Result<(), ActivityError> +fn get_pre_activity_metadata( + wallet_id: String, + search_key: String, + search_by_address: bool +) -> Result, ActivityError> +fn get_all_pre_activity_metadata() -> Result, ActivityError> + +// Transaction details +fn upsert_transaction_details(details_list: Vec) -> Result<(), ActivityError> +fn get_transaction_details(wallet_id: String, tx_id: String) -> Result, ActivityError> +fn get_all_transaction_details() -> Result, ActivityError> +fn delete_transaction_details(wallet_id: String, tx_id: String) -> Result +fn wipe_all_transaction_details() -> Result<(), ActivityError> + // Database wipe fn activity_wipe_all() -> Result<(), ActivityError> ``` @@ -69,26 +106,31 @@ import BitkitCore func manageActivities() { do { // Initialize database - try initDb("/path/to/data") // Creates /path/to/data/activity.db + try initDb(basePath: "/path/to/data") // Creates /path/to/data/activity.db // Create and store an onchain activity let onchainActivity = OnchainActivity( + walletId: "bitkit", id: "tx123", - tx_type: .sent, - tx_id: "abc123", + txType: .sent, + txId: "abc123", value: 50000, fee: 500, - fee_rate: 1, + feeRate: 1, address: "bc1q...", confirmed: true, timestamp: 1234567890, - is_boosted: false, - boost_tx_ids: [], - is_transfer: false, - does_exist: true, - confirm_timestamp: 1234568890, - channel_id: nil, - transfer_tx_id: nil + isBoosted: false, + boostTxIds: [], + isTransfer: false, + doesExist: true, + confirmTimestamp: 1234568890, + channelId: nil, + transferTxId: nil, + contact: nil, + createdAt: nil, + updatedAt: nil, + seenAt: nil ) // Wrap in Activity enum and insert @@ -97,6 +139,7 @@ func manageActivities() { // Retrieve activities with advanced filtering let filteredActivities = try getActivities( + walletId: "bitkit", filter: .all, txType: .sent, tags: ["coffee", "food"], @@ -109,6 +152,7 @@ func manageActivities() { // Simple query (all parameters are optional) let simpleQuery = try getActivities( + walletId: nil, filter: .all, txType: nil, tags: nil, @@ -120,7 +164,7 @@ func manageActivities() { ) // Get specific activity - if let foundActivity = try getActivityById(activityId: "tx123") { + if let foundActivity = try getActivityById(walletId: "bitkit", activityId: "tx123") { switch foundActivity { case .onchain(let onchain): print("Found onchain activity: \(onchain.txId)") @@ -134,17 +178,22 @@ func manageActivities() { try updateActivity(activityId: "tx123", activity: updatedActivity) // Tag operations - try addTags(activityId: "tx123", tags: ["payment", "coffee"]) - let tags = try getTags(activityId: "tx123") - let taggedActivities = try getActivitiesByTag(tag: "coffee", limit: 5, sortDirection: .desc) + try addTags(walletId: "bitkit", activityId: "tx123", tags: ["payment", "coffee"]) + let tags = try getTags(walletId: "bitkit", activityId: "tx123") + let taggedActivities = try getActivitiesByTag( + walletId: "bitkit", + tag: "coffee", + limit: 5, + sortDirection: .desc + ) // Get all unique tags let allUniqueTags = try getAllUniqueTags() // ["coffee", "food", "payment"] - try removeTags(activityId: "tx123", tags: ["payment"]) + try removeTags(walletId: "bitkit", activityId: "tx123", tags: ["payment"]) // Delete activity - let deleted = try deleteActivityById(activityId: "tx123") + let deleted = try deleteActivityById(walletId: "bitkit", activityId: "tx123") // Wipe all activity data (use with caution!) try activityWipeAll() @@ -166,15 +215,20 @@ fun manageActivities() { // Create and store a lightning activity val lightningActivity = LightningActivity( + walletId = "bitkit", id = "ln456", - tx_type = PaymentType.RECEIVED, + txType = PaymentType.RECEIVED, status = PaymentState.SUCCEEDED, - value = 10000, - fee = 1, + value = 10000uL, + fee = 1uL, invoice = "lnbc...", message = "Payment for coffee", - timestamp = 1234567890, - preimage = "def456" + timestamp = 1234567890uL, + preimage = "def456", + contact = null, + createdAt = null, + updatedAt = null, + seenAt = null ) // Wrap in Activity enum and insert @@ -183,52 +237,72 @@ fun manageActivities() { // Retrieve activities with advanced filtering val filteredActivities = getActivities( + walletId = "bitkit", filter = ActivityFilter.ALL, txType = PaymentType.SENT, tags = listOf("coffee", "food"), search = "bc1q", - minDate = 1234567890, - maxDate = 1234667890, - limit = 20, + minDate = 1234567890uL, + maxDate = 1234667890uL, + limit = 20u, sortDirection = SortDirection.DESC ) // Simple query (all parameters are optional) val simpleQuery = getActivities( + walletId = null, filter = ActivityFilter.ALL, txType = null, tags = null, search = null, minDate = null, maxDate = null, - limit = 20, + limit = 20u, sortDirection = SortDirection.DESC ) // Filter by specific criteria val sentPayments = getActivities( + walletId = "bitkit", filter = ActivityFilter.ALL, txType = PaymentType.SENT, - limit = 20 + tags = null, + search = null, + minDate = null, + maxDate = null, + limit = 20u, + sortDirection = SortDirection.DESC ) val recentLightning = getActivities( + walletId = "bitkit", filter = ActivityFilter.LIGHTNING, - minDate = System.currentTimeMillis() / 1000 - 86400, // Last 24 hours - limit = 20 + txType = null, + tags = null, + search = null, + minDate = ((System.currentTimeMillis() / 1000) - 86400).toULong(), + maxDate = null, + limit = 20u, + sortDirection = SortDirection.DESC ) val taggedPayments = getActivities( + walletId = "bitkit", filter = ActivityFilter.ALL, + txType = null, tags = listOf("coffee"), - limit = 20 + search = null, + minDate = null, + maxDate = null, + limit = 20u, + sortDirection = SortDirection.DESC ) // Get specific activity - getActivityById("ln456")?.let { foundActivity -> + getActivityById(walletId = "bitkit", activityId = "ln456")?.let { foundActivity -> when (foundActivity) { - is Activity.Onchain -> println("Found onchain activity: ${foundActivity.txId}") - is Activity.Lightning -> println("Found lightning activity: ${foundActivity.preimage}") + is Activity.Onchain -> println("Found onchain activity: ${foundActivity.v1.txId}") + is Activity.Lightning -> println("Found lightning activity: ${foundActivity.v1.preimage}") } } @@ -237,21 +311,22 @@ fun manageActivities() { updateActivity(activityId = "ln456", activity = updatedActivity) // Tag operations - addTags(activityId = "ln456", tags = listOf("income", "coffee")) - val tags = getTags(activityId = "ln456") + addTags(walletId = "bitkit", activityId = "ln456", tags = listOf("income", "coffee")) + val tags = getTags(walletId = "bitkit", activityId = "ln456") val taggedActivities = getActivitiesByTag( + walletId = "bitkit", tag = "coffee", - limit = 5, + limit = 5u, sortDirection = SortDirection.DESC ) // Get all unique tags val allUniqueTags = getAllUniqueTags() // ["coffee", "food", "payment"] - removeTags(activityId = "ln456", tags = listOf("income")) + removeTags(walletId = "bitkit", activityId = "ln456", tags = listOf("income")) // Delete activity - val deleted = deleteActivityById(activityId = "ln456") + val deleted = deleteActivityById(walletId = "bitkit", activityId = "ln456") // Wipe all activity data (use with caution!) activityWipeAll() @@ -264,6 +339,7 @@ fun manageActivities() { ### Python ```python +import time from bitkitcore import * try: @@ -272,6 +348,7 @@ try: # Create and store an onchain activity onchain_activity = OnchainActivity( + wallet_id="bitkit", id="tx123", tx_type=PaymentType.SENT, tx_id="abc123", @@ -287,15 +364,20 @@ try: does_exist=True, confirm_timestamp=1234568890, channel_id=None, - transfer_tx_id=None + transfer_tx_id=None, + contact=None, + created_at=None, + updated_at=None, + seen_at=None ) # Wrap in Activity enum and insert - activity = Activity.Onchain(onchain_activity) + activity = Activity.ONCHAIN(onchain_activity) insert_activity(activity) # Retrieve activities with advanced filtering filtered_activities = get_activities( + wallet_id="bitkit", filter=ActivityFilter.ALL, tx_type=PaymentType.SENT, tags=["coffee", "food"], @@ -308,6 +390,7 @@ try: # Simple query (all parameters are optional) simple_query = get_activities( + wallet_id=None, filter=ActivityFilter.ALL, tx_type=None, tags=None, @@ -320,38 +403,57 @@ try: # Filter by specific criteria sent_payments = get_activities( + wallet_id="bitkit", filter=ActivityFilter.ALL, tx_type=PaymentType.SENT, - limit=10 + tags=None, + search=None, + min_date=None, + max_date=None, + limit=10, + sort_direction=SortDirection.DESC ) recent_lightning = get_activities( + wallet_id="bitkit", filter=ActivityFilter.LIGHTNING, + tx_type=None, + tags=None, + search=None, min_date=int(time.time()) - 86400, # Last 24 hours - limit=10 + max_date=None, + limit=10, + sort_direction=SortDirection.DESC ) tagged_payments = get_activities( + wallet_id="bitkit", filter=ActivityFilter.ALL, + tx_type=None, tags=["coffee"], - limit=10 + search=None, + min_date=None, + max_date=None, + limit=10, + sort_direction=SortDirection.DESC ) # Get specific activity - if found_activity := get_activity_by_id("tx123"): - if isinstance(found_activity, Activity.Onchain): - print(f"Found onchain activity: {found_activity.tx_id}") - elif isinstance(found_activity, Activity.Lightning): - print(f"Found lightning activity: {found_activity.preimage}") + if found_activity := get_activity_by_id("bitkit", "tx123"): + if isinstance(found_activity, Activity.ONCHAIN): + print(f"Found onchain activity: {found_activity[0].tx_id}") + elif isinstance(found_activity, Activity.LIGHTNING): + print(f"Found lightning activity: {found_activity[0].preimage}") # Update activity - updated_activity = Activity.Onchain(onchain_activity) + updated_activity = Activity.ONCHAIN(onchain_activity) update_activity(activity_id="tx123", activity=updated_activity) # Tag operations - add_tags("tx123", ["payment", "coffee"]) - tags = get_tags("tx123") + add_tags("bitkit", "tx123", ["payment", "coffee"]) + tags = get_tags("bitkit", "tx123") tagged_activities = get_activities_by_tag( + wallet_id="bitkit", tag="coffee", limit=5, sort_direction=SortDirection.DESC @@ -360,10 +462,10 @@ try: # Get all unique tags with optional sorting all_unique_tags = get_all_unique_tags() # ["coffee", "food", "payment"] - remove_tags("tx123", ["payment"]) + remove_tags("bitkit", "tx123", ["payment"]) # Delete activity - deleted = delete_activity_by_id("tx123") + deleted = delete_activity_by_id("bitkit", "tx123") # Wipe all activity data (use with caution!) activity_wipe_all() @@ -388,6 +490,7 @@ except Exception as e: - `Failed`: Payment failed ### OnchainActivity Fields +- `wallet_id`: String - Wallet identifier - `id`: String - Unique identifier - `tx_type`: PaymentType - Type of transaction (Sent/Received) - `tx_id`: String - Transaction ID @@ -408,6 +511,7 @@ except Exception as e: - `updated_at`: Option - Last update timestamp (optional) ### LightningActivity Fields +- `wallet_id`: String - Wallet identifier - `id`: String - Unique identifier - `tx_type`: PaymentType - Type of transaction (Sent/Received) - `status`: PaymentState - Payment state (Pending/Succeeded/Failed) @@ -420,6 +524,19 @@ except Exception as e: - `created_at`: Option - Creation timestamp (optional) - `updated_at`: Option - Last update timestamp (optional) +### PreActivityMetadata Fields +- `wallet_id`: String - Wallet identifier +- `payment_id`: String - Pending payment identifier +- `tags`: Vec - Tags to attach when the activity is created +- `payment_hash`: Option - Lightning payment hash (optional) +- `tx_id`: Option - On-chain transaction ID (optional) +- `address`: Option - Bitcoin address used for lookup (optional) +- `is_receive`: bool - Whether this metadata is for a receive flow +- `fee_rate`: u64 - Fee rate to apply when transferred +- `is_transfer`: bool - Internal transfer flag to apply when transferred +- `channel_id`: Option - Associated channel ID (optional) +- `created_at`: u64 - Creation timestamp + ## Activity Types and Data Structures ### Activity Filters @@ -447,4 +564,4 @@ The module uses the `ActivityError` enum which includes: - `DataError`: Issues with data format or constraints - `InsertError`: Failures during insert operations - `RetrievalError`: Failures during data retrieval -- `UpdateError`: Failures during update operations \ No newline at end of file +- `UpdateError`: Failures during update operations diff --git a/src/modules/activity/implementation.rs b/src/modules/activity/implementation.rs index 8174f0e..59ffb27 100644 --- a/src/modules/activity/implementation.rs +++ b/src/modules/activity/implementation.rs @@ -9,21 +9,38 @@ use serde_json; pub struct ActivityDB { pub conn: Connection, } + +struct TableColumn { + name: String, + pk_index: i64, +} + +fn select_or_default(columns: &[TableColumn], column: &str, default_sql: &str) -> String { + if columns.iter().any(|existing| existing.name == column) { + column.to_string() + } else { + default_sql.to_string() + } +} + const CREATE_ACTIVITIES_TABLE: &str = " CREATE TABLE IF NOT EXISTS activities ( - id TEXT PRIMARY KEY, + id TEXT NOT NULL, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), activity_type TEXT NOT NULL CHECK (activity_type IN ('onchain', 'lightning')), tx_type TEXT NOT NULL CHECK (tx_type IN ('sent', 'received')), timestamp INTEGER NOT NULL CHECK (timestamp > 0), created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), seen_at INTEGER CHECK (seen_at IS NULL OR seen_at > 0), - contact TEXT CHECK (contact IS NULL OR length(contact) > 0) + contact TEXT CHECK (contact IS NULL OR length(contact) > 0), + PRIMARY KEY (wallet_id, id) )"; const CREATE_ONCHAIN_TABLE: &str = " CREATE TABLE IF NOT EXISTS onchain_activity ( - id TEXT PRIMARY KEY, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + id TEXT NOT NULL, tx_id TEXT NOT NULL, address TEXT NOT NULL CHECK (length(address) > 0), confirmed BOOLEAN NOT NULL, @@ -43,12 +60,14 @@ const CREATE_ONCHAIN_TABLE: &str = " transfer_tx_id TEXT CHECK ( transfer_tx_id IS NULL OR length(transfer_tx_id) > 0 ), - FOREIGN KEY (id) REFERENCES activities(id) ON DELETE CASCADE + PRIMARY KEY (wallet_id, id), + FOREIGN KEY (wallet_id, id) REFERENCES activities(wallet_id, id) ON DELETE CASCADE )"; const CREATE_LIGHTNING_TABLE: &str = " CREATE TABLE IF NOT EXISTS lightning_activity ( - id TEXT PRIMARY KEY, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + id TEXT NOT NULL, invoice TEXT NOT NULL CHECK (length(invoice) > 0), value INTEGER NOT NULL CHECK (value >= 0), status TEXT NOT NULL CHECK (status IN ('pending', 'succeeded', 'failed')), @@ -57,21 +76,24 @@ const CREATE_LIGHTNING_TABLE: &str = " preimage TEXT CHECK ( preimage IS NULL OR length(preimage) > 0 ), - FOREIGN KEY (id) REFERENCES activities(id) ON DELETE CASCADE + PRIMARY KEY (wallet_id, id), + FOREIGN KEY (wallet_id, id) REFERENCES activities(wallet_id, id) ON DELETE CASCADE )"; const CREATE_TAGS_TABLE: &str = " CREATE TABLE IF NOT EXISTS activity_tags ( + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), activity_id TEXT NOT NULL, tag TEXT NOT NULL, - PRIMARY KEY (activity_id, tag), - FOREIGN KEY (activity_id) REFERENCES activities(id) + PRIMARY KEY (wallet_id, activity_id, tag), + FOREIGN KEY (wallet_id, activity_id) REFERENCES activities(wallet_id, id) ON DELETE CASCADE )"; const CREATE_PRE_ACTIVITY_METADATA_TABLE: &str = " CREATE TABLE IF NOT EXISTS pre_activity_metadata ( - payment_id TEXT PRIMARY KEY, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + payment_id TEXT NOT NULL, tags TEXT NOT NULL, payment_hash TEXT, tx_id TEXT, @@ -80,7 +102,8 @@ const CREATE_PRE_ACTIVITY_METADATA_TABLE: &str = " fee_rate INTEGER NOT NULL DEFAULT 0, is_transfer BOOLEAN NOT NULL DEFAULT FALSE, channel_id TEXT, - created_at INTEGER NOT NULL DEFAULT 0 + created_at INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (wallet_id, payment_id) )"; const CREATE_CLOSED_CHANNELS_TABLE: &str = " @@ -103,10 +126,12 @@ const CREATE_CLOSED_CHANNELS_TABLE: &str = " const CREATE_TRANSACTION_DETAILS_TABLE: &str = " CREATE TABLE IF NOT EXISTS transaction_details ( - tx_id TEXT PRIMARY KEY, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + tx_id TEXT NOT NULL, amount_sats INTEGER NOT NULL, inputs TEXT NOT NULL, - outputs TEXT NOT NULL + outputs TEXT NOT NULL, + PRIMARY KEY (wallet_id, tx_id) )"; const UPSERT_CLOSED_CHANNEL_SQL: &str = " @@ -124,26 +149,31 @@ const INDEX_STATEMENTS: &[&str] = &[ // Activity indexes "CREATE INDEX IF NOT EXISTS idx_activities_type_timestamp ON activities(activity_type, timestamp DESC)", "CREATE INDEX IF NOT EXISTS idx_activities_timestamp ON activities(timestamp DESC)", + "CREATE INDEX IF NOT EXISTS idx_activities_wallet_timestamp ON activities(wallet_id, timestamp DESC)", + "CREATE INDEX IF NOT EXISTS idx_activities_wallet_type_timestamp ON activities(wallet_id, activity_type, timestamp DESC)", // Onchain indexes "CREATE INDEX IF NOT EXISTS idx_onchain_txid_confirmed ON onchain_activity(tx_id, confirmed)", + "CREATE INDEX IF NOT EXISTS idx_onchain_wallet_txid ON onchain_activity(wallet_id, tx_id)", "CREATE INDEX IF NOT EXISTS idx_onchain_confirmed_timestamp ON onchain_activity(confirmed, confirm_timestamp DESC)", - "CREATE UNIQUE INDEX IF NOT EXISTS idx_onchain_id ON onchain_activity(id)", // Lightning indexes "CREATE INDEX IF NOT EXISTS idx_lightning_status_value ON lightning_activity(status, value DESC)", - "CREATE UNIQUE INDEX IF NOT EXISTS idx_lightning_id ON lightning_activity(id)", + "CREATE INDEX IF NOT EXISTS idx_lightning_wallet_id ON lightning_activity(wallet_id, id)", // Tags indexes - "CREATE INDEX IF NOT EXISTS idx_activity_tags_tag_activity ON activity_tags(tag, activity_id)", + "CREATE INDEX IF NOT EXISTS idx_activity_tags_tag_activity ON activity_tags(tag, wallet_id, activity_id)", // Pre-activity metadata indexes - "CREATE INDEX IF NOT EXISTS idx_pre_activity_metadata_id ON pre_activity_metadata(payment_id)", - "CREATE INDEX IF NOT EXISTS idx_pre_activity_metadata_address ON pre_activity_metadata(address)", - "CREATE INDEX IF NOT EXISTS idx_pre_activity_metadata_tx_id ON pre_activity_metadata(tx_id)", + "CREATE INDEX IF NOT EXISTS idx_pre_activity_metadata_id ON pre_activity_metadata(wallet_id, payment_id)", + "CREATE INDEX IF NOT EXISTS idx_pre_activity_metadata_address ON pre_activity_metadata(wallet_id, address)", + "CREATE INDEX IF NOT EXISTS idx_pre_activity_metadata_tx_id ON pre_activity_metadata(wallet_id, tx_id)", // Closed channels indexes - "CREATE INDEX IF NOT EXISTS idx_closed_channels_funding_txo ON closed_channels(funding_txo_txid)" + "CREATE INDEX IF NOT EXISTS idx_closed_channels_funding_txo ON closed_channels(funding_txo_txid)", + + // Transaction details indexes + "CREATE INDEX IF NOT EXISTS idx_transaction_details_txid ON transaction_details(tx_id)" ]; const TRIGGER_STATEMENTS: &[&str] = &[ @@ -153,7 +183,7 @@ const TRIGGER_STATEMENTS: &[&str] = &[ BEGIN UPDATE activities SET updated_at = strftime('%s', 'now') - WHERE id = NEW.id; + WHERE wallet_id = NEW.wallet_id AND id = NEW.id; END", // Insert confirm timestamp validation trigger "CREATE TRIGGER IF NOT EXISTS onchain_confirm_timestamp_check_insert @@ -162,7 +192,8 @@ const TRIGGER_STATEMENTS: &[&str] = &[ BEGIN SELECT CASE WHEN NEW.confirm_timestamp < ( - SELECT timestamp FROM activities WHERE id = NEW.id + SELECT timestamp FROM activities + WHERE wallet_id = NEW.wallet_id AND id = NEW.id ) THEN RAISE(ABORT, 'confirm_timestamp must be greater than or equal to timestamp') END; @@ -174,18 +205,19 @@ const TRIGGER_STATEMENTS: &[&str] = &[ BEGIN SELECT CASE WHEN NEW.confirm_timestamp < ( - SELECT timestamp FROM activities WHERE id = NEW.id + SELECT timestamp FROM activities + WHERE wallet_id = NEW.wallet_id AND id = NEW.id ) THEN RAISE(ABORT, 'confirm_timestamp must be greater than or equal to timestamp') END; END", ]; -/// Migrations to apply to the activities table. +/// Column-add migrations to apply to the activities table. /// Each entry is (column_name, ALTER TABLE statement). The column is checked /// via `PRAGMA table_info` before running the statement to avoid relying on /// locale-dependent SQLite error messages. -const MIGRATIONS: &[(&str, &str)] = &[ +const ACTIVITY_TABLE_COLUMN_MIGRATIONS: &[(&str, &str)] = &[ ( "seen_at", "ALTER TABLE activities ADD COLUMN seen_at INTEGER CHECK (seen_at IS NULL OR seen_at > 0)", @@ -194,6 +226,10 @@ const MIGRATIONS: &[(&str, &str)] = &[ "contact", "ALTER TABLE activities ADD COLUMN contact TEXT CHECK (contact IS NULL OR length(contact) > 0)", ), + ( + "wallet_id", + "ALTER TABLE activities ADD COLUMN wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0)", + ), ]; impl ActivityDB { @@ -283,6 +319,11 @@ impl ActivityDB { }); } + self.run_activity_table_column_migrations()?; + self.migrate_activity_tables_to_wallet_primary_keys()?; + self.migrate_transaction_details_table()?; + self.migrate_pre_activity_metadata_table()?; + // Create indexes for statement in INDEX_STATEMENTS { if let Err(e) = self.conn.execute(statement, []) { @@ -301,22 +342,50 @@ impl ActivityDB { } } - // Run migrations. Check if each column already exists via PRAGMA table_info - // before running ALTER TABLE, so we don't rely on locale-dependent error messages. - for (column, statement) in MIGRATIONS { - let column_exists: bool = self - .conn - .prepare("PRAGMA table_info(activities)") - .and_then(|mut stmt| { - stmt.query_map([], |row| row.get::<_, String>(1)) - .map(|rows| rows.filter_map(|r| r.ok()).any(|name| name == *column)) + Ok(()) + } + + fn table_columns(&self, table_name: &str) -> Result, ActivityError> { + let query = format!("PRAGMA table_info({})", table_name); + let mut stmt = + self.conn + .prepare(&query) + .map_err(|e| ActivityError::InitializationError { + error_details: format!("Failed to inspect {} table: {}", table_name, e), + })?; + + let rows = stmt + .query_map([], |row| { + Ok(TableColumn { + name: row.get(1)?, + pk_index: row.get(5)?, }) - .unwrap_or(false); + }) + .map_err(|e| ActivityError::InitializationError { + error_details: format!("Failed to inspect {} table: {}", table_name, e), + })?; + + let columns = rows.collect::, _>>().map_err(|e| { + ActivityError::InitializationError { + error_details: format!("Failed to inspect {} table: {}", table_name, e), + } + })?; + + Ok(columns) + } + + fn run_activity_table_column_migrations(&self) -> Result<(), ActivityError> { + let columns = self.table_columns("activities")?; + + for (column, statement) in ACTIVITY_TABLE_COLUMN_MIGRATIONS { + let column_exists = columns + .iter() + .any(|column_info| column_info.name.as_str() == *column); if !column_exists { self.conn.execute(statement, []).map_err(|e| { ActivityError::InitializationError { - error_details: format!("Error running migration: {}", e), + error_details: format!("Error running activity table migration: {}", e), } })?; } @@ -325,6 +394,309 @@ impl ActivityDB { Ok(()) } + fn normalize_wallet_id(wallet_id: &str) -> Result { + let wallet_id = wallet_id.trim(); + if wallet_id.is_empty() { + return Err(ActivityError::InvalidActivity { + error_details: "Wallet ID cannot be empty".to_string(), + }); + } + + Ok(wallet_id.to_string()) + } + + fn table_has_primary_key_columns( + &self, + table_name: &str, + primary_key_columns: &[&str], + ) -> Result { + let columns = self.table_columns(table_name)?; + + Ok(primary_key_columns.iter().all(|primary_key_column| { + columns + .iter() + .any(|column| column.name == *primary_key_column && column.pk_index > 0) + })) + } + + fn migrate_activity_tables_to_wallet_primary_keys(&self) -> Result<(), ActivityError> { + let activities_have_composite_key = + self.table_has_primary_key_columns("activities", &["wallet_id", "id"])?; + let onchain_has_composite_key = + self.table_has_primary_key_columns("onchain_activity", &["wallet_id", "id"])?; + let lightning_has_composite_key = + self.table_has_primary_key_columns("lightning_activity", &["wallet_id", "id"])?; + let tags_have_composite_key = self + .table_has_primary_key_columns("activity_tags", &["wallet_id", "activity_id", "tag"])?; + + if activities_have_composite_key + && onchain_has_composite_key + && lightning_has_composite_key + && tags_have_composite_key + { + return Ok(()); + } + + self.conn + .execute_batch( + " + BEGIN IMMEDIATE; + ALTER TABLE activity_tags RENAME TO activity_tags_legacy; + ALTER TABLE onchain_activity RENAME TO onchain_activity_legacy; + ALTER TABLE lightning_activity RENAME TO lightning_activity_legacy; + ALTER TABLE activities RENAME TO activities_legacy; + + CREATE TABLE activities ( + id TEXT NOT NULL, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + activity_type TEXT NOT NULL CHECK (activity_type IN ('onchain', 'lightning')), + tx_type TEXT NOT NULL CHECK (tx_type IN ('sent', 'received')), + timestamp INTEGER NOT NULL CHECK (timestamp > 0), + created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), + updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), + seen_at INTEGER CHECK (seen_at IS NULL OR seen_at > 0), + contact TEXT CHECK (contact IS NULL OR length(contact) > 0), + PRIMARY KEY (wallet_id, id) + ); + + CREATE TABLE onchain_activity ( + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + id TEXT NOT NULL, + tx_id TEXT NOT NULL, + address TEXT NOT NULL CHECK (length(address) > 0), + confirmed BOOLEAN NOT NULL, + value INTEGER NOT NULL CHECK (value >= 0), + fee INTEGER NOT NULL CHECK (fee >= 0), + fee_rate INTEGER NOT NULL CHECK (fee_rate >= 0), + is_boosted BOOLEAN NOT NULL, + boost_tx_ids TEXT NOT NULL, + is_transfer BOOLEAN NOT NULL, + does_exist BOOLEAN NOT NULL, + confirm_timestamp INTEGER CHECK ( + confirm_timestamp IS NULL OR confirm_timestamp >= 0 + ), + channel_id TEXT CHECK ( + channel_id IS NULL OR length(channel_id) > 0 + ), + transfer_tx_id TEXT CHECK ( + transfer_tx_id IS NULL OR length(transfer_tx_id) > 0 + ), + PRIMARY KEY (wallet_id, id), + FOREIGN KEY (wallet_id, id) REFERENCES activities(wallet_id, id) ON DELETE CASCADE + ); + + CREATE TABLE lightning_activity ( + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + id TEXT NOT NULL, + invoice TEXT NOT NULL CHECK (length(invoice) > 0), + value INTEGER NOT NULL CHECK (value >= 0), + status TEXT NOT NULL CHECK (status IN ('pending', 'succeeded', 'failed')), + fee INTEGER CHECK (fee IS NULL OR fee >= 0), + message TEXT NOT NULL, + preimage TEXT CHECK ( + preimage IS NULL OR length(preimage) > 0 + ), + PRIMARY KEY (wallet_id, id), + FOREIGN KEY (wallet_id, id) REFERENCES activities(wallet_id, id) ON DELETE CASCADE + ); + + CREATE TABLE activity_tags ( + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + activity_id TEXT NOT NULL, + tag TEXT NOT NULL, + PRIMARY KEY (wallet_id, activity_id, tag), + FOREIGN KEY (wallet_id, activity_id) REFERENCES activities(wallet_id, id) + ON DELETE CASCADE + ); + + INSERT OR IGNORE INTO activities ( + wallet_id, id, activity_type, tx_type, timestamp, created_at, + updated_at, seen_at, contact + ) + SELECT + COALESCE(NULLIF(wallet_id, ''), 'bitkit'), + id, activity_type, tx_type, timestamp, created_at, updated_at, seen_at, contact + FROM activities_legacy; + + INSERT OR IGNORE INTO onchain_activity ( + wallet_id, id, tx_id, address, confirmed, value, fee, fee_rate, + is_boosted, boost_tx_ids, is_transfer, does_exist, confirm_timestamp, + channel_id, transfer_tx_id + ) + SELECT + COALESCE(NULLIF(a.wallet_id, ''), 'bitkit'), + o.id, o.tx_id, o.address, o.confirmed, o.value, o.fee, o.fee_rate, + o.is_boosted, o.boost_tx_ids, o.is_transfer, o.does_exist, + o.confirm_timestamp, o.channel_id, o.transfer_tx_id + FROM onchain_activity_legacy o + JOIN activities_legacy a ON a.id = o.id; + + INSERT OR IGNORE INTO lightning_activity ( + wallet_id, id, invoice, value, status, fee, message, preimage + ) + SELECT + COALESCE(NULLIF(a.wallet_id, ''), 'bitkit'), + l.id, l.invoice, l.value, l.status, l.fee, l.message, l.preimage + FROM lightning_activity_legacy l + JOIN activities_legacy a ON a.id = l.id; + + INSERT OR IGNORE INTO activity_tags (wallet_id, activity_id, tag) + SELECT + COALESCE(NULLIF(a.wallet_id, ''), 'bitkit'), + t.activity_id, t.tag + FROM activity_tags_legacy t + JOIN activities_legacy a ON a.id = t.activity_id; + + DROP TABLE activity_tags_legacy; + DROP TABLE onchain_activity_legacy; + DROP TABLE lightning_activity_legacy; + DROP TABLE activities_legacy; + COMMIT; + ", + ) + .map_err(|e| ActivityError::InitializationError { + error_details: format!("Failed to migrate activity tables: {}", e), + })?; + + Ok(()) + } + + fn migrate_transaction_details_table(&self) -> Result<(), ActivityError> { + // Rebuild transaction_details when needed because SQLite cannot change the primary key + // in-place from tx_id to (wallet_id, tx_id). + let columns = self.table_columns("transaction_details")?; + + let has_wallet_id = columns.iter().any(|column| column.name == "wallet_id"); + let wallet_id_is_pk = columns + .iter() + .any(|column| column.name == "wallet_id" && column.pk_index > 0); + let tx_id_is_pk = columns + .iter() + .any(|column| column.name == "tx_id" && column.pk_index > 0); + + if has_wallet_id && wallet_id_is_pk && tx_id_is_pk { + return Ok(()); + } + + let wallet_id_select = if has_wallet_id { + "COALESCE(NULLIF(wallet_id, ''), 'bitkit')" + } else { + "'bitkit'" + }; + + let migration_sql = format!( + " + BEGIN IMMEDIATE; + ALTER TABLE transaction_details RENAME TO transaction_details_legacy; + CREATE TABLE transaction_details ( + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + tx_id TEXT NOT NULL, + amount_sats INTEGER NOT NULL, + inputs TEXT NOT NULL, + outputs TEXT NOT NULL, + PRIMARY KEY (wallet_id, tx_id) + ); + INSERT OR IGNORE INTO transaction_details ( + wallet_id, tx_id, amount_sats, inputs, outputs + ) + SELECT {}, tx_id, amount_sats, inputs, outputs + FROM transaction_details_legacy; + DROP TABLE transaction_details_legacy; + COMMIT; + ", + wallet_id_select + ); + + self.conn.execute_batch(&migration_sql).map_err(|e| { + ActivityError::InitializationError { + error_details: format!("Failed to migrate transaction_details table: {}", e), + } + })?; + + Ok(()) + } + + fn migrate_pre_activity_metadata_table(&self) -> Result<(), ActivityError> { + // Rebuild pre_activity_metadata when needed because SQLite cannot change the primary key + // in-place from payment_id to (wallet_id, payment_id). + let columns = self.table_columns("pre_activity_metadata")?; + + let has_wallet_id = columns.iter().any(|column| column.name == "wallet_id"); + let wallet_id_is_pk = columns + .iter() + .any(|column| column.name == "wallet_id" && column.pk_index > 0); + let payment_id_is_pk = columns + .iter() + .any(|column| column.name == "payment_id" && column.pk_index > 0); + + if has_wallet_id && wallet_id_is_pk && payment_id_is_pk { + return Ok(()); + } + + let wallet_id_select = if has_wallet_id { + "COALESCE(NULLIF(wallet_id, ''), 'bitkit')" + } else { + "'bitkit'" + }; + + let payment_hash_select = select_or_default(&columns, "payment_hash", "NULL"); + let tx_id_select = select_or_default(&columns, "tx_id", "NULL"); + let address_select = select_or_default(&columns, "address", "NULL"); + let is_receive_select = select_or_default(&columns, "is_receive", "FALSE"); + let fee_rate_select = select_or_default(&columns, "fee_rate", "0"); + let is_transfer_select = select_or_default(&columns, "is_transfer", "FALSE"); + let channel_id_select = select_or_default(&columns, "channel_id", "NULL"); + let created_at_select = select_or_default(&columns, "created_at", "0"); + + let migration_sql = format!( + " + BEGIN IMMEDIATE; + ALTER TABLE pre_activity_metadata RENAME TO pre_activity_metadata_legacy; + CREATE TABLE pre_activity_metadata ( + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + payment_id TEXT NOT NULL, + tags TEXT NOT NULL, + payment_hash TEXT, + tx_id TEXT, + address TEXT, + is_receive BOOLEAN NOT NULL DEFAULT FALSE, + fee_rate INTEGER NOT NULL DEFAULT 0, + is_transfer BOOLEAN NOT NULL DEFAULT FALSE, + channel_id TEXT, + created_at INTEGER NOT NULL DEFAULT 0, + PRIMARY KEY (wallet_id, payment_id) + ); + INSERT OR IGNORE INTO pre_activity_metadata ( + wallet_id, payment_id, tags, payment_hash, tx_id, address, + is_receive, fee_rate, is_transfer, channel_id, created_at + ) + SELECT + {}, payment_id, tags, {}, {}, {}, + {}, {}, {}, {}, {} + FROM pre_activity_metadata_legacy; + DROP TABLE pre_activity_metadata_legacy; + COMMIT; + ", + wallet_id_select, + payment_hash_select, + tx_id_select, + address_select, + is_receive_select, + fee_rate_select, + is_transfer_select, + channel_id_select, + created_at_select + ); + + self.conn.execute_batch(&migration_sql).map_err(|e| { + ActivityError::InitializationError { + error_details: format!("Failed to migrate pre_activity_metadata table: {}", e), + } + })?; + + Ok(()) + } + pub fn upsert_activity(&mut self, activity: &Activity) -> Result<(), ActivityError> { match activity { Activity::Onchain(onchain) => { @@ -362,28 +734,27 @@ impl ActivityDB { error_details: "Activity ID cannot be empty".to_string(), }); } + let wallet_id = Self::normalize_wallet_id(&activity.wallet_id)?; - let tx = match self + let tx = self .conn .transaction() .map_err(|e| ActivityError::DataError { error_details: format!("Failed to start transaction: {}", e), - }) { - Ok(tx) => tx, - Err(e) => return Err(e), - }; + })?; let activities_sql = " INSERT INTO activities ( - id, activity_type, tx_type, timestamp, contact + id, wallet_id, activity_type, tx_type, timestamp, contact ) VALUES ( - ?1, 'onchain', ?2, ?3, ?4 + ?1, ?2, 'onchain', ?3, ?4, ?5 )"; tx.execute( activities_sql, ( &activity.id, + &wallet_id, Self::payment_type_to_string(&activity.tx_type), activity.timestamp, &activity.contact, @@ -395,11 +766,11 @@ impl ActivityDB { let onchain_sql = " INSERT INTO onchain_activity ( - id, tx_id, address, confirmed, value, fee, fee_rate, is_boosted, + wallet_id, id, tx_id, address, confirmed, value, fee, fee_rate, is_boosted, boost_tx_ids, is_transfer, does_exist, confirm_timestamp, channel_id, transfer_tx_id ) VALUES ( - ?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14 + ?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15 )"; let boost_tx_ids_str = activity.boost_tx_ids.join(","); @@ -407,6 +778,7 @@ impl ActivityDB { tx.execute( onchain_sql, ( + &wallet_id, &activity.id, &activity.tx_id, &activity.address, @@ -433,12 +805,14 @@ impl ActivityDB { if activity.tx_type == PaymentType::Received { let _ = self.transfer_pre_activity_metadata_to_activity( + &wallet_id, &activity.address, &activity.id, true, ); } else if activity.tx_type == PaymentType::Sent { let _ = self.transfer_pre_activity_metadata_to_activity( + &wallet_id, &activity.tx_id, &activity.id, false, @@ -453,6 +827,7 @@ impl ActivityDB { &mut self, activity: &LightningActivity, ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(&activity.wallet_id)?; let tx = self .conn .transaction() @@ -462,15 +837,16 @@ impl ActivityDB { let activities_sql = " INSERT INTO activities ( - id, activity_type, tx_type, timestamp, contact + id, wallet_id, activity_type, tx_type, timestamp, contact ) VALUES ( - ?1, 'lightning', ?2, ?3, ?4 + ?1, ?2, 'lightning', ?3, ?4, ?5 )"; tx.execute( activities_sql, ( &activity.id, + &wallet_id, Self::payment_type_to_string(&activity.tx_type), activity.timestamp, &activity.contact, @@ -482,14 +858,15 @@ impl ActivityDB { let lightning_sql = " INSERT INTO lightning_activity ( - id, invoice, value, status, fee, message, preimage + wallet_id, id, invoice, value, status, fee, message, preimage ) VALUES ( - ?1, ?2, ?3, ?4, ?5, ?6, ?7 + ?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8 )"; tx.execute( lightning_sql, ( + &wallet_id, &activity.id, &activity.invoice, activity.value, @@ -507,7 +884,12 @@ impl ActivityDB { error_details: format!("Failed to commit transaction: {}", e), })?; - let _ = self.transfer_pre_activity_metadata_to_activity(&activity.id, &activity.id, false); + let _ = self.transfer_pre_activity_metadata_to_activity( + &wallet_id, + &activity.id, + &activity.id, + false, + ); Ok(()) } @@ -528,20 +910,45 @@ impl ActivityDB { })?; { - let mut stmt_act = tx.prepare( - "INSERT OR REPLACE INTO activities (id, activity_type, tx_type, timestamp, contact) VALUES (?1, 'onchain', ?2, ?3, ?4)" - ).map_err(|e| ActivityError::DataError { - error_details: format!("Failed to prepare activities statement: {}", e), - })?; + let mut stmt_act = tx + .prepare( + "INSERT INTO activities ( + id, wallet_id, activity_type, tx_type, timestamp, contact + ) VALUES ( + ?1, ?2, 'onchain', ?3, ?4, ?5 + ) + ON CONFLICT(wallet_id, id) DO UPDATE SET + activity_type = excluded.activity_type, + tx_type = excluded.tx_type, + timestamp = excluded.timestamp, + contact = excluded.contact", + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to prepare activities statement: {}", e), + })?; let mut stmt_onchain = tx .prepare( - "INSERT OR REPLACE INTO onchain_activity ( - id, tx_id, address, confirmed, value, fee, fee_rate, is_boosted, + "INSERT INTO onchain_activity ( + wallet_id, id, tx_id, address, confirmed, value, fee, fee_rate, is_boosted, boost_tx_ids, is_transfer, does_exist, confirm_timestamp, channel_id, transfer_tx_id ) VALUES ( - ?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14 - )", + ?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15 + ) + ON CONFLICT(wallet_id, id) DO UPDATE SET + tx_id = excluded.tx_id, + address = excluded.address, + confirmed = excluded.confirmed, + value = excluded.value, + fee = excluded.fee, + fee_rate = excluded.fee_rate, + is_boosted = excluded.is_boosted, + boost_tx_ids = excluded.boost_tx_ids, + is_transfer = excluded.is_transfer, + does_exist = excluded.does_exist, + confirm_timestamp = excluded.confirm_timestamp, + channel_id = excluded.channel_id, + transfer_tx_id = excluded.transfer_tx_id", ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to prepare onchain statement: {}", e), @@ -553,10 +960,12 @@ impl ActivityDB { error_details: "Activity ID cannot be empty".to_string(), }); } + let wallet_id = Self::normalize_wallet_id(&activity.wallet_id)?; stmt_act .execute(( &activity.id, + &wallet_id, Self::payment_type_to_string(&activity.tx_type), activity.timestamp, &activity.contact, @@ -568,6 +977,7 @@ impl ActivityDB { let boost_tx_ids_str = activity.boost_tx_ids.join(","); stmt_onchain .execute(( + &wallet_id, &activity.id, &activity.tx_id, &activity.address, @@ -593,6 +1003,10 @@ impl ActivityDB { error_details: format!("Failed to commit transaction: {}", e), })?; + for activity in activities { + self.apply_pre_activity_metadata_for_onchain(activity, &activity.id); + } + Ok(()) } @@ -612,18 +1026,36 @@ impl ActivityDB { })?; { - let mut stmt_act = tx.prepare( - "INSERT OR REPLACE INTO activities (id, activity_type, tx_type, timestamp, contact) VALUES (?1, 'lightning', ?2, ?3, ?4)" - ).map_err(|e| ActivityError::DataError { - error_details: format!("Failed to prepare activities statement: {}", e), - })?; + let mut stmt_act = tx + .prepare( + "INSERT INTO activities ( + id, wallet_id, activity_type, tx_type, timestamp, contact + ) VALUES ( + ?1, ?2, 'lightning', ?3, ?4, ?5 + ) + ON CONFLICT(wallet_id, id) DO UPDATE SET + activity_type = excluded.activity_type, + tx_type = excluded.tx_type, + timestamp = excluded.timestamp, + contact = excluded.contact", + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to prepare activities statement: {}", e), + })?; let mut stmt_ln = tx .prepare( - "INSERT OR REPLACE INTO lightning_activity ( - id, invoice, value, status, fee, message, preimage + "INSERT INTO lightning_activity ( + wallet_id, id, invoice, value, status, fee, message, preimage ) VALUES ( - ?1, ?2, ?3, ?4, ?5, ?6, ?7 - )", + ?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8 + ) + ON CONFLICT(wallet_id, id) DO UPDATE SET + invoice = excluded.invoice, + value = excluded.value, + status = excluded.status, + fee = excluded.fee, + message = excluded.message, + preimage = excluded.preimage", ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to prepare lightning statement: {}", e), @@ -635,10 +1067,12 @@ impl ActivityDB { error_details: "Activity ID cannot be empty".to_string(), }); } + let wallet_id = Self::normalize_wallet_id(&activity.wallet_id)?; stmt_act .execute(( &activity.id, + &wallet_id, Self::payment_type_to_string(&activity.tx_type), activity.timestamp, &activity.contact, @@ -649,6 +1083,7 @@ impl ActivityDB { stmt_ln .execute(( + &wallet_id, &activity.id, &activity.invoice, activity.value, @@ -667,11 +1102,44 @@ impl ActivityDB { error_details: format!("Failed to commit transaction: {}", e), })?; + for activity in activities { + self.apply_pre_activity_metadata_for_lightning(activity, &activity.id); + } + Ok(()) } + #[allow(clippy::too_many_arguments)] pub fn get_activities( &self, + wallet_id: Option<&str>, + filter: Option, + tx_type: Option, + tags: Option>, + search: Option, + min_date: Option, + max_date: Option, + limit: Option, + sort_direction: Option, + ) -> Result, ActivityError> { + let wallet_id = wallet_id.map(Self::normalize_wallet_id).transpose()?; + self.get_activities_scoped( + wallet_id.as_deref(), + filter, + tx_type, + tags, + search, + min_date, + max_date, + limit, + sort_direction, + ) + } + + #[allow(clippy::too_many_arguments)] + fn get_activities_scoped( + &self, + wallet_id: Option<&str>, filter: Option, tx_type: Option, tags: Option>, @@ -686,11 +1154,11 @@ impl ActivityDB { let mut query = String::from( "WITH filtered_activities AS ( - SELECT DISTINCT a.id + SELECT DISTINCT a.wallet_id, a.id FROM activities a - LEFT JOIN activity_tags t ON a.id = t.activity_id - LEFT JOIN onchain_activity o ON a.id = o.id - LEFT JOIN lightning_activity l ON a.id = l.id + LEFT JOIN activity_tags t ON a.wallet_id = t.wallet_id AND a.id = t.activity_id + LEFT JOIN onchain_activity o ON a.wallet_id = o.wallet_id AND a.id = o.id + LEFT JOIN lightning_activity l ON a.wallet_id = l.wallet_id AND a.id = l.id WHERE 1=1", ); @@ -701,6 +1169,13 @@ impl ActivityDB { ActivityFilter::All => {} } + if let Some(wallet_id) = wallet_id { + query.push_str(&format!( + " AND a.wallet_id = '{}'", + wallet_id.replace('\'', "''") + )); + } + // Transaction type filter if let Some(tx_type) = tx_type { query.push_str(&format!( @@ -748,7 +1223,7 @@ impl ActivityDB { } } - query.push_str(")"); + query.push(')'); // Main query query.push_str( @@ -784,12 +1259,13 @@ impl ActivityDB { l.fee AS ln_fee, l.message AS ln_message, l.preimage AS ln_preimage, - a.contact AS contact + a.contact AS contact, + a.wallet_id AS wallet_id FROM activities a - INNER JOIN filtered_activities fa ON a.id = fa.id - LEFT JOIN onchain_activity o ON a.id = o.id AND a.activity_type = 'onchain' - LEFT JOIN lightning_activity l ON a.id = l.id AND a.activity_type = 'lightning' + INNER JOIN filtered_activities fa ON a.wallet_id = fa.wallet_id AND a.id = fa.id + LEFT JOIN onchain_activity o ON a.wallet_id = o.wallet_id AND a.id = o.id AND a.activity_type = 'onchain' + LEFT JOIN lightning_activity l ON a.wallet_id = l.wallet_id AND a.id = l.id AND a.activity_type = 'lightning' ORDER BY a.timestamp ", ); @@ -827,6 +1303,7 @@ impl ActivityDB { }; Ok(Activity::Onchain(OnchainActivity { + wallet_id: row.get(27)?, id: row.get(0)?, tx_type: Self::parse_payment_type(row, 2)?, timestamp: timestamp as u64, @@ -858,6 +1335,7 @@ impl ActivityDB { let fee: Option = row.get(23)?; Ok(Activity::Lightning(LightningActivity { + wallet_id: row.get(27)?, id: row.get(0)?, tx_type: Self::parse_payment_type(row, 2)?, timestamp: timestamp as u64, @@ -896,10 +1374,15 @@ impl ActivityDB { } /// Retrieves a single activity by its ID. - pub fn get_activity_by_id(&self, activity_id: &str) -> Result, ActivityError> { + pub fn get_activity_by_id( + &self, + wallet_id: &str, + activity_id: &str, + ) -> Result, ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let activity_type: String = match self.conn.query_row( - "SELECT activity_type FROM activities WHERE id = ?1", - [activity_id], + "SELECT activity_type FROM activities WHERE wallet_id = ?1 AND id = ?2", + rusqlite::params![&wallet_id, activity_id], |row| row.get(0), ) { Ok(activity_type) => activity_type, @@ -919,10 +1402,10 @@ impl ActivityDB { o.address, o.confirmed, a.timestamp, o.is_boosted, o.boost_tx_ids, o.is_transfer, o.does_exist, o.confirm_timestamp, o.channel_id, o.transfer_tx_id, a.created_at, a.updated_at, a.seen_at, - a.contact + a.contact, a.wallet_id FROM activities a - JOIN onchain_activity o ON a.id = o.id - WHERE a.id = ?1"; + JOIN onchain_activity o ON a.wallet_id = o.wallet_id AND a.id = o.id + WHERE a.wallet_id = ?1 AND a.id = ?2"; let mut stmt = self.conn @@ -931,51 +1414,53 @@ impl ActivityDB { error_details: format!("Failed to prepare statement: {}", e), })?; - let activity = match stmt.query_row([activity_id], |row| { - let value: i64 = row.get(3)?; - let fee: i64 = row.get(4)?; - let fee_rate: i64 = row.get(5)?; - let timestamp: i64 = row.get(8)?; - let confirm_timestamp: Option = row.get(13)?; - let created_at: Option = row.get(16)?; - let updated_at: Option = row.get(17)?; - let seen_at: Option = row.get(18)?; - let boost_tx_ids_str: String = row.get(10)?; - let boost_tx_ids: Vec = if boost_tx_ids_str.is_empty() { - Vec::new() - } else { - boost_tx_ids_str.split(',').map(|s| s.to_string()).collect() - }; + let activity = + match stmt.query_row(rusqlite::params![&wallet_id, activity_id], |row| { + let value: i64 = row.get(3)?; + let fee: i64 = row.get(4)?; + let fee_rate: i64 = row.get(5)?; + let timestamp: i64 = row.get(8)?; + let confirm_timestamp: Option = row.get(13)?; + let created_at: Option = row.get(16)?; + let updated_at: Option = row.get(17)?; + let seen_at: Option = row.get(18)?; + let boost_tx_ids_str: String = row.get(10)?; + let boost_tx_ids: Vec = if boost_tx_ids_str.is_empty() { + Vec::new() + } else { + boost_tx_ids_str.split(',').map(|s| s.to_string()).collect() + }; - Ok(Activity::Onchain(OnchainActivity { - id: row.get(0)?, - tx_type: Self::parse_payment_type(row, 1)?, - tx_id: row.get(2)?, - value: value as u64, - fee: fee as u64, - fee_rate: fee_rate as u64, - address: row.get(6)?, - confirmed: row.get(7)?, - timestamp: timestamp as u64, - is_boosted: row.get(9)?, - boost_tx_ids, - is_transfer: row.get(11)?, - does_exist: row.get(12)?, - confirm_timestamp: confirm_timestamp.map(|t| t as u64), - channel_id: row.get(14)?, - transfer_tx_id: row.get(15)?, - contact: row.get(19)?, - created_at: created_at.map(|t| t as u64), - updated_at: updated_at.map(|t| t as u64), - seen_at: seen_at.map(|t| t as u64), - })) - }) { - Ok(activity) => Ok(Some(activity)), - Err(rusqlite::Error::QueryReturnedNoRows) => Ok(None), - Err(e) => Err(ActivityError::RetrievalError { - error_details: format!("Failed to get onchain activity: {}", e), - }), - }; + Ok(Activity::Onchain(OnchainActivity { + wallet_id: row.get(20)?, + id: row.get(0)?, + tx_type: Self::parse_payment_type(row, 1)?, + tx_id: row.get(2)?, + value: value as u64, + fee: fee as u64, + fee_rate: fee_rate as u64, + address: row.get(6)?, + confirmed: row.get(7)?, + timestamp: timestamp as u64, + is_boosted: row.get(9)?, + boost_tx_ids, + is_transfer: row.get(11)?, + does_exist: row.get(12)?, + confirm_timestamp: confirm_timestamp.map(|t| t as u64), + channel_id: row.get(14)?, + transfer_tx_id: row.get(15)?, + contact: row.get(19)?, + created_at: created_at.map(|t| t as u64), + updated_at: updated_at.map(|t| t as u64), + seen_at: seen_at.map(|t| t as u64), + })) + }) { + Ok(activity) => Ok(Some(activity)), + Err(rusqlite::Error::QueryReturnedNoRows) => Ok(None), + Err(e) => Err(ActivityError::RetrievalError { + error_details: format!("Failed to get onchain activity: {}", e), + }), + }; activity } "lightning" => { @@ -984,10 +1469,10 @@ impl ActivityDB { a.id, a.tx_type, l.status, l.value, l.fee, l.invoice, l.message, a.timestamp, l.preimage, a.created_at, a.updated_at, a.seen_at, - a.contact + a.contact, a.wallet_id FROM activities a - JOIN lightning_activity l ON a.id = l.id - WHERE a.id = ?1"; + JOIN lightning_activity l ON a.wallet_id = l.wallet_id AND a.id = l.id + WHERE a.wallet_id = ?1 AND a.id = ?2"; let mut stmt = self.conn @@ -997,7 +1482,7 @@ impl ActivityDB { })?; let activity = stmt - .query_row([activity_id], |row| { + .query_row(rusqlite::params![&wallet_id, activity_id], |row| { let value: i64 = row.get(3)?; let fee: Option = row.get(4)?; let timestamp: i64 = row.get(7)?; @@ -1006,6 +1491,7 @@ impl ActivityDB { let seen_at: Option = row.get(11)?; Ok(Activity::Lightning(LightningActivity { + wallet_id: row.get(13)?, id: row.get(0)?, tx_type: Self::parse_payment_type(row, 1)?, status: Self::parse_payment_state(row, 2)?, @@ -1034,18 +1520,22 @@ impl ActivityDB { /// Retrieves an onchain activity by transaction ID. pub fn get_activity_by_tx_id( &self, + wallet_id: &str, tx_id: &str, ) -> Result, ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let sql = " SELECT a.id, a.tx_type, o.tx_id, o.value, o.fee, o.fee_rate, o.address, o.confirmed, a.timestamp, o.is_boosted, o.boost_tx_ids, o.is_transfer, o.does_exist, o.confirm_timestamp, o.channel_id, o.transfer_tx_id, a.created_at, a.updated_at, a.seen_at, - a.contact + a.contact, a.wallet_id FROM activities a - JOIN onchain_activity o ON a.id = o.id - WHERE o.tx_id = ?1 AND a.activity_type = 'onchain' + JOIN onchain_activity o ON a.wallet_id = o.wallet_id AND a.id = o.id + WHERE o.tx_id = ?1 + AND a.wallet_id = ?2 + AND a.activity_type = 'onchain' LIMIT 1"; let mut stmt = self @@ -1055,7 +1545,7 @@ impl ActivityDB { error_details: format!("Failed to prepare statement: {}", e), })?; - let activity = match stmt.query_row([tx_id], |row| { + let activity = match stmt.query_row(rusqlite::params![tx_id, &wallet_id], |row| { let value: i64 = row.get(3)?; let fee: i64 = row.get(4)?; let fee_rate: i64 = row.get(5)?; @@ -1072,6 +1562,7 @@ impl ActivityDB { }; Ok(OnchainActivity { + wallet_id: row.get(20)?, id: row.get(0)?, tx_type: Self::parse_payment_type(row, 1)?, tx_id: row.get(2)?, @@ -1110,6 +1601,7 @@ impl ActivityDB { activity_id: &str, activity: &OnchainActivity, ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(&activity.wallet_id)?; let tx = self .conn .transaction() @@ -1122,7 +1614,7 @@ impl ActivityDB { tx_type = ?1, timestamp = ?2, contact = ?3 - WHERE id = ?4 AND activity_type = 'onchain'"; + WHERE wallet_id = ?4 AND id = ?5 AND activity_type = 'onchain'"; let rows = tx .execute( @@ -1131,6 +1623,7 @@ impl ActivityDB { Self::payment_type_to_string(&activity.tx_type), activity.timestamp, &activity.contact, + &wallet_id, activity_id, ), ) @@ -1159,7 +1652,7 @@ impl ActivityDB { confirm_timestamp = ?11, channel_id = ?12, transfer_tx_id = ?13 - WHERE id = ?14"; + WHERE wallet_id = ?14 AND id = ?15"; let boost_tx_ids_str = activity.boost_tx_ids.join(","); @@ -1179,6 +1672,7 @@ impl ActivityDB { activity.confirm_timestamp, &activity.channel_id, &activity.transfer_tx_id, + &wallet_id, activity_id, ), ) @@ -1190,6 +1684,8 @@ impl ActivityDB { error_details: format!("Failed to commit transaction: {}", e), })?; + self.apply_pre_activity_metadata_for_onchain(activity, activity_id); + Ok(()) } @@ -1199,6 +1695,7 @@ impl ActivityDB { activity_id: &str, activity: &LightningActivity, ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(&activity.wallet_id)?; let tx = self .conn .transaction() @@ -1211,7 +1708,7 @@ impl ActivityDB { tx_type = ?1, timestamp = ?2, contact = ?3 - WHERE id = ?4 AND activity_type = 'lightning'"; + WHERE wallet_id = ?4 AND id = ?5 AND activity_type = 'lightning'"; let rows = tx .execute( @@ -1220,6 +1717,7 @@ impl ActivityDB { Self::payment_type_to_string(&activity.tx_type), activity.timestamp, &activity.contact, + &wallet_id, activity_id, ), ) @@ -1241,7 +1739,7 @@ impl ActivityDB { fee = ?4, message = ?5, preimage = ?6 - WHERE id = ?7"; + WHERE wallet_id = ?7 AND id = ?8"; tx.execute( lightning_sql, @@ -1252,6 +1750,7 @@ impl ActivityDB { activity.fee, &activity.message, &activity.preimage, + &wallet_id, activity_id, ), ) @@ -1263,20 +1762,24 @@ impl ActivityDB { error_details: format!("Failed to commit transaction: {}", e), })?; + self.apply_pre_activity_metadata_for_lightning(activity, activity_id); + Ok(()) } /// Marks an activity as seen by setting the seen_at timestamp. pub fn mark_activity_as_seen( &mut self, + wallet_id: &str, activity_id: &str, seen_at: u64, ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let rows = self .conn .execute( - "UPDATE activities SET seen_at = ?1 WHERE id = ?2", - rusqlite::params![seen_at as i64, activity_id], + "UPDATE activities SET seen_at = ?1 WHERE wallet_id = ?2 AND id = ?3", + rusqlite::params![seen_at as i64, &wallet_id, activity_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to mark activity as seen: {}", e), @@ -1292,7 +1795,12 @@ impl ActivityDB { } /// Deletes an activity and associated data. - pub fn delete_activity_by_id(&mut self, activity_id: &str) -> Result { + pub fn delete_activity_by_id( + &mut self, + wallet_id: &str, + activity_id: &str, + ) -> Result { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let tx = self .conn .transaction() @@ -1300,8 +1808,32 @@ impl ActivityDB { error_details: format!("Failed to start transaction: {}", e), })?; - // Delete from activities table (this will cascade to other tables) - let rows = match tx.execute("DELETE FROM activities WHERE id = ?1", [activity_id]) { + tx.execute( + "DELETE FROM activity_tags WHERE wallet_id = ?1 AND activity_id = ?2", + rusqlite::params![&wallet_id, activity_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete activity tags: {}", e), + })?; + tx.execute( + "DELETE FROM onchain_activity WHERE wallet_id = ?1 AND id = ?2", + rusqlite::params![&wallet_id, activity_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete onchain activity: {}", e), + })?; + tx.execute( + "DELETE FROM lightning_activity WHERE wallet_id = ?1 AND id = ?2", + rusqlite::params![&wallet_id, activity_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete lightning activity: {}", e), + })?; + + let rows = match tx.execute( + "DELETE FROM activities WHERE wallet_id = ?1 AND id = ?2", + rusqlite::params![&wallet_id, activity_id], + ) { Ok(rows) => rows, Err(e) => { tx.rollback().ok(); @@ -1318,14 +1850,80 @@ impl ActivityDB { Ok(rows > 0) } + pub fn delete_activities_by_wallet_id( + &mut self, + wallet_id: &str, + ) -> Result { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; + let tx = self + .conn + .transaction() + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to start transaction: {}", e), + })?; + + tx.execute( + "DELETE FROM activity_tags WHERE wallet_id = ?1", + [&wallet_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete wallet activity tags: {}", e), + })?; + tx.execute( + "DELETE FROM onchain_activity WHERE wallet_id = ?1", + [&wallet_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete wallet onchain activities: {}", e), + })?; + tx.execute( + "DELETE FROM lightning_activity WHERE wallet_id = ?1", + [&wallet_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete wallet lightning activities: {}", e), + })?; + let rows = tx + .execute("DELETE FROM activities WHERE wallet_id = ?1", [&wallet_id]) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete wallet activities: {}", e), + })?; + tx.execute( + "DELETE FROM transaction_details WHERE wallet_id = ?1", + [&wallet_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete wallet transaction details: {}", e), + })?; + tx.execute( + "DELETE FROM pre_activity_metadata WHERE wallet_id = ?1", + [&wallet_id], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to delete wallet pre-activity metadata: {}", e), + })?; + + tx.commit().map_err(|e| ActivityError::DataError { + error_details: format!("Failed to commit transaction: {}", e), + })?; + + Ok(rows as u32) + } + /// Add tags to an activity - pub fn add_tags(&mut self, activity_id: &str, tags: &[String]) -> Result<(), ActivityError> { + pub fn add_tags( + &mut self, + wallet_id: &str, + activity_id: &str, + tags: &[String], + ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; // Verify the activity exists let exists = self .conn .query_row( - "SELECT 1 FROM activities WHERE id = ?1", - [activity_id], + "SELECT 1 FROM activities WHERE wallet_id = ?1 AND id = ?2", + rusqlite::params![&wallet_id, activity_id], |_| Ok(true), ) .optional() @@ -1349,8 +1947,8 @@ impl ActivityDB { for tag in tags { tx.execute( - "INSERT OR IGNORE INTO activity_tags (activity_id, tag) VALUES (?1, ?2)", - [activity_id, tag], + "INSERT OR IGNORE INTO activity_tags (wallet_id, activity_id, tag) VALUES (?1, ?2, ?3)", + rusqlite::params![&wallet_id, activity_id, tag], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to insert tag: {}", e), @@ -1365,7 +1963,13 @@ impl ActivityDB { } /// Remove tags from an activity - pub fn remove_tags(&mut self, activity_id: &str, tags: &[String]) -> Result<(), ActivityError> { + pub fn remove_tags( + &mut self, + wallet_id: &str, + activity_id: &str, + tags: &[String], + ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let tx = self .conn .transaction() @@ -1375,8 +1979,8 @@ impl ActivityDB { for tag in tags { tx.execute( - "DELETE FROM activity_tags WHERE activity_id = ?1 AND tag = ?2", - [activity_id, tag], + "DELETE FROM activity_tags WHERE wallet_id = ?1 AND activity_id = ?2 AND tag = ?3", + rusqlite::params![&wallet_id, activity_id, tag], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to remove tag: {}", e), @@ -1391,13 +1995,18 @@ impl ActivityDB { } /// Get all tags for an activity - pub fn get_tags(&self, activity_id: &str) -> Result, ActivityError> { + pub fn get_tags( + &self, + wallet_id: &str, + activity_id: &str, + ) -> Result, ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; // Verify the activity exists let exists = self .conn .query_row( - "SELECT 1 FROM activities WHERE id = ?1", - [activity_id], + "SELECT 1 FROM activities WHERE wallet_id = ?1 AND id = ?2", + rusqlite::params![&wallet_id, activity_id], |_| Ok(true), ) .optional() @@ -1412,13 +2021,17 @@ impl ActivityDB { let mut stmt = self .conn - .prepare("SELECT tag FROM activity_tags WHERE activity_id = ?1") + .prepare( + "SELECT tag FROM activity_tags + WHERE wallet_id = ?1 AND activity_id = ?2 + ORDER BY tag ASC", + ) .map_err(|e| ActivityError::RetrievalError { error_details: format!("Failed to prepare statement: {}", e), })?; let tags = stmt - .query_map([activity_id], |row| row.get(0)) + .query_map(rusqlite::params![&wallet_id, activity_id], |row| row.get(0)) .map_err(|e| ActivityError::RetrievalError { error_details: format!("Failed to execute query: {}", e), })? @@ -1433,17 +2046,25 @@ impl ActivityDB { /// Get activities by tag with optional limit pub fn get_activities_by_tag( &self, + wallet_id: Option<&str>, tag: &str, limit: Option, sort_direction: Option, ) -> Result, ActivityError> { + let wallet_id = wallet_id.map(Self::normalize_wallet_id).transpose()?; let direction = sort_direction.unwrap_or_default(); + let wallet_filter = if wallet_id.is_some() { + " AND a.wallet_id = ?2" + } else { + "" + }; let sql = format!( - "SELECT a.id, a.activity_type + "SELECT a.wallet_id, a.id, a.activity_type FROM activities a - JOIN activity_tags t ON a.id = t.activity_id - WHERE t.tag = ?1 + JOIN activity_tags t ON a.wallet_id = t.wallet_id AND a.id = t.activity_id + WHERE t.tag = ?1{} ORDER BY a.timestamp {} {}", + wallet_filter, Self::sort_direction_to_sql(direction), limit.map_or(String::new(), |n| format!("LIMIT {}", n)) ); @@ -1455,24 +2076,43 @@ impl ActivityDB { error_details: format!("Failed to prepare statement: {}", e), })?; - let rows = match stmt.query_map([tag], |row| { - Ok((row.get::<_, String>(0)?, row.get::<_, String>(1)?)) - }) { - Ok(rows) => rows, - Err(e) => { - return Err(ActivityError::RetrievalError { - error_details: format!("Failed to execute query: {}", e), - }) - } + let rows: Vec<(String, String, String)> = if let Some(wallet_id) = wallet_id.as_deref() { + stmt.query_map(rusqlite::params![tag, wallet_id], |row| { + Ok(( + row.get::<_, String>(0)?, + row.get::<_, String>(1)?, + row.get::<_, String>(2)?, + )) + }) + .map_err(|e| ActivityError::RetrievalError { + error_details: format!("Failed to execute query: {}", e), + })? + .collect::, _>>() + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to process rows: {}", e), + })? + } else { + stmt.query_map([tag], |row| { + Ok(( + row.get::<_, String>(0)?, + row.get::<_, String>(1)?, + row.get::<_, String>(2)?, + )) + }) + .map_err(|e| ActivityError::RetrievalError { + error_details: format!("Failed to execute query: {}", e), + })? + .collect::, _>>() + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to process rows: {}", e), + })? }; let mut activities = Vec::new(); for row in rows { - let (id, _) = row.map_err(|e| ActivityError::DataError { - error_details: format!("Failed to process row: {}", e), - })?; + let (wallet_id, id, _) = row; - if let Some(activity) = self.get_activity_by_id(&id)? { + if let Some(activity) = self.get_activity_by_id(&wallet_id, &id)? { activities.push(activity); } } @@ -1506,13 +2146,17 @@ impl ActivityDB { pub fn get_all_activities_tags(&self) -> Result, ActivityError> { let mut stmt = self .conn - .prepare("SELECT activity_id, tag FROM activity_tags ORDER BY activity_id, tag") + .prepare( + "SELECT wallet_id, activity_id, tag + FROM activity_tags + ORDER BY wallet_id, activity_id, tag", + ) .map_err(|e| ActivityError::RetrievalError { error_details: format!("Failed to prepare statement: {}", e), })?; - let rows: Vec<(String, String)> = stmt - .query_map([], |row| Ok((row.get(0)?, row.get(1)?))) + let rows: Vec<(String, String, String)> = stmt + .query_map([], |row| Ok((row.get(0)?, row.get(1)?, row.get(2)?))) .map_err(|e| ActivityError::RetrievalError { error_details: format!("Failed to execute query: {}", e), })? @@ -1521,24 +2165,32 @@ impl ActivityDB { error_details: format!("Failed to process rows: {}", e), })?; - // Group by activity_id - let mut grouped: std::collections::HashMap> = + // Group by wallet_id and activity_id. + let mut grouped: std::collections::HashMap<(String, String), Vec> = std::collections::HashMap::new(); - for (activity_id, tag) in rows { + for (wallet_id, activity_id, tag) in rows { grouped - .entry(activity_id) - .or_insert_with(Vec::new) + .entry((wallet_id, activity_id)) + .or_default() .push(tag); } let mut result: Vec = grouped .into_iter() - .map(|(activity_id, tags)| ActivityTags { activity_id, tags }) + .map(|((wallet_id, activity_id), tags)| ActivityTags { + wallet_id, + activity_id, + tags, + }) .collect(); // Sort for consistent output - result.sort_by(|a, b| a.activity_id.cmp(&b.activity_id)); + result.sort_by(|a, b| { + a.wallet_id + .cmp(&b.wallet_id) + .then_with(|| a.activity_id.cmp(&b.activity_id)) + }); Ok(result) } @@ -1558,7 +2210,10 @@ impl ActivityDB { { let mut stmt = tx - .prepare("INSERT OR IGNORE INTO activity_tags (activity_id, tag) VALUES (?1, ?2)") + .prepare( + "INSERT OR IGNORE INTO activity_tags (wallet_id, activity_id, tag) + VALUES (?1, ?2, ?3)", + ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to prepare statement: {}", e), })?; @@ -1569,15 +2224,20 @@ impl ActivityDB { error_details: "Activity ID cannot be empty".to_string(), }); } + let wallet_id = Self::normalize_wallet_id(&activity_tag.wallet_id)?; for tag in &activity_tag.tags { if tag.is_empty() { continue; // Skip empty tags } - stmt.execute([&activity_tag.activity_id, tag]) - .map_err(|e| ActivityError::DataError { - error_details: format!("Failed to insert tag: {}", e), - })?; + stmt.execute(rusqlite::params![ + &wallet_id, + &activity_tag.activity_id, + tag + ]) + .map_err(|e| ActivityError::DataError { + error_details: format!("Failed to insert tag: {}", e), + })?; } } } @@ -1589,8 +2249,8 @@ impl ActivityDB { Ok(()) } - /// Add pre-activity metadata for an onchain address or lightning invoice - /// If the metadata has an address, any existing metadata with the same address will be removed first + /// Add pre-activity metadata for an onchain address or lightning invoice. + /// Receive metadata replaces previous receive metadata for the same wallet and address. pub fn add_pre_activity_metadata( &mut self, pre_activity_metadata: &PreActivityMetadata, @@ -1600,6 +2260,7 @@ impl ActivityDB { error_details: "Payment ID cannot be empty".to_string(), }); } + let wallet_id = Self::normalize_wallet_id(&pre_activity_metadata.wallet_id)?; let tags_json = serde_json::to_string(&pre_activity_metadata.tags).map_err(|e| { ActivityError::DataError { @@ -1614,24 +2275,28 @@ impl ActivityDB { error_details: format!("Failed to start transaction: {}", e), })?; - if let Some(ref address) = pre_activity_metadata.address { - if !address.is_empty() { - tx.execute( - "DELETE FROM pre_activity_metadata WHERE address = ?1", - [address], - ) - .map_err(|e| ActivityError::DataError { - error_details: format!( - "Failed to delete existing metadata with address: {}", - e - ), - })?; + if pre_activity_metadata.is_receive { + if let Some(ref address) = pre_activity_metadata.address { + if !address.is_empty() { + tx.execute( + "DELETE FROM pre_activity_metadata + WHERE wallet_id = ?1 AND address = ?2 AND is_receive = 1", + rusqlite::params![&wallet_id, address], + ) + .map_err(|e| ActivityError::DataError { + error_details: format!( + "Failed to delete existing receive metadata with address: {}", + e + ), + })?; + } } } tx.execute( - "INSERT OR REPLACE INTO pre_activity_metadata (payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10)", + "INSERT OR REPLACE INTO pre_activity_metadata (wallet_id, payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)", rusqlite::params![ + &wallet_id, &pre_activity_metadata.payment_id, &tags_json, &pre_activity_metadata.payment_hash, @@ -1658,15 +2323,17 @@ impl ActivityDB { /// Returns an error if the metadata doesn't exist pub fn add_pre_activity_metadata_tags( &mut self, + wallet_id: &str, payment_id: &str, tags_to_add: &[String], ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; // Get current metadata let current_tags_json: Option = self .conn .query_row( - "SELECT tags FROM pre_activity_metadata WHERE payment_id = ?1", - [payment_id], + "SELECT tags FROM pre_activity_metadata WHERE wallet_id = ?1 AND payment_id = ?2", + rusqlite::params![&wallet_id, payment_id], |row| row.get(0), ) .optional() @@ -1702,8 +2369,8 @@ impl ActivityDB { self.conn .execute( - "UPDATE pre_activity_metadata SET tags = ?1 WHERE payment_id = ?2", - [&updated_tags_json, payment_id], + "UPDATE pre_activity_metadata SET tags = ?1 WHERE wallet_id = ?2 AND payment_id = ?3", + rusqlite::params![&updated_tags_json, &wallet_id, payment_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to update tags: {}", e), @@ -1715,15 +2382,17 @@ impl ActivityDB { /// Remove specific tags from pre-activity metadata for an onchain address or lightning invoice pub fn remove_pre_activity_metadata_tags( &mut self, + wallet_id: &str, payment_id: &str, tags_to_remove: &[String], ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; // Get current metadata let current_tags_json: Option = self .conn .query_row( - "SELECT tags FROM pre_activity_metadata WHERE payment_id = ?1", - [payment_id], + "SELECT tags FROM pre_activity_metadata WHERE wallet_id = ?1 AND payment_id = ?2", + rusqlite::params![&wallet_id, payment_id], |row| row.get(0), ) .optional() @@ -1748,8 +2417,8 @@ impl ActivityDB { self.conn .execute( - "UPDATE pre_activity_metadata SET tags = ?1 WHERE payment_id = ?2", - [&updated_tags_json, payment_id], + "UPDATE pre_activity_metadata SET tags = ?1 WHERE wallet_id = ?2 AND payment_id = ?3", + rusqlite::params![&updated_tags_json, &wallet_id, payment_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to update tags: {}", e), @@ -1762,14 +2431,16 @@ impl ActivityDB { /// Reset (clear all tags) from pre-activity metadata for an onchain address or lightning invoice pub fn reset_pre_activity_metadata_tags( &mut self, + wallet_id: &str, payment_id: &str, ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; // Check if row exists first let exists: bool = self .conn .query_row( - "SELECT EXISTS(SELECT 1 FROM pre_activity_metadata WHERE payment_id = ?1)", - [payment_id], + "SELECT EXISTS(SELECT 1 FROM pre_activity_metadata WHERE wallet_id = ?1 AND payment_id = ?2)", + rusqlite::params![&wallet_id, payment_id], |row| row.get(0), ) .map_err(|e| ActivityError::RetrievalError { @@ -1788,8 +2459,8 @@ impl ActivityDB { self.conn .execute( - "UPDATE pre_activity_metadata SET tags = ?1 WHERE payment_id = ?2", - [&empty_tags_json, payment_id], + "UPDATE pre_activity_metadata SET tags = ?1 WHERE wallet_id = ?2 AND payment_id = ?3", + rusqlite::params![&empty_tags_json, &wallet_id, payment_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to reset pre-activity metadata tags: {}", e), @@ -1799,11 +2470,16 @@ impl ActivityDB { } /// Delete all pre-activity metadata for an onchain address or lightning invoice - pub fn delete_pre_activity_metadata(&mut self, payment_id: &str) -> Result<(), ActivityError> { + pub fn delete_pre_activity_metadata( + &mut self, + wallet_id: &str, + payment_id: &str, + ) -> Result<(), ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; self.conn .execute( - "DELETE FROM pre_activity_metadata WHERE payment_id = ?1", - [payment_id], + "DELETE FROM pre_activity_metadata WHERE wallet_id = ?1 AND payment_id = ?2", + rusqlite::params![&wallet_id, payment_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to delete pre-activity metadata: {}", e), @@ -1829,20 +2505,49 @@ impl ActivityDB { })?; { + let mut delete_receive_address_stmt = tx + .prepare( + "DELETE FROM pre_activity_metadata + WHERE wallet_id = ?1 AND address = ?2 AND is_receive = 1", + ) + .map_err(|e| ActivityError::DataError { + error_details: format!( + "Failed to prepare address replacement statement: {}", + e + ), + })?; + let mut stmt = tx.prepare( - "INSERT OR REPLACE INTO pre_activity_metadata (payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10)" + "INSERT OR REPLACE INTO pre_activity_metadata (wallet_id, payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11)" ).map_err(|e| ActivityError::DataError { error_details: format!("Failed to prepare statement: {}", e), })?; for metadata in pre_activity_metadata { + let wallet_id = Self::normalize_wallet_id(&metadata.wallet_id)?; let tags_json = serde_json::to_string(&metadata.tags).map_err(|e| { ActivityError::DataError { error_details: format!("Failed to serialize tags: {}", e), } })?; + if metadata.is_receive { + if let Some(address) = &metadata.address { + if !address.is_empty() { + delete_receive_address_stmt + .execute(rusqlite::params![&wallet_id, address]) + .map_err(|e| ActivityError::DataError { + error_details: format!( + "Failed to delete existing receive metadata with address: {}", + e + ), + })?; + } + } + } + stmt.execute(rusqlite::params![ + &wallet_id, &metadata.payment_id, &tags_json, &metadata.payment_hash, @@ -1870,21 +2575,23 @@ impl ActivityDB { /// Get pre-activity metadata for a specific payment_id or address pub fn get_pre_activity_metadata( &self, + wallet_id: &str, search_key: &str, search_by_address: bool, ) -> Result, ActivityError> { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let sql = if search_by_address { " SELECT - payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at + wallet_id, payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at FROM pre_activity_metadata - WHERE address = ?1" + WHERE wallet_id = ?1 AND address = ?2 AND is_receive = 1" } else { " SELECT - payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at + wallet_id, payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at FROM pre_activity_metadata - WHERE payment_id = ?1" + WHERE wallet_id = ?1 AND payment_id = ?2" }; let mut stmt = self @@ -1894,22 +2601,23 @@ impl ActivityDB { error_details: format!("Failed to prepare statement: {}", e), })?; - match stmt.query_row([search_key], |row| { - let payment_id_val: String = row.get(0)?; - let tags_json: String = row.get(1)?; - let payment_hash: Option = row.get(2)?; - let tx_id: Option = row.get(3)?; - let address: Option = row.get(4)?; - let is_receive: bool = row.get(5)?; - let fee_rate: i64 = row.get(6)?; - let is_transfer: bool = row.get(7)?; - let channel_id: Option = row.get(8)?; - let created_at: i64 = row.get(9)?; + match stmt.query_row(rusqlite::params![&wallet_id, search_key], |row| { + let wallet_id: String = row.get(0)?; + let payment_id_val: String = row.get(1)?; + let tags_json: String = row.get(2)?; + let payment_hash: Option = row.get(3)?; + let tx_id: Option = row.get(4)?; + let address: Option = row.get(5)?; + let is_receive: bool = row.get(6)?; + let fee_rate: i64 = row.get(7)?; + let is_transfer: bool = row.get(8)?; + let channel_id: Option = row.get(9)?; + let created_at: i64 = row.get(10)?; let tags: Vec = serde_json::from_str(&tags_json).map_err(|_e: serde_json::Error| { rusqlite::Error::InvalidColumnType( - 1, + 2, "tags".to_string(), rusqlite::types::Type::Text, ) @@ -1917,6 +2625,7 @@ impl ActivityDB { let created_at_u64 = created_at as u64; Ok(PreActivityMetadata { + wallet_id, payment_id: payment_id_val, tags, payment_hash, @@ -1938,14 +2647,16 @@ impl ActivityDB { } /// Get all pre-activity metadata for backup + #[allow(clippy::type_complexity)] pub fn get_all_pre_activity_metadata(&self) -> Result, ActivityError> { let mut stmt = self.conn.prepare( - "SELECT payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at FROM pre_activity_metadata ORDER BY payment_id" + "SELECT wallet_id, payment_id, tags, payment_hash, tx_id, address, is_receive, fee_rate, is_transfer, channel_id, created_at FROM pre_activity_metadata ORDER BY wallet_id, payment_id" ).map_err(|e| ActivityError::RetrievalError { error_details: format!("Failed to prepare statement: {}", e), })?; let rows: Vec<( + String, String, String, Option, @@ -1969,6 +2680,7 @@ impl ActivityDB { row.get(7)?, row.get(8)?, row.get(9)?, + row.get(10)?, )) }) .map_err(|e| ActivityError::RetrievalError { @@ -1982,6 +2694,7 @@ impl ActivityDB { let mut result: Vec = Vec::new(); for ( + wallet_id, payment_id, tags_json, payment_hash, @@ -2001,6 +2714,7 @@ impl ActivityDB { let created_at_u64 = created_at as u64; result.push(PreActivityMetadata { + wallet_id, payment_id, tags, payment_hash, @@ -2015,21 +2729,28 @@ impl ActivityDB { } // Sort for consistent output - result.sort_by(|a, b| a.payment_id.cmp(&b.payment_id)); + result.sort_by(|a, b| { + a.wallet_id + .cmp(&b.wallet_id) + .then_with(|| a.payment_id.cmp(&b.payment_id)) + }); Ok(result) } fn transfer_pre_activity_metadata_to_activity( &mut self, + wallet_id: &str, search_key: &str, activity_id: &str, search_by_address: bool, ) -> Result, ActivityError> { - let metadata = match self.get_pre_activity_metadata(search_key, search_by_address)? { - Some(m) => m, - None => return Ok(Vec::new()), - }; + let wallet_id = Self::normalize_wallet_id(wallet_id)?; + let metadata = + match self.get_pre_activity_metadata(&wallet_id, search_key, search_by_address)? { + Some(m) => m, + None => return Ok(Vec::new()), + }; let tags = metadata.tags; @@ -2043,8 +2764,10 @@ impl ActivityDB { if let Some(address) = &metadata.address { if !address.is_empty() { tx.execute( - "UPDATE onchain_activity SET address = ?1 WHERE id = ?2", - [address, activity_id], + "UPDATE onchain_activity + SET address = ?1 + WHERE wallet_id = ?2 AND id = ?3", + rusqlite::params![address, &wallet_id, activity_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to update address: {}", e), @@ -2054,8 +2777,10 @@ impl ActivityDB { if metadata.fee_rate > 0 { tx.execute( - "UPDATE onchain_activity SET fee_rate = ?1 WHERE id = ?2", - rusqlite::params![metadata.fee_rate as i64, activity_id], + "UPDATE onchain_activity + SET fee_rate = ?1 + WHERE wallet_id = ?2 AND id = ?3", + rusqlite::params![metadata.fee_rate as i64, &wallet_id, activity_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to update fee_rate: {}", e), @@ -2064,8 +2789,10 @@ impl ActivityDB { if metadata.is_transfer { tx.execute( - "UPDATE onchain_activity SET is_transfer = ?1 WHERE id = ?2", - rusqlite::params![metadata.is_transfer, activity_id], + "UPDATE onchain_activity + SET is_transfer = ?1 + WHERE wallet_id = ?2 AND id = ?3", + rusqlite::params![metadata.is_transfer, &wallet_id, activity_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to update is_transfer: {}", e), @@ -2075,8 +2802,10 @@ impl ActivityDB { if let Some(channel_id) = &metadata.channel_id { if !channel_id.is_empty() { tx.execute( - "UPDATE onchain_activity SET channel_id = ?1 WHERE id = ?2", - [channel_id, activity_id], + "UPDATE onchain_activity + SET channel_id = ?1 + WHERE wallet_id = ?2 AND id = ?3", + rusqlite::params![channel_id, &wallet_id, activity_id], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to update channel_id: {}", e), @@ -2086,8 +2815,9 @@ impl ActivityDB { for tag in &tags { tx.execute( - "INSERT OR IGNORE INTO activity_tags (activity_id, tag) VALUES (?1, ?2)", - [activity_id, tag], + "INSERT OR IGNORE INTO activity_tags (wallet_id, activity_id, tag) + VALUES (?1, ?2, ?3)", + rusqlite::params![&wallet_id, activity_id, tag], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to insert tag: {}", e), @@ -2096,16 +2826,16 @@ impl ActivityDB { if search_by_address { tx.execute( - "DELETE FROM pre_activity_metadata WHERE address = ?1 AND is_receive = 1", - [search_key], + "DELETE FROM pre_activity_metadata WHERE wallet_id = ?1 AND address = ?2 AND is_receive = 1", + rusqlite::params![&wallet_id, search_key], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to delete pre-activity metadata: {}", e), })?; } else { tx.execute( - "DELETE FROM pre_activity_metadata WHERE payment_id = ?1", - [search_key], + "DELETE FROM pre_activity_metadata WHERE wallet_id = ?1 AND payment_id = ?2", + rusqlite::params![&wallet_id, search_key], ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to delete pre-activity metadata: {}", e), @@ -2119,6 +2849,52 @@ impl ActivityDB { Ok(tags) } + fn apply_pre_activity_metadata_for_onchain( + &mut self, + activity: &OnchainActivity, + activity_id: &str, + ) { + let Ok(wallet_id) = Self::normalize_wallet_id(&activity.wallet_id) else { + return; + }; + + match activity.tx_type { + PaymentType::Received => { + let _ = self.transfer_pre_activity_metadata_to_activity( + &wallet_id, + &activity.address, + activity_id, + true, + ); + } + PaymentType::Sent => { + let _ = self.transfer_pre_activity_metadata_to_activity( + &wallet_id, + &activity.tx_id, + activity_id, + false, + ); + } + } + } + + fn apply_pre_activity_metadata_for_lightning( + &mut self, + activity: &LightningActivity, + activity_id: &str, + ) { + let Ok(wallet_id) = Self::normalize_wallet_id(&activity.wallet_id) else { + return; + }; + + let _ = self.transfer_pre_activity_metadata_to_activity( + &wallet_id, + &activity.id, + activity_id, + false, + ); + } + pub fn upsert_closed_channel( &mut self, channel: &ClosedChannelDetails, @@ -2427,7 +3203,7 @@ impl ActivityDB { { let mut stmt = tx.prepare( - "INSERT OR REPLACE INTO transaction_details (tx_id, amount_sats, inputs, outputs) VALUES (?1, ?2, ?3, ?4)" + "INSERT OR REPLACE INTO transaction_details (wallet_id, tx_id, amount_sats, inputs, outputs) VALUES (?1, ?2, ?3, ?4, ?5)" ).map_err(|e| ActivityError::DataError { error_details: format!("Failed to prepare statement: {}", e), })?; @@ -2438,6 +3214,7 @@ impl ActivityDB { error_details: "Transaction ID cannot be empty".to_string(), }); } + let wallet_id = Self::normalize_wallet_id(&details.wallet_id)?; let inputs_json = serde_json::to_string(&details.inputs).map_err(|e| { ActivityError::DataError { @@ -2452,6 +3229,7 @@ impl ActivityDB { })?; stmt.execute(rusqlite::params![ + &wallet_id, &details.tx_id, details.amount_sats, &inputs_json, @@ -2473,10 +3251,16 @@ impl ActivityDB { /// Retrieves transaction details by transaction ID. pub fn get_transaction_details( &self, + wallet_id: &str, tx_id: &str, ) -> Result, ActivityError> { - let sql = - "SELECT tx_id, amount_sats, inputs, outputs FROM transaction_details WHERE tx_id = ?1"; + let wallet_id = Self::normalize_wallet_id(wallet_id)?; + let sql = " + SELECT wallet_id, tx_id, amount_sats, inputs, outputs + FROM transaction_details + WHERE tx_id = ?1 + AND wallet_id = ?2 + LIMIT 1"; let mut stmt = self .conn @@ -2485,15 +3269,16 @@ impl ActivityDB { error_details: format!("Failed to prepare statement: {}", e), })?; - match stmt.query_row([tx_id], |row| { - let tx_id: String = row.get(0)?; - let amount_sats: i64 = row.get(1)?; - let inputs_json: String = row.get(2)?; - let outputs_json: String = row.get(3)?; + match stmt.query_row(rusqlite::params![tx_id, &wallet_id], |row| { + let wallet_id: String = row.get(0)?; + let tx_id: String = row.get(1)?; + let amount_sats: i64 = row.get(2)?; + let inputs_json: String = row.get(3)?; + let outputs_json: String = row.get(4)?; let inputs: Vec = serde_json::from_str(&inputs_json).map_err(|_| { rusqlite::Error::InvalidColumnType( - 2, + 3, "inputs".to_string(), rusqlite::types::Type::Text, ) @@ -2501,13 +3286,14 @@ impl ActivityDB { let outputs: Vec = serde_json::from_str(&outputs_json).map_err(|_| { rusqlite::Error::InvalidColumnType( - 3, + 4, "outputs".to_string(), rusqlite::types::Type::Text, ) })?; Ok(TransactionDetails { + wallet_id, tx_id, amount_sats, inputs, @@ -2524,8 +3310,7 @@ impl ActivityDB { /// Retrieves all transaction details. pub fn get_all_transaction_details(&self) -> Result, ActivityError> { - let sql = - "SELECT tx_id, amount_sats, inputs, outputs FROM transaction_details ORDER BY tx_id"; + let sql = "SELECT wallet_id, tx_id, amount_sats, inputs, outputs FROM transaction_details ORDER BY wallet_id, tx_id"; let mut stmt = self .conn @@ -2536,14 +3321,15 @@ impl ActivityDB { let rows = stmt .query_map([], |row| { - let tx_id: String = row.get(0)?; - let amount_sats: i64 = row.get(1)?; - let inputs_json: String = row.get(2)?; - let outputs_json: String = row.get(3)?; + let wallet_id: String = row.get(0)?; + let tx_id: String = row.get(1)?; + let amount_sats: i64 = row.get(2)?; + let inputs_json: String = row.get(3)?; + let outputs_json: String = row.get(4)?; let inputs: Vec = serde_json::from_str(&inputs_json).map_err(|_| { rusqlite::Error::InvalidColumnType( - 2, + 3, "inputs".to_string(), rusqlite::types::Type::Text, ) @@ -2551,13 +3337,14 @@ impl ActivityDB { let outputs: Vec = serde_json::from_str(&outputs_json).map_err(|_| { rusqlite::Error::InvalidColumnType( - 3, + 4, "outputs".to_string(), rusqlite::types::Type::Text, ) })?; Ok(TransactionDetails { + wallet_id, tx_id, amount_sats, inputs, @@ -2579,10 +3366,18 @@ impl ActivityDB { } /// Deletes transaction details by transaction ID. - pub fn delete_transaction_details(&mut self, tx_id: &str) -> Result { + pub fn delete_transaction_details( + &mut self, + wallet_id: &str, + tx_id: &str, + ) -> Result { + let wallet_id = Self::normalize_wallet_id(wallet_id)?; let rows = self .conn - .execute("DELETE FROM transaction_details WHERE tx_id = ?1", [tx_id]) + .execute( + "DELETE FROM transaction_details WHERE wallet_id = ?1 AND tx_id = ?2", + rusqlite::params![wallet_id, tx_id], + ) .map_err(|e| ActivityError::DataError { error_details: format!("Failed to delete transaction details: {}", e), })?; @@ -2653,7 +3448,7 @@ impl ActivityDB { " SELECT COUNT(*) FROM activities a - JOIN onchain_activity o ON a.id = o.id + JOIN onchain_activity o ON a.wallet_id = o.wallet_id AND a.id = o.id WHERE o.address = ?1 AND a.activity_type = 'onchain' ", [address], diff --git a/src/modules/activity/tests.rs b/src/modules/activity/tests.rs index 9273884..86c3613 100644 --- a/src/modules/activity/tests.rs +++ b/src/modules/activity/tests.rs @@ -3,7 +3,7 @@ mod tests { use crate::activity::{ Activity, ActivityDB, ActivityFilter, ActivityTags, ActivityType, ClosedChannelDetails, LightningActivity, OnchainActivity, PaymentState, PaymentType, PreActivityMetadata, - SortDirection, TransactionDetails, TxInput, TxOutput, + SortDirection, TransactionDetails, TxInput, TxOutput, DEFAULT_WALLET_ID, }; use rand::random; use std::fs; @@ -18,8 +18,27 @@ mod tests { fs::remove_file(db_path).ok(); } + fn primary_key_columns(db: &ActivityDB, table: &str) -> Vec { + let mut stmt = db + .conn + .prepare(&format!("PRAGMA table_info({})", table)) + .unwrap(); + let mut columns = stmt + .query_map([], |row| { + Ok((row.get::<_, i64>(5)?, row.get::<_, String>(1)?)) + }) + .unwrap() + .collect::, _>>() + .unwrap(); + + columns.retain(|(pk_index, _)| *pk_index > 0); + columns.sort_by_key(|(pk_index, _)| *pk_index); + columns.into_iter().map(|(_, column)| column).collect() + } + fn create_test_onchain_activity() -> OnchainActivity { OnchainActivity { + wallet_id: DEFAULT_WALLET_ID.to_string(), id: "test_onchain_1".to_string(), tx_type: PaymentType::Sent, tx_id: "txid123".to_string(), @@ -45,6 +64,7 @@ mod tests { fn create_test_lightning_activity() -> LightningActivity { LightningActivity { + wallet_id: DEFAULT_WALLET_ID.to_string(), id: "test_lightning_1".to_string(), tx_type: PaymentType::Received, status: PaymentState::Succeeded, @@ -86,6 +106,7 @@ mod tests { tags: Vec, ) -> PreActivityMetadata { PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id, tags, payment_hash: None, @@ -139,6 +160,425 @@ mod tests { assert!(columns.contains(&"seen_at".to_string())); assert!(columns.contains(&"contact".to_string())); + assert!(columns.contains(&"wallet_id".to_string())); + + cleanup(&db_path); + } + + #[test] + fn test_activity_migration_rebuilds_wallet_primary_keys() { + let db_path = format!("test_db_{}.sqlite", random::()); + { + let conn = rusqlite::Connection::open(&db_path).unwrap(); + conn.execute_batch( + " + CREATE TABLE activities ( + id TEXT PRIMARY KEY, + wallet_id TEXT NOT NULL DEFAULT 'bitkit' CHECK (length(wallet_id) > 0), + activity_type TEXT NOT NULL CHECK (activity_type IN ('onchain', 'lightning')), + tx_type TEXT NOT NULL CHECK (tx_type IN ('sent', 'received')), + timestamp INTEGER NOT NULL CHECK (timestamp > 0), + created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), + updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), + seen_at INTEGER CHECK (seen_at IS NULL OR seen_at > 0), + contact TEXT CHECK (contact IS NULL OR length(contact) > 0) + ); + CREATE TABLE onchain_activity ( + id TEXT PRIMARY KEY, + tx_id TEXT NOT NULL, + address TEXT NOT NULL CHECK (length(address) > 0), + confirmed BOOLEAN NOT NULL, + value INTEGER NOT NULL CHECK (value >= 0), + fee INTEGER NOT NULL CHECK (fee >= 0), + fee_rate INTEGER NOT NULL CHECK (fee_rate >= 0), + is_boosted BOOLEAN NOT NULL, + boost_tx_ids TEXT NOT NULL, + is_transfer BOOLEAN NOT NULL, + does_exist BOOLEAN NOT NULL, + confirm_timestamp INTEGER CHECK ( + confirm_timestamp IS NULL OR confirm_timestamp >= 0 + ), + channel_id TEXT CHECK ( + channel_id IS NULL OR length(channel_id) > 0 + ), + transfer_tx_id TEXT CHECK ( + transfer_tx_id IS NULL OR length(transfer_tx_id) > 0 + ) + ); + CREATE TABLE lightning_activity ( + id TEXT PRIMARY KEY, + invoice TEXT NOT NULL CHECK (length(invoice) > 0), + value INTEGER NOT NULL CHECK (value >= 0), + status TEXT NOT NULL CHECK (status IN ('pending', 'succeeded', 'failed')), + fee INTEGER CHECK (fee IS NULL OR fee >= 0), + message TEXT NOT NULL, + preimage TEXT CHECK ( + preimage IS NULL OR length(preimage) > 0 + ) + ); + CREATE TABLE activity_tags ( + activity_id TEXT NOT NULL, + tag TEXT NOT NULL, + PRIMARY KEY (activity_id, tag) + ); + INSERT INTO activities ( + id, wallet_id, activity_type, tx_type, timestamp, created_at, + updated_at, seen_at, contact + ) + VALUES ( + 'legacy_activity', 'hardware-wallet-1', 'onchain', 'sent', + 1234567890, 1234567890, 1234567891, 1234567892, 'contact_pubky' + ); + INSERT INTO onchain_activity ( + id, tx_id, address, confirmed, value, fee, fee_rate, is_boosted, + boost_tx_ids, is_transfer, does_exist, confirm_timestamp, + channel_id, transfer_tx_id + ) + VALUES ( + 'legacy_activity', 'legacy_txid', 'bc1qlegacy', 1, 5000, 50, 1, + 0, '', 0, 1, 1234567893, NULL, NULL + ); + INSERT INTO activity_tags (activity_id, tag) + VALUES ('legacy_activity', 'legacy_tag'); + ", + ) + .unwrap(); + } + + let db = ActivityDB::new(&db_path).unwrap(); + assert_eq!( + primary_key_columns(&db, "activities"), + vec!["wallet_id", "id"] + ); + assert_eq!( + primary_key_columns(&db, "onchain_activity"), + vec!["wallet_id", "id"] + ); + assert_eq!( + primary_key_columns(&db, "lightning_activity"), + vec!["wallet_id", "id"] + ); + assert_eq!( + primary_key_columns(&db, "activity_tags"), + vec!["wallet_id", "activity_id", "tag"] + ); + + let activity = db + .get_activity_by_id("hardware-wallet-1", "legacy_activity") + .unwrap() + .unwrap(); + match activity { + Activity::Onchain(activity) => { + assert_eq!(activity.wallet_id, "hardware-wallet-1"); + assert_eq!(activity.tx_id, "legacy_txid"); + assert_eq!(activity.contact, Some("contact_pubky".to_string())); + assert_eq!(activity.seen_at, Some(1234567892)); + } + Activity::Lightning(_) => panic!("Expected onchain activity"), + } + assert_eq!( + db.get_tags("hardware-wallet-1", "legacy_activity").unwrap(), + vec!["legacy_tag".to_string()] + ); + + cleanup(&db_path); + } + + #[test] + fn test_activity_migration_defaults_pre_wallet_rows_to_bitkit() { + let db_path = format!("test_db_{}.sqlite", random::()); + { + let conn = rusqlite::Connection::open(&db_path).unwrap(); + conn.execute_batch( + " + CREATE TABLE activities ( + id TEXT PRIMARY KEY, + activity_type TEXT NOT NULL CHECK (activity_type IN ('onchain', 'lightning')), + tx_type TEXT NOT NULL CHECK (tx_type IN ('sent', 'received')), + timestamp INTEGER NOT NULL CHECK (timestamp > 0), + created_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')), + updated_at INTEGER NOT NULL DEFAULT (strftime('%s', 'now')) + ); + CREATE TABLE onchain_activity ( + id TEXT PRIMARY KEY, + tx_id TEXT NOT NULL, + address TEXT NOT NULL CHECK (length(address) > 0), + confirmed BOOLEAN NOT NULL, + value INTEGER NOT NULL CHECK (value >= 0), + fee INTEGER NOT NULL CHECK (fee >= 0), + fee_rate INTEGER NOT NULL CHECK (fee_rate >= 0), + is_boosted BOOLEAN NOT NULL, + boost_tx_ids TEXT NOT NULL, + is_transfer BOOLEAN NOT NULL, + does_exist BOOLEAN NOT NULL, + confirm_timestamp INTEGER CHECK ( + confirm_timestamp IS NULL OR confirm_timestamp >= 0 + ), + channel_id TEXT CHECK ( + channel_id IS NULL OR length(channel_id) > 0 + ), + transfer_tx_id TEXT CHECK ( + transfer_tx_id IS NULL OR length(transfer_tx_id) > 0 + ) + ); + CREATE TABLE lightning_activity ( + id TEXT PRIMARY KEY, + invoice TEXT NOT NULL CHECK (length(invoice) > 0), + value INTEGER NOT NULL CHECK (value >= 0), + status TEXT NOT NULL CHECK (status IN ('pending', 'succeeded', 'failed')), + fee INTEGER CHECK (fee IS NULL OR fee >= 0), + message TEXT NOT NULL, + preimage TEXT CHECK ( + preimage IS NULL OR length(preimage) > 0 + ) + ); + CREATE TABLE activity_tags ( + activity_id TEXT NOT NULL, + tag TEXT NOT NULL, + PRIMARY KEY (activity_id, tag) + ); + INSERT INTO activities ( + id, activity_type, tx_type, timestamp, created_at, updated_at + ) + VALUES + ('legacy_onchain', 'onchain', 'sent', 1234567890, 1234567890, 1234567891), + ('legacy_lightning', 'lightning', 'received', 1234567990, 1234567990, 1234567991); + INSERT INTO onchain_activity ( + id, tx_id, address, confirmed, value, fee, fee_rate, is_boosted, + boost_tx_ids, is_transfer, does_exist, confirm_timestamp, + channel_id, transfer_tx_id + ) + VALUES ( + 'legacy_onchain', 'legacy_onchain_txid', 'bc1qlegacy', 1, 5000, 50, 1, + 0, '', 0, 1, 1234567893, NULL, NULL + ); + INSERT INTO lightning_activity ( + id, invoice, value, status, fee, message, preimage + ) + VALUES ( + 'legacy_lightning', 'lightning:legacy', 7000, 'succeeded', + 3, 'legacy message', 'legacy_preimage' + ); + INSERT INTO activity_tags (activity_id, tag) + VALUES + ('legacy_onchain', 'legacy_onchain_tag'), + ('legacy_lightning', 'legacy_lightning_tag'); + ", + ) + .unwrap(); + } + + let db = ActivityDB::new(&db_path).unwrap(); + assert_eq!( + primary_key_columns(&db, "activities"), + vec!["wallet_id", "id"] + ); + assert_eq!( + primary_key_columns(&db, "onchain_activity"), + vec!["wallet_id", "id"] + ); + assert_eq!( + primary_key_columns(&db, "lightning_activity"), + vec!["wallet_id", "id"] + ); + assert_eq!( + primary_key_columns(&db, "activity_tags"), + vec!["wallet_id", "activity_id", "tag"] + ); + + let onchain = db + .get_activity_by_id(DEFAULT_WALLET_ID, "legacy_onchain") + .unwrap() + .unwrap(); + match onchain { + Activity::Onchain(activity) => { + assert_eq!(activity.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(activity.tx_id, "legacy_onchain_txid"); + assert_eq!(activity.seen_at, None); + assert_eq!(activity.contact, None); + } + Activity::Lightning(_) => panic!("Expected onchain activity"), + } + + let lightning = db + .get_activity_by_id(DEFAULT_WALLET_ID, "legacy_lightning") + .unwrap() + .unwrap(); + match lightning { + Activity::Lightning(activity) => { + assert_eq!(activity.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(activity.invoice, "lightning:legacy"); + assert_eq!(activity.message, "legacy message"); + } + Activity::Onchain(_) => panic!("Expected lightning activity"), + } + + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, "legacy_onchain").unwrap(), + vec!["legacy_onchain_tag".to_string()] + ); + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, "legacy_lightning").unwrap(), + vec!["legacy_lightning_tag".to_string()] + ); + + cleanup(&db_path); + } + + #[test] + fn test_pre_activity_metadata_migration_defaults_rows_to_bitkit() { + let db_path = format!("test_db_{}.sqlite", random::()); + { + let conn = rusqlite::Connection::open(&db_path).unwrap(); + conn.execute( + " + CREATE TABLE pre_activity_metadata ( + payment_id TEXT PRIMARY KEY, + tags TEXT NOT NULL, + payment_hash TEXT, + tx_id TEXT, + address TEXT, + is_receive BOOLEAN NOT NULL DEFAULT FALSE, + fee_rate INTEGER NOT NULL DEFAULT 0, + is_transfer BOOLEAN NOT NULL DEFAULT FALSE, + channel_id TEXT, + created_at INTEGER NOT NULL DEFAULT 0 + ) + ", + [], + ) + .unwrap(); + conn.execute( + " + INSERT INTO pre_activity_metadata ( + payment_id, tags, payment_hash, tx_id, address, + is_receive, fee_rate, is_transfer, channel_id, created_at + ) VALUES (?1, ?2, NULL, NULL, ?3, 1, 0, 0, NULL, 1234) + ", + rusqlite::params!["legacy_payment", "[\"legacy\"]", "bc1qlegacy"], + ) + .unwrap(); + } + + let db = ActivityDB::new(&db_path).unwrap(); + + assert_eq!( + primary_key_columns(&db, "pre_activity_metadata"), + vec!["wallet_id".to_string(), "payment_id".to_string()] + ); + + let metadata = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "legacy_payment", false) + .unwrap() + .unwrap(); + assert_eq!(metadata.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(metadata.payment_id, "legacy_payment"); + assert_eq!(metadata.tags, vec!["legacy".to_string()]); + + cleanup(&db_path); + } + + #[test] + fn test_pre_activity_metadata_migration_handles_older_schema() { + let db_path = format!("test_db_{}.sqlite", random::()); + { + let conn = rusqlite::Connection::open(&db_path).unwrap(); + conn.execute( + " + CREATE TABLE pre_activity_metadata ( + payment_id TEXT PRIMARY KEY, + payment_type TEXT NOT NULL, + tags TEXT NOT NULL, + payment_hash TEXT, + tx_id TEXT, + address TEXT, + is_receive BOOLEAN NOT NULL DEFAULT FALSE, + created_at INTEGER NOT NULL DEFAULT 0 + ) + ", + [], + ) + .unwrap(); + conn.execute( + " + INSERT INTO pre_activity_metadata ( + payment_id, payment_type, tags, payment_hash, tx_id, + address, is_receive, created_at + ) VALUES (?1, 'onchain', ?2, NULL, NULL, ?3, 1, 1234) + ", + rusqlite::params!["older_payment", "[\"older\"]", "bc1qolder"], + ) + .unwrap(); + } + + let db = ActivityDB::new(&db_path).unwrap(); + + assert_eq!( + primary_key_columns(&db, "pre_activity_metadata"), + vec!["wallet_id".to_string(), "payment_id".to_string()] + ); + + let metadata = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "older_payment", false) + .unwrap() + .unwrap(); + assert_eq!(metadata.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(metadata.payment_id, "older_payment"); + assert_eq!(metadata.tags, vec!["older".to_string()]); + assert_eq!(metadata.address, Some("bc1qolder".to_string())); + assert!(metadata.is_receive); + assert_eq!(metadata.fee_rate, 0); + assert!(!metadata.is_transfer); + assert_eq!(metadata.channel_id, None); + + cleanup(&db_path); + } + + #[test] + fn test_transaction_details_migration_rebuilds_wallet_primary_key() { + let db_path = format!("test_db_{}.sqlite", random::()); + { + let conn = rusqlite::Connection::open(&db_path).unwrap(); + conn.execute_batch( + " + CREATE TABLE transaction_details ( + tx_id TEXT PRIMARY KEY, + amount_sats INTEGER NOT NULL, + inputs TEXT NOT NULL, + outputs TEXT NOT NULL + ); + INSERT INTO transaction_details (tx_id, amount_sats, inputs, outputs) + VALUES ('legacy_txid', 1234, '[]', '[]'); + ", + ) + .unwrap(); + } + + let db = ActivityDB::new(&db_path).unwrap(); + let primary_keys = db + .conn + .prepare("PRAGMA table_info(transaction_details)") + .unwrap() + .query_map([], |row| { + Ok((row.get::<_, String>(1)?, row.get::<_, i64>(5)?)) + }) + .unwrap() + .collect::, _>>() + .unwrap(); + + assert!(primary_keys + .iter() + .any(|(column, pk)| column == "wallet_id" && *pk > 0)); + assert!(primary_keys + .iter() + .any(|(column, pk)| column == "tx_id" && *pk > 0)); + + let details = db + .get_transaction_details(DEFAULT_WALLET_ID, "legacy_txid") + .unwrap() + .unwrap(); + assert_eq!(details.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(details.amount_sats, 1234); cleanup(&db_path); } @@ -151,6 +591,7 @@ mod tests { let activities = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -163,6 +604,7 @@ mod tests { .unwrap(); assert_eq!(activities.len(), 1); if let Activity::Onchain(retrieved) = &activities[0] { + assert_eq!(retrieved.wallet_id.as_str(), DEFAULT_WALLET_ID); assert_eq!(retrieved.id, activity.id); assert_eq!(retrieved.value, activity.value); assert_eq!(retrieved.fee, activity.fee); @@ -175,6 +617,331 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_get_activities_optional_wallet_id_filters_and_sorts() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + + let mut main = create_test_onchain_activity(); + main.id = "main_tx".to_string(); + main.tx_id = "main_txid".to_string(); + main.timestamp = 100; + + let mut hw_newer = create_test_onchain_activity(); + hw_newer.wallet_id = wallet_id.to_string(); + hw_newer.id = "hardware-wallet-1:tx_newer".to_string(); + hw_newer.tx_id = "tx_newer".to_string(); + hw_newer.timestamp = 300; + + let mut hw_older = create_test_onchain_activity(); + hw_older.wallet_id = wallet_id.to_string(); + hw_older.id = "hardware-wallet-1:tx_older".to_string(); + hw_older.tx_id = "tx_older".to_string(); + hw_older.timestamp = 200; + + db.upsert_onchain_activities(&[main.clone(), hw_newer.clone(), hw_older.clone()]) + .unwrap(); + + let wallet_activities = db + .get_activities( + Some(wallet_id), + Some(ActivityFilter::Onchain), + None, + None, + None, + None, + None, + None, + Some(SortDirection::Desc), + ) + .unwrap(); + + assert_eq!(wallet_activities.len(), 2); + assert_eq!(wallet_activities[0].get_id(), hw_newer.id); + assert_eq!(wallet_activities[1].get_id(), hw_older.id); + + let unified = db + .get_activities( + None, + Some(ActivityFilter::Onchain), + None, + None, + None, + None, + None, + Some(2), + Some(SortDirection::Desc), + ) + .unwrap(); + + assert_eq!(unified.len(), 2); + assert_eq!(unified[0].get_id(), hw_newer.id); + assert_eq!(unified[1].get_id(), hw_older.id); + + cleanup(&db_path); + } + + #[test] + fn test_wallet_scoped_txid_lookup_allows_collisions() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + + let mut main = create_test_onchain_activity(); + main.id = "bitkit:shared_txid".to_string(); + main.tx_id = "shared_txid".to_string(); + main.value = 10_000; + + let mut hardware = create_test_onchain_activity(); + hardware.wallet_id = wallet_id.to_string(); + hardware.id = "hardware-wallet-1:shared_txid".to_string(); + hardware.tx_id = "shared_txid".to_string(); + hardware.value = 20_000; + + db.upsert_onchain_activities(&[main.clone(), hardware.clone()]) + .unwrap(); + + let default_lookup = db + .get_activity_by_tx_id(DEFAULT_WALLET_ID, "shared_txid") + .unwrap() + .unwrap(); + assert_eq!(default_lookup.wallet_id.as_str(), DEFAULT_WALLET_ID); + assert_eq!(default_lookup.value, main.value); + + let scoped_lookup = db + .get_activity_by_tx_id(wallet_id, "shared_txid") + .unwrap() + .unwrap(); + assert_eq!(scoped_lookup.wallet_id.as_str(), wallet_id); + assert_eq!(scoped_lookup.value, hardware.value); + + cleanup(&db_path); + } + + #[test] + fn test_wallet_scoped_app_shaped_activity_collision() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + let shared_id = "shared_activity_txid"; + let shared_tag = "shared_tag"; + + let mut main = create_test_onchain_activity(); + main.id = shared_id.to_string(); + main.tx_id = shared_id.to_string(); + main.value = 10_000; + + let mut hardware = create_test_onchain_activity(); + hardware.wallet_id = wallet_id.to_string(); + hardware.id = shared_id.to_string(); + hardware.tx_id = shared_id.to_string(); + hardware.value = 20_000; + + db.insert_onchain_activity(&main).unwrap(); + db.insert_onchain_activity(&hardware).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, shared_id, &[shared_tag.to_string()]) + .unwrap(); + db.add_tags(wallet_id, shared_id, &[shared_tag.to_string()]) + .unwrap(); + + let default_lookup = db + .get_activity_by_tx_id(DEFAULT_WALLET_ID, shared_id) + .unwrap() + .unwrap(); + assert_eq!(default_lookup.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(default_lookup.value, main.value); + + let hardware_lookup = db + .get_activity_by_tx_id(wallet_id, shared_id) + .unwrap() + .unwrap(); + assert_eq!(hardware_lookup.wallet_id, wallet_id); + assert_eq!(hardware_lookup.value, hardware.value); + + let all_tagged = db + .get_activities_by_tag(None, shared_tag, None, None) + .unwrap(); + assert_eq!(all_tagged.len(), 2); + assert!(all_tagged + .iter() + .any(|activity| activity.get_wallet_id() == DEFAULT_WALLET_ID)); + assert!(all_tagged + .iter() + .any(|activity| activity.get_wallet_id() == wallet_id)); + + let default_tagged = db + .get_activities_by_tag(Some(DEFAULT_WALLET_ID), shared_tag, None, None) + .unwrap(); + assert_eq!(default_tagged.len(), 1); + assert_eq!(default_tagged[0].get_wallet_id(), DEFAULT_WALLET_ID); + + let hardware_tagged = db + .get_activities_by_tag(Some(wallet_id), shared_tag, None, None) + .unwrap(); + assert_eq!(hardware_tagged.len(), 1); + assert_eq!(hardware_tagged[0].get_wallet_id(), wallet_id); + + cleanup(&db_path); + } + + #[test] + fn test_wallet_scoped_activity_ids_allow_collisions() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + let activity_id = "shared_activity_id"; + + let mut main = create_test_onchain_activity(); + main.id = activity_id.to_string(); + main.tx_id = "default_wallet_txid".to_string(); + main.value = 10_000; + + let mut hardware = create_test_onchain_activity(); + hardware.wallet_id = wallet_id.to_string(); + hardware.id = activity_id.to_string(); + hardware.tx_id = "hardware_wallet_txid".to_string(); + hardware.value = 20_000; + + db.insert_onchain_activity(&main).unwrap(); + db.insert_onchain_activity(&hardware).unwrap(); + + let default_activity = db + .get_activity_by_id(DEFAULT_WALLET_ID, activity_id) + .unwrap() + .unwrap(); + match default_activity { + Activity::Onchain(activity) => { + assert_eq!(activity.wallet_id, DEFAULT_WALLET_ID); + assert_eq!(activity.value, main.value); + } + Activity::Lightning(_) => panic!("Expected onchain activity"), + } + + let hardware_activity = db + .get_activity_by_id(wallet_id, activity_id) + .unwrap() + .unwrap(); + match hardware_activity { + Activity::Onchain(activity) => { + assert_eq!(activity.wallet_id, wallet_id); + assert_eq!(activity.value, hardware.value); + } + Activity::Lightning(_) => panic!("Expected onchain activity"), + } + + db.add_tags(DEFAULT_WALLET_ID, activity_id, &["main".to_string()]) + .unwrap(); + db.add_tags(wallet_id, activity_id, &["hardware".to_string()]) + .unwrap(); + + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, activity_id).unwrap(), + vec!["main".to_string()] + ); + assert_eq!( + db.get_tags(wallet_id, activity_id).unwrap(), + vec!["hardware".to_string()] + ); + + assert!(db.delete_activity_by_id(wallet_id, activity_id).unwrap()); + assert!(db + .get_activity_by_id(DEFAULT_WALLET_ID, activity_id) + .unwrap() + .is_some()); + assert!(db + .get_activity_by_id(wallet_id, activity_id) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + + #[test] + fn test_delete_activities_by_wallet_id_cleans_scoped_data() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + + let mut main = create_test_onchain_activity(); + main.id = "bitkit:cleanup_txid".to_string(); + main.tx_id = "cleanup_txid".to_string(); + + let mut hardware = create_test_onchain_activity(); + hardware.wallet_id = wallet_id.to_string(); + hardware.id = "hardware-wallet-1:cleanup_txid".to_string(); + hardware.tx_id = "cleanup_txid".to_string(); + + db.upsert_onchain_activities(&[main.clone(), hardware.clone()]) + .unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &main.id, &["main".to_string()]) + .unwrap(); + db.add_tags(wallet_id, &hardware.id, &["hardware".to_string()]) + .unwrap(); + + let mut main_details = create_test_transaction_details(); + main_details.tx_id = "cleanup_txid".to_string(); + main_details.amount_sats = 1; + + let mut hardware_details = create_test_transaction_details(); + hardware_details.wallet_id = wallet_id.to_string(); + hardware_details.tx_id = "cleanup_txid".to_string(); + hardware_details.amount_sats = 2; + + db.upsert_transaction_details(&[main_details, hardware_details]) + .unwrap(); + + let mut main_metadata = create_test_pre_activity_metadata( + "bitkit:cleanup_pending".to_string(), + ActivityType::Onchain, + vec!["main-pending".to_string()], + ); + main_metadata.address = Some("bc1qbitkitcleanup".to_string()); + + let mut hardware_metadata = create_test_pre_activity_metadata( + "hardware-wallet-1:cleanup_pending".to_string(), + ActivityType::Onchain, + vec!["hardware-pending".to_string()], + ); + hardware_metadata.wallet_id = wallet_id.to_string(); + hardware_metadata.address = Some("bc1qhardwarecleanup".to_string()); + + db.add_pre_activity_metadata(&main_metadata).unwrap(); + db.add_pre_activity_metadata(&hardware_metadata).unwrap(); + + let deleted = db.delete_activities_by_wallet_id(wallet_id).unwrap(); + assert_eq!(deleted, 1); + + assert!(db + .get_activity_by_id(wallet_id, &hardware.id) + .unwrap() + .is_none()); + assert!(db + .get_activity_by_id(DEFAULT_WALLET_ID, &main.id) + .unwrap() + .is_some()); + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &main.id).unwrap(), + vec!["main".to_string()] + ); + assert!(db.get_tags(wallet_id, &hardware.id).unwrap().is_empty()); + + let main_details = db + .get_transaction_details(DEFAULT_WALLET_ID, "cleanup_txid") + .unwrap() + .unwrap(); + assert_eq!(main_details.amount_sats, 1); + assert!(db + .get_transaction_details(wallet_id, "cleanup_txid") + .unwrap() + .is_none()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &main_metadata.payment_id, false) + .unwrap() + .is_some()); + assert!(db + .get_pre_activity_metadata(wallet_id, &hardware_metadata.payment_id, false) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + #[test] fn test_insert_and_retrieve_lightning_activity() { let (mut db, db_path) = setup(); @@ -183,6 +950,7 @@ mod tests { let activities = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -219,7 +987,10 @@ mod tests { db.insert_onchain_activity(&onchain).unwrap(); db.insert_lightning_activity(&lightning).unwrap(); - let onchain_by_id = db.get_activity_by_id(&onchain.id).unwrap().unwrap(); + let onchain_by_id = db + .get_activity_by_id(DEFAULT_WALLET_ID, &onchain.id) + .unwrap() + .unwrap(); match onchain_by_id { Activity::Onchain(activity) => { assert_eq!(activity.contact, Some("onchain_contact_pubky".to_string())); @@ -227,7 +998,10 @@ mod tests { Activity::Lightning(_) => panic!("Expected Onchain activity"), } - let onchain_by_tx_id = db.get_activity_by_tx_id(&onchain.tx_id).unwrap().unwrap(); + let onchain_by_tx_id = db + .get_activity_by_tx_id(DEFAULT_WALLET_ID, &onchain.tx_id) + .unwrap() + .unwrap(); assert_eq!( onchain_by_tx_id.contact, Some("onchain_contact_pubky".to_string()) @@ -235,6 +1009,7 @@ mod tests { let activities = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -268,6 +1043,7 @@ mod tests { let results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -304,6 +1080,7 @@ mod tests { let all_activities = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -332,6 +1109,7 @@ mod tests { let retrieved = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -366,6 +1144,7 @@ mod tests { let all_activities = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -398,6 +1177,7 @@ mod tests { let activities = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -434,6 +1214,7 @@ mod tests { // Test limits with different filters let all = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -448,6 +1229,7 @@ mod tests { let onchain = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -462,6 +1244,7 @@ mod tests { let lightning = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -477,6 +1260,7 @@ mod tests { // Test without limits let all = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -502,6 +1286,7 @@ mod tests { let all = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -516,6 +1301,7 @@ mod tests { let onchain = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -530,6 +1316,7 @@ mod tests { let lightning = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -552,8 +1339,8 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); let tags = vec!["payment".to_string(), "coffee".to_string()]; - db.add_tags(&activity.id, &tags).unwrap(); - let retrieved_tags = db.get_tags(&activity.id).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &tags).unwrap(); + let retrieved_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(retrieved_tags.len(), 2); assert!(retrieved_tags.contains(&"payment".to_string())); assert!(retrieved_tags.contains(&"coffee".to_string())); @@ -568,11 +1355,15 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); let tags = vec!["payment".to_string(), "coffee".to_string()]; - db.add_tags(&activity.id, &tags).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &tags).unwrap(); - db.remove_tags(&activity.id, &vec!["payment".to_string()]) - .unwrap(); - let remaining_tags = db.get_tags(&activity.id).unwrap(); + db.remove_tags( + DEFAULT_WALLET_ID, + &activity.id, + &vec!["payment".to_string()], + ) + .unwrap(); + let remaining_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(remaining_tags.len(), 1); assert_eq!(remaining_tags[0], "coffee"); @@ -582,21 +1373,48 @@ mod tests { #[test] fn test_get_activities_by_tag() { let (mut db, db_path) = setup(); + let hardware_wallet_id = "hardware-wallet-1"; let onchain = create_test_onchain_activity(); let mut lightning = create_test_lightning_activity(); lightning.id = "test_lightning_tagged".to_string(); + let mut hardware = create_test_onchain_activity(); + hardware.wallet_id = hardware_wallet_id.to_string(); + hardware.id = "hardware_tagged".to_string(); + hardware.tx_id = "hardware_tagged_txid".to_string(); db.insert_onchain_activity(&onchain).unwrap(); db.insert_lightning_activity(&lightning).unwrap(); + db.insert_onchain_activity(&hardware).unwrap(); - db.add_tags(&onchain.id, &["payment".to_string()]).unwrap(); - db.add_tags(&lightning.id, &["payment".to_string()]) + db.add_tags(DEFAULT_WALLET_ID, &onchain.id, &["payment".to_string()]) + .unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &lightning.id, &["payment".to_string()]) + .unwrap(); + db.add_tags(hardware_wallet_id, &hardware.id, &["payment".to_string()]) .unwrap(); - let activities = db.get_activities_by_tag("payment", None, None).unwrap(); - assert_eq!(activities.len(), 2); + let activities = db + .get_activities_by_tag(None, "payment", None, None) + .unwrap(); + assert_eq!(activities.len(), 3); - let limited = db.get_activities_by_tag("payment", Some(1), None).unwrap(); + let default_wallet_activities = db + .get_activities_by_tag(Some(DEFAULT_WALLET_ID), "payment", None, None) + .unwrap(); + assert_eq!(default_wallet_activities.len(), 2); + assert!(default_wallet_activities + .iter() + .all(|activity| activity.get_wallet_id() == DEFAULT_WALLET_ID)); + + let hardware_activities = db + .get_activities_by_tag(Some(hardware_wallet_id), "payment", None, None) + .unwrap(); + assert_eq!(hardware_activities.len(), 1); + assert_eq!(hardware_activities[0].get_wallet_id(), hardware_wallet_id); + + let limited = db + .get_activities_by_tag(None, "payment", Some(1), None) + .unwrap(); assert_eq!(limited.len(), 1); cleanup(&db_path); @@ -606,7 +1424,9 @@ mod tests { fn test_tags_on_nonexistent_activity() { let (mut db, db_path) = setup(); let tags = vec!["test".to_string()]; - assert!(db.add_tags("nonexistent", &tags).is_err()); + assert!(db + .add_tags(DEFAULT_WALLET_ID, "nonexistent", &tags) + .is_err()); cleanup(&db_path); } @@ -617,9 +1437,9 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); let tags = vec!["test".to_string(), "test".to_string()]; - db.add_tags(&activity.id, &tags).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &tags).unwrap(); - let retrieved_tags = db.get_tags(&activity.id).unwrap(); + let retrieved_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(retrieved_tags.len(), 1); cleanup(&db_path); @@ -631,7 +1451,7 @@ mod tests { let activity = create_test_onchain_activity(); db.insert_onchain_activity(&activity).unwrap(); - let tags = db.get_tags(&activity.id).unwrap(); + let tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!(tags.is_empty()); cleanup(&db_path); @@ -643,10 +1463,12 @@ mod tests { let activity = create_test_onchain_activity(); db.insert_onchain_activity(&activity).unwrap(); - db.add_tags(&activity.id, &["test".to_string()]).unwrap(); - db.delete_activity_by_id(&activity.id).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &["test".to_string()]) + .unwrap(); + db.delete_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); - let tags = db.get_tags(&activity.id).unwrap(); + let tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!( tags.is_empty(), "Tags should be removed after activity deletion" @@ -658,7 +1480,9 @@ mod tests { #[test] fn test_get_activities_by_nonexistent_tag() { let (db, db_path) = setup(); - let activities = db.get_activities_by_tag("nonexistent", None, None).unwrap(); + let activities = db + .get_activities_by_tag(None, "nonexistent", None, None) + .unwrap(); assert!(activities.is_empty()); cleanup(&db_path); } @@ -669,14 +1493,20 @@ mod tests { let activity = create_test_onchain_activity(); db.insert_onchain_activity(&activity).unwrap(); - db.delete_activity_by_id(&activity.id).unwrap(); + db.delete_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); // These operations should fail or return empty results after deletion - assert!(db.get_activity_by_id(&activity.id).unwrap().is_none()); + assert!(db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .is_none()); assert!(db .update_onchain_activity_by_id(&activity.id, &activity) .is_err()); - assert!(db.add_tags(&activity.id, &["test".to_string()]).is_err()); + assert!(db + .add_tags(DEFAULT_WALLET_ID, &activity.id, &["test".to_string()]) + .is_err()); cleanup(&db_path); } @@ -701,7 +1531,10 @@ mod tests { result.err() ); - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.value, safe_max); assert_eq!(retrieved.fee, safe_max - 1); @@ -727,7 +1560,10 @@ mod tests { assert!(db.insert_onchain_activity(&activity).is_ok()); - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.value, 0); assert_eq!(retrieved.fee, 0); @@ -760,6 +1596,7 @@ mod tests { let activities = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -806,7 +1643,10 @@ mod tests { activity.confirm_timestamp = Some(2000); assert!(db.insert_onchain_activity(&activity).is_ok()); - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.timestamp, 1000); assert_eq!(retrieved.confirm_timestamp, Some(2000)); @@ -835,7 +1675,10 @@ mod tests { .update_onchain_activity_by_id(&activity.id, &activity) .is_ok()); - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.value, 1_000_000_000_000); assert!(retrieved.created_at.is_some()); @@ -847,6 +1690,83 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_update_onchain_metadata_transfer_targets_activity_id_argument() { + let (mut db, db_path) = setup(); + + let activity = create_test_onchain_activity(); + let activity_id = activity.id.clone(); + db.insert_onchain_activity(&activity).unwrap(); + + let mut metadata = create_test_pre_activity_metadata( + "updated_txid".to_string(), + ActivityType::Onchain, + vec!["target-row".to_string()], + ); + metadata.tx_id = Some("updated_txid".to_string()); + db.add_pre_activity_metadata(&metadata).unwrap(); + + let mut updated = activity; + updated.id = "mismatched_activity_id".to_string(); + updated.tx_id = "updated_txid".to_string(); + + db.update_onchain_activity_by_id(&activity_id, &updated) + .unwrap(); + + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &activity_id).unwrap(), + vec!["target-row".to_string()] + ); + assert!(db + .get_tags(DEFAULT_WALLET_ID, "mismatched_activity_id") + .unwrap() + .is_empty()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "updated_txid", false) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + + #[test] + fn test_update_lightning_metadata_transfer_targets_activity_id_argument() { + let (mut db, db_path) = setup(); + + let activity = create_test_lightning_activity(); + let activity_id = activity.id.clone(); + db.insert_lightning_activity(&activity).unwrap(); + + let metadata = create_test_pre_activity_metadata( + "mismatched_lightning_id".to_string(), + ActivityType::Lightning, + vec!["target-row".to_string()], + ); + db.add_pre_activity_metadata(&metadata).unwrap(); + + let mut updated = activity; + updated.id = "mismatched_lightning_id".to_string(); + updated.status = PaymentState::Succeeded; + + db.update_lightning_activity_by_id(&activity_id, &updated) + .unwrap(); + + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &activity_id).unwrap(), + vec!["target-row".to_string()] + ); + assert!(db + .get_tags(DEFAULT_WALLET_ID, "mismatched_lightning_id") + .unwrap() + .is_empty()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "mismatched_lightning_id", false) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + #[test] fn test_upsert_onchain_activity_insert_then_update() { let (mut db, db_path) = setup(); @@ -858,7 +1778,10 @@ mod tests { // Test insert path assert!(db.upsert_activity(&activity).is_ok()); - let retrieved = db.get_activity_by_id(&onchain.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &onchain.id) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.value, onchain.value); assert!(retrieved.created_at.is_some()); @@ -866,16 +1789,35 @@ mod tests { // Test update path std::thread::sleep(std::time::Duration::from_secs(1)); + let mut metadata = create_test_pre_activity_metadata( + onchain.tx_id.clone(), + ActivityType::Onchain, + vec!["upsert-update-tag".to_string()], + ); + metadata.tx_id = Some(onchain.tx_id.clone()); + db.add_pre_activity_metadata(&metadata).unwrap(); + onchain.value = 100_000; let updated = Activity::Onchain(onchain); assert!(db.upsert_activity(&updated).is_ok()); // Verify update - let retrieved = db.get_activity_by_id(&updated.get_id()).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &updated.get_id()) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.value, 100_000); assert!(retrieved.updated_at > first_update); } + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &updated.get_id()).unwrap(), + vec!["upsert-update-tag".to_string()] + ); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "txid123", false) + .unwrap() + .is_none()); } else { panic!("Expected Onchain activity"); } @@ -895,23 +1837,44 @@ mod tests { // Test insert assert!(db.upsert_activity(&activity).is_ok()); - let retrieved = db.get_activity_by_id(&lightning.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &lightning.id) + .unwrap() + .unwrap(); if let Activity::Lightning(retrieved) = retrieved { assert_eq!(retrieved.status, PaymentState::Pending); // Update to succeeded std::thread::sleep(std::time::Duration::from_millis(1)); + let metadata = create_test_pre_activity_metadata( + lightning.id.clone(), + ActivityType::Lightning, + vec!["lightning-upsert-update-tag".to_string()], + ); + db.add_pre_activity_metadata(&metadata).unwrap(); + lightning.status = PaymentState::Succeeded; let updated = Activity::Lightning(lightning); assert!(db.upsert_activity(&updated).is_ok()); // Verify status change - let retrieved = db.get_activity_by_id(&updated.get_id()).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &updated.get_id()) + .unwrap() + .unwrap(); if let Activity::Lightning(retrieved) = retrieved { assert_eq!(retrieved.status, PaymentState::Succeeded); assert!(retrieved.created_at.is_some()); assert!(retrieved.updated_at.is_some()); } + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &updated.get_id()).unwrap(), + vec!["lightning-upsert-update-tag".to_string()] + ); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "test_lightning_1", false) + .unwrap() + .is_none()); } else { panic!("Expected Lightning activity"); } @@ -929,6 +1892,16 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_upsert_activity_empty_wallet_id_fails() { + let (mut db, db_path) = setup(); + let mut activity = create_test_onchain_activity(); + activity.wallet_id = "".to_string(); + let activity = Activity::Onchain(activity); + assert!(db.upsert_activity(&activity).is_err()); + cleanup(&db_path); + } + #[test] fn test_upsert_activity_timestamps() { let (mut db, db_path) = setup(); @@ -937,7 +1910,10 @@ mod tests { let activity = Activity::Onchain(onchain.clone()); assert!(db.upsert_activity(&activity).is_ok()); - let initial = db.get_activity_by_id(&onchain.id).unwrap().unwrap(); + let initial = db + .get_activity_by_id(DEFAULT_WALLET_ID, &onchain.id) + .unwrap() + .unwrap(); if let Activity::Onchain(initial) = initial { let created_at = initial.created_at.unwrap(); @@ -947,7 +1923,10 @@ mod tests { let updated = Activity::Onchain(onchain); assert!(db.upsert_activity(&updated).is_ok()); - let retrieved = db.get_activity_by_id(&updated.get_id()).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &updated.get_id()) + .unwrap() + .unwrap(); if let Activity::Onchain(retrieved) = retrieved { assert_eq!(retrieved.created_at.unwrap(), created_at); assert!(retrieved.updated_at.unwrap() > initial.updated_at.unwrap()); @@ -977,6 +1956,7 @@ mod tests { // Test ascending order let asc_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -993,6 +1973,7 @@ mod tests { // Test descending order let desc_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1025,19 +2006,21 @@ mod tests { // Add same tag to both let tag = "test_tag".to_string(); - db.add_tags(&onchain1.id, &[tag.clone()]).unwrap(); - db.add_tags(&onchain2.id, &[tag.clone()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &onchain1.id, &[tag.clone()]) + .unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &onchain2.id, &[tag.clone()]) + .unwrap(); // Test ascending order let asc_activities = db - .get_activities_by_tag(&tag, None, Some(SortDirection::Asc)) + .get_activities_by_tag(None, &tag, None, Some(SortDirection::Asc)) .unwrap(); let asc_timestamps: Vec = asc_activities.iter().map(|a| a.get_timestamp()).collect(); assert_eq!(asc_timestamps, vec![1000, 2000]); // Test descending order let desc_activities = db - .get_activities_by_tag(&tag, None, Some(SortDirection::Desc)) + .get_activities_by_tag(None, &tag, None, Some(SortDirection::Desc)) .unwrap(); let desc_timestamps: Vec = desc_activities.iter().map(|a| a.get_timestamp()).collect(); assert_eq!(desc_timestamps, vec![2000, 1000]); @@ -1060,6 +2043,7 @@ mod tests { // Test ascending order with limit let asc_limited = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1076,6 +2060,7 @@ mod tests { // Test descending order with limit let desc_limited = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1114,6 +2099,7 @@ mod tests { // Test ascending order let asc_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1152,6 +2138,7 @@ mod tests { // Test with None sort direction (should default to Desc) let default_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1186,6 +2173,7 @@ mod tests { // Test filtering by sent let sent_activities = db .get_activities( + None, Some(ActivityFilter::All), Some(PaymentType::Sent), None, @@ -1204,6 +2192,7 @@ mod tests { // Test filtering by received let received_activities = db .get_activities( + None, Some(ActivityFilter::All), Some(PaymentType::Received), None, @@ -1239,6 +2228,7 @@ mod tests { // Test address search let address_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1255,6 +2245,7 @@ mod tests { // Test message search let message_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1293,6 +2284,7 @@ mod tests { // Test min date let min_date_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1308,6 +2300,7 @@ mod tests { // Test max date let max_date_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1323,6 +2316,7 @@ mod tests { // Test date range let range_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1358,8 +2352,10 @@ mod tests { db.insert_onchain_activity(&onchain2).unwrap(); // Add tags - db.add_tags(&onchain1.id, &["payment".to_string()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &onchain1.id, &["payment".to_string()]) + .unwrap(); db.add_tags( + DEFAULT_WALLET_ID, &onchain2.id, &["payment".to_string(), "important".to_string()], ) @@ -1368,6 +2364,7 @@ mod tests { // Test combined filters let results = db .get_activities( + None, Some(ActivityFilter::Onchain), Some(PaymentType::Received), Some(vec!["payment".to_string()]), @@ -1402,6 +2399,7 @@ mod tests { // Test empty search string - should return all results, same as if no search was provided let empty_search = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1417,6 +2415,7 @@ mod tests { // Test empty tags array let empty_tags = db .get_activities( + None, Some(ActivityFilter::All), None, Some(vec![]), @@ -1448,16 +2447,29 @@ mod tests { db.insert_onchain_activity(&activity3).unwrap(); // Add different tag combinations - db.add_tags(&activity1.id, &["tag1".to_string(), "tag2".to_string()]) - .unwrap(); - db.add_tags(&activity2.id, &["tag2".to_string(), "tag3".to_string()]) - .unwrap(); - db.add_tags(&activity3.id, &["tag1".to_string(), "tag3".to_string()]) - .unwrap(); + db.add_tags( + DEFAULT_WALLET_ID, + &activity1.id, + &["tag1".to_string(), "tag2".to_string()], + ) + .unwrap(); + db.add_tags( + DEFAULT_WALLET_ID, + &activity2.id, + &["tag2".to_string(), "tag3".to_string()], + ) + .unwrap(); + db.add_tags( + DEFAULT_WALLET_ID, + &activity3.id, + &["tag1".to_string(), "tag3".to_string()], + ) + .unwrap(); // Test filtering with multiple tags (OR condition) let results = db .get_activities( + None, Some(ActivityFilter::All), None, Some(vec!["tag1".to_string(), "tag2".to_string()]), @@ -1473,6 +2485,7 @@ mod tests { // Test with non-existent tag mixed with existing tags let mixed_results = db .get_activities( + None, Some(ActivityFilter::All), None, Some(vec!["tag1".to_string(), "nonexistent".to_string()]), @@ -1498,6 +2511,7 @@ mod tests { // Test max date before min date let invalid_range = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1513,6 +2527,7 @@ mod tests { // Test dates way in the future let future_date = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1539,6 +2554,7 @@ mod tests { // Test lowercase search let lower_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1554,6 +2570,7 @@ mod tests { // Test uppercase search let upper_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1569,6 +2586,7 @@ mod tests { // Test mixed case search let mixed_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1593,14 +2611,16 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); // Add tags from both connections - db.add_tags(&activity.id, &["tag1".to_string()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &["tag1".to_string()]) + .unwrap(); db_clone - .add_tags(&activity.id, &["tag2".to_string()]) + .add_tags(DEFAULT_WALLET_ID, &activity.id, &["tag2".to_string()]) .unwrap(); // Verify tags from both connections let results = db .get_activities( + None, Some(ActivityFilter::All), None, Some(vec!["tag1".to_string(), "tag2".to_string()]), @@ -1632,6 +2652,7 @@ mod tests { // Search with special characters let special_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1647,6 +2668,7 @@ mod tests { // Search with underscore let underscore_results = db .get_activities( + None, Some(ActivityFilter::All), None, None, @@ -1676,13 +2698,15 @@ mod tests { // Add tags to even numbered activities if i % 2 == 0 { - db.add_tags(&activity.id, &["even".to_string()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &["even".to_string()]) + .unwrap(); } } // Test pagination with combined filters let page1 = db .get_activities( + None, Some(ActivityFilter::All), None, Some(vec!["even".to_string()]), @@ -1699,6 +2723,7 @@ mod tests { let min_date = page1.last().unwrap().get_timestamp(); let page2 = db .get_activities( + None, Some(ActivityFilter::All), None, Some(vec!["even".to_string()]), @@ -1730,12 +2755,17 @@ mod tests { // Add various tags db.add_tags( + DEFAULT_WALLET_ID, &activity1.id, &["payment".to_string(), "coffee".to_string()], ) .unwrap(); - db.add_tags(&activity2.id, &["payment".to_string(), "food".to_string()]) - .unwrap(); + db.add_tags( + DEFAULT_WALLET_ID, + &activity2.id, + &["payment".to_string(), "food".to_string()], + ) + .unwrap(); // Get all unique tags let all_tags = db.get_all_unique_tags().unwrap(); @@ -1770,14 +2800,17 @@ mod tests { // Bulk upsert tags let activity_tags = vec![ ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity1.id.clone(), tags: vec!["payment".to_string(), "coffee".to_string()], }, ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity2.id.clone(), tags: vec!["payment".to_string(), "food".to_string()], }, ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity3.id.clone(), tags: vec!["payment".to_string()], }, @@ -1786,17 +2819,17 @@ mod tests { assert!(db.upsert_tags(&activity_tags).is_ok()); // Verify tags were added - let tags1 = db.get_tags(&activity1.id).unwrap(); + let tags1 = db.get_tags(DEFAULT_WALLET_ID, &activity1.id).unwrap(); assert_eq!(tags1.len(), 2); assert!(tags1.contains(&"payment".to_string())); assert!(tags1.contains(&"coffee".to_string())); - let tags2 = db.get_tags(&activity2.id).unwrap(); + let tags2 = db.get_tags(DEFAULT_WALLET_ID, &activity2.id).unwrap(); assert_eq!(tags2.len(), 2); assert!(tags2.contains(&"payment".to_string())); assert!(tags2.contains(&"food".to_string())); - let tags3 = db.get_tags(&activity3.id).unwrap(); + let tags3 = db.get_tags(DEFAULT_WALLET_ID, &activity3.id).unwrap(); assert_eq!(tags3.len(), 1); assert!(tags3.contains(&"payment".to_string())); @@ -1813,6 +2846,7 @@ mod tests { // First upsert let activity_tags = vec![ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity.id.clone(), tags: vec!["payment".to_string(), "coffee".to_string()], }]; @@ -1822,7 +2856,7 @@ mod tests { assert!(db.upsert_tags(&activity_tags).is_ok()); // Verify tags are still there and not duplicated - let tags = db.get_tags(&activity.id).unwrap(); + let tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(tags.len(), 2); assert!(tags.contains(&"payment".to_string())); assert!(tags.contains(&"coffee".to_string())); @@ -1837,10 +2871,12 @@ mod tests { // Create activity and add initial tags let activity = create_test_onchain_activity(); db.insert_onchain_activity(&activity).unwrap(); - db.add_tags(&activity.id, &["payment".to_string()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &["payment".to_string()]) + .unwrap(); // Upsert with additional tags (adds new tags, keeps existing) let activity_tags = vec![ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity.id.clone(), tags: vec![ "payment".to_string(), @@ -1851,7 +2887,7 @@ mod tests { assert!(db.upsert_tags(&activity_tags).is_ok()); // Verify all tags are present (payment was already there, coffee and food are new) - let tags = db.get_tags(&activity.id).unwrap(); + let tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!(tags.len() >= 3); assert!(tags.contains(&"payment".to_string())); assert!(tags.contains(&"coffee".to_string())); @@ -1870,13 +2906,14 @@ mod tests { // Upsert with empty tags mixed in let activity_tags = vec![ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity.id.clone(), tags: vec!["payment".to_string(), "".to_string(), "coffee".to_string()], }]; assert!(db.upsert_tags(&activity_tags).is_ok()); // Verify only non-empty tags were added - let tags = db.get_tags(&activity.id).unwrap(); + let tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(tags.len(), 2); assert!(tags.contains(&"payment".to_string())); assert!(tags.contains(&"coffee".to_string())); @@ -1903,14 +2940,17 @@ mod tests { // Bulk upsert tags for all activities in one call let activity_tags = vec![ ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity1.id.clone(), tags: vec!["tag1".to_string(), "tag2".to_string()], }, ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity2.id.clone(), tags: vec!["tag2".to_string(), "tag3".to_string()], }, ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity3.id.clone(), tags: vec!["tag1".to_string(), "tag3".to_string(), "tag4".to_string()], }, @@ -1919,17 +2959,17 @@ mod tests { assert!(db.upsert_tags(&activity_tags).is_ok()); // Verify all tags were added correctly - let tags1 = db.get_tags(&activity1.id).unwrap(); + let tags1 = db.get_tags(DEFAULT_WALLET_ID, &activity1.id).unwrap(); assert_eq!(tags1.len(), 2); assert!(tags1.contains(&"tag1".to_string())); assert!(tags1.contains(&"tag2".to_string())); - let tags2 = db.get_tags(&activity2.id).unwrap(); + let tags2 = db.get_tags(DEFAULT_WALLET_ID, &activity2.id).unwrap(); assert_eq!(tags2.len(), 2); assert!(tags2.contains(&"tag2".to_string())); assert!(tags2.contains(&"tag3".to_string())); - let tags3 = db.get_tags(&activity3.id).unwrap(); + let tags3 = db.get_tags(DEFAULT_WALLET_ID, &activity3.id).unwrap(); assert_eq!(tags3.len(), 3); assert!(tags3.contains(&"tag1".to_string())); assert!(tags3.contains(&"tag3".to_string())); @@ -1954,9 +2994,13 @@ mod tests { db.insert_lightning_activity(&lightning).unwrap(); // Add tags - db.add_tags(&onchain.id, &["payment".to_string(), "coffee".to_string()]) - .unwrap(); - db.add_tags(&lightning.id, &["payment".to_string()]) + db.add_tags( + DEFAULT_WALLET_ID, + &onchain.id, + &["payment".to_string(), "coffee".to_string()], + ) + .unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &lightning.id, &["payment".to_string()]) .unwrap(); // Get all activity tags @@ -1986,6 +3030,65 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_activity_tags_backup_keeps_duplicate_ids_wallet_scoped() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + let activity_id = "shared_activity_id"; + + let mut main = create_test_onchain_activity(); + main.id = activity_id.to_string(); + main.tx_id = "main_shared_activity_tags_txid".to_string(); + + let mut hardware = create_test_onchain_activity(); + hardware.wallet_id = wallet_id.to_string(); + hardware.id = activity_id.to_string(); + hardware.tx_id = "hardware_shared_activity_tags_txid".to_string(); + + db.insert_onchain_activity(&main).unwrap(); + db.insert_onchain_activity(&hardware).unwrap(); + + db.upsert_tags(&[ + ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), + activity_id: activity_id.to_string(), + tags: vec!["main".to_string()], + }, + ActivityTags { + wallet_id: wallet_id.to_string(), + activity_id: activity_id.to_string(), + tags: vec!["hardware".to_string()], + }, + ]) + .unwrap(); + + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, activity_id).unwrap(), + vec!["main".to_string()] + ); + assert_eq!( + db.get_tags(wallet_id, activity_id).unwrap(), + vec!["hardware".to_string()] + ); + + let activity_tags = db.get_all_activities_tags().unwrap(); + assert_eq!(activity_tags.len(), 2); + + let main_tags = activity_tags + .iter() + .find(|tags| tags.wallet_id == DEFAULT_WALLET_ID && tags.activity_id == activity_id) + .unwrap(); + assert_eq!(main_tags.tags, vec!["main".to_string()]); + + let hardware_tags = activity_tags + .iter() + .find(|tags| tags.wallet_id == wallet_id && tags.activity_id == activity_id) + .unwrap(); + assert_eq!(hardware_tags.tags, vec!["hardware".to_string()]); + + cleanup(&db_path); + } + #[test] fn test_get_all_activities_tags_empty() { let (db, db_path) = setup(); @@ -2003,10 +3106,12 @@ mod tests { // Create activity with tags let activity = create_test_onchain_activity(); db.insert_onchain_activity(&activity).unwrap(); - db.add_tags(&activity.id, &["old_tag".to_string()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &activity.id, &["old_tag".to_string()]) + .unwrap(); // Upsert with empty tags (with INSERT OR IGNORE, won't clear existing tags) let activity_tags = vec![ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: activity.id.clone(), tags: vec![], }]; @@ -2014,7 +3119,7 @@ mod tests { assert!(db.upsert_tags(&activity_tags).is_ok()); // Verify old tags still exist (empty tags list doesn't clear) - let tags = db.get_tags(&activity.id).unwrap(); + let tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!(tags.contains(&"old_tag".to_string())); cleanup(&db_path); @@ -2036,6 +3141,7 @@ mod tests { // Test with empty activity_id let activity_tags = vec![ActivityTags { + wallet_id: DEFAULT_WALLET_ID.to_string(), activity_id: "".to_string(), tags: vec!["payment".to_string()], }]; @@ -2064,13 +3170,14 @@ mod tests { db.insert_lightning_activity(&activity4).unwrap(); // Add tags - db.add_tags(&activity1.id, &["payment".to_string()]) + db.add_tags(DEFAULT_WALLET_ID, &activity1.id, &["payment".to_string()]) .unwrap(); - db.add_tags(&activity2.id, &["invoice".to_string()]) + db.add_tags(DEFAULT_WALLET_ID, &activity2.id, &["invoice".to_string()]) .unwrap(); - db.add_tags(&activity3.id, &["transfer".to_string()]) + db.add_tags(DEFAULT_WALLET_ID, &activity3.id, &["transfer".to_string()]) .unwrap(); db.add_tags( + DEFAULT_WALLET_ID, &activity4.id, &["payment".to_string(), "invoice".to_string()], ) @@ -2086,7 +3193,7 @@ mod tests { // Verify data exists let activities = db - .get_activities(None, None, None, None, None, None, None, None) + .get_activities(None, None, None, None, None, None, None, None, None) .unwrap(); assert_eq!(activities.len(), 4); let tags = db.get_all_unique_tags().unwrap(); @@ -2099,7 +3206,7 @@ mod tests { // Verify everything is deleted let activities_after = db - .get_activities(None, None, None, None, None, None, None, None) + .get_activities(None, None, None, None, None, None, None, None, None) .unwrap(); assert_eq!(activities_after.len(), 0); let tags_after = db.get_all_unique_tags().unwrap(); @@ -2111,7 +3218,7 @@ mod tests { let new_activity = create_test_onchain_activity(); db.insert_onchain_activity(&new_activity).unwrap(); let activities_new = db - .get_activities(None, None, None, None, None, None, None, None) + .get_activities(None, None, None, None, None, None, None, None, None) .unwrap(); assert_eq!(activities_new.len(), 1); @@ -2387,6 +3494,7 @@ mod tests { let all = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -2408,6 +3516,7 @@ mod tests { let after = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -2433,12 +3542,165 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_bulk_upserts_preserve_tags_and_seen_state() { + let (mut db, db_path) = setup(); + let seen_timestamp = 1234567999; + + let mut onchain = create_test_onchain_activity(); + onchain.id = "onchain_preserve_state".to_string(); + onchain.tx_id = "onchain_preserve_state_txid".to_string(); + + db.upsert_onchain_activities(&[onchain.clone()]).unwrap(); + db.add_tags(DEFAULT_WALLET_ID, &onchain.id, &["onchain_tag".to_string()]) + .unwrap(); + db.mark_activity_as_seen(DEFAULT_WALLET_ID, &onchain.id, seen_timestamp) + .unwrap(); + + let mut updated_onchain = onchain.clone(); + updated_onchain.value = 99_999; + db.upsert_onchain_activities(&[updated_onchain]).unwrap(); + + let retrieved_onchain = db + .get_activity_by_id(DEFAULT_WALLET_ID, &onchain.id) + .unwrap() + .unwrap(); + match retrieved_onchain { + Activity::Onchain(activity) => { + assert_eq!(activity.value, 99_999); + assert_eq!(activity.seen_at, Some(seen_timestamp)); + } + Activity::Lightning(_) => panic!("Expected onchain activity"), + } + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &onchain.id).unwrap(), + vec!["onchain_tag".to_string()] + ); + + let mut lightning = create_test_lightning_activity(); + lightning.id = "lightning_preserve_state".to_string(); + + db.upsert_lightning_activities(&[lightning.clone()]) + .unwrap(); + db.add_tags( + DEFAULT_WALLET_ID, + &lightning.id, + &["lightning_tag".to_string()], + ) + .unwrap(); + db.mark_activity_as_seen(DEFAULT_WALLET_ID, &lightning.id, seen_timestamp) + .unwrap(); + + let mut updated_lightning = lightning.clone(); + updated_lightning.value = 77_777; + db.upsert_lightning_activities(&[updated_lightning]) + .unwrap(); + + let retrieved_lightning = db + .get_activity_by_id(DEFAULT_WALLET_ID, &lightning.id) + .unwrap() + .unwrap(); + match retrieved_lightning { + Activity::Lightning(activity) => { + assert_eq!(activity.value, 77_777); + assert_eq!(activity.seen_at, Some(seen_timestamp)); + } + Activity::Onchain(_) => panic!("Expected lightning activity"), + } + assert_eq!( + db.get_tags(DEFAULT_WALLET_ID, &lightning.id).unwrap(), + vec!["lightning_tag".to_string()] + ); + + cleanup(&db_path); + } + + #[test] + fn test_bulk_upsert_onchain_transfers_pre_activity_metadata() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + let address = "bc1qbulkmetadata".to_string(); + + let mut metadata = create_test_pre_activity_metadata( + "hardware_bulk_pending".to_string(), + ActivityType::Onchain, + vec!["bulk-tag".to_string()], + ); + metadata.wallet_id = wallet_id.to_string(); + metadata.address = Some(address.clone()); + metadata.is_receive = true; + metadata.fee_rate = 7; + db.add_pre_activity_metadata(&metadata).unwrap(); + + let mut activity = create_test_onchain_activity(); + activity.wallet_id = wallet_id.to_string(); + activity.id = "hardware_bulk_activity".to_string(); + activity.tx_id = "hardware_bulk_txid".to_string(); + activity.address = address.clone(); + activity.tx_type = PaymentType::Received; + activity.fee_rate = 1; + + db.upsert_onchain_activities(&[activity.clone()]).unwrap(); + + assert_eq!( + db.get_tags(wallet_id, &activity.id).unwrap(), + vec!["bulk-tag".to_string()] + ); + let retrieved = db + .get_activity_by_id(wallet_id, &activity.id) + .unwrap() + .unwrap(); + match retrieved { + Activity::Onchain(onchain) => assert_eq!(onchain.fee_rate, 7), + Activity::Lightning(_) => panic!("Expected onchain activity"), + } + assert!(db + .get_pre_activity_metadata(wallet_id, &address, true) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + + #[test] + fn test_bulk_upsert_lightning_transfers_pre_activity_metadata() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + let payment_id = "hardware_bulk_lightning".to_string(); + + let mut metadata = create_test_pre_activity_metadata( + payment_id.clone(), + ActivityType::Lightning, + vec!["lightning-bulk-tag".to_string()], + ); + metadata.wallet_id = wallet_id.to_string(); + db.add_pre_activity_metadata(&metadata).unwrap(); + + let mut activity = create_test_lightning_activity(); + activity.wallet_id = wallet_id.to_string(); + activity.id = payment_id.clone(); + + db.upsert_lightning_activities(&[activity.clone()]).unwrap(); + + assert_eq!( + db.get_tags(wallet_id, &activity.id).unwrap(), + vec!["lightning-bulk-tag".to_string()] + ); + assert!(db + .get_pre_activity_metadata(wallet_id, &payment_id, false) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + #[test] fn test_upsert_onchain_activities_empty() { let (mut db, db_path) = setup(); assert!(db.upsert_onchain_activities(&[]).is_ok()); let all = db .get_activities( + None, Some(ActivityFilter::Onchain), None, None, @@ -2471,6 +3733,7 @@ mod tests { let all = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -2492,6 +3755,7 @@ mod tests { let after = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -2523,6 +3787,7 @@ mod tests { assert!(db.upsert_lightning_activities(&[]).is_ok()); let all = db .get_activities( + None, Some(ActivityFilter::Lightning), None, None, @@ -2556,7 +3821,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"payment".to_string())); assert!(activity_tags.contains(&"coffee".to_string())); @@ -2584,7 +3849,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_lightning_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"invoice".to_string())); assert!(activity_tags.contains(&"payment".to_string())); @@ -2629,7 +3894,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 1); assert!(activity_tags.contains(&"payment".to_string())); @@ -2654,9 +3919,13 @@ mod tests { assert!(db.add_pre_activity_metadata(&metadata1).is_ok()); // Verify it exists - let result1 = db.get_pre_activity_metadata(&payment_id1, false).unwrap(); + let result1 = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &payment_id1, false) + .unwrap(); assert!(result1.is_some()); - let result_by_address1 = db.get_pre_activity_metadata(&address, true).unwrap(); + let result_by_address1 = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap(); assert!(result_by_address1.is_some()); assert_eq!(result_by_address1.unwrap().payment_id, payment_id1); @@ -2671,13 +3940,19 @@ mod tests { assert!(db.add_pre_activity_metadata(&metadata2).is_ok()); // Verify metadata1 is gone - let result1_after = db.get_pre_activity_metadata(&payment_id1, false).unwrap(); + let result1_after = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &payment_id1, false) + .unwrap(); assert!(result1_after.is_none()); // Verify metadata2 exists and can be found by address - let result2 = db.get_pre_activity_metadata(&payment_id2, false).unwrap(); + let result2 = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &payment_id2, false) + .unwrap(); assert!(result2.is_some()); - let result_by_address2 = db.get_pre_activity_metadata(&address, true).unwrap(); + let result_by_address2 = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap(); assert!(result_by_address2.is_some()); let metadata2_retrieved = result_by_address2.unwrap(); assert_eq!(metadata2_retrieved.payment_id, payment_id2); @@ -2686,6 +3961,67 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_add_pre_activity_metadata_address_replacement_is_receive_scoped() { + let (mut db, db_path) = setup(); + let address = "bc1qsharedmetadataaddress".to_string(); + + let mut receive_metadata = create_test_pre_activity_metadata( + "receive_pending_1".to_string(), + ActivityType::Onchain, + vec!["receive-old".to_string()], + ); + receive_metadata.address = Some(address.clone()); + receive_metadata.is_receive = true; + db.add_pre_activity_metadata(&receive_metadata).unwrap(); + + let mut sent_metadata = create_test_pre_activity_metadata( + "sent_txid_1".to_string(), + ActivityType::Onchain, + vec!["sent".to_string()], + ); + sent_metadata.tx_id = Some("sent_txid_1".to_string()); + sent_metadata.address = Some(address.clone()); + sent_metadata.is_receive = false; + db.add_pre_activity_metadata(&sent_metadata).unwrap(); + + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "receive_pending_1", false) + .unwrap() + .is_some()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "sent_txid_1", false) + .unwrap() + .is_some()); + + let mut new_receive_metadata = create_test_pre_activity_metadata( + "receive_pending_2".to_string(), + ActivityType::Onchain, + vec!["receive-new".to_string()], + ); + new_receive_metadata.address = Some(address.clone()); + new_receive_metadata.is_receive = true; + db.add_pre_activity_metadata(&new_receive_metadata).unwrap(); + + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "receive_pending_1", false) + .unwrap() + .is_none()); + assert_eq!( + db.get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap() + .unwrap() + .payment_id, + "receive_pending_2" + ); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "sent_txid_1", false) + .unwrap() + .is_some()); + + cleanup(&db_path); + } + #[test] fn test_add_pre_activity_metadata_multiple() { let (mut db, db_path) = setup(); @@ -2713,7 +4049,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"tag2".to_string())); assert!(activity_tags.contains(&"tag3".to_string())); @@ -2737,7 +4073,11 @@ mod tests { // Add more tags to existing metadata assert!(db - .add_pre_activity_metadata_tags(&address, &["tag2".to_string(), "tag3".to_string()]) + .add_pre_activity_metadata_tags( + DEFAULT_WALLET_ID, + &address, + &["tag2".to_string(), "tag3".to_string()] + ) .is_ok()); // Verify all tags are present @@ -2751,7 +4091,7 @@ mod tests { // Add duplicate tag (should not add duplicate) assert!(db - .add_pre_activity_metadata_tags(&address, &["tag2".to_string()]) + .add_pre_activity_metadata_tags(DEFAULT_WALLET_ID, &address, &["tag2".to_string()]) .is_ok()); // Verify no duplicate was added @@ -2773,7 +4113,8 @@ mod tests { let address = "bc1qtest123".to_string(); // Try to add tags to non-existent metadata (should error) - let result = db.add_pre_activity_metadata_tags(&address, &["tag1".to_string()]); + let result = + db.add_pre_activity_metadata_tags(DEFAULT_WALLET_ID, &address, &["tag1".to_string()]); assert!(result.is_err()); cleanup(&db_path); @@ -2788,10 +4129,11 @@ mod tests { let mut metadata = create_test_pre_activity_metadata(address.clone(), ActivityType::Onchain, tags.clone()); metadata.address = Some(address.clone()); + metadata.is_receive = true; assert!(db.add_pre_activity_metadata(&metadata).is_ok()); assert!(db - .remove_pre_activity_metadata_tags(&address, &["tag2".to_string()]) + .remove_pre_activity_metadata_tags(DEFAULT_WALLET_ID, &address, &["tag2".to_string()]) .is_ok()); let mut activity = create_test_onchain_activity(); @@ -2799,7 +4141,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"tag1".to_string())); assert!(activity_tags.contains(&"tag3".to_string())); @@ -2822,10 +4164,15 @@ mod tests { let mut metadata = create_test_pre_activity_metadata(address.clone(), ActivityType::Onchain, tags.clone()); metadata.address = Some(address.clone()); + metadata.is_receive = true; assert!(db.add_pre_activity_metadata(&metadata).is_ok()); assert!(db - .remove_pre_activity_metadata_tags(&address, &["tag1".to_string(), "tag3".to_string()]) + .remove_pre_activity_metadata_tags( + DEFAULT_WALLET_ID, + &address, + &["tag1".to_string(), "tag3".to_string()] + ) .is_ok()); let mut activity = create_test_onchain_activity(); @@ -2833,7 +4180,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"tag2".to_string())); assert!(activity_tags.contains(&"tag4".to_string())); @@ -2848,7 +4195,11 @@ mod tests { // Try to remove tags that don't exist (should not error) assert!(db - .remove_pre_activity_metadata_tags(&address, &["nonexistent".to_string()]) + .remove_pre_activity_metadata_tags( + DEFAULT_WALLET_ID, + &address, + &["nonexistent".to_string()] + ) .is_ok()); cleanup(&db_path); @@ -2870,7 +4221,9 @@ mod tests { .is_ok()); // Reset all tags - assert!(db.reset_pre_activity_metadata_tags(&address).is_ok()); + assert!(db + .reset_pre_activity_metadata_tags(DEFAULT_WALLET_ID, &address) + .is_ok()); // Verify no tags are transferred let mut activity = create_test_onchain_activity(); @@ -2878,7 +4231,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!(activity_tags.is_empty()); cleanup(&db_path); @@ -2890,7 +4243,9 @@ mod tests { let address = "bc1qtest123".to_string(); // Reset tags that don't exist (should not error) - assert!(db.reset_pre_activity_metadata_tags(&address).is_ok()); + assert!(db + .reset_pre_activity_metadata_tags(DEFAULT_WALLET_ID, &address) + .is_ok()); cleanup(&db_path); } @@ -2915,7 +4270,9 @@ mod tests { assert_eq!(all_metadata.len(), 1); // Delete all metadata - assert!(db.delete_pre_activity_metadata(&address).is_ok()); + assert!(db + .delete_pre_activity_metadata(DEFAULT_WALLET_ID, &address) + .is_ok()); // Verify metadata is deleted let all_metadata_after = db.get_all_pre_activity_metadata().unwrap(); @@ -2927,7 +4284,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!(activity_tags.is_empty()); cleanup(&db_path); @@ -2951,13 +4308,54 @@ mod tests { received_activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&received_activity).unwrap(); - let received_tags = db.get_tags(&received_activity.id).unwrap(); + let received_tags = db + .get_tags(DEFAULT_WALLET_ID, &received_activity.id) + .unwrap(); assert_eq!(received_tags.len(), 1); assert!(received_tags.contains(&"payment".to_string())); cleanup(&db_path); } + #[test] + fn test_pre_activity_metadata_received_lookup_ignores_sent_only_address_metadata() { + let (mut db, db_path) = setup(); + let address = "bc1qsentonlyaddress".to_string(); + + let mut metadata = create_test_pre_activity_metadata( + "sent_only_txid".to_string(), + ActivityType::Onchain, + vec!["sent-only".to_string()], + ); + metadata.tx_id = Some("sent_only_txid".to_string()); + metadata.address = Some(address.clone()); + metadata.is_receive = false; + db.add_pre_activity_metadata(&metadata).unwrap(); + + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap() + .is_none()); + + let mut received_activity = create_test_onchain_activity(); + received_activity.id = "received_should_ignore_sent_metadata".to_string(); + received_activity.tx_id = "received_should_ignore_sent_metadata_txid".to_string(); + received_activity.address = address.clone(); + received_activity.tx_type = PaymentType::Received; + db.insert_onchain_activity(&received_activity).unwrap(); + + assert!(db + .get_tags(DEFAULT_WALLET_ID, &received_activity.id) + .unwrap() + .is_empty()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "sent_only_txid", false) + .unwrap() + .is_some()); + + cleanup(&db_path); + } + #[test] fn test_pre_activity_metadata_transferred_on_sent_onchain() { let (mut db, db_path) = setup(); @@ -2974,7 +4372,7 @@ mod tests { sent_activity.tx_type = PaymentType::Sent; db.insert_onchain_activity(&sent_activity).unwrap(); - let sent_tags = db.get_tags(&sent_activity.id).unwrap(); + let sent_tags = db.get_tags(DEFAULT_WALLET_ID, &sent_activity.id).unwrap(); assert_eq!(sent_tags.len(), 1); assert!(sent_tags.contains(&"sent_payment".to_string())); @@ -3000,14 +4398,16 @@ mod tests { sent_activity.tx_type = PaymentType::Sent; db.insert_onchain_activity(&sent_activity).unwrap(); - let retrieved = db.get_activity_by_id(&sent_activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &sent_activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.address, metadata_address); } else { panic!("Expected Onchain activity"); } - let sent_tags = db.get_tags(&sent_activity.id).unwrap(); + let sent_tags = db.get_tags(DEFAULT_WALLET_ID, &sent_activity.id).unwrap(); assert_eq!(sent_tags.len(), 1); assert!(sent_tags.contains(&"sent_payment".to_string())); @@ -3033,7 +4433,9 @@ mod tests { activity.fee_rate = 0; db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_id(&activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.fee_rate, 10); } else { @@ -3062,7 +4464,9 @@ mod tests { activity.is_transfer = false; db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_id(&activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.is_transfer, true); } else { @@ -3092,7 +4496,9 @@ mod tests { activity.channel_id = None; db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_id(&activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.channel_id, Some(channel_id)); } else { @@ -3126,13 +4532,15 @@ mod tests { activity.channel_id = None; db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_id(&activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.address, address); assert_eq!(activity.fee_rate, 15); assert_eq!(activity.is_transfer, true); assert_eq!(activity.channel_id, Some(channel_id)); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"payment".to_string())); assert!(activity_tags.contains(&"transfer".to_string())); @@ -3162,7 +4570,9 @@ mod tests { activity.fee_rate = 5; db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_id(&activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.fee_rate, 5); } else { @@ -3191,7 +4601,9 @@ mod tests { activity.is_transfer = false; db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_id(&activity.id).unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap(); if let Activity::Onchain(activity) = retrieved.unwrap() { assert_eq!(activity.is_transfer, false); } else { @@ -3222,7 +4634,7 @@ mod tests { sent_activity.tx_type = PaymentType::Sent; db.insert_lightning_activity(&sent_activity).unwrap(); - let sent_tags = db.get_tags(&sent_activity.id).unwrap(); + let sent_tags = db.get_tags(DEFAULT_WALLET_ID, &sent_activity.id).unwrap(); assert_eq!(sent_tags.len(), 1); assert!(sent_tags.contains(&"sent_invoice".to_string())); @@ -3246,7 +4658,7 @@ mod tests { activity1.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity1).unwrap(); - let tags1 = db.get_tags(&activity1.id).unwrap(); + let tags1 = db.get_tags(DEFAULT_WALLET_ID, &activity1.id).unwrap(); assert_eq!(tags1.len(), 2); let mut activity2 = create_test_onchain_activity(); @@ -3255,7 +4667,7 @@ mod tests { activity2.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity2).unwrap(); - let tags2 = db.get_tags(&activity2.id).unwrap(); + let tags2 = db.get_tags(DEFAULT_WALLET_ID, &activity2.id).unwrap(); assert!(tags2.is_empty()); cleanup(&db_path); @@ -3280,7 +4692,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_lightning_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"invoice".to_string())); assert!(activity_tags.contains(&"payment".to_string())); @@ -3298,6 +4710,7 @@ mod tests { let mut metadata = create_test_pre_activity_metadata(address.clone(), ActivityType::Onchain, tags.clone()); metadata.address = Some(address.clone()); + metadata.is_receive = true; assert!(db.add_pre_activity_metadata(&metadata).is_ok()); let mut activity = create_test_onchain_activity(); @@ -3306,7 +4719,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"payment".to_string())); assert!(activity_tags.contains(&"coffee".to_string())); @@ -3350,17 +4763,125 @@ mod tests { db.insert_onchain_activity(&activity2).unwrap(); // Verify each activity got its own tags - let tags1 = db.get_tags(&activity1.id).unwrap(); + let tags1 = db.get_tags(DEFAULT_WALLET_ID, &activity1.id).unwrap(); assert_eq!(tags1.len(), 1); assert!(tags1.contains(&"tag1".to_string())); - let tags2 = db.get_tags(&activity2.id).unwrap(); + let tags2 = db.get_tags(DEFAULT_WALLET_ID, &activity2.id).unwrap(); assert_eq!(tags2.len(), 1); assert!(tags2.contains(&"tag2".to_string())); cleanup(&db_path); } + #[test] + fn test_pre_activity_metadata_transfer_is_wallet_scoped() { + let (mut db, db_path) = setup(); + let hardware_wallet_id = "hardware-wallet-1"; + let address = "bc1qsharedaddress".to_string(); + + let mut metadata = create_test_pre_activity_metadata( + "bitkit_pending".to_string(), + ActivityType::Onchain, + vec!["bitkit_tag".to_string()], + ); + metadata.address = Some(address.clone()); + metadata.is_receive = true; + assert!(db.add_pre_activity_metadata(&metadata).is_ok()); + + let mut hardware_activity = create_test_onchain_activity(); + hardware_activity.wallet_id = hardware_wallet_id.to_string(); + hardware_activity.id = "hardware_shared_address_activity".to_string(); + hardware_activity.tx_id = "hardware_shared_address_txid".to_string(); + hardware_activity.address = address.clone(); + hardware_activity.tx_type = PaymentType::Received; + db.insert_onchain_activity(&hardware_activity).unwrap(); + + let hardware_tags = db + .get_tags(hardware_wallet_id, &hardware_activity.id) + .unwrap(); + assert!(hardware_tags.is_empty()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap() + .is_some()); + + let mut bitkit_activity = create_test_onchain_activity(); + bitkit_activity.id = "bitkit_shared_address_activity".to_string(); + bitkit_activity.tx_id = "bitkit_shared_address_txid".to_string(); + bitkit_activity.address = address.clone(); + bitkit_activity.tx_type = PaymentType::Received; + db.insert_onchain_activity(&bitkit_activity).unwrap(); + + let bitkit_tags = db.get_tags(DEFAULT_WALLET_ID, &bitkit_activity.id).unwrap(); + assert_eq!(bitkit_tags, vec!["bitkit_tag".to_string()]); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap() + .is_none()); + + cleanup(&db_path); + } + + #[test] + fn test_pre_activity_metadata_allows_same_payment_id_across_wallets() { + let (mut db, db_path) = setup(); + let hardware_wallet_id = "hardware-wallet-1"; + let payment_id = "shared_pending_payment".to_string(); + + let default_metadata = create_test_pre_activity_metadata( + payment_id.clone(), + ActivityType::Lightning, + vec!["bitkit_tag".to_string()], + ); + let mut hardware_metadata = create_test_pre_activity_metadata( + payment_id.clone(), + ActivityType::Lightning, + vec!["hardware_tag".to_string()], + ); + hardware_metadata.wallet_id = hardware_wallet_id.to_string(); + + assert!(db.add_pre_activity_metadata(&default_metadata).is_ok()); + assert!(db.add_pre_activity_metadata(&hardware_metadata).is_ok()); + + assert!(db + .add_pre_activity_metadata_tags( + hardware_wallet_id, + &payment_id, + &["hardware_extra".to_string()] + ) + .is_ok()); + + let default_result = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &payment_id, false) + .unwrap() + .unwrap(); + let hardware_result = db + .get_pre_activity_metadata(hardware_wallet_id, &payment_id, false) + .unwrap() + .unwrap(); + + assert_eq!(default_result.tags, vec!["bitkit_tag".to_string()]); + assert_eq!( + hardware_result.tags, + vec!["hardware_tag".to_string(), "hardware_extra".to_string()] + ); + + assert!(db + .delete_pre_activity_metadata(hardware_wallet_id, &payment_id) + .is_ok()); + assert!(db + .get_pre_activity_metadata(hardware_wallet_id, &payment_id, false) + .unwrap() + .is_none()); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &payment_id, false) + .unwrap() + .is_some()); + + cleanup(&db_path); + } + #[test] fn test_pre_activity_metadata_onchain_and_lightning_separate() { let (mut db, db_path) = setup(); @@ -3395,11 +4916,15 @@ mod tests { db.insert_lightning_activity(&lightning_activity).unwrap(); // Verify each got its own tags - let onchain_tags = db.get_tags(&onchain_activity.id).unwrap(); + let onchain_tags = db + .get_tags(DEFAULT_WALLET_ID, &onchain_activity.id) + .unwrap(); assert_eq!(onchain_tags.len(), 1); assert!(onchain_tags.contains(&"onchain_tag".to_string())); - let lightning_tags = db.get_tags(&lightning_activity.id).unwrap(); + let lightning_tags = db + .get_tags(DEFAULT_WALLET_ID, &lightning_activity.id) + .unwrap(); assert_eq!(lightning_tags.len(), 1); assert!(lightning_tags.contains(&"lightning_tag".to_string())); @@ -3427,7 +4952,7 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); // Verify no tags were transferred - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert!(activity_tags.is_empty()); cleanup(&db_path); @@ -3453,11 +4978,15 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); // Add regular tags to the same activity - db.add_tags(&activity.id, &["regular_tag".to_string()]) - .unwrap(); + db.add_tags( + DEFAULT_WALLET_ID, + &activity.id, + &["regular_tag".to_string()], + ) + .unwrap(); // Verify both types of tags are present - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"receiving_tag".to_string())); assert!(activity_tags.contains(&"regular_tag".to_string())); @@ -3472,7 +5001,9 @@ mod tests { let tags = vec!["tag1".to_string(), "tag2".to_string()]; // Get non-existent metadata (should return None) - let result = db.get_pre_activity_metadata(&address, false).unwrap(); + let result = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, false) + .unwrap(); assert!(result.is_none()); // Add pre-activity metadata @@ -3485,7 +5016,9 @@ mod tests { .is_ok()); // Get existing metadata - let metadata = db.get_pre_activity_metadata(&address, false).unwrap(); + let metadata = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, false) + .unwrap(); assert!(metadata.is_some()); let metadata = metadata.unwrap(); assert_eq!(metadata.payment_id, address); @@ -3514,11 +5047,15 @@ mod tests { assert!(db.add_pre_activity_metadata(&metadata).is_ok()); // Test searching by payment_id - let result_by_payment_id = db.get_pre_activity_metadata(&payment_id, false).unwrap(); + let result_by_payment_id = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &payment_id, false) + .unwrap(); assert!(result_by_payment_id.is_some()); // Test searching by address - let result_by_address = db.get_pre_activity_metadata(&address, true).unwrap(); + let result_by_address = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap(); assert!(result_by_address.is_some()); let metadata_by_address = result_by_address.unwrap(); assert_eq!(metadata_by_address.payment_id, payment_id); @@ -3527,7 +5064,9 @@ mod tests { assert!(metadata_by_address.tags.contains(&"tag2".to_string())); // Test that searching by address with wrong search type returns None - let result_wrong_search = db.get_pre_activity_metadata(&address, false).unwrap(); + let result_wrong_search = db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, false) + .unwrap(); assert!(result_wrong_search.is_none()); cleanup(&db_path); @@ -3610,6 +5149,7 @@ mod tests { // Create pre-activity metadata for backup/restore let pre_activity_metadata = vec![ PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "bc1qtest123".to_string(), tags: vec!["tag1".to_string(), "tag2".to_string()], payment_hash: None, @@ -3622,6 +5162,7 @@ mod tests { created_at: 0, }, PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "bc1qtest456".to_string(), tags: vec!["tag3".to_string()], payment_hash: None, @@ -3634,6 +5175,7 @@ mod tests { created_at: 0, }, PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "lightning:invoice123".to_string(), tags: vec!["tag4".to_string(), "tag5".to_string()], payment_hash: None, @@ -3662,7 +5204,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"tag1".to_string())); assert!(activity_tags.contains(&"tag2".to_string())); @@ -3670,11 +5212,81 @@ mod tests { cleanup(&db_path); } + #[test] + fn test_upsert_pre_activity_metadata_replaces_receive_address_only() { + let (mut db, db_path) = setup(); + let address = "bc1qbulkrestoreaddress".to_string(); + + let pre_activity_metadata = vec![ + PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), + payment_id: "receive_old".to_string(), + tags: vec!["receive-old".to_string()], + payment_hash: None, + tx_id: None, + address: Some(address.clone()), + is_receive: true, + fee_rate: 0, + is_transfer: false, + channel_id: None, + created_at: 0, + }, + PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), + payment_id: "sent_txid".to_string(), + tags: vec!["sent".to_string()], + payment_hash: None, + tx_id: Some("sent_txid".to_string()), + address: Some(address.clone()), + is_receive: false, + fee_rate: 0, + is_transfer: false, + channel_id: None, + created_at: 0, + }, + PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), + payment_id: "receive_new".to_string(), + tags: vec!["receive-new".to_string()], + payment_hash: None, + tx_id: None, + address: Some(address.clone()), + is_receive: true, + fee_rate: 0, + is_transfer: false, + channel_id: None, + created_at: 0, + }, + ]; + + db.upsert_pre_activity_metadata(&pre_activity_metadata) + .unwrap(); + + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "receive_old", false) + .unwrap() + .is_none()); + assert_eq!( + db.get_pre_activity_metadata(DEFAULT_WALLET_ID, &address, true) + .unwrap() + .unwrap() + .payment_id, + "receive_new" + ); + assert!(db + .get_pre_activity_metadata(DEFAULT_WALLET_ID, "sent_txid", false) + .unwrap() + .is_some()); + + cleanup(&db_path); + } + #[test] fn test_upsert_pre_activity_metadata_idempotent() { let (mut db, db_path) = setup(); let pre_activity_metadata = vec![PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "bc1qtest123".to_string(), tags: vec!["tag1".to_string(), "tag2".to_string()], payment_hash: None, @@ -3720,6 +5332,7 @@ mod tests { assert!(db.add_pre_activity_metadata(&initial_metadata).is_ok()); let pre_activity_metadata = vec![PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "bc1qtest123".to_string(), tags: vec!["tag1".to_string(), "tag2".to_string(), "tag3".to_string()], payment_hash: None, @@ -3766,6 +5379,7 @@ mod tests { let (mut db, db_path) = setup(); let pre_activity_metadata = vec![PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "".to_string(), tags: vec!["tag1".to_string()], payment_hash: None, @@ -3796,6 +5410,7 @@ mod tests { vec!["tag1".to_string(), "tag2".to_string()], ); metadata1.address = Some("bc1qtest123".to_string()); + metadata1.is_receive = true; let metadata2 = create_test_pre_activity_metadata( "lightning:invoice123".to_string(), ActivityType::Lightning, @@ -3810,10 +5425,10 @@ mod tests { // Simulate restore: Delete and restore assert!(db - .delete_pre_activity_metadata(&"bc1qtest123".to_string()) + .delete_pre_activity_metadata(DEFAULT_WALLET_ID, &"bc1qtest123".to_string()) .is_ok()); assert!(db - .delete_pre_activity_metadata(&"lightning:invoice123".to_string()) + .delete_pre_activity_metadata(DEFAULT_WALLET_ID, &"lightning:invoice123".to_string()) .is_ok()); // Verify cleared @@ -3833,7 +5448,7 @@ mod tests { activity.tx_type = PaymentType::Received; db.insert_onchain_activity(&activity).unwrap(); - let activity_tags = db.get_tags(&activity.id).unwrap(); + let activity_tags = db.get_tags(DEFAULT_WALLET_ID, &activity.id).unwrap(); assert_eq!(activity_tags.len(), 2); assert!(activity_tags.contains(&"tag1".to_string())); assert!(activity_tags.contains(&"tag2".to_string())); @@ -3848,6 +5463,7 @@ mod tests { // Same identifier string (second one replaces first) let pre_activity_metadata = vec![ PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "same_id".to_string(), tags: vec!["tag1".to_string()], payment_hash: None, @@ -3860,6 +5476,7 @@ mod tests { created_at: 0, }, PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "same_id".to_string(), tags: vec!["tag2".to_string()], payment_hash: None, @@ -3960,6 +5577,7 @@ mod tests { // Upsert with new tags for address2 (replaces existing tags) let updated = vec![PreActivityMetadata { + wallet_id: DEFAULT_WALLET_ID.to_string(), payment_id: "address2".to_string(), tags: vec!["tag2_updated".to_string(), "tag2_new".to_string()], payment_hash: None, @@ -4195,7 +5813,7 @@ mod tests { let (db, db_path) = setup(); let tx_id = "nonexistent_tx_id".to_string(); - let activity = db.get_activity_by_tx_id(&tx_id).unwrap(); + let activity = db.get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id).unwrap(); assert!(activity.is_none(), "Non-existent tx_id should return None"); cleanup(&db_path); @@ -4212,7 +5830,7 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); - let retrieved = db.get_activity_by_tx_id(&tx_id).unwrap(); + let retrieved = db.get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id).unwrap(); assert!(retrieved.is_some(), "Activity should be found by tx_id"); if let Some(retrieved_activity) = retrieved { @@ -4246,7 +5864,7 @@ mod tests { db.insert_onchain_activity(&activity2).unwrap(); // Should return the first one found - let retrieved = db.get_activity_by_tx_id(&tx_id).unwrap(); + let retrieved = db.get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id).unwrap(); assert!(retrieved.is_some(), "Activity should be found by tx_id"); if let Some(retrieved_activity) = retrieved { @@ -4277,7 +5895,9 @@ mod tests { db.insert_onchain_activity(&activity2).unwrap(); // Get first activity - let retrieved1 = db.get_activity_by_tx_id(&tx_id1).unwrap(); + let retrieved1 = db + .get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id1) + .unwrap(); assert!(retrieved1.is_some(), "First activity should be found"); if let Some(retrieved) = retrieved1 { assert_eq!(retrieved.tx_id, tx_id1); @@ -4287,7 +5907,9 @@ mod tests { } // Get second activity - let retrieved2 = db.get_activity_by_tx_id(&tx_id2).unwrap(); + let retrieved2 = db + .get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id2) + .unwrap(); assert!(retrieved2.is_some(), "Second activity should be found"); if let Some(retrieved) = retrieved2 { assert_eq!(retrieved.tx_id, tx_id2); @@ -4309,7 +5931,7 @@ mod tests { db.insert_lightning_activity(&lightning_activity).unwrap(); // Try to get by tx_id - should return None since lightning doesn't have tx_id - let retrieved = db.get_activity_by_tx_id(&tx_id).unwrap(); + let retrieved = db.get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id).unwrap(); assert!( retrieved.is_none(), "Lightning activities should not be found by tx_id" @@ -4322,7 +5944,7 @@ mod tests { db.insert_onchain_activity(&onchain_activity).unwrap(); // Now should find it - let retrieved = db.get_activity_by_tx_id(&tx_id).unwrap(); + let retrieved = db.get_activity_by_tx_id(DEFAULT_WALLET_ID, &tx_id).unwrap(); assert!( retrieved.is_some(), "Onchain activity should be found by tx_id" @@ -4338,7 +5960,10 @@ mod tests { db.insert_onchain_activity(&activity).unwrap(); // Verify initial state - seen_at should be None - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); assert!( retrieved.get_seen_at().is_none(), "seen_at should be None initially" @@ -4346,11 +5971,14 @@ mod tests { // Mark as seen let seen_timestamp = 1234567900u64; - db.mark_activity_as_seen(&activity.id, seen_timestamp) + db.mark_activity_as_seen(DEFAULT_WALLET_ID, &activity.id, seen_timestamp) .unwrap(); // Verify seen_at is now set - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); assert_eq!( retrieved.get_seen_at(), Some(seen_timestamp), @@ -4367,7 +5995,10 @@ mod tests { db.insert_lightning_activity(&activity).unwrap(); // Verify initial state - seen_at should be None - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); assert!( retrieved.get_seen_at().is_none(), "seen_at should be None initially" @@ -4375,11 +6006,14 @@ mod tests { // Mark as seen let seen_timestamp = 1234567900u64; - db.mark_activity_as_seen(&activity.id, seen_timestamp) + db.mark_activity_as_seen(DEFAULT_WALLET_ID, &activity.id, seen_timestamp) .unwrap(); // Verify seen_at is now set - let retrieved = db.get_activity_by_id(&activity.id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_id(DEFAULT_WALLET_ID, &activity.id) + .unwrap() + .unwrap(); assert_eq!( retrieved.get_seen_at(), Some(seen_timestamp), @@ -4394,7 +6028,7 @@ mod tests { let (mut db, db_path) = setup(); // Try to mark a non-existent activity as seen - let result = db.mark_activity_as_seen("nonexistent_id", 1234567900); + let result = db.mark_activity_as_seen(DEFAULT_WALLET_ID, "nonexistent_id", 1234567900); assert!(result.is_err(), "Should fail for non-existent activity"); cleanup(&db_path); @@ -4415,12 +6049,12 @@ mod tests { // Mark only onchain as seen let seen_timestamp = 3000u64; - db.mark_activity_as_seen(&onchain.id, seen_timestamp) + db.mark_activity_as_seen(DEFAULT_WALLET_ID, &onchain.id, seen_timestamp) .unwrap(); // Get all activities let activities = db - .get_activities(None, None, None, None, None, None, None, None) + .get_activities(None, None, None, None, None, None, None, None, None) .unwrap(); assert_eq!(activities.len(), 2); @@ -4450,11 +6084,14 @@ mod tests { // Mark as seen let seen_timestamp = 1234567900u64; - db.mark_activity_as_seen(&activity.id, seen_timestamp) + db.mark_activity_as_seen(DEFAULT_WALLET_ID, &activity.id, seen_timestamp) .unwrap(); // Retrieve by tx_id and verify seen_at - let retrieved = db.get_activity_by_tx_id(&activity.tx_id).unwrap().unwrap(); + let retrieved = db + .get_activity_by_tx_id(DEFAULT_WALLET_ID, &activity.tx_id) + .unwrap() + .unwrap(); assert_eq!( retrieved.seen_at, Some(seen_timestamp), @@ -4466,6 +6103,7 @@ mod tests { fn create_test_transaction_details() -> TransactionDetails { TransactionDetails { + wallet_id: DEFAULT_WALLET_ID.to_string(), tx_id: "tx123abc".to_string(), amount_sats: 50000, inputs: vec![TxInput { @@ -4503,7 +6141,10 @@ mod tests { db.upsert_transaction_details(&[details.clone()]).unwrap(); // Retrieve - let retrieved = db.get_transaction_details(&details.tx_id).unwrap().unwrap(); + let retrieved = db + .get_transaction_details(DEFAULT_WALLET_ID, &details.tx_id) + .unwrap() + .unwrap(); assert_eq!(retrieved.tx_id, details.tx_id); assert_eq!(retrieved.amount_sats, details.amount_sats); assert_eq!(retrieved.inputs.len(), 1); @@ -4518,7 +6159,9 @@ mod tests { fn test_transaction_details_not_found() { let (db, db_path) = setup(); - let retrieved = db.get_transaction_details("nonexistent_tx").unwrap(); + let retrieved = db + .get_transaction_details(DEFAULT_WALLET_ID, "nonexistent_tx") + .unwrap(); assert!(retrieved.is_none()); cleanup(&db_path); @@ -4537,12 +6180,59 @@ mod tests { db.upsert_transaction_details(&[details.clone()]).unwrap(); // Verify update - let retrieved = db.get_transaction_details(&details.tx_id).unwrap().unwrap(); + let retrieved = db + .get_transaction_details(DEFAULT_WALLET_ID, &details.tx_id) + .unwrap() + .unwrap(); assert_eq!(retrieved.amount_sats, 100000); cleanup(&db_path); } + #[test] + fn test_transaction_details_are_wallet_scoped() { + let (mut db, db_path) = setup(); + let wallet_id = "hardware-wallet-1"; + + let mut main_details = create_test_transaction_details(); + main_details.tx_id = "shared_details_txid".to_string(); + main_details.amount_sats = 10_000; + + let mut hardware_details = create_test_transaction_details(); + hardware_details.wallet_id = wallet_id.to_string(); + hardware_details.tx_id = "shared_details_txid".to_string(); + hardware_details.amount_sats = -25_000; + + db.upsert_transaction_details(&[main_details.clone(), hardware_details.clone()]) + .unwrap(); + + let main = db + .get_transaction_details(DEFAULT_WALLET_ID, "shared_details_txid") + .unwrap() + .unwrap(); + let hardware = db + .get_transaction_details(wallet_id, "shared_details_txid") + .unwrap() + .unwrap(); + + assert_eq!(main.amount_sats, main_details.amount_sats); + assert_eq!(hardware.amount_sats, hardware_details.amount_sats); + + db.delete_transaction_details(wallet_id, "shared_details_txid") + .unwrap(); + + assert!(db + .get_transaction_details(wallet_id, "shared_details_txid") + .unwrap() + .is_none()); + assert!(db + .get_transaction_details(DEFAULT_WALLET_ID, "shared_details_txid") + .unwrap() + .is_some()); + + cleanup(&db_path); + } + #[test] fn test_delete_transaction_details() { let (mut db, db_path) = setup(); @@ -4551,11 +6241,15 @@ mod tests { db.upsert_transaction_details(&[details.clone()]).unwrap(); // Delete - let deleted = db.delete_transaction_details(&details.tx_id).unwrap(); + let deleted = db + .delete_transaction_details(DEFAULT_WALLET_ID, &details.tx_id) + .unwrap(); assert!(deleted); // Verify deletion - let retrieved = db.get_transaction_details(&details.tx_id).unwrap(); + let retrieved = db + .get_transaction_details(DEFAULT_WALLET_ID, &details.tx_id) + .unwrap(); assert!(retrieved.is_none()); cleanup(&db_path); @@ -4565,7 +6259,9 @@ mod tests { fn test_delete_nonexistent_transaction_details() { let (mut db, db_path) = setup(); - let deleted = db.delete_transaction_details("nonexistent_tx").unwrap(); + let deleted = db + .delete_transaction_details(DEFAULT_WALLET_ID, "nonexistent_tx") + .unwrap(); assert!(!deleted); cleanup(&db_path); @@ -4588,13 +6284,13 @@ mod tests { assert_eq!(all.len(), 2); let retrieved1 = db - .get_transaction_details(&details1.tx_id) + .get_transaction_details(DEFAULT_WALLET_ID, &details1.tx_id) .unwrap() .unwrap(); assert_eq!(retrieved1.amount_sats, 50000); let retrieved2 = db - .get_transaction_details(&details2.tx_id) + .get_transaction_details(DEFAULT_WALLET_ID, &details2.tx_id) .unwrap() .unwrap(); assert_eq!(retrieved2.amount_sats, -25000); @@ -4662,6 +6358,7 @@ mod tests { let (mut db, db_path) = setup(); let details = TransactionDetails { + wallet_id: DEFAULT_WALLET_ID.to_string(), tx_id: "tx_with_complex_witness".to_string(), amount_sats: 10000, inputs: vec![TxInput { @@ -4686,7 +6383,10 @@ mod tests { db.upsert_transaction_details(&[details.clone()]).unwrap(); - let retrieved = db.get_transaction_details(&details.tx_id).unwrap().unwrap(); + let retrieved = db + .get_transaction_details(DEFAULT_WALLET_ID, &details.tx_id) + .unwrap() + .unwrap(); assert_eq!(retrieved.inputs[0].witness.len(), 3); assert_eq!( retrieved.outputs[0].scriptpubkey_type, diff --git a/src/modules/activity/types.rs b/src/modules/activity/types.rs index 2d427fb..8b2d13d 100644 --- a/src/modules/activity/types.rs +++ b/src/modules/activity/types.rs @@ -3,6 +3,12 @@ use crate::modules::blocktank::BlocktankError; use serde::{Deserialize, Serialize}; use thiserror::Error; +pub const DEFAULT_WALLET_ID: &str = "bitkit"; + +fn default_wallet_id() -> String { + DEFAULT_WALLET_ID.to_string() +} + #[derive(Debug, uniffi::Enum)] pub enum Activity { Onchain(OnchainActivity), @@ -58,6 +64,13 @@ impl Activity { Activity::Lightning(l) => l.seen_at, } } + + pub fn get_wallet_id(&self) -> &str { + match self { + Activity::Onchain(o) => &o.wallet_id, + Activity::Lightning(l) => &l.wallet_id, + } + } } #[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Hash, Clone, Copy, uniffi::Enum)] @@ -83,6 +96,8 @@ pub enum PaymentState { #[derive(Debug, Serialize, Deserialize, Clone, uniffi::Record)] pub struct OnchainActivity { + #[serde(default = "default_wallet_id")] + pub wallet_id: String, pub id: String, pub tx_type: PaymentType, pub tx_id: String, @@ -111,6 +126,8 @@ pub struct OnchainActivity { #[derive(Debug, Serialize, Deserialize, Clone, uniffi::Record)] pub struct LightningActivity { + #[serde(default = "default_wallet_id")] + pub wallet_id: String, pub id: String, pub tx_type: PaymentType, pub status: PaymentState, @@ -150,12 +167,16 @@ pub struct ClosedChannelDetails { #[derive(Debug, Clone, uniffi::Record, Serialize, Deserialize)] pub struct ActivityTags { + #[serde(default = "default_wallet_id")] + pub wallet_id: String, pub activity_id: String, pub tags: Vec, } #[derive(Debug, Clone, uniffi::Record, Serialize, Deserialize)] pub struct PreActivityMetadata { + #[serde(default = "default_wallet_id")] + pub wallet_id: String, pub payment_id: String, pub tags: Vec, #[serde(skip_serializing_if = "Option::is_none")] @@ -205,6 +226,8 @@ pub struct TxOutput { /// Details about an onchain transaction. #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, uniffi::Record)] pub struct TransactionDetails { + #[serde(default = "default_wallet_id")] + pub wallet_id: String, /// The transaction ID. pub tx_id: String, /// The net amount in this transaction (in satoshis). @@ -220,15 +243,10 @@ pub struct TransactionDetails { pub outputs: Vec, } -impl Default for SortDirection { - fn default() -> Self { - SortDirection::Desc - } -} - -#[derive(Debug, Clone, Copy, uniffi::Enum)] +#[derive(Debug, Clone, Copy, Default, uniffi::Enum)] pub enum SortDirection { Asc, + #[default] Desc, }