From 9f2f58d6295977b23d6721d3f813beeb4d0a558d Mon Sep 17 00:00:00 2001 From: Ross Savage Date: Fri, 13 Dec 2024 23:34:38 +0100 Subject: [PATCH] Add ExternalInputParser mirror for frb --- .../include/breez_sdk_liquid.h | 26 +- .../include/breez_sdk_liquidFFI.h | 10 +- lib/core/src/bindings.rs | 7 + lib/core/src/frb_generated.rs | 296 +++++++++--------- packages/dart/lib/src/bindings.dart | 25 +- packages/dart/lib/src/frb_generated.dart | 200 ++++-------- packages/dart/lib/src/frb_generated.io.dart | 210 ++++--------- packages/dart/lib/src/model.dart | 1 - ...utter_breez_liquid_bindings_generated.dart | 146 ++++----- 9 files changed, 367 insertions(+), 554 deletions(-) diff --git a/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h b/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h index 0ed007dd1..effb4b2ea 100644 --- a/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h +++ b/lib/bindings/langs/flutter/breez_sdk_liquid/include/breez_sdk_liquid.h @@ -489,10 +489,16 @@ typedef struct wire_cst_sdk_event { union SdkEventKind kind; } wire_cst_sdk_event; -typedef struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser { - uintptr_t *ptr; +typedef struct wire_cst_external_input_parser { + struct wire_cst_list_prim_u_8_strict *provider_id; + struct wire_cst_list_prim_u_8_strict *input_regex; + struct wire_cst_list_prim_u_8_strict *parser_url; +} wire_cst_external_input_parser; + +typedef struct wire_cst_list_external_input_parser { + struct wire_cst_external_input_parser *ptr; int32_t len; -} wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser; +} wire_cst_list_external_input_parser; typedef struct wire_cst_config { struct wire_cst_list_prim_u_8_strict *liquid_electrum_url; @@ -505,7 +511,7 @@ typedef struct wire_cst_config { uint32_t zero_conf_min_fee_rate_msat; uint64_t *zero_conf_max_amount_sat; struct wire_cst_list_prim_u_8_strict *breez_api_key; - struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser *external_input_parsers; + struct wire_cst_list_external_input_parser *external_input_parsers; } wire_cst_config; typedef struct wire_cst_connect_request { @@ -1182,10 +1188,6 @@ void frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust void frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk(const void *ptr); -void frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser(const void *ptr); - -void frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser(const void *ptr); - struct wire_cst_aes_success_action_data *frbgen_breez_liquid_cst_new_box_autoadd_aes_success_action_data(void); struct wire_cst_aes_success_action_data_decrypted *frbgen_breez_liquid_cst_new_box_autoadd_aes_success_action_data_decrypted(void); @@ -1286,10 +1288,10 @@ uint64_t *frbgen_breez_liquid_cst_new_box_autoadd_u_64(uint64_t value); struct wire_cst_url_success_action_data *frbgen_breez_liquid_cst_new_box_autoadd_url_success_action_data(void); -struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser *frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser(int32_t len); - struct wire_cst_list_String *frbgen_breez_liquid_cst_new_list_String(int32_t len); +struct wire_cst_list_external_input_parser *frbgen_breez_liquid_cst_new_list_external_input_parser(int32_t len); + struct wire_cst_list_fiat_currency *frbgen_breez_liquid_cst_new_list_fiat_currency(int32_t len); struct wire_cst_list_ln_offer_blinded_path *frbgen_breez_liquid_cst_new_list_ln_offer_blinded_path(int32_t len); @@ -1363,8 +1365,8 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_u_32); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_u_64); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_box_autoadd_url_success_action_data); - dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_String); + dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_external_input_parser); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_fiat_currency); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_ln_offer_blinded_path); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_locale_overrides); @@ -1377,9 +1379,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_route_hint); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_cst_new_list_route_hint_hop); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk); - dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk); - dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_add_event_listener); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_backup); dummy_var ^= ((int64_t) (void*) frbgen_breez_liquid_wire__crate__bindings__BindingLiquidSdk_buy_bitcoin); diff --git a/lib/bindings/langs/flutter/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h b/lib/bindings/langs/flutter/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h index 87abfcedd..4295729cb 100644 --- a/lib/bindings/langs/flutter/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h +++ b/lib/bindings/langs/flutter/breez_sdk_liquidFFI/include/breez_sdk_liquidFFI.h @@ -97,6 +97,8 @@ RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_lnurl_pay ); RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_lnurl_withdraw(void*_Nonnull ptr, RustBuffer req, RustCallStatus *_Nonnull out_status ); +RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parse(void*_Nonnull ptr, RustBuffer input, RustCallStatus *_Nonnull out_status +); RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_pay_onchain(void*_Nonnull ptr, RustBuffer req, RustCallStatus *_Nonnull out_status ); RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_prepare_buy_bitcoin(void*_Nonnull ptr, RustBuffer req, RustCallStatus *_Nonnull out_status @@ -145,8 +147,6 @@ void*_Nonnull uniffi_breez_sdk_liquid_bindings_fn_func_connect_with_signer(RustB ); RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_default_config(RustBuffer network, RustBuffer breez_api_key, RustCallStatus *_Nonnull out_status ); -RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_parse(RustBuffer input, RustCallStatus *_Nonnull out_status -); RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_parse_invoice(RustBuffer input, RustCallStatus *_Nonnull out_status ); void uniffi_breez_sdk_liquid_bindings_fn_func_set_logger(uint64_t logger, RustCallStatus *_Nonnull out_status @@ -273,9 +273,6 @@ uint16_t uniffi_breez_sdk_liquid_bindings_checksum_func_connect_with_signer(void ); uint16_t uniffi_breez_sdk_liquid_bindings_checksum_func_default_config(void -); -uint16_t uniffi_breez_sdk_liquid_bindings_checksum_func_parse(void - ); uint16_t uniffi_breez_sdk_liquid_bindings_checksum_func_parse_invoice(void @@ -330,6 +327,9 @@ uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_lnurl ); uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_lnurl_withdraw(void +); +uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parse(void + ); uint16_t uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_pay_onchain(void diff --git a/lib/core/src/bindings.rs b/lib/core/src/bindings.rs index 153467364..13abe904b 100644 --- a/lib/core/src/bindings.rs +++ b/lib/core/src/bindings.rs @@ -297,6 +297,13 @@ pub enum _Network { Regtest, } +#[frb(mirror(ExternalInputParser))] +pub struct _ExternalInputParser { + pub provider_id: String, + pub input_regex: String, + pub parser_url: String, +} + #[frb(mirror(LNInvoice))] pub struct _LNInvoice { pub bolt11: String, diff --git a/lib/core/src/frb_generated.rs b/lib/core/src/frb_generated.rs index b00ad46b0..57c42a734 100644 --- a/lib/core/src/frb_generated.rs +++ b/lib/core/src/frb_generated.rs @@ -27,7 +27,6 @@ use crate::bindings::*; use crate::model::EventListener; -use crate::*; use flutter_rust_bridge::for_generated::byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt}; use flutter_rust_bridge::for_generated::{transform_result_dco, Lifetimeable, Lockable}; use flutter_rust_bridge::{Handler, IntoIntoDart}; @@ -1819,6 +1818,12 @@ const _: fn() = || { let _: Vec = CurrencyInfo.localized_name; let _: Vec = CurrencyInfo.locale_overrides; } + { + let ExternalInputParser = None::.unwrap(); + let _: String = ExternalInputParser.provider_id; + let _: String = ExternalInputParser.input_regex; + let _: String = ExternalInputParser.parser_url; + } { let FiatCurrency = None::.unwrap(); let _: String = FiatCurrency.id; @@ -2149,16 +2154,6 @@ impl SseDecode for BindingLiquidSdk { } } -impl SseDecode for ExternalInputParser { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut inner = , - >>::sse_decode(deserializer); - return flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(inner); - } -} - impl SseDecode for RustOpaqueNom> { @@ -2169,16 +2164,6 @@ impl SseDecode } } -impl SseDecode - for RustOpaqueNom> -{ - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { - let mut inner = ::sse_decode(deserializer); - return unsafe { decode_rust_opaque_nom(inner) }; - } -} - impl SseDecode for StreamSink { @@ -2390,7 +2375,7 @@ impl SseDecode for crate::model::Config { let mut var_zeroConfMaxAmountSat = >::sse_decode(deserializer); let mut var_breezApiKey = >::sse_decode(deserializer); let mut var_externalInputParsers = - >>::sse_decode(deserializer); + >>::sse_decode(deserializer); return crate::model::Config { liquid_electrum_url: var_liquidElectrumUrl, bitcoin_electrum_url: var_bitcoinElectrumUrl, @@ -2442,6 +2427,20 @@ impl SseDecode for crate::bindings::CurrencyInfo { } } +impl SseDecode for crate::bindings::ExternalInputParser { + // 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_providerId = ::sse_decode(deserializer); + let mut var_inputRegex = ::sse_decode(deserializer); + let mut var_parserUrl = ::sse_decode(deserializer); + return crate::bindings::ExternalInputParser { + provider_id: var_providerId, + input_regex: var_inputRegex, + parser_url: var_parserUrl, + }; + } +} + impl SseDecode for f64 { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { @@ -2633,25 +2632,27 @@ impl SseDecode for crate::model::LiquidNetwork { } } -impl SseDecode for Vec { +impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut len_ = ::sse_decode(deserializer); let mut ans_ = vec![]; for idx_ in 0..len_ { - ans_.push(::sse_decode(deserializer)); + ans_.push(::sse_decode(deserializer)); } return ans_; } } -impl SseDecode for Vec { +impl SseDecode for Vec { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { let mut len_ = ::sse_decode(deserializer); let mut ans_ = vec![]; for idx_ in 0..len_ { - ans_.push(::sse_decode(deserializer)); + ans_.push(::sse_decode( + deserializer, + )); } return ans_; } @@ -3462,11 +3463,13 @@ impl SseDecode for Option { } } -impl SseDecode for Option> { +impl SseDecode for Option> { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_decode(deserializer: &mut flutter_rust_bridge::for_generated::SseDeserializer) -> Self { if (::sse_decode(deserializer)) { - return Some(>::sse_decode(deserializer)); + return Some(>::sse_decode( + deserializer, + )); } else { return None; } @@ -4343,24 +4346,6 @@ impl flutter_rust_bridge::IntoIntoDart> for Binding } } -// Codec=Dco (DartCObject based), see doc to use other codecs -impl flutter_rust_bridge::IntoDart for FrbWrapper { - fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { - flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self.0) - .into_dart() - } -} -impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive - for FrbWrapper -{ -} - -impl flutter_rust_bridge::IntoIntoDart> for ExternalInputParser { - fn into_into_dart(self) -> FrbWrapper { - self.into() - } -} - // Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for FrbWrapper { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { @@ -4671,6 +4656,28 @@ impl flutter_rust_bridge::IntoIntoDart } } // Codec=Dco (DartCObject based), see doc to use other codecs +impl flutter_rust_bridge::IntoDart for FrbWrapper { + fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { + [ + self.0.provider_id.into_into_dart().into_dart(), + self.0.input_regex.into_into_dart().into_dart(), + self.0.parser_url.into_into_dart().into_dart(), + ] + .into_dart() + } +} +impl flutter_rust_bridge::for_generated::IntoDartExceptPrimitive + for FrbWrapper +{ +} +impl flutter_rust_bridge::IntoIntoDart> + for crate::bindings::ExternalInputParser +{ + fn into_into_dart(self) -> FrbWrapper { + self.into() + } +} +// Codec=Dco (DartCObject based), see doc to use other codecs impl flutter_rust_bridge::IntoDart for FrbWrapper { fn into_dart(self) -> flutter_rust_bridge::for_generated::DartAbi { [ @@ -6490,13 +6497,6 @@ impl SseEncode for BindingLiquidSdk { } } -impl SseEncode for ExternalInputParser { - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - >>::sse_encode(flutter_rust_bridge::for_generated::rust_auto_opaque_encode::<_, StdArc<_>>(self), serializer); - } -} - impl SseEncode for RustOpaqueNom> { @@ -6508,17 +6508,6 @@ impl SseEncode } } -impl SseEncode - for RustOpaqueNom> -{ - // Codec=Sse (Serialization based), see doc to use other codecs - fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { - let (ptr, size) = self.sse_encode_raw(); - ::sse_encode(ptr, serializer); - ::sse_encode(size, serializer); - } -} - impl SseEncode for StreamSink { @@ -6687,7 +6676,10 @@ impl SseEncode for crate::model::Config { ::sse_encode(self.zero_conf_min_fee_rate_msat, serializer); >::sse_encode(self.zero_conf_max_amount_sat, serializer); >::sse_encode(self.breez_api_key, serializer); - >>::sse_encode(self.external_input_parsers, serializer); + >>::sse_encode( + self.external_input_parsers, + serializer, + ); } } @@ -6712,6 +6704,15 @@ impl SseEncode for crate::bindings::CurrencyInfo { } } +impl SseEncode for crate::bindings::ExternalInputParser { + // 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.provider_id, serializer); + ::sse_encode(self.input_regex, serializer); + ::sse_encode(self.parser_url, serializer); + } +} + impl SseEncode for f64 { // Codec=Sse (Serialization based), see doc to use other codecs fn sse_encode(self, serializer: &mut flutter_rust_bridge::for_generated::SseSerializer) { @@ -6863,22 +6864,22 @@ impl SseEncode for crate::model::LiquidNetwork { } } -impl SseEncode for Vec { +impl SseEncode for Vec { // 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.len() as _, serializer); for item in self { - ::sse_encode(item, serializer); + ::sse_encode(item, serializer); } } } -impl SseEncode for Vec { +impl SseEncode for Vec { // 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.len() as _, serializer); for item in self { - ::sse_encode(item, serializer); + ::sse_encode(item, serializer); } } } @@ -7520,12 +7521,12 @@ impl SseEncode for Option { } } -impl SseEncode for Option> { +impl SseEncode for Option> { // 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.is_some(), serializer); if let Some(value) = self { - >::sse_encode(value, serializer); + >::sse_encode(value, serializer); } } } @@ -8201,7 +8202,6 @@ mod io { use super::*; use crate::bindings::*; use crate::model::EventListener; - use crate::*; use flutter_rust_bridge::for_generated::byteorder::{ NativeEndian, ReadBytesExt, WriteBytesExt, }; @@ -8234,18 +8234,6 @@ mod io { )) } } - impl CstDecode for usize { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> ExternalInputParser { - flutter_rust_bridge::for_generated::rust_auto_opaque_decode_owned(CstDecode::< - RustOpaqueNom< - flutter_rust_bridge::for_generated::RustAutoOpaqueInner, - >, - >::cst_decode( - self - )) - } - } impl CstDecode< RustOpaqueNom< @@ -8261,22 +8249,6 @@ mod io { unsafe { decode_rust_opaque_nom(self as _) } } } - impl - CstDecode< - RustOpaqueNom< - flutter_rust_bridge::for_generated::RustAutoOpaqueInner, - >, - > for usize - { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode( - self, - ) -> RustOpaqueNom< - flutter_rust_bridge::for_generated::RustAutoOpaqueInner, - > { - unsafe { decode_rust_opaque_nom(self as _) } - } - } impl CstDecode> for *mut wire_cst_list_prim_u_8_strict { @@ -8828,6 +8800,16 @@ mod io { } } } + impl CstDecode for wire_cst_external_input_parser { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> crate::bindings::ExternalInputParser { + crate::bindings::ExternalInputParser { + provider_id: self.provider_id.cst_decode(), + input_regex: self.input_regex.cst_decode(), + parser_url: self.parser_url.cst_decode(), + } + } + } impl CstDecode for wire_cst_fiat_currency { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> crate::bindings::FiatCurrency { @@ -8965,16 +8947,6 @@ mod io { } } } - impl CstDecode> for *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser { - // Codec=Cst (C-struct based), see doc to use other codecs - fn cst_decode(self) -> Vec { - let vec = unsafe { - let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); - flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) - }; - vec.into_iter().map(CstDecode::cst_decode).collect() - } - } impl CstDecode> for *mut wire_cst_list_String { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -8985,6 +8957,18 @@ mod io { vec.into_iter().map(CstDecode::cst_decode).collect() } } + impl CstDecode> + for *mut wire_cst_list_external_input_parser + { + // Codec=Cst (C-struct based), see doc to use other codecs + fn cst_decode(self) -> Vec { + let vec = unsafe { + let wrap = flutter_rust_bridge::for_generated::box_from_leak_ptr(self); + flutter_rust_bridge::for_generated::vec_from_leak_ptr(wrap.ptr, wrap.len) + }; + vec.into_iter().map(CstDecode::cst_decode).collect() + } + } impl CstDecode> for *mut wire_cst_list_fiat_currency { // Codec=Cst (C-struct based), see doc to use other codecs fn cst_decode(self) -> Vec { @@ -10286,6 +10270,20 @@ mod io { Self::new_with_null_ptr() } } + impl NewWithNullPtr for wire_cst_external_input_parser { + fn new_with_null_ptr() -> Self { + Self { + provider_id: core::ptr::null_mut(), + input_regex: core::ptr::null_mut(), + parser_url: core::ptr::null_mut(), + } + } + } + impl Default for wire_cst_external_input_parser { + fn default() -> Self { + Self::new_with_null_ptr() + } + } impl NewWithNullPtr for wire_cst_fiat_currency { fn new_with_null_ptr() -> Self { Self { @@ -11614,24 +11612,6 @@ mod io { } } - #[no_mangle] - pub extern "C" fn frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ptr: *const std::ffi::c_void, - ) { - unsafe { - StdArc::>::increment_strong_count(ptr as _); - } - } - - #[no_mangle] - pub extern "C" fn frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ptr: *const std::ffi::c_void, - ) { - unsafe { - StdArc::>::decrement_strong_count(ptr as _); - } - } - #[no_mangle] pub extern "C" fn frbgen_breez_liquid_cst_new_box_autoadd_aes_success_action_data( ) -> *mut wire_cst_aes_success_action_data { @@ -12003,12 +11983,6 @@ mod io { ) } - #[no_mangle] - pub extern "C" fn frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser(len: i32) -> *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser{ - let wrap = wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser { ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr(Default::default(), len), len }; - flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) - } - #[no_mangle] pub extern "C" fn frbgen_breez_liquid_cst_new_list_String( len: i32, @@ -12023,6 +11997,20 @@ mod io { flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) } + #[no_mangle] + pub extern "C" fn frbgen_breez_liquid_cst_new_list_external_input_parser( + len: i32, + ) -> *mut wire_cst_list_external_input_parser { + let wrap = wire_cst_list_external_input_parser { + ptr: flutter_rust_bridge::for_generated::new_leak_vec_ptr( + ::new_with_null_ptr(), + len, + ), + len, + }; + flutter_rust_bridge::for_generated::new_leak_box_ptr(wrap) + } + #[no_mangle] pub extern "C" fn frbgen_breez_liquid_cst_new_list_fiat_currency( len: i32, @@ -12268,17 +12256,19 @@ mod io { } #[repr(C)] #[derive(Clone, Copy)] - pub struct wire_cst_config { liquid_electrum_url: *mut wire_cst_list_prim_u_8_strict, -bitcoin_electrum_url: *mut wire_cst_list_prim_u_8_strict, -mempoolspace_url: *mut wire_cst_list_prim_u_8_strict, -working_dir: *mut wire_cst_list_prim_u_8_strict, -cache_dir: *mut wire_cst_list_prim_u_8_strict, -network: i32, -payment_timeout_sec: u64, -zero_conf_min_fee_rate_msat: u32, -zero_conf_max_amount_sat: *mut u64, -breez_api_key: *mut wire_cst_list_prim_u_8_strict, -external_input_parsers: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser } + pub struct wire_cst_config { + liquid_electrum_url: *mut wire_cst_list_prim_u_8_strict, + bitcoin_electrum_url: *mut wire_cst_list_prim_u_8_strict, + mempoolspace_url: *mut wire_cst_list_prim_u_8_strict, + working_dir: *mut wire_cst_list_prim_u_8_strict, + cache_dir: *mut wire_cst_list_prim_u_8_strict, + network: i32, + payment_timeout_sec: u64, + zero_conf_min_fee_rate_msat: u32, + zero_conf_max_amount_sat: *mut u64, + breez_api_key: *mut wire_cst_list_prim_u_8_strict, + external_input_parsers: *mut wire_cst_list_external_input_parser, + } #[repr(C)] #[derive(Clone, Copy)] pub struct wire_cst_connect_request { @@ -12298,6 +12288,13 @@ external_input_parsers: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_br } #[repr(C)] #[derive(Clone, Copy)] + pub struct wire_cst_external_input_parser { + provider_id: *mut wire_cst_list_prim_u_8_strict, + input_regex: *mut wire_cst_list_prim_u_8_strict, + parser_url: *mut wire_cst_list_prim_u_8_strict, + } + #[repr(C)] + #[derive(Clone, Copy)] pub struct wire_cst_fiat_currency { id: *mut wire_cst_list_prim_u_8_strict, info: wire_cst_currency_info, @@ -12424,15 +12421,14 @@ external_input_parsers: *mut wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_br } #[repr(C)] #[derive(Clone, Copy)] - pub struct wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser - { - ptr: *mut usize, + pub struct wire_cst_list_String { + ptr: *mut *mut wire_cst_list_prim_u_8_strict, len: i32, } #[repr(C)] #[derive(Clone, Copy)] - pub struct wire_cst_list_String { - ptr: *mut *mut wire_cst_list_prim_u_8_strict, + pub struct wire_cst_list_external_input_parser { + ptr: *mut wire_cst_external_input_parser, len: i32, } #[repr(C)] diff --git a/packages/dart/lib/src/bindings.dart b/packages/dart/lib/src/bindings.dart index bf946fbd4..0a74cf709 100644 --- a/packages/dart/lib/src/bindings.dart +++ b/packages/dart/lib/src/bindings.dart @@ -6,7 +6,6 @@ import 'bindings/duplicates.dart'; import 'error.dart'; import 'frb_generated.dart'; -import 'lib.dart'; import 'model.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; @@ -264,6 +263,30 @@ class CurrencyInfo { localeOverrides == other.localeOverrides; } +class ExternalInputParser { + final String providerId; + final String inputRegex; + final String parserUrl; + + const ExternalInputParser({ + required this.providerId, + required this.inputRegex, + required this.parserUrl, + }); + + @override + int get hashCode => providerId.hashCode ^ inputRegex.hashCode ^ parserUrl.hashCode; + + @override + bool operator ==(Object other) => + identical(this, other) || + other is ExternalInputParser && + runtimeType == other.runtimeType && + providerId == other.providerId && + inputRegex == other.inputRegex && + parserUrl == other.parserUrl; +} + class FiatCurrency { final String id; final CurrencyInfo info; diff --git a/packages/dart/lib/src/frb_generated.dart b/packages/dart/lib/src/frb_generated.dart index 80fb01ecb..9c35c17ce 100644 --- a/packages/dart/lib/src/frb_generated.dart +++ b/packages/dart/lib/src/frb_generated.dart @@ -10,7 +10,6 @@ import 'dart:convert'; import 'error.dart'; import 'frb_generated.dart'; import 'frb_generated.io.dart' if (dart.library.js_interop) 'frb_generated.web.dart'; -import 'lib.dart'; import 'model.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; @@ -185,12 +184,6 @@ abstract class RustLibApi extends BaseApi { RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_BindingLiquidSdk; CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BindingLiquidSdkPtr; - - RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_ExternalInputParser; - - RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_ExternalInputParser; - - CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ExternalInputParserPtr; } class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { @@ -1212,12 +1205,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_BindingLiquidSdk => wire .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk; - RustArcIncrementStrongCountFnType get rust_arc_increment_strong_count_ExternalInputParser => wire - .rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser; - - RustArcDecrementStrongCountFnType get rust_arc_decrement_strong_count_ExternalInputParser => wire - .rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser; - @protected AnyhowException dco_decode_AnyhowException(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1232,14 +1219,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return BindingLiquidSdkImpl.frbInternalDcoDecode(raw as List); } - @protected - ExternalInputParser - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return ExternalInputParserImpl.frbInternalDcoDecode(raw as List); - } - @protected BindingLiquidSdk dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( @@ -1255,14 +1234,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return BindingLiquidSdkImpl.frbInternalDcoDecode(raw as List); } - @protected - ExternalInputParser - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw) { - // Codec=Dco (DartCObject based), see doc to use other codecs - return ExternalInputParserImpl.frbInternalDcoDecode(raw as List); - } - @protected RustStreamSink dco_decode_StreamSink_log_entry_Dco(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1734,9 +1705,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { zeroConfMinFeeRateMsat: dco_decode_u_32(arr[7]), zeroConfMaxAmountSat: dco_decode_opt_box_autoadd_u_64(arr[8]), breezApiKey: dco_decode_opt_String(arr[9]), - externalInputParsers: - dco_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - arr[10]), + externalInputParsers: dco_decode_opt_list_external_input_parser(arr[10]), ); } @@ -1767,6 +1736,18 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { ); } + @protected + ExternalInputParser dco_decode_external_input_parser(dynamic raw) { + // Codec=Dco (DartCObject based), see doc to use other codecs + final arr = raw as List; + if (arr.length != 3) throw Exception('unexpected arr length: expect 3 but see ${arr.length}'); + return ExternalInputParser( + providerId: dco_decode_String(arr[0]), + inputRegex: dco_decode_String(arr[1]), + parserUrl: dco_decode_String(arr[2]), + ); + } + @protected double dco_decode_f_64(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs @@ -1917,20 +1898,15 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - List - dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw) { + List dco_decode_list_String(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return (raw as List) - .map( - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser) - .toList(); + return (raw as List).map(dco_decode_String).toList(); } @protected - List dco_decode_list_String(dynamic raw) { + List dco_decode_list_external_input_parser(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return (raw as List).map(dco_decode_String).toList(); + return (raw as List).map(dco_decode_external_input_parser).toList(); } @protected @@ -2494,14 +2470,9 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - List? - dco_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw) { + List? dco_decode_opt_list_external_input_parser(dynamic raw) { // Codec=Dco (DartCObject based), see doc to use other codecs - return raw == null - ? null - : dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - raw); + return raw == null ? null : dco_decode_list_external_input_parser(raw); } @protected @@ -3173,15 +3144,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } - @protected - ExternalInputParser - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return ExternalInputParserImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); - } - @protected BindingLiquidSdk sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( @@ -3199,15 +3161,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); } - @protected - ExternalInputParser - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - return ExternalInputParserImpl.frbInternalSseDecode( - sse_decode_usize(deserializer), sse_decode_i_32(deserializer)); - } - @protected RustStreamSink sse_decode_StreamSink_log_entry_Dco(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3661,9 +3614,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { var var_zeroConfMinFeeRateMsat = sse_decode_u_32(deserializer); var var_zeroConfMaxAmountSat = sse_decode_opt_box_autoadd_u_64(deserializer); var var_breezApiKey = sse_decode_opt_String(deserializer); - var var_externalInputParsers = - sse_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - deserializer); + var var_externalInputParsers = sse_decode_opt_list_external_input_parser(deserializer); return Config( liquidElectrumUrl: var_liquidElectrumUrl, bitcoinElectrumUrl: var_bitcoinElectrumUrl, @@ -3706,6 +3657,16 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { localeOverrides: var_localeOverrides); } + @protected + ExternalInputParser sse_decode_external_input_parser(SseDeserializer deserializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + var var_providerId = sse_decode_String(deserializer); + var var_inputRegex = sse_decode_String(deserializer); + var var_parserUrl = sse_decode_String(deserializer); + return ExternalInputParser( + providerId: var_providerId, inputRegex: var_inputRegex, parserUrl: var_parserUrl); + } + @protected double sse_decode_f_64(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -3846,29 +3807,25 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - List - sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer) { + List sse_decode_list_String(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); - var ans_ = []; + var ans_ = []; for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add( - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - deserializer)); + ans_.add(sse_decode_String(deserializer)); } return ans_; } @protected - List sse_decode_list_String(SseDeserializer deserializer) { + List sse_decode_list_external_input_parser(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs var len_ = sse_decode_i_32(deserializer); - var ans_ = []; + var ans_ = []; for (var idx_ = 0; idx_ < len_; ++idx_) { - ans_.add(sse_decode_String(deserializer)); + ans_.add(sse_decode_external_input_parser(deserializer)); } return ans_; } @@ -4532,14 +4489,11 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - List? - sse_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer) { + List? sse_decode_opt_list_external_input_parser(SseDeserializer deserializer) { // Codec=Sse (Serialization based), see doc to use other codecs if (sse_decode_bool(deserializer)) { - return (sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - deserializer)); + return (sse_decode_list_external_input_parser(deserializer)); } else { return null; } @@ -5165,14 +5119,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return (raw as BindingLiquidSdkImpl).frbInternalCstEncode(move: true); } - @protected - int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser raw) { - // Codec=Cst (C-struct based), see doc to use other codecs -// ignore: invalid_use_of_internal_member - return (raw as ExternalInputParserImpl).frbInternalCstEncode(move: true); - } - @protected int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk raw) { @@ -5189,14 +5135,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { return (raw as BindingLiquidSdkImpl).frbInternalCstEncode(); } - @protected - int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser raw) { - // Codec=Cst (C-struct based), see doc to use other codecs -// ignore: invalid_use_of_internal_member - return (raw as ExternalInputParserImpl).frbInternalCstEncode(); - } - @protected bool cst_encode_bool(bool raw) { // Codec=Cst (C-struct based), see doc to use other codecs @@ -5288,14 +5226,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_usize((self as BindingLiquidSdkImpl).frbInternalSseEncode(move: true), serializer); } - @protected - void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize((self as ExternalInputParserImpl).frbInternalSseEncode(move: true), serializer); - } - @protected void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer) { @@ -5310,13 +5240,6 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_usize((self as BindingLiquidSdkImpl).frbInternalSseEncode(move: null), serializer); } - @protected - void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser self, SseSerializer serializer) { - // Codec=Sse (Serialization based), see doc to use other codecs - sse_encode_usize((self as ExternalInputParserImpl).frbInternalSseEncode(move: null), serializer); - } - @protected void sse_encode_StreamSink_log_entry_Dco(RustStreamSink self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5771,8 +5694,7 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_u_32(self.zeroConfMinFeeRateMsat, serializer); sse_encode_opt_box_autoadd_u_64(self.zeroConfMaxAmountSat, serializer); sse_encode_opt_String(self.breezApiKey, serializer); - sse_encode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - self.externalInputParsers, serializer); + sse_encode_opt_list_external_input_parser(self.externalInputParsers, serializer); } @protected @@ -5794,6 +5716,14 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { sse_encode_list_locale_overrides(self.localeOverrides, serializer); } + @protected + void sse_encode_external_input_parser(ExternalInputParser self, SseSerializer serializer) { + // Codec=Sse (Serialization based), see doc to use other codecs + sse_encode_String(self.providerId, serializer); + sse_encode_String(self.inputRegex, serializer); + sse_encode_String(self.parserUrl, serializer); + } + @protected void sse_encode_f_64(double self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs @@ -5914,23 +5844,20 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - void - sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - List self, SseSerializer serializer) { + void sse_encode_list_String(List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - item, serializer); + sse_encode_String(item, serializer); } } @protected - void sse_encode_list_String(List self, SseSerializer serializer) { + void sse_encode_list_external_input_parser(List self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_i_32(self.length, serializer); for (final item in self) { - sse_encode_String(item, serializer); + sse_encode_external_input_parser(item, serializer); } } @@ -6479,15 +6406,12 @@ class RustLibApiImpl extends RustLibApiImplPlatform implements RustLibApi { } @protected - void - sse_encode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - List? self, SseSerializer serializer) { + void sse_encode_opt_list_external_input_parser(List? self, SseSerializer serializer) { // Codec=Sse (Serialization based), see doc to use other codecs sse_encode_bool(self != null, serializer); if (self != null) { - sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - self, serializer); + sse_encode_list_external_input_parser(self, serializer); } } @@ -7150,21 +7074,3 @@ class BindingLiquidSdkImpl extends RustOpaque implements BindingLiquidSdk { that: this, ); } - -@sealed -class ExternalInputParserImpl extends RustOpaque implements ExternalInputParser { - // Not to be used by end users - ExternalInputParserImpl.frbInternalDcoDecode(List wire) - : super.frbInternalDcoDecode(wire, _kStaticData); - - // Not to be used by end users - ExternalInputParserImpl.frbInternalSseDecode(BigInt ptr, int externalSizeOnNative) - : super.frbInternalSseDecode(ptr, externalSizeOnNative, _kStaticData); - - static final _kStaticData = RustArcStaticData( - rustArcIncrementStrongCount: RustLib.instance.api.rust_arc_increment_strong_count_ExternalInputParser, - rustArcDecrementStrongCount: RustLib.instance.api.rust_arc_decrement_strong_count_ExternalInputParser, - rustArcDecrementStrongCountPtr: - RustLib.instance.api.rust_arc_decrement_strong_count_ExternalInputParserPtr, - ); -} diff --git a/packages/dart/lib/src/frb_generated.io.dart b/packages/dart/lib/src/frb_generated.io.dart index 5dd1c68a8..f3fd3ea82 100644 --- a/packages/dart/lib/src/frb_generated.io.dart +++ b/packages/dart/lib/src/frb_generated.io.dart @@ -10,7 +10,6 @@ import 'dart:convert'; import 'dart:ffi' as ffi; import 'error.dart'; import 'frb_generated.dart'; -import 'lib.dart'; import 'model.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated_io.dart'; @@ -25,9 +24,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_BindingLiquidSdkPtr => wire ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr; - CrossPlatformFinalizerArg get rust_arc_decrement_strong_count_ExternalInputParserPtr => wire - ._rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr; - @protected AnyhowException dco_decode_AnyhowException(dynamic raw); @@ -36,11 +32,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( dynamic raw); - @protected - ExternalInputParser - dco_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw); - @protected BindingLiquidSdk dco_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( @@ -50,11 +41,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { BindingLiquidSdk dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( dynamic raw); - @protected - ExternalInputParser - dco_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw); - @protected RustStreamSink dco_decode_StreamSink_log_entry_Dco(dynamic raw); @@ -259,6 +245,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected CurrencyInfo dco_decode_currency_info(dynamic raw); + @protected + ExternalInputParser dco_decode_external_input_parser(dynamic raw); + @protected double dco_decode_f_64(dynamic raw); @@ -293,12 +282,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { LiquidNetwork dco_decode_liquid_network(dynamic raw); @protected - List - dco_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw); + List dco_decode_list_String(dynamic raw); @protected - List dco_decode_list_String(dynamic raw); + List dco_decode_list_external_input_parser(dynamic raw); @protected List dco_decode_list_fiat_currency(dynamic raw); @@ -451,9 +438,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { BigInt? dco_decode_opt_box_autoadd_u_64(dynamic raw); @protected - List? - dco_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - dynamic raw); + List? dco_decode_opt_list_external_input_parser(dynamic raw); @protected List? dco_decode_opt_list_payment_type(dynamic raw); @@ -607,11 +592,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( SseDeserializer deserializer); - @protected - ExternalInputParser - sse_decode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer); - @protected BindingLiquidSdk sse_decode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( @@ -621,11 +601,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { BindingLiquidSdk sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( SseDeserializer deserializer); - @protected - ExternalInputParser - sse_decode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer); - @protected RustStreamSink sse_decode_StreamSink_log_entry_Dco(SseDeserializer deserializer); @@ -832,6 +807,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected CurrencyInfo sse_decode_currency_info(SseDeserializer deserializer); + @protected + ExternalInputParser sse_decode_external_input_parser(SseDeserializer deserializer); + @protected double sse_decode_f_64(SseDeserializer deserializer); @@ -866,12 +844,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { LiquidNetwork sse_decode_liquid_network(SseDeserializer deserializer); @protected - List - sse_decode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer); + List sse_decode_list_String(SseDeserializer deserializer); @protected - List sse_decode_list_String(SseDeserializer deserializer); + List sse_decode_list_external_input_parser(SseDeserializer deserializer); @protected List sse_decode_list_fiat_currency(SseDeserializer deserializer); @@ -1024,9 +1000,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { BigInt? sse_decode_opt_box_autoadd_u_64(SseDeserializer deserializer); @protected - List? - sse_decode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - SseDeserializer deserializer); + List? sse_decode_opt_list_external_input_parser(SseDeserializer deserializer); @protected List? sse_decode_opt_list_payment_type(SseDeserializer deserializer); @@ -1634,28 +1608,22 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - List raw) { + ffi.Pointer cst_encode_list_String(List raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ans = wire - .cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - raw.length); + final ans = wire.cst_new_list_String(raw.length); for (var i = 0; i < raw.length; ++i) { - ans.ref.ptr[i] = - cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - raw[i]); + ans.ref.ptr[i] = cst_encode_String(raw[i]); } return ans; } @protected - ffi.Pointer cst_encode_list_String(List raw) { + ffi.Pointer cst_encode_list_external_input_parser( + List raw) { // Codec=Cst (C-struct based), see doc to use other codecs - final ans = wire.cst_new_list_String(raw.length); + final ans = wire.cst_new_list_external_input_parser(raw.length); for (var i = 0; i < raw.length; ++i) { - ans.ref.ptr[i] = cst_encode_String(raw[i]); + cst_api_fill_to_wire_external_input_parser(raw[i], ans.ref.ptr[i]); } return ans; } @@ -1850,15 +1818,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { } @protected - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - cst_encode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - List? raw) { + ffi.Pointer cst_encode_opt_list_external_input_parser( + List? raw) { // Codec=Cst (C-struct based), see doc to use other codecs - return raw == null - ? ffi.nullptr - : cst_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - raw); + return raw == null ? ffi.nullptr : cst_encode_list_external_input_parser(raw); } @protected @@ -2248,9 +2211,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { wireObj.zero_conf_min_fee_rate_msat = cst_encode_u_32(apiObj.zeroConfMinFeeRateMsat); wireObj.zero_conf_max_amount_sat = cst_encode_opt_box_autoadd_u_64(apiObj.zeroConfMaxAmountSat); wireObj.breez_api_key = cst_encode_opt_String(apiObj.breezApiKey); - wireObj.external_input_parsers = - cst_encode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - apiObj.externalInputParsers); + wireObj.external_input_parsers = cst_encode_opt_list_external_input_parser(apiObj.externalInputParsers); } @protected @@ -2270,6 +2231,14 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { wireObj.locale_overrides = cst_encode_list_locale_overrides(apiObj.localeOverrides); } + @protected + void cst_api_fill_to_wire_external_input_parser( + ExternalInputParser apiObj, wire_cst_external_input_parser wireObj) { + wireObj.provider_id = cst_encode_String(apiObj.providerId); + wireObj.input_regex = cst_encode_String(apiObj.inputRegex); + wireObj.parser_url = cst_encode_String(apiObj.parserUrl); + } + @protected void cst_api_fill_to_wire_fiat_currency(FiatCurrency apiObj, wire_cst_fiat_currency wireObj) { wireObj.id = cst_encode_String(apiObj.id); @@ -3280,10 +3249,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk raw); - @protected - int cst_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser raw); - @protected int cst_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk raw); @@ -3292,10 +3257,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk raw); - @protected - int cst_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser raw); - @protected bool cst_encode_bool(bool raw); @@ -3342,11 +3303,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer); - @protected - void - sse_encode_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser self, SseSerializer serializer); - @protected void sse_encode_Auto_Ref_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer); @@ -3355,10 +3311,6 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdk( BindingLiquidSdk self, SseSerializer serializer); - @protected - void sse_encode_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ExternalInputParser self, SseSerializer serializer); - @protected void sse_encode_StreamSink_log_entry_Dco(RustStreamSink self, SseSerializer serializer); @@ -3572,6 +3524,9 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { @protected void sse_encode_currency_info(CurrencyInfo self, SseSerializer serializer); + @protected + void sse_encode_external_input_parser(ExternalInputParser self, SseSerializer serializer); + @protected void sse_encode_f_64(double self, SseSerializer serializer); @@ -3607,12 +3562,10 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void sse_encode_liquid_network(LiquidNetwork self, SseSerializer serializer); @protected - void - sse_encode_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - List self, SseSerializer serializer); + void sse_encode_list_String(List self, SseSerializer serializer); @protected - void sse_encode_list_String(List self, SseSerializer serializer); + void sse_encode_list_external_input_parser(List self, SseSerializer serializer); @protected void sse_encode_list_fiat_currency(List self, SseSerializer serializer); @@ -3767,9 +3720,7 @@ abstract class RustLibApiImplPlatform extends BaseApiImpl { void sse_encode_opt_box_autoadd_u_64(BigInt? self, SseSerializer serializer); @protected - void - sse_encode_opt_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - List? self, SseSerializer serializer); + void sse_encode_opt_list_external_input_parser(List? self, SseSerializer serializer); @protected void sse_encode_opt_list_payment_type(List? self, SseSerializer serializer); @@ -4712,38 +4663,6 @@ class RustLibWire implements BaseWire { _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr .asFunction)>(); - void - rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ffi.Pointer ptr, - ) { - return _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ptr, - ); - } - - late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr = - _lookup)>>( - 'frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser'); - late final _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser = - _rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr - .asFunction)>(); - - void - rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ffi.Pointer ptr, - ) { - return _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ptr, - ); - } - - late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr = - _lookup)>>( - 'frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser'); - late final _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser = - _rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr - .asFunction)>(); - ffi.Pointer cst_new_box_autoadd_aes_success_action_data() { return _cst_new_box_autoadd_aes_success_action_data(); } @@ -5273,30 +5192,6 @@ class RustLibWire implements BaseWire { late final _cst_new_box_autoadd_url_success_action_data = _cst_new_box_autoadd_url_success_action_dataPtr .asFunction Function()>(); - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - int len, - ) { - return _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - len, - ); - } - - late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr = - _lookup< - ffi.NativeFunction< - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - Function(ffi.Int32)>>( - 'frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser'); - late final _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser = - _cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr - .asFunction< - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - Function(int)>(); - ffi.Pointer cst_new_list_String( int len, ) { @@ -5311,6 +5206,20 @@ class RustLibWire implements BaseWire { late final _cst_new_list_String = _cst_new_list_StringPtr.asFunction Function(int)>(); + ffi.Pointer cst_new_list_external_input_parser( + int len, + ) { + return _cst_new_list_external_input_parser( + len, + ); + } + + late final _cst_new_list_external_input_parserPtr = + _lookup Function(ffi.Int32)>>( + 'frbgen_breez_liquid_cst_new_list_external_input_parser'); + late final _cst_new_list_external_input_parser = _cst_new_list_external_input_parserPtr + .asFunction Function(int)>(); + ffi.Pointer cst_new_list_fiat_currency( int len, ) { @@ -6121,9 +6030,16 @@ final class wire_cst_sdk_event extends ffi.Struct { external SdkEventKind kind; } -final class wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser - extends ffi.Struct { - external ffi.Pointer ptr; +final class wire_cst_external_input_parser extends ffi.Struct { + external ffi.Pointer provider_id; + + external ffi.Pointer input_regex; + + external ffi.Pointer parser_url; +} + +final class wire_cst_list_external_input_parser extends ffi.Struct { + external ffi.Pointer ptr; @ffi.Int32() external int len; @@ -6153,9 +6069,7 @@ final class wire_cst_config extends ffi.Struct { external ffi.Pointer breez_api_key; - external ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - external_input_parsers; + external ffi.Pointer external_input_parsers; } final class wire_cst_connect_request extends ffi.Struct { diff --git a/packages/dart/lib/src/model.dart b/packages/dart/lib/src/model.dart index 3895a3356..04e678623 100644 --- a/packages/dart/lib/src/model.dart +++ b/packages/dart/lib/src/model.dart @@ -5,7 +5,6 @@ import 'bindings.dart'; import 'frb_generated.dart'; -import 'lib.dart'; import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart'; import 'package:freezed_annotation/freezed_annotation.dart' hide protected; part 'model.freezed.dart'; diff --git a/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart b/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart index 5942606a6..61a89e4f4 100644 --- a/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart +++ b/packages/flutter/lib/flutter_breez_liquid_bindings_generated.dart @@ -813,38 +813,6 @@ class FlutterBreezLiquidBindings { _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerBindingLiquidSdkPtr .asFunction)>(); - void - frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ffi.Pointer ptr, - ) { - return _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ptr, - ); - } - - late final _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr = - _lookup)>>( - 'frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser'); - late final _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser = - _frbgen_breez_liquid_rust_arc_increment_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr - .asFunction)>(); - - void - frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ffi.Pointer ptr, - ) { - return _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - ptr, - ); - } - - late final _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr = - _lookup)>>( - 'frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser'); - late final _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser = - _frbgen_breez_liquid_rust_arc_decrement_strong_count_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr - .asFunction)>(); - ffi.Pointer frbgen_breez_liquid_cst_new_box_autoadd_aes_success_action_data() { return _frbgen_breez_liquid_cst_new_box_autoadd_aes_success_action_data(); @@ -1432,30 +1400,6 @@ class FlutterBreezLiquidBindings { _frbgen_breez_liquid_cst_new_box_autoadd_url_success_action_dataPtr .asFunction Function()>(); - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - int len, - ) { - return _frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser( - len, - ); - } - - late final _frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr = - _lookup< - ffi.NativeFunction< - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - Function(ffi.Int32)>>( - 'frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser'); - late final _frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser = - _frbgen_breez_liquid_cst_new_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParserPtr - .asFunction< - ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - Function(int)>(); - ffi.Pointer frbgen_breez_liquid_cst_new_list_String( int len, ) { @@ -1470,6 +1414,21 @@ class FlutterBreezLiquidBindings { late final _frbgen_breez_liquid_cst_new_list_String = _frbgen_breez_liquid_cst_new_list_StringPtr .asFunction Function(int)>(); + ffi.Pointer frbgen_breez_liquid_cst_new_list_external_input_parser( + int len, + ) { + return _frbgen_breez_liquid_cst_new_list_external_input_parser( + len, + ); + } + + late final _frbgen_breez_liquid_cst_new_list_external_input_parserPtr = + _lookup Function(ffi.Int32)>>( + 'frbgen_breez_liquid_cst_new_list_external_input_parser'); + late final _frbgen_breez_liquid_cst_new_list_external_input_parser = + _frbgen_breez_liquid_cst_new_list_external_input_parserPtr + .asFunction Function(int)>(); + ffi.Pointer frbgen_breez_liquid_cst_new_list_fiat_currency( int len, ) { @@ -1958,6 +1917,26 @@ class FlutterBreezLiquidBindings { _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_lnurl_withdrawPtr .asFunction, RustBuffer, ffi.Pointer)>(); + RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parse( + ffi.Pointer ptr, + RustBuffer input, + ffi.Pointer out_status, + ) { + return _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parse( + ptr, + input, + out_status, + ); + } + + late final _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parsePtr = _lookup< + ffi.NativeFunction< + RustBuffer Function(ffi.Pointer, RustBuffer, ffi.Pointer)>>( + 'uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parse'); + late final _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parse = + _uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_parsePtr + .asFunction, RustBuffer, ffi.Pointer)>(); + RustBuffer uniffi_breez_sdk_liquid_bindings_fn_method_bindingliquidsdk_pay_onchain( ffi.Pointer ptr, RustBuffer req, @@ -2414,23 +2393,6 @@ class FlutterBreezLiquidBindings { _uniffi_breez_sdk_liquid_bindings_fn_func_default_configPtr .asFunction)>(); - RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_parse( - RustBuffer input, - ffi.Pointer out_status, - ) { - return _uniffi_breez_sdk_liquid_bindings_fn_func_parse( - input, - out_status, - ); - } - - late final _uniffi_breez_sdk_liquid_bindings_fn_func_parsePtr = - _lookup)>>( - 'uniffi_breez_sdk_liquid_bindings_fn_func_parse'); - late final _uniffi_breez_sdk_liquid_bindings_fn_func_parse = - _uniffi_breez_sdk_liquid_bindings_fn_func_parsePtr - .asFunction)>(); - RustBuffer uniffi_breez_sdk_liquid_bindings_fn_func_parse_invoice( RustBuffer input, ffi.Pointer out_status, @@ -3413,16 +3375,6 @@ class FlutterBreezLiquidBindings { late final _uniffi_breez_sdk_liquid_bindings_checksum_func_default_config = _uniffi_breez_sdk_liquid_bindings_checksum_func_default_configPtr.asFunction(); - int uniffi_breez_sdk_liquid_bindings_checksum_func_parse() { - return _uniffi_breez_sdk_liquid_bindings_checksum_func_parse(); - } - - late final _uniffi_breez_sdk_liquid_bindings_checksum_func_parsePtr = - _lookup>( - 'uniffi_breez_sdk_liquid_bindings_checksum_func_parse'); - late final _uniffi_breez_sdk_liquid_bindings_checksum_func_parse = - _uniffi_breez_sdk_liquid_bindings_checksum_func_parsePtr.asFunction(); - int uniffi_breez_sdk_liquid_bindings_checksum_func_parse_invoice() { return _uniffi_breez_sdk_liquid_bindings_checksum_func_parse_invoice(); } @@ -3619,6 +3571,17 @@ class FlutterBreezLiquidBindings { _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_lnurl_withdrawPtr .asFunction(); + int uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parse() { + return _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parse(); + } + + late final _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parsePtr = + _lookup>( + 'uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parse'); + late final _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parse = + _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_parsePtr + .asFunction(); + int uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_pay_onchain() { return _uniffi_breez_sdk_liquid_bindings_checksum_method_bindingliquidsdk_pay_onchain(); } @@ -4567,9 +4530,16 @@ final class wire_cst_sdk_event extends ffi.Struct { external SdkEventKind kind; } -final class wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser - extends ffi.Struct { - external ffi.Pointer ptr; +final class wire_cst_external_input_parser extends ffi.Struct { + external ffi.Pointer provider_id; + + external ffi.Pointer input_regex; + + external ffi.Pointer parser_url; +} + +final class wire_cst_list_external_input_parser extends ffi.Struct { + external ffi.Pointer ptr; @ffi.Int32() external int len; @@ -4599,9 +4569,7 @@ final class wire_cst_config extends ffi.Struct { external ffi.Pointer breez_api_key; - external ffi.Pointer< - wire_cst_list_Auto_Owned_RustOpaque_flutter_rust_bridgefor_generatedRustAutoOpaqueInnerExternalInputParser> - external_input_parsers; + external ffi.Pointer external_input_parsers; } final class wire_cst_connect_request extends ffi.Struct {