diff --git a/cli/Cargo.lock b/cli/Cargo.lock index 14860f2..818ab4e 100644 --- a/cli/Cargo.lock +++ b/cli/Cargo.lock @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "allo-isolate" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f5a5fd28223e6f3cafb7d9cd685f51eafdd71d33ca1229f8316925d5957240" +checksum = "97b6d794345b06592d0ebeed8e477e41b71e5a0a49df4fc0e4184d5938b99509" dependencies = [ "anyhow", "atomic", @@ -839,9 +839,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.36" +version = "2.0.0-dev.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbafb8df6b5ec843e2b7f19f33f5b682d6bd028bf86aef2c5e02ff3e4ea37b03" +checksum = "d0405761db6c536d430c753b8fc5a06cf36ad554d1485407af65be79624249e9" dependencies = [ "allo-isolate", "android_logger", @@ -867,11 +867,13 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.36" +version = "2.0.0-dev.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04366488e32ac18f07982356d62860e145cc7ae28e16070f240082fe1c8ed5c9" +checksum = "b69c76832e96fa57e8b043a3b5d715b9c858511b8b3f9b21036d85b7c77d6851" dependencies = [ "hex", + "md-5", + "proc-macro2", "quote", "syn", ] @@ -1474,6 +1476,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + [[package]] name = "memchr" version = "2.7.2" diff --git a/lib/Cargo.lock b/lib/Cargo.lock index 3cc8378..67ee820 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -76,9 +76,9 @@ dependencies = [ [[package]] name = "allo-isolate" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f5a5fd28223e6f3cafb7d9cd685f51eafdd71d33ca1229f8316925d5957240" +checksum = "97b6d794345b06592d0ebeed8e477e41b71e5a0a49df4fc0e4184d5938b99509" dependencies = [ "anyhow", "atomic", @@ -1001,9 +1001,9 @@ dependencies = [ [[package]] name = "flutter_rust_bridge" -version = "2.0.0-dev.36" +version = "2.0.0-dev.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbafb8df6b5ec843e2b7f19f33f5b682d6bd028bf86aef2c5e02ff3e4ea37b03" +checksum = "d0405761db6c536d430c753b8fc5a06cf36ad554d1485407af65be79624249e9" dependencies = [ "allo-isolate", "android_logger", @@ -1029,11 +1029,13 @@ dependencies = [ [[package]] name = "flutter_rust_bridge_macros" -version = "2.0.0-dev.36" +version = "2.0.0-dev.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04366488e32ac18f07982356d62860e145cc7ae28e16070f240082fe1c8ed5c9" +checksum = "b69c76832e96fa57e8b043a3b5d715b9c858511b8b3f9b21036d85b7c77d6851" dependencies = [ "hex", + "md-5", + "proc-macro2", "quote", "syn 2.0.61", ] @@ -1705,6 +1707,16 @@ dependencies = [ "tracing", ] +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest", +] + [[package]] name = "memchr" version = "2.7.2" diff --git a/lib/bindings/langs/flutter/breez_liquid_sdk/include/breez_liquid_sdk.h b/lib/bindings/langs/flutter/breez_liquid_sdk/include/breez_liquid_sdk.h index 088ee5c..80e0544 100644 --- a/lib/bindings/langs/flutter/breez_liquid_sdk/include/breez_liquid_sdk.h +++ b/lib/bindings/langs/flutter/breez_liquid_sdk/include/breez_liquid_sdk.h @@ -55,18 +55,9 @@ typedef struct wire_cst_prepare_send_response { uint64_t fees_sat; } wire_cst_prepare_send_response; -typedef struct wire_cst_config { - struct wire_cst_list_prim_u_8_strict *boltz_url; - struct wire_cst_list_prim_u_8_strict *electrum_url; - struct wire_cst_list_prim_u_8_strict *working_dir; - int32_t network; - uint64_t payment_timeout_sec; -} wire_cst_config; - -typedef struct wire_cst_connect_request { - struct wire_cst_list_prim_u_8_strict *mnemonic; - struct wire_cst_config config; -} wire_cst_connect_request; +typedef struct wire_cst_binding_event_listener { + struct wire_cst_list_prim_u_8_strict *stream; +} wire_cst_binding_event_listener; typedef struct wire_cst_payment { struct wire_cst_list_prim_u_8_strict *tx_id; @@ -81,6 +72,57 @@ typedef struct wire_cst_payment { int32_t status; } wire_cst_payment; +typedef struct wire_cst_LiquidSdkEvent_PaymentFailed { + struct wire_cst_payment *details; +} wire_cst_LiquidSdkEvent_PaymentFailed; + +typedef struct wire_cst_LiquidSdkEvent_PaymentPending { + struct wire_cst_payment *details; +} wire_cst_LiquidSdkEvent_PaymentPending; + +typedef struct wire_cst_LiquidSdkEvent_PaymentRefunded { + struct wire_cst_payment *details; +} wire_cst_LiquidSdkEvent_PaymentRefunded; + +typedef struct wire_cst_LiquidSdkEvent_PaymentRefundPending { + struct wire_cst_payment *details; +} wire_cst_LiquidSdkEvent_PaymentRefundPending; + +typedef struct wire_cst_LiquidSdkEvent_PaymentSucceeded { + struct wire_cst_payment *details; +} wire_cst_LiquidSdkEvent_PaymentSucceeded; + +typedef struct wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation { + struct wire_cst_payment *details; +} wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation; + +typedef union LiquidSdkEventKind { + struct wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed; + struct wire_cst_LiquidSdkEvent_PaymentPending PaymentPending; + struct wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded; + struct wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending; + struct wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded; + struct wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation; +} LiquidSdkEventKind; + +typedef struct wire_cst_liquid_sdk_event { + int32_t tag; + union LiquidSdkEventKind kind; +} wire_cst_liquid_sdk_event; + +typedef struct wire_cst_config { + struct wire_cst_list_prim_u_8_strict *boltz_url; + struct wire_cst_list_prim_u_8_strict *electrum_url; + struct wire_cst_list_prim_u_8_strict *working_dir; + int32_t network; + uint64_t payment_timeout_sec; +} wire_cst_config; + +typedef struct wire_cst_connect_request { + struct wire_cst_list_prim_u_8_strict *mnemonic; + struct wire_cst_config config; +} wire_cst_connect_request; + typedef struct wire_cst_list_payment { struct wire_cst_payment *ptr; int32_t len; @@ -130,44 +172,6 @@ typedef struct wire_cst_liquid_sdk_error { union LiquidSdkErrorKind kind; } wire_cst_liquid_sdk_error; -typedef struct wire_cst_LiquidSdkEvent_PaymentFailed { - struct wire_cst_payment *details; -} wire_cst_LiquidSdkEvent_PaymentFailed; - -typedef struct wire_cst_LiquidSdkEvent_PaymentPending { - struct wire_cst_payment *details; -} wire_cst_LiquidSdkEvent_PaymentPending; - -typedef struct wire_cst_LiquidSdkEvent_PaymentRefunded { - struct wire_cst_payment *details; -} wire_cst_LiquidSdkEvent_PaymentRefunded; - -typedef struct wire_cst_LiquidSdkEvent_PaymentRefundPending { - struct wire_cst_payment *details; -} wire_cst_LiquidSdkEvent_PaymentRefundPending; - -typedef struct wire_cst_LiquidSdkEvent_PaymentSucceeded { - struct wire_cst_payment *details; -} wire_cst_LiquidSdkEvent_PaymentSucceeded; - -typedef struct wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation { - struct wire_cst_payment *details; -} wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation; - -typedef union LiquidSdkEventKind { - struct wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed; - struct wire_cst_LiquidSdkEvent_PaymentPending PaymentPending; - struct wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded; - struct wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending; - struct wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded; - struct wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation; -} LiquidSdkEventKind; - -typedef struct wire_cst_liquid_sdk_event { - int32_t tag; - union LiquidSdkEventKind kind; -} wire_cst_liquid_sdk_event; - typedef struct wire_cst_ln_invoice { struct wire_cst_list_prim_u_8_strict *bolt11; int32_t network; @@ -282,6 +286,10 @@ void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment(in void frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_sync(int64_t port_, uintptr_t that); +void frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event(int64_t port_, + struct wire_cst_binding_event_listener *that, + struct wire_cst_liquid_sdk_event *e); + void frbgen_breez_liquid_wire__crate__bindings__breez_log_stream(int64_t port_, struct wire_cst_list_prim_u_8_strict *s); @@ -298,10 +306,14 @@ void frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust struct wire_cst_backup_request *frbgen_breez_liquid_cst_new_box_autoadd_backup_request(void); +struct wire_cst_binding_event_listener *frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener(void); + struct wire_cst_connect_request *frbgen_breez_liquid_cst_new_box_autoadd_connect_request(void); struct wire_cst_get_info_request *frbgen_breez_liquid_cst_new_box_autoadd_get_info_request(void); +struct wire_cst_liquid_sdk_event *frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event(void); + struct wire_cst_payment *frbgen_breez_liquid_cst_new_box_autoadd_payment(void); struct wire_cst_prepare_receive_request *frbgen_breez_liquid_cst_new_box_autoadd_prepare_receive_request(void); @@ -326,8 +338,10 @@ struct wire_cst_list_route_hint_hop *frbgen_breez_liquid_cst_new_list_route_hint static int64_t dummy_method_to_enforce_bundling(void) { int64_t dummy_var = 0; dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_backup_request); + dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_connect_request); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_get_info_request); + dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_payment); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_prepare_receive_request); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_prepare_receive_response); @@ -353,6 +367,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_restore); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_send_payment); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_sync); + dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__breez_log_stream); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__connect); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__default_config); diff --git a/lib/bindings/langs/flutter/flutter_rust_bridge.yml b/lib/bindings/langs/flutter/flutter_rust_bridge.yml index 4d943ff..4c657d9 100644 --- a/lib/bindings/langs/flutter/flutter_rust_bridge.yml +++ b/lib/bindings/langs/flutter/flutter_rust_bridge.yml @@ -1,6 +1,8 @@ -rust_input: ../../../core/src/bindings.rs +rust_input: crate::bindings +rust_root: ../../../core/ dart_output: ../../../../packages/dart/lib/src -rust_output: ../../../core/src/frb/bridge.rs +# flutter_rust_bridge has relative path issues with this new approach introduced in 2.0.0-dev.38 +# rust_output: ../../../core/frb/bridge.rs c_output: breez_liquid_sdk/include/breez_liquid_sdk.h web: false full_dep: true diff --git a/lib/bindings/langs/flutter/justfile b/lib/bindings/langs/flutter/justfile index 91ab27f..d665a17 100644 --- a/lib/bindings/langs/flutter/justfile +++ b/lib/bindings/langs/flutter/justfile @@ -20,7 +20,7 @@ bootstrap frb='true' build='false': # Install flutter_rust_bridge_codegen dependencies frb: cargo install cargo-expand - cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.36 + cargo install flutter_rust_bridge_codegen --version 2.0.0-dev.38 dart pub global activate ffigen dart pub global activate ffi cargo install cargo-xcode diff --git a/lib/core/Cargo.toml b/lib/core/Cargo.toml index 74ae416..80e6e84 100644 --- a/lib/core/Cargo.toml +++ b/lib/core/Cargo.toml @@ -18,7 +18,7 @@ bip39 = { version = "2.0.0", features = ["serde"] } boltz-client = { git = "https://github.com/ok300/boltz-rust", branch = "ok300-breez-latest-06-05" } chrono = "0.4" env_logger = "0.11" -flutter_rust_bridge = { version = "=2.0.0-dev.36", features = ["chrono"], optional = true } +flutter_rust_bridge = { version = "=2.0.0-dev.38", features = ["chrono"], optional = true } log = { workspace = true } lwk_common = "0.5.1" lwk_signer = "0.5.1" diff --git a/lib/core/src/bindings.rs b/lib/core/src/bindings.rs index 16e2ab5..0bcb2c4 100644 --- a/lib/core/src/bindings.rs +++ b/lib/core/src/bindings.rs @@ -6,10 +6,10 @@ use anyhow::Result; use flutter_rust_bridge::frb; use log::{Level, LevelFilter, Metadata, Record, SetLoggerError}; -use crate::{error::*, frb::bridge::StreamSink, model::*, sdk::LiquidSdk}; +use crate::{error::*, frb_generated::StreamSink, model::*, sdk::LiquidSdk}; -struct BindingEventListener { - stream: StreamSink, +pub struct BindingEventListener { + pub stream: StreamSink, } impl EventListener for BindingEventListener { diff --git a/lib/core/src/frb/mod.rs b/lib/core/src/frb/mod.rs deleted file mode 100644 index 83d9377..0000000 --- a/lib/core/src/frb/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub(crate) mod bridge; diff --git a/lib/core/src/frb/bridge.io.rs b/lib/core/src/frb_generated.io.rs similarity index 94% rename from lib/core/src/frb/bridge.io.rs rename to lib/core/src/frb_generated.io.rs index a3f4938..ec7519d 100644 --- a/lib/core/src/frb/bridge.io.rs +++ b/lib/core/src/frb_generated.io.rs @@ -1,12 +1,13 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. // Section: imports use super::*; use crate::bindings::*; +use crate::model::EventListener; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -88,6 +89,14 @@ impl CstDecode for wire_cst_backup_request { } } } +impl CstDecode for wire_cst_binding_event_listener { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::bindings::BindingEventListener { + crate::bindings::BindingEventListener { + stream: self.stream.cst_decode(), + } + } +} impl CstDecode for *mut wire_cst_backup_request { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::model::BackupRequest { @@ -95,6 +104,13 @@ impl CstDecode for *mut wire_cst_backup_request { CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_binding_event_listener { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::bindings::BindingEventListener { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_connect_request { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::model::ConnectRequest { @@ -109,6 +125,13 @@ impl CstDecode for *mut wire_cst_get_info_request CstDecode::::cst_decode(*wrap).into() } } +impl CstDecode for *mut wire_cst_liquid_sdk_event { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::model::LiquidSdkEvent { + let wrap = unsafe { flutter_rust_bridge::for_generated::box_from_leak_ptr(self) }; + CstDecode::::cst_decode(*wrap).into() + } +} impl CstDecode for *mut wire_cst_payment { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::model::Payment { @@ -497,6 +520,18 @@ impl Default for wire_cst_backup_request { Self::new_with_null_ptr() } } +impl NewWithNullPtr for wire_cst_binding_event_listener { + fn new_with_null_ptr() -> Self { + Self { + stream: core::ptr::null_mut(), + } + } +} +impl Default for wire_cst_binding_event_listener { + fn default() -> Self { + Self::new_with_null_ptr() + } +} impl NewWithNullPtr for wire_cst_config { fn new_with_null_ptr() -> Self { Self { @@ -868,6 +903,15 @@ pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_sy wire__crate__bindings__BindingLiquidSdk_sync_impl(port_, that) } +#[no_mangle] +pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event( + port_: i64, + that: *mut wire_cst_binding_event_listener, + e: *mut wire_cst_liquid_sdk_event, +) { + wire__crate__bindings__binding_event_listener_on_event_impl(port_, that, e) +} + #[no_mangle] pub extern "C" fn frbgen_breez_liquid_wire__crate__bindings__breez_log_stream( port_: i64, @@ -924,6 +968,14 @@ pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_backup_request( ) } +#[no_mangle] +pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener( +) -> *mut wire_cst_binding_event_listener { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_binding_event_listener::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_connect_request( ) -> *mut wire_cst_connect_request { @@ -940,6 +992,14 @@ pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_get_info_request( ) } +#[no_mangle] +pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event( +) -> *mut wire_cst_liquid_sdk_event { + flutter_rust_bridge::for_generated::new_leak_box_ptr( + wire_cst_liquid_sdk_event::new_with_null_ptr(), + ) +} + #[no_mangle] pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_payment() -> *mut wire_cst_payment { flutter_rust_bridge::for_generated::new_leak_box_ptr(wire_cst_payment::new_with_null_ptr()) @@ -1048,6 +1108,11 @@ pub struct wire_cst_backup_request { } #[repr(C)] #[derive(Clone, Copy)] +pub struct wire_cst_binding_event_listener { + stream: *mut wire_cst_list_prim_u_8_strict, +} +#[repr(C)] +#[derive(Clone, Copy)] pub struct wire_cst_config { boltz_url: *mut wire_cst_list_prim_u_8_strict, electrum_url: *mut wire_cst_list_prim_u_8_strict, diff --git a/lib/core/src/frb/bridge.rs b/lib/core/src/frb_generated.rs similarity index 81% rename from lib/core/src/frb/bridge.rs rename to lib/core/src/frb_generated.rs index e8c207e..e1cd8b2 100644 --- a/lib/core/src/frb/bridge.rs +++ b/lib/core/src/frb_generated.rs @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. #![allow( non_camel_case_types, @@ -22,8 +22,9 @@ // Section: imports use crate::bindings::*; +use crate::model::EventListener; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; -use flutter_rust_bridge::for_generated::transform_result_dco; +use flutter_rust_bridge::for_generated::{transform_result_dco, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; // Section: boilerplate @@ -33,8 +34,8 @@ flutter_rust_bridge::frb_generated_boilerplate!( default_rust_opaque = RustOpaqueNom, default_rust_auto_opaque = RustAutoOpaqueNom, ); -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.36"; -pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 1028270774; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_VERSION: &str = "2.0.0-dev.38"; +pub(crate) const FLUTTER_RUST_BRIDGE_CODEGEN_CONTENT_HASH: i32 = 308302012; // Section: executor @@ -51,20 +52,46 @@ fn wire__crate__bindings__BindingLiquidSdk_add_event_listener_impl( StreamSink, >, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_add_event_listener", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode();let api_listener = listener.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_add_event_listener", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_listener = listener.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::add_event_listener( + api_that, + api_listener, + ) + .await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::add_event_listener(&api_that, api_listener).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_backup_impl( that: impl CstDecode< @@ -84,25 +111,19 @@ fn wire__crate__bindings__BindingLiquidSdk_backup_impl( transform_result_dco((move || { let mut api_that_decoded = None; let decode_indices_ = - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order( - vec![ - flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info( - &api_that, 0, false, - ), - ], - ); + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); for i in decode_indices_ { match i { - 0 => api_that_decoded = Some( - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_sync_ref( - &api_that, - ), - ), + 0 => api_that_decoded = Some(api_that.lockable_decode_sync_ref()), _ => unreachable!(), } } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::backup(&api_that, api_req) + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::backup(api_that, api_req) })()) }, ) @@ -113,20 +134,41 @@ fn wire__crate__bindings__BindingLiquidSdk_disconnect_impl( RustOpaqueNom>, >, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_disconnect", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_disconnect", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::disconnect(api_that).await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::disconnect(&api_that).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_empty_wallet_cache_impl( that: impl CstDecode< @@ -144,25 +186,19 @@ fn wire__crate__bindings__BindingLiquidSdk_empty_wallet_cache_impl( transform_result_dco((move || { let mut api_that_decoded = None; let decode_indices_ = - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order( - vec![ - flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info( - &api_that, 0, false, - ), - ], - ); + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); for i in decode_indices_ { match i { - 0 => api_that_decoded = Some( - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_sync_ref( - &api_that, - ), - ), + 0 => api_that_decoded = Some(api_that.lockable_decode_sync_ref()), _ => unreachable!(), } } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::empty_wallet_cache(&api_that) + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::empty_wallet_cache(api_that) })()) }, ) @@ -174,20 +210,42 @@ fn wire__crate__bindings__BindingLiquidSdk_get_info_impl( >, req: impl CstDecode, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_get_info", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode();let api_req = req.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_get_info", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_req = req.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::get_info(api_that, api_req).await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::get_info(&api_that, api_req).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_list_payments_impl( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -195,20 +253,41 @@ fn wire__crate__bindings__BindingLiquidSdk_list_payments_impl( RustOpaqueNom>, >, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_list_payments", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_list_payments", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::list_payments(api_that).await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::list_payments(&api_that).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -217,20 +296,45 @@ fn wire__crate__bindings__BindingLiquidSdk_prepare_receive_payment_impl( >, req: impl CstDecode, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_prepare_receive_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode();let api_req = req.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_prepare_receive_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_req = req.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::prepare_receive_payment( + api_that, api_req, + ) + .await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::prepare_receive_payment(&api_that, api_req).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_prepare_send_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -239,20 +343,43 @@ fn wire__crate__bindings__BindingLiquidSdk_prepare_send_payment_impl( >, req: impl CstDecode, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_prepare_send_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode();let api_req = req.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_prepare_send_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_req = req.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::prepare_send_payment(api_that, api_req) + .await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::prepare_send_payment(&api_that, api_req).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_receive_payment_impl( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -261,20 +388,42 @@ fn wire__crate__bindings__BindingLiquidSdk_receive_payment_impl( >, req: impl CstDecode, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_receive_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode();let api_req = req.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_receive_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_req = req.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::receive_payment(api_that, api_req).await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::receive_payment(&api_that, api_req).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_restore_impl( that: impl CstDecode< @@ -294,25 +443,19 @@ fn wire__crate__bindings__BindingLiquidSdk_restore_impl( transform_result_dco((move || { let mut api_that_decoded = None; let decode_indices_ = - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order( - vec![ - flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info( - &api_that, 0, false, - ), - ], - ); + flutter_rust_bridge::for_generated::lockable_compute_decode_order(vec![ + flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + ), + ]); for i in decode_indices_ { match i { - 0 => api_that_decoded = Some( - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_sync_ref( - &api_that, - ), - ), + 0 => api_that_decoded = Some(api_that.lockable_decode_sync_ref()), _ => unreachable!(), } } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::restore(&api_that, api_req) + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::restore(api_that, api_req) })()) }, ) @@ -324,20 +467,42 @@ fn wire__crate__bindings__BindingLiquidSdk_send_payment_impl( >, req: impl CstDecode, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_send_payment", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode();let api_req = req.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_send_payment", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_req = req.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::send_payment(api_that, api_req).await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::send_payment(&api_that, api_req).await - })().await) - } }) + }, + ) } fn wire__crate__bindings__BindingLiquidSdk_sync_impl( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -345,20 +510,65 @@ fn wire__crate__bindings__BindingLiquidSdk_sync_impl( RustOpaqueNom>, >, ) { - FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::(flutter_rust_bridge::for_generated::TaskInfo{ debug_name: "BindingLiquidSdk_sync", port: Some(port_), mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal }, move || { let api_that = that.cst_decode(); move |context| async move { - transform_result_dco((move || async move { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_async::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "BindingLiquidSdk_sync", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + move |context| async move { + transform_result_dco( + (move || async move { let mut api_that_decoded = None; -let decode_indices_ = flutter_rust_bridge::for_generated::rust_auto_opaque_decode_compute_order(vec![flutter_rust_bridge::for_generated::rust_auto_opaque_lock_order_info(&api_that, 0, false)]); - for i in decode_indices_ { - match i { - 0 => api_that_decoded = Some(flutter_rust_bridge::for_generated::rust_auto_opaque_decode_async_ref(&api_that).await), - _ => unreachable!(), + let decode_indices_ = + flutter_rust_bridge::for_generated::lockable_compute_decode_order( + vec![flutter_rust_bridge::for_generated::LockableOrderInfo::new( + &api_that, 0, false, + )], + ); + for i in decode_indices_ { + match i { + 0 => { + api_that_decoded = + Some(api_that.lockable_decode_async_ref().await) + } + _ => unreachable!(), + } + } + let api_that = &*api_that_decoded.unwrap(); + crate::bindings::BindingLiquidSdk::sync(api_that).await + })() + .await, + ) } - } - let api_that = api_that_decoded.unwrap(); - crate::bindings::BindingLiquidSdk::sync(&api_that).await - })().await) - } }) + }, + ) +} +fn wire__crate__bindings__binding_event_listener_on_event_impl( + port_: flutter_rust_bridge::for_generated::MessagePort, + that: impl CstDecode, + e: impl CstDecode, +) { + FLUTTER_RUST_BRIDGE_HANDLER.wrap_normal::( + flutter_rust_bridge::for_generated::TaskInfo { + debug_name: "binding_event_listener_on_event", + port: Some(port_), + mode: flutter_rust_bridge::for_generated::FfiCallMode::Normal, + }, + move || { + let api_that = that.cst_decode(); + let api_e = e.cst_decode(); + move |context| { + transform_result_dco((move || { + Result::<_, ()>::Ok({ + crate::bindings::BindingEventListener::on_event(&api_that, api_e); + }) + })()) + } + }, + ) } fn wire__crate__bindings__breez_log_stream_impl( port_: flutter_rust_bridge::for_generated::MessagePort, @@ -560,6 +770,17 @@ impl SseDecode for crate::model::BackupRequest { } } +impl SseDecode for crate::bindings::BindingEventListener { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { + let mut var_stream = >::sse_decode(deserializer); + return crate::bindings::BindingEventListener { stream: var_stream }; + } +} + impl SseDecode for bool { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -1157,6 +1378,23 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for crate::bindings::BindingEventListener { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [self.stream.into_into_dart().into_dart()].into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for crate::bindings::BindingEventListener +{ +} +impl flutter_rust_bridge::IntoIntoDart + for crate::bindings::BindingEventListener +{ + fn into_into_dart(self) -> crate::bindings::BindingEventListener { + self + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for crate::model::Config { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -1236,6 +1474,9 @@ impl flutter_rust_bridge::IntoDart for crate::error::LiquidSdkError { [1.into_dart(), err.into_into_dart().into_dart()].into_dart() } crate::error::LiquidSdkError::NotStarted => [2.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -1270,6 +1511,9 @@ impl flutter_rust_bridge::IntoDart for crate::model::LiquidSdkEvent { [5.into_dart(), details.into_into_dart().into_dart()].into_dart() } crate::model::LiquidSdkEvent::Synced => [6.into_dart()].into_dart(), + _ => { + unimplemented!(""); + } } } } @@ -1331,6 +1575,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::Network { match self { Self::Mainnet => 0.into_dart(), Self::Testnet => 1.into_dart(), + _ => unreachable!(), } } } @@ -1403,6 +1648,9 @@ impl flutter_rust_bridge::IntoDart for crate::error::PaymentError { crate::error::PaymentError::SignerError { err } => { [17.into_dart(), err.into_into_dart().into_dart()].into_dart() } + _ => { + unimplemented!(""); + } } } } @@ -1421,6 +1669,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::PaymentState { Self::Complete => 2.into_dart(), Self::Failed => 3.into_dart(), Self::TimedOut => 4.into_dart(), + _ => unreachable!(), } } } @@ -1436,6 +1685,7 @@ impl flutter_rust_bridge::IntoDart for crate::model::PaymentType { match self { Self::Receive => 0.into_dart(), Self::Send => 1.into_dart(), + _ => unreachable!(), } } } @@ -1666,6 +1916,13 @@ impl SseEncode for crate::model::BackupRequest { } } +impl SseEncode for crate::bindings::BindingEventListener { + // Codec=Sse (Serialization based), see doc to use other codecs + fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { + >::sse_encode(self.stream, serializer); + } +} + impl SseEncode for bool { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -1730,6 +1987,9 @@ impl SseEncode for crate::error::LiquidSdkError { crate::error::LiquidSdkError::NotStarted => { ::sse_encode(2, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -1765,6 +2025,9 @@ impl SseEncode for crate::model::LiquidSdkEvent { crate::model::LiquidSdkEvent::Synced => { ::sse_encode(6, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -1953,6 +2216,9 @@ impl SseEncode for crate::error::PaymentError { ::sse_encode(17, serializer); ::sse_encode(err, serializer); } + _ => { + unimplemented!(""); + } } } } @@ -2101,7 +2367,7 @@ impl SseEncode for usize { } #[cfg(not(target_family = "wasm"))] -#[path = "bridge.io.rs"] +#[path = "frb_generated.io.rs"] mod io; #[cfg(not(target_family = "wasm"))] pub use io::*; diff --git a/lib/core/src/lib.rs b/lib/core/src/lib.rs index 3ab8fb2..83cf81e 100644 --- a/lib/core/src/lib.rs +++ b/lib/core/src/lib.rs @@ -1,9 +1,9 @@ #[cfg(feature = "frb")] -pub mod bindings; +pub(crate) mod bindings; pub mod error; pub(crate) mod event; #[cfg(feature = "frb")] -pub mod frb; +pub(crate) mod frb_generated; pub mod logger; pub mod model; pub mod persist; diff --git a/packages/dart/lib/src/bindings.dart b/packages/dart/lib/src/bindings.dart index b02b8e6..cffe3b2 100644 --- a/packages/dart/lib/src/bindings.dart +++ b/packages/dart/lib/src/bindings.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import @@ -8,70 +8,63 @@ import 'frb_generated.dart'; import 'model.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; -// The type `BindingEventListener` is not used by any `pub` functions, thus it is ignored. -// The type `DartBindingLogger` is not used by any `pub` functions, thus it is ignored. +// These functions are ignored because they are not marked as `pub`: `init` +// These types are ignored because they are not used by any `pub` functions: `DartBindingLogger` -Future connect({required ConnectRequest req, dynamic hint}) => - RustLib.instance.api.crateBindingsConnect(req: req, hint: hint); +Future connect({required ConnectRequest req}) => + RustLib.instance.api.crateBindingsConnect(req: req); /// If used, this must be called before `connect`. It can only be called once. -Stream breezLogStream({dynamic hint}) => - RustLib.instance.api.crateBindingsBreezLogStream(hint: hint); +Stream breezLogStream() => RustLib.instance.api.crateBindingsBreezLogStream(); -Config defaultConfig({required Network network, dynamic hint}) => - RustLib.instance.api.crateBindingsDefaultConfig(network: network, hint: hint); +Config defaultConfig({required Network network}) => + RustLib.instance.api.crateBindingsDefaultConfig(network: network); -LNInvoice parseInvoice({required String input, dynamic hint}) => - RustLib.instance.api.crateBindingsParseInvoice(input: input, hint: hint); +LNInvoice parseInvoice({required String input}) => + RustLib.instance.api.crateBindingsParseInvoice(input: input); // Rust type: RustOpaqueNom> -@sealed -class BindingLiquidSdk extends RustOpaque { - BindingLiquidSdk.dcoDecode(List wire) : super.dcoDecode(wire, _kStaticData); +abstract class BindingLiquidSdk implements RustOpaqueInterface { + Stream addEventListener(); - BindingLiquidSdk.sseDecode(BigInt ptr, int externalSizeOnNative) - : super.sseDecode(ptr, externalSizeOnNative, _kStaticData); + void backup({required BackupRequest req}); - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_BindingLiquidSdk, - rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_BindingLiquidSdk, - rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_BindingLiquidSdkPtr, - ); + Future disconnect(); - Stream addEventListener({dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkAddEventListener(that: this, hint: hint); + void emptyWalletCache(); - void backup({required BackupRequest req, dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkBackup(that: this, req: req, hint: hint); + Future getInfo({required GetInfoRequest req}); - Future disconnect({dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkDisconnect(that: this, hint: hint); + Future> listPayments(); - void emptyWalletCache({dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkEmptyWalletCache(that: this, hint: hint); + Future prepareReceivePayment({required PrepareReceiveRequest req}); - Future getInfo({required GetInfoRequest req, dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkGetInfo(that: this, req: req, hint: hint); + Future prepareSendPayment({required PrepareSendRequest req}); - Future> listPayments({dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkListPayments(that: this, hint: hint); + Future receivePayment({required PrepareReceiveResponse req}); - Future prepareReceivePayment({required PrepareReceiveRequest req, dynamic hint}) => - RustLib.instance.api - .crateBindingsBindingLiquidSdkPrepareReceivePayment(that: this, req: req, hint: hint); + void restore({required RestoreRequest req}); - Future prepareSendPayment({required PrepareSendRequest req, dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkPrepareSendPayment(that: this, req: req, hint: hint); + Future sendPayment({required PrepareSendResponse req}); - Future receivePayment({required PrepareReceiveResponse req, dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkReceivePayment(that: this, req: req, hint: hint); - - void restore({required RestoreRequest req, dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkRestore(that: this, req: req, hint: hint); - - Future sendPayment({required PrepareSendResponse req, dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkSendPayment(that: this, req: req, hint: hint); - - Future sync({dynamic hint}) => - RustLib.instance.api.crateBindingsBindingLiquidSdkSync(that: this, hint: hint); + Future sync(); +} + +class BindingEventListener { + final RustStreamSink stream; + + const BindingEventListener({ + required this.stream, + }); + + Future onEvent({required LiquidSdkEvent e}) => + RustLib.instance.api.crateBindingsBindingEventListenerOnEvent(that: this, e: e); + + @override + int get hashCode => stream.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is BindingEventListener && runtimeType == other.runtimeType && stream == other.stream; } diff --git a/packages/dart/lib/src/error.dart b/packages/dart/lib/src/error.dart index 1d5e727..69d910a 100644 --- a/packages/dart/lib/src/error.dart +++ b/packages/dart/lib/src/error.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/packages/dart/lib/src/frb_generated.dart b/packages/dart/lib/src/frb_generated.dart index 4823758..3d1f0d7 100644 --- a/packages/dart/lib/src/frb_generated.dart +++ b/packages/dart/lib/src/frb_generated.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -7,6 +7,7 @@ import 'bindings.dart'; import 'dart:async'; import 'dart:convert'; import 'error.dart'; +import 'frb_generated.dart'; import 'frb_generated.io.dart' if (dart.library.html) 'frb_generated.web.dart'; import 'model.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; @@ -50,10 +51,10 @@ class RustLib extends BaseEntrypoint { ExternalLibraryLoaderConfig get defaultExternalLibraryLoaderConfig => kDefaultExternalLibraryLoaderConfig; @override - String get codegenVersion => '2.0.0-dev.36'; + String get codegenVersion => '2.0.0-dev.38'; @override - int get rustContentHash => 1028270774; + int get rustContentHash => 308302012; static const kDefaultExternalLibraryLoaderConfig = ExternalLibraryLoaderConfig( stem: 'breez_liquid_sdk', @@ -63,46 +64,45 @@ class RustLib extends BaseEntrypoint { } abstract class RustLibApi extends BaseApi { - Stream crateBindingsBindingLiquidSdkAddEventListener( - {required BindingLiquidSdk that, dynamic hint}); + Stream crateBindingsBindingLiquidSdkAddEventListener({required BindingLiquidSdk that}); - void crateBindingsBindingLiquidSdkBackup( - {required BindingLiquidSdk that, required BackupRequest req, dynamic hint}); + void crateBindingsBindingLiquidSdkBackup({required BindingLiquidSdk that, required BackupRequest req}); - Future crateBindingsBindingLiquidSdkDisconnect({required BindingLiquidSdk that, dynamic hint}); + Future crateBindingsBindingLiquidSdkDisconnect({required BindingLiquidSdk that}); - void crateBindingsBindingLiquidSdkEmptyWalletCache({required BindingLiquidSdk that, dynamic hint}); + void crateBindingsBindingLiquidSdkEmptyWalletCache({required BindingLiquidSdk that}); Future crateBindingsBindingLiquidSdkGetInfo( - {required BindingLiquidSdk that, required GetInfoRequest req, dynamic hint}); + {required BindingLiquidSdk that, required GetInfoRequest req}); - Future> crateBindingsBindingLiquidSdkListPayments( - {required BindingLiquidSdk that, dynamic hint}); + Future> crateBindingsBindingLiquidSdkListPayments({required BindingLiquidSdk that}); Future crateBindingsBindingLiquidSdkPrepareReceivePayment( - {required BindingLiquidSdk that, required PrepareReceiveRequest req, dynamic hint}); + {required BindingLiquidSdk that, required PrepareReceiveRequest req}); Future crateBindingsBindingLiquidSdkPrepareSendPayment( - {required BindingLiquidSdk that, required PrepareSendRequest req, dynamic hint}); + {required BindingLiquidSdk that, required PrepareSendRequest req}); Future crateBindingsBindingLiquidSdkReceivePayment( - {required BindingLiquidSdk that, required PrepareReceiveResponse req, dynamic hint}); + {required BindingLiquidSdk that, required PrepareReceiveResponse req}); - void crateBindingsBindingLiquidSdkRestore( - {required BindingLiquidSdk that, required RestoreRequest req, dynamic hint}); + void crateBindingsBindingLiquidSdkRestore({required BindingLiquidSdk that, required RestoreRequest req}); Future crateBindingsBindingLiquidSdkSendPayment( - {required BindingLiquidSdk that, required PrepareSendResponse req, dynamic hint}); + {required BindingLiquidSdk that, required PrepareSendResponse req}); - Future crateBindingsBindingLiquidSdkSync({required BindingLiquidSdk that, dynamic hint}); + Future crateBindingsBindingLiquidSdkSync({required BindingLiquidSdk that}); - Stream crateBindingsBreezLogStream({dynamic hint}); + Future crateBindingsBindingEventListenerOnEvent( + {required BindingEventListener that, required LiquidSdkEvent e}); - Future crateBindingsConnect({required ConnectRequest req, dynamic hint}); + Stream crateBindingsBreezLogStream(); - Config crateBindingsDefaultConfig({required Network network, dynamic hint}); + Future crateBindingsConnect({required ConnectRequest req}); - LNInvoice crateBindingsParseInvoice({required String input, dynamic hint}); + Config crateBindingsDefaultConfig({required Network network}); + + LNInvoice crateBindingsParseInvoice({required String input}); RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_BindingLiquidSdk; @@ -120,8 +120,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { }); @override - Stream crateBindingsBindingLiquidSdkAddEventListener( - {required BindingLiquidSdk that, dynamic hint}) { + Stream crateBindingsBindingLiquidSdkAddEventListener({required BindingLiquidSdk that}) { final listener = RustStreamSink(); unawaited(handler.executeNormal(NormalTask( callFfi: (port_) { @@ -138,7 +137,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkAddEventListenerConstMeta, argValues: [that, listener], apiImpl: this, - hint: hint, ))); return listener.stream; } @@ -149,8 +147,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - void crateBindingsBindingLiquidSdkBackup( - {required BindingLiquidSdk that, required BackupRequest req, dynamic hint}) { + void crateBindingsBindingLiquidSdkBackup({required BindingLiquidSdk that, required BackupRequest req}) { return handler.executeSync(SyncTask( callFfi: () { var arg0 = @@ -166,7 +163,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkBackupConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -176,7 +172,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateBindingsBindingLiquidSdkDisconnect({required BindingLiquidSdk that, dynamic hint}) { + Future crateBindingsBindingLiquidSdkDisconnect({required BindingLiquidSdk that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -191,7 +187,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkDisconnectConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } @@ -201,7 +196,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - void crateBindingsBindingLiquidSdkEmptyWalletCache({required BindingLiquidSdk that, dynamic hint}) { + void crateBindingsBindingLiquidSdkEmptyWalletCache({required BindingLiquidSdk that}) { return handler.executeSync(SyncTask( callFfi: () { var arg0 = @@ -216,7 +211,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkEmptyWalletCacheConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } @@ -227,7 +221,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateBindingsBindingLiquidSdkGetInfo( - {required BindingLiquidSdk that, required GetInfoRequest req, dynamic hint}) { + {required BindingLiquidSdk that, required GetInfoRequest req}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -243,7 +237,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkGetInfoConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -253,8 +246,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future> crateBindingsBindingLiquidSdkListPayments( - {required BindingLiquidSdk that, dynamic hint}) { + Future> crateBindingsBindingLiquidSdkListPayments({required BindingLiquidSdk that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -269,7 +261,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkListPaymentsConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } @@ -280,7 +271,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateBindingsBindingLiquidSdkPrepareReceivePayment( - {required BindingLiquidSdk that, required PrepareReceiveRequest req, dynamic hint}) { + {required BindingLiquidSdk that, required PrepareReceiveRequest req}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -296,7 +287,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkPrepareReceivePaymentConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -307,7 +297,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateBindingsBindingLiquidSdkPrepareSendPayment( - {required BindingLiquidSdk that, required PrepareSendRequest req, dynamic hint}) { + {required BindingLiquidSdk that, required PrepareSendRequest req}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -323,7 +313,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkPrepareSendPaymentConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -334,7 +323,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateBindingsBindingLiquidSdkReceivePayment( - {required BindingLiquidSdk that, required PrepareReceiveResponse req, dynamic hint}) { + {required BindingLiquidSdk that, required PrepareReceiveResponse req}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -350,7 +339,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkReceivePaymentConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -360,8 +348,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - void crateBindingsBindingLiquidSdkRestore( - {required BindingLiquidSdk that, required RestoreRequest req, dynamic hint}) { + void crateBindingsBindingLiquidSdkRestore({required BindingLiquidSdk that, required RestoreRequest req}) { return handler.executeSync(SyncTask( callFfi: () { var arg0 = @@ -377,7 +364,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkRestoreConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -388,7 +374,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @override Future crateBindingsBindingLiquidSdkSendPayment( - {required BindingLiquidSdk that, required PrepareSendResponse req, dynamic hint}) { + {required BindingLiquidSdk that, required PrepareSendResponse req}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -404,7 +390,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkSendPaymentConstMeta, argValues: [that, req], apiImpl: this, - hint: hint, )); } @@ -414,7 +399,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateBindingsBindingLiquidSdkSync({required BindingLiquidSdk that, dynamic hint}) { + Future crateBindingsBindingLiquidSdkSync({required BindingLiquidSdk that}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = @@ -429,7 +414,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBindingLiquidSdkSyncConstMeta, argValues: [that], apiImpl: this, - hint: hint, )); } @@ -439,7 +423,31 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Stream crateBindingsBreezLogStream({dynamic hint}) { + Future crateBindingsBindingEventListenerOnEvent( + {required BindingEventListener that, required LiquidSdkEvent e}) { + return handler.executeNormal(NormalTask( + callFfi: (port_) { + var arg0 = cst_encode_box_autoadd_binding_event_listener(that); + var arg1 = cst_encode_box_autoadd_liquid_sdk_event(e); + return wire.wire__crate__bindings__binding_event_listener_on_event(port_, arg0, arg1); + }, + codec: DcoCodec( + decodeSuccessData: dco_decode_unit, + decodeErrorData: null, + ), + constMeta: kCrateBindingsBindingEventListenerOnEventConstMeta, + argValues: [that, e], + apiImpl: this, + )); + } + + TaskConstMeta get kCrateBindingsBindingEventListenerOnEventConstMeta => const TaskConstMeta( + debugName: "binding_event_listener_on_event", + argNames: ["that", "e"], + ); + + @override + Stream crateBindingsBreezLogStream() { final s = RustStreamSink(); unawaited(handler.executeNormal(NormalTask( callFfi: (port_) { @@ -453,7 +461,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsBreezLogStreamConstMeta, argValues: [s], apiImpl: this, - hint: hint, ))); return s.stream; } @@ -464,7 +471,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Future crateBindingsConnect({required ConnectRequest req, dynamic hint}) { + Future crateBindingsConnect({required ConnectRequest req}) { return handler.executeNormal(NormalTask( callFfi: (port_) { var arg0 = cst_encode_box_autoadd_connect_request(req); @@ -478,7 +485,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsConnectConstMeta, argValues: [req], apiImpl: this, - hint: hint, )); } @@ -488,7 +494,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - Config crateBindingsDefaultConfig({required Network network, dynamic hint}) { + Config crateBindingsDefaultConfig({required Network network}) { return handler.executeSync(SyncTask( callFfi: () { var arg0 = cst_encode_network(network); @@ -501,7 +507,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsDefaultConfigConstMeta, argValues: [network], apiImpl: this, - hint: hint, )); } @@ -511,7 +516,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); @override - LNInvoice crateBindingsParseInvoice({required String input, dynamic hint}) { + LNInvoice crateBindingsParseInvoice({required String input}) { return handler.executeSync(SyncTask( callFfi: () { var arg0 = cst_encode_String(input); @@ -524,7 +529,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { constMeta: kCrateBindingsParseInvoiceConstMeta, argValues: [input], apiImpl: this, - hint: hint, )); } @@ -550,7 +554,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return BindingLiquidSdk.dcoDecode(raw as List); + return BindingLiquidSdkImpl.frbInternalDcoDecode(raw as List); } @protected @@ -558,14 +562,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return BindingLiquidSdk.dcoDecode(raw as List); + return BindingLiquidSdkImpl.frbInternalDcoDecode(raw as List); } @protected BindingLiquidSdk dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return BindingLiquidSdk.dcoDecode(raw as List); + return BindingLiquidSdkImpl.frbInternalDcoDecode(raw as List); } @protected @@ -596,6 +600,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); } + @protected + BindingEventListener dco_decode_binding_event_listener(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return BindingEventListener( + stream: dco_decode_StreamSink_liquid_sdk_event_Dco(arr[0]), + ); + } + @protected bool dco_decode_bool(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -608,6 +622,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return dco_decode_backup_request(raw); } + @protected + BindingEventListener dco_decode_box_autoadd_binding_event_listener(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_binding_event_listener(raw); + } + @protected ConnectRequest dco_decode_box_autoadd_connect_request(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -620,6 +640,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return dco_decode_get_info_request(raw); } + @protected + LiquidSdkEvent dco_decode_box_autoadd_liquid_sdk_event(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + return dco_decode_liquid_sdk_event(raw); + } + @protected Payment dco_decode_box_autoadd_payment(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1074,7 +1100,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return BindingLiquidSdk.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + return BindingLiquidSdkImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected @@ -1082,14 +1109,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return BindingLiquidSdk.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + return BindingLiquidSdkImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected BindingLiquidSdk sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs - return BindingLiquidSdk.sseDecode(sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); + return BindingLiquidSdkImpl.frbInternalSseDecode( + sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } @protected @@ -1118,6 +1147,13 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return BackupRequest(backupPath: var_backupPath); } + @protected + BindingEventListener sse_decode_binding_event_listener(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_stream = sse_decode_StreamSink_liquid_sdk_event_Dco(deserializer); + return BindingEventListener(stream: var_stream); + } + @protected bool sse_decode_bool(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1130,6 +1166,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return (sse_decode_backup_request(deserializer)); } + @protected + BindingEventListener sse_decode_box_autoadd_binding_event_listener(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_binding_event_listener(deserializer)); + } + @protected ConnectRequest sse_decode_box_autoadd_connect_request(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1142,6 +1184,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return (sse_decode_get_info_request(deserializer)); } + @protected + LiquidSdkEvent sse_decode_box_autoadd_liquid_sdk_event(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + return (sse_decode_liquid_sdk_event(deserializer)); + } + @protected Payment sse_decode_box_autoadd_payment(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1602,7 +1650,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { BindingLiquidSdk raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(move: true); + return (raw as BindingLiquidSdkImpl).frbInternalCstEncode(move: true); } @protected @@ -1610,7 +1658,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { BindingLiquidSdk raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(move: false); + return (raw as BindingLiquidSdkImpl).frbInternalCstEncode(move: false); } @protected @@ -1618,7 +1666,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { BindingLiquidSdk raw) { // Codec=Cst (C-struct based), see doc to use other codecs // ignore: invalid_use_of_internal_member - return raw.cstEncode(); + return (raw as BindingLiquidSdkImpl).frbInternalCstEncode(); } @protected @@ -1679,21 +1727,21 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: true), serializer); + sse_encode_usize((self as BindingLiquidSdkImpl).frbInternalSseEncode(move: true), serializer); } @protected void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: false), serializer); + sse_encode_usize((self as BindingLiquidSdkImpl).frbInternalSseEncode(move: false), serializer); } @protected void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize(self.sseEncode(move: null), serializer); + sse_encode_usize((self as BindingLiquidSdkImpl).frbInternalSseEncode(move: null), serializer); } @protected @@ -1727,6 +1775,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_opt_String(self.backupPath, serializer); } + @protected + void sse_encode_binding_event_listener(BindingEventListener self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_StreamSink_liquid_sdk_event_Dco(self.stream, serializer); + } + @protected void sse_encode_bool(bool self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1739,6 +1793,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_backup_request(self, serializer); } + @protected + void sse_encode_box_autoadd_binding_event_listener(BindingEventListener self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_binding_event_listener(self, serializer); + } + @protected void sse_encode_box_autoadd_connect_request(ConnectRequest self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1751,6 +1811,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_get_info_request(self, serializer); } + @protected + void sse_encode_box_autoadd_liquid_sdk_event(LiquidSdkEvent self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_liquid_sdk_event(self, serializer); + } + @protected void sse_encode_box_autoadd_payment(Payment self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -1843,6 +1909,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_String(err, serializer); case LiquidSdkError_NotStarted(): sse_encode_i_32(2, serializer); + default: + throw UnimplementedError(''); } } @@ -1870,6 +1938,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_box_autoadd_payment(details, serializer); case LiquidSdkEvent_Synced(): sse_encode_i_32(6, serializer); + default: + throw UnimplementedError(''); } } @@ -2020,6 +2090,8 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { case PaymentError_SignerError(err: final err): sse_encode_i_32(17, serializer); sse_encode_String(err, serializer); + default: + throw UnimplementedError(''); } } @@ -2127,3 +2199,62 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { serializer.buffer.putBigUint64(self); } } + +@sealed +class BindingLiquidSdkImpl extends RustOpaque implements BindingLiquidSdk { + // Not to be used by end users + BindingLiquidSdkImpl.frbInternalDcoDecode(List wire) + : super.frbInternalDcoDecode(wire, _kStaticData); + + // Not to be used by end users + BindingLiquidSdkImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) + : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); + + static final _kStaticData = RustArcStaticData( + rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_BindingLiquidSdk, + rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_BindingLiquidSdk, + rustArcDecrementStrongCountPtr: RustLib.instance.api.rust_arc_decrement_strong_count_BindingLiquidSdkPtr, + ); + + Stream addEventListener() => + RustLib.instance.api.crateBindingsBindingLiquidSdkAddEventListener( + that: this, + ); + + void backup({required BackupRequest req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkBackup(that: this, req: req); + + Future disconnect() => RustLib.instance.api.crateBindingsBindingLiquidSdkDisconnect( + that: this, + ); + + void emptyWalletCache() => RustLib.instance.api.crateBindingsBindingLiquidSdkEmptyWalletCache( + that: this, + ); + + Future getInfo({required GetInfoRequest req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkGetInfo(that: this, req: req); + + Future> listPayments() => RustLib.instance.api.crateBindingsBindingLiquidSdkListPayments( + that: this, + ); + + Future prepareReceivePayment({required PrepareReceiveRequest req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkPrepareReceivePayment(that: this, req: req); + + Future prepareSendPayment({required PrepareSendRequest req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkPrepareSendPayment(that: this, req: req); + + Future receivePayment({required PrepareReceiveResponse req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkReceivePayment(that: this, req: req); + + void restore({required RestoreRequest req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkRestore(that: this, req: req); + + Future sendPayment({required PrepareSendResponse req}) => + RustLib.instance.api.crateBindingsBindingLiquidSdkSendPayment(that: this, req: req); + + Future sync() => RustLib.instance.api.crateBindingsBindingLiquidSdkSync( + that: this, + ); +} diff --git a/packages/dart/lib/src/frb_generated.io.dart b/packages/dart/lib/src/frb_generated.io.dart index fde1f5a..d53001d 100644 --- a/packages/dart/lib/src/frb_generated.io.dart +++ b/packages/dart/lib/src/frb_generated.io.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. // ignore_for_file: unused_import, unused_element, unnecessary_import, duplicate_ignore, invalid_use_of_internal_member, annotate_overrides, non_constant_identifier_names, curly_braces_in_flow_control_structures, prefer_const_literals_to_create_immutables, unused_field @@ -52,18 +52,27 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected BackupRequest dco_decode_backup_request(dynamic raw); + @protected + BindingEventListener dco_decode_binding_event_listener(dynamic raw); + @protected bool dco_decode_bool(dynamic raw); @protected BackupRequest dco_decode_box_autoadd_backup_request(dynamic raw); + @protected + BindingEventListener dco_decode_box_autoadd_binding_event_listener(dynamic raw); + @protected ConnectRequest dco_decode_box_autoadd_connect_request(dynamic raw); @protected GetInfoRequest dco_decode_box_autoadd_get_info_request(dynamic raw); + @protected + LiquidSdkEvent dco_decode_box_autoadd_liquid_sdk_event(dynamic raw); + @protected Payment dco_decode_box_autoadd_payment(dynamic raw); @@ -216,18 +225,27 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected BackupRequest sse_decode_backup_request(SseDeserializer deserializer); + @protected + BindingEventListener sse_decode_binding_event_listener(SseDeserializer deserializer); + @protected bool sse_decode_bool(SseDeserializer deserializer); @protected BackupRequest sse_decode_box_autoadd_backup_request(SseDeserializer deserializer); + @protected + BindingEventListener sse_decode_box_autoadd_binding_event_listener(SseDeserializer deserializer); + @protected ConnectRequest sse_decode_box_autoadd_connect_request(SseDeserializer deserializer); @protected GetInfoRequest sse_decode_box_autoadd_get_info_request(SseDeserializer deserializer); + @protected + LiquidSdkEvent sse_decode_box_autoadd_liquid_sdk_event(SseDeserializer deserializer); + @protected Payment sse_decode_box_autoadd_payment(SseDeserializer deserializer); @@ -387,6 +405,15 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_binding_event_listener( + BindingEventListener raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_binding_event_listener(); + cst_api_fill_to_wire_binding_event_listener(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_connect_request(ConnectRequest raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -403,6 +430,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { return ptr; } + @protected + ffi.Pointer cst_encode_box_autoadd_liquid_sdk_event(LiquidSdkEvent raw) { + // Codec=Cst (C-struct based), see doc to use other codecs + final ptr = wire.cst_new_box_autoadd_liquid_sdk_event(); + cst_api_fill_to_wire_liquid_sdk_event(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer cst_encode_box_autoadd_payment(Payment raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -528,12 +563,24 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { wireObj.backup_path = cst_encode_opt_String(apiObj.backupPath); } + @protected + void cst_api_fill_to_wire_binding_event_listener( + BindingEventListener apiObj, wire_cst_binding_event_listener wireObj) { + wireObj.stream = cst_encode_StreamSink_liquid_sdk_event_Dco(apiObj.stream); + } + @protected void cst_api_fill_to_wire_box_autoadd_backup_request( BackupRequest apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_backup_request(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_binding_event_listener( + BindingEventListener apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_binding_event_listener(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_connect_request( ConnectRequest apiObj, ffi.Pointer wireObj) { @@ -546,6 +593,12 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { cst_api_fill_to_wire_get_info_request(apiObj, wireObj.ref); } + @protected + void cst_api_fill_to_wire_box_autoadd_liquid_sdk_event( + LiquidSdkEvent apiObj, ffi.Pointer wireObj) { + cst_api_fill_to_wire_liquid_sdk_event(apiObj, wireObj.ref); + } + @protected void cst_api_fill_to_wire_box_autoadd_payment(Payment apiObj, ffi.Pointer wireObj) { cst_api_fill_to_wire_payment(apiObj, wireObj.ref); @@ -923,18 +976,27 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_backup_request(BackupRequest self, SseSerializer serializer); + @protected + void sse_encode_binding_event_listener(BindingEventListener self, SseSerializer serializer); + @protected void sse_encode_bool(bool self, SseSerializer serializer); @protected void sse_encode_box_autoadd_backup_request(BackupRequest self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_binding_event_listener(BindingEventListener self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_connect_request(ConnectRequest self, SseSerializer serializer); @protected void sse_encode_box_autoadd_get_info_request(GetInfoRequest self, SseSerializer serializer); + @protected + void sse_encode_box_autoadd_liquid_sdk_event(LiquidSdkEvent self, SseSerializer serializer); + @protected void sse_encode_box_autoadd_payment(Payment self, SseSerializer serializer); @@ -1313,6 +1375,28 @@ class RustLibWire implements BaseWire { late final _wire__crate__bindings__BindingLiquidSdk_sync = _wire__crate__bindings__BindingLiquidSdk_syncPtr.asFunction(); + void wire__crate__bindings__binding_event_listener_on_event( + int port_, + ffi.Pointer that, + ffi.Pointer e, + ) { + return _wire__crate__bindings__binding_event_listener_on_event( + port_, + that, + e, + ); + } + + late final _wire__crate__bindings__binding_event_listener_on_eventPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event'); + late final _wire__crate__bindings__binding_event_listener_on_event = + _wire__crate__bindings__binding_event_listener_on_eventPtr.asFunction< + void Function( + int, ffi.Pointer, ffi.Pointer)>(); + void wire__crate__bindings__breez_log_stream( int port_, ffi.Pointer s, @@ -1415,6 +1499,16 @@ class RustLibWire implements BaseWire { late final _cst_new_box_autoadd_backup_request = _cst_new_box_autoadd_backup_requestPtr.asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_binding_event_listener() { + return _cst_new_box_autoadd_binding_event_listener(); + } + + late final _cst_new_box_autoadd_binding_event_listenerPtr = + _lookup Function()>>( + 'frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener'); + late final _cst_new_box_autoadd_binding_event_listener = _cst_new_box_autoadd_binding_event_listenerPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_connect_request() { return _cst_new_box_autoadd_connect_request(); } @@ -1435,6 +1529,16 @@ class RustLibWire implements BaseWire { late final _cst_new_box_autoadd_get_info_request = _cst_new_box_autoadd_get_info_requestPtr .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_liquid_sdk_event() { + return _cst_new_box_autoadd_liquid_sdk_event(); + } + + late final _cst_new_box_autoadd_liquid_sdk_eventPtr = + _lookup Function()>>( + 'frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event'); + late final _cst_new_box_autoadd_liquid_sdk_event = _cst_new_box_autoadd_liquid_sdk_eventPtr + .asFunction Function()>(); + ffi.Pointer cst_new_box_autoadd_payment() { return _cst_new_box_autoadd_payment(); } @@ -1626,24 +1730,8 @@ final class wire_cst_prepare_send_response extends ffi.Struct { external int fees_sat; } -final class wire_cst_config extends ffi.Struct { - external ffi.Pointer boltz_url; - - external ffi.Pointer electrum_url; - - external ffi.Pointer working_dir; - - @ffi.Int32() - external int network; - - @ffi.Uint64() - external int payment_timeout_sec; -} - -final class wire_cst_connect_request extends ffi.Struct { - external ffi.Pointer mnemonic; - - external wire_cst_config config; +final class wire_cst_binding_event_listener extends ffi.Struct { + external ffi.Pointer stream; } final class wire_cst_payment extends ffi.Struct { @@ -1673,6 +1761,71 @@ final class wire_cst_payment extends ffi.Struct { external int status; } +final class wire_cst_LiquidSdkEvent_PaymentFailed extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentPending extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentRefunded extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentRefundPending extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentSucceeded extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation extends ffi.Struct { + external ffi.Pointer details; +} + +final class LiquidSdkEventKind extends ffi.Union { + external wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed; + + external wire_cst_LiquidSdkEvent_PaymentPending PaymentPending; + + external wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded; + + external wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending; + + external wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded; + + external wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation; +} + +final class wire_cst_liquid_sdk_event extends ffi.Struct { + @ffi.Int32() + external int tag; + + external LiquidSdkEventKind kind; +} + +final class wire_cst_config extends ffi.Struct { + external ffi.Pointer boltz_url; + + external ffi.Pointer electrum_url; + + external ffi.Pointer working_dir; + + @ffi.Int32() + external int network; + + @ffi.Uint64() + external int payment_timeout_sec; +} + +final class wire_cst_connect_request extends ffi.Struct { + external ffi.Pointer mnemonic; + + external wire_cst_config config; +} + final class wire_cst_list_payment extends ffi.Struct { external ffi.Pointer ptr; @@ -1746,51 +1899,6 @@ final class wire_cst_liquid_sdk_error extends ffi.Struct { external LiquidSdkErrorKind kind; } -final class wire_cst_LiquidSdkEvent_PaymentFailed extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentPending extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentRefunded extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentRefundPending extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentSucceeded extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation extends ffi.Struct { - external ffi.Pointer details; -} - -final class LiquidSdkEventKind extends ffi.Union { - external wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed; - - external wire_cst_LiquidSdkEvent_PaymentPending PaymentPending; - - external wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded; - - external wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending; - - external wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded; - - external wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation; -} - -final class wire_cst_liquid_sdk_event extends ffi.Struct { - @ffi.Int32() - external int tag; - - external LiquidSdkEventKind kind; -} - final class wire_cst_ln_invoice extends ffi.Struct { external ffi.Pointer bolt11; diff --git a/packages/dart/lib/src/model.dart b/packages/dart/lib/src/model.dart index ef84bdf..ce6a4bf 100644 --- a/packages/dart/lib/src/model.dart +++ b/packages/dart/lib/src/model.dart @@ -1,5 +1,5 @@ // This file is automatically generated, so please do not edit it. -// Generated by `flutter_rust_bridge`@ 2.0.0-dev.36. +// Generated by `flutter_rust_bridge`@ 2.0.0-dev.38. // ignore_for_file: invalid_use_of_internal_member, unused_import, unnecessary_import diff --git a/packages/dart/pubspec.yaml b/packages/dart/pubspec.yaml index 4540e97..1b1d394 100644 --- a/packages/dart/pubspec.yaml +++ b/packages/dart/pubspec.yaml @@ -18,11 +18,11 @@ dev_dependencies: build_runner: ^2.4.10 ffigen: ">=8.0.0 <=11.0.0" freezed: ^2.5.3 - lints: ">=2.0.0 <4.0.0" + lints: ">=2.0.0 <=4.0.0" path: ^1.9.0 test: ^1.25.5 dependencies: ffi: ^2.1.2 - flutter_rust_bridge: 2.0.0-dev.36 + flutter_rust_bridge: ">=2.0.0-dev.38" freezed_annotation: ^2.4.1 meta: ^1.12.0 # meta is pinned to version 1.12.0 by integration_test from the flutter SDK. diff --git a/packages/flutter/example/pubspec.lock b/packages/flutter/example/pubspec.lock index bd11e26..65165a4 100644 --- a/packages/flutter/example/pubspec.lock +++ b/packages/flutter/example/pubspec.lock @@ -152,10 +152,10 @@ packages: dependency: "direct main" description: name: flutter_rust_bridge - sha256: efb018e387c5e844095e35e9d6c6bd1610c49f25de109f4988b7c45aeca60a9a + sha256: "867ae0e50cf856ab9fe8d26f88319aa5ec47b3e641e055280bdc626d6f5cd0f2" url: "https://pub.dev" source: hosted - version: "2.0.0-dev.36" + version: "2.0.0-dev.38" flutter_secure_storage: dependency: "direct main" description: @@ -362,10 +362,10 @@ packages: dependency: transitive description: name: path_provider_android - sha256: a248d8146ee5983446bf03ed5ea8f6533129a12b11f12057ad1b4a67a2b3b41d + sha256: "9c96da072b421e98183f9ea7464898428e764bc0ce5567f27ec8693442e72514" url: "https://pub.dev" source: hosted - version: "2.2.4" + version: "2.2.5" path_provider_foundation: dependency: transitive description: @@ -565,4 +565,4 @@ packages: version: "2.2.1" sdks: dart: ">=3.4.0 <4.0.0" - flutter: ">=3.19.0" + flutter: ">=3.22.0" diff --git a/packages/flutter/example/pubspec.yaml b/packages/flutter/example/pubspec.yaml index 5b48480..10bf0e4 100644 --- a/packages/flutter/example/pubspec.yaml +++ b/packages/flutter/example/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: flutter: sdk: flutter - flutter_rust_bridge: ^2.0.0-dev.36 + flutter_rust_bridge: ">=2.0.0-dev.38" flutter_breez_liquid: ^0.1.0 # When depending on this package from a real application you should use: # flutter_breez_liquid: ^x.y.z diff --git a/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart b/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart index 47898b9..a9006b2 100644 --- a/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart +++ b/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart @@ -260,6 +260,28 @@ class FlutterBreezLiquidBindings { _frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_syncPtr .asFunction(); + void frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event( + int port_, + ffi.Pointer that, + ffi.Pointer e, + ) { + return _frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event( + port_, + that, + e, + ); + } + + late final _frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_eventPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Int64, ffi.Pointer, + ffi.Pointer)>>( + 'frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event'); + late final _frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_event = + _frbgen_breez_liquid_wire__crate__bindings__binding_event_listener_on_eventPtr.asFunction< + void Function( + int, ffi.Pointer, ffi.Pointer)>(); + void frbgen_breez_liquid_wire__crate__bindings__breez_log_stream( int port_, ffi.Pointer s, @@ -367,6 +389,18 @@ class FlutterBreezLiquidBindings { _frbgen_breez_liquid_cst_new_box_autoadd_backup_requestPtr .asFunction Function()>(); + ffi.Pointer + frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener() { + return _frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener(); + } + + late final _frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listenerPtr = + _lookup Function()>>( + 'frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener'); + late final _frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listener = + _frbgen_breez_liquid_cst_new_box_autoadd_binding_event_listenerPtr + .asFunction Function()>(); + ffi.Pointer frbgen_breez_liquid_cst_new_box_autoadd_connect_request() { return _frbgen_breez_liquid_cst_new_box_autoadd_connect_request(); } @@ -389,6 +423,17 @@ class FlutterBreezLiquidBindings { _frbgen_breez_liquid_cst_new_box_autoadd_get_info_requestPtr .asFunction Function()>(); + ffi.Pointer frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event() { + return _frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event(); + } + + late final _frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_eventPtr = + _lookup Function()>>( + 'frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event'); + late final _frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_event = + _frbgen_breez_liquid_cst_new_box_autoadd_liquid_sdk_eventPtr + .asFunction Function()>(); + ffi.Pointer frbgen_breez_liquid_cst_new_box_autoadd_payment() { return _frbgen_breez_liquid_cst_new_box_autoadd_payment(); } @@ -602,24 +647,8 @@ final class wire_cst_prepare_send_response extends ffi.Struct { external int fees_sat; } -final class wire_cst_config extends ffi.Struct { - external ffi.Pointer boltz_url; - - external ffi.Pointer electrum_url; - - external ffi.Pointer working_dir; - - @ffi.Int32() - external int network; - - @ffi.Uint64() - external int payment_timeout_sec; -} - -final class wire_cst_connect_request extends ffi.Struct { - external ffi.Pointer mnemonic; - - external wire_cst_config config; +final class wire_cst_binding_event_listener extends ffi.Struct { + external ffi.Pointer stream; } final class wire_cst_payment extends ffi.Struct { @@ -649,6 +678,71 @@ final class wire_cst_payment extends ffi.Struct { external int status; } +final class wire_cst_LiquidSdkEvent_PaymentFailed extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentPending extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentRefunded extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentRefundPending extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentSucceeded extends ffi.Struct { + external ffi.Pointer details; +} + +final class wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation extends ffi.Struct { + external ffi.Pointer details; +} + +final class LiquidSdkEventKind extends ffi.Union { + external wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed; + + external wire_cst_LiquidSdkEvent_PaymentPending PaymentPending; + + external wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded; + + external wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending; + + external wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded; + + external wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation; +} + +final class wire_cst_liquid_sdk_event extends ffi.Struct { + @ffi.Int32() + external int tag; + + external LiquidSdkEventKind kind; +} + +final class wire_cst_config extends ffi.Struct { + external ffi.Pointer boltz_url; + + external ffi.Pointer electrum_url; + + external ffi.Pointer working_dir; + + @ffi.Int32() + external int network; + + @ffi.Uint64() + external int payment_timeout_sec; +} + +final class wire_cst_connect_request extends ffi.Struct { + external ffi.Pointer mnemonic; + + external wire_cst_config config; +} + final class wire_cst_list_payment extends ffi.Struct { external ffi.Pointer ptr; @@ -722,51 +816,6 @@ final class wire_cst_liquid_sdk_error extends ffi.Struct { external LiquidSdkErrorKind kind; } -final class wire_cst_LiquidSdkEvent_PaymentFailed extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentPending extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentRefunded extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentRefundPending extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentSucceeded extends ffi.Struct { - external ffi.Pointer details; -} - -final class wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation extends ffi.Struct { - external ffi.Pointer details; -} - -final class LiquidSdkEventKind extends ffi.Union { - external wire_cst_LiquidSdkEvent_PaymentFailed PaymentFailed; - - external wire_cst_LiquidSdkEvent_PaymentPending PaymentPending; - - external wire_cst_LiquidSdkEvent_PaymentRefunded PaymentRefunded; - - external wire_cst_LiquidSdkEvent_PaymentRefundPending PaymentRefundPending; - - external wire_cst_LiquidSdkEvent_PaymentSucceeded PaymentSucceeded; - - external wire_cst_LiquidSdkEvent_PaymentWaitingConfirmation PaymentWaitingConfirmation; -} - -final class wire_cst_liquid_sdk_event extends ffi.Struct { - @ffi.Int32() - external int tag; - - external LiquidSdkEventKind kind; -} - final class wire_cst_ln_invoice extends ffi.Struct { external ffi.Pointer bolt11;