From 32ff02644945caa66525fc4c3736d0d9cde6ca5d Mon Sep 17 00:00:00 2001 From: Ross Savage Date: Thu, 19 Oct 2023 16:13:19 +0200 Subject: [PATCH] Change send_spontaneous_payment to msat and wrap in request/response structs --- libs/sdk-bindings/src/breez_sdk.udl | 19 +- libs/sdk-bindings/src/uniffi_binding.rs | 33 +- libs/sdk-core/src/binding.rs | 33 +- libs/sdk-core/src/breez_services.rs | 35 +- libs/sdk-core/src/bridge_generated.io.rs | 99 +- libs/sdk-core/src/bridge_generated.rs | 31 +- libs/sdk-core/src/greenlight/node_api.rs | 6 +- libs/sdk-core/src/lnurl/pay.rs | 169 ++-- libs/sdk-core/src/models.rs | 30 +- libs/sdk-core/src/test_utils.rs | 2 +- .../ios/Classes/bridge_generated.h | 27 +- libs/sdk-flutter/lib/breez_sdk.dart | 23 +- libs/sdk-flutter/lib/bridge_generated.dart | 191 +++- .../lib/bridge_generated.freezed.dart | 906 +++++++++--------- libs/sdk-flutter/pubspec.lock | 82 +- .../main/java/com/breezsdk/BreezSDKMapper.kt | 262 +++++ .../main/java/com/breezsdk/BreezSDKModule.kt | 75 +- .../sdk-react-native/ios/BreezSDKMapper.swift | 242 +++++ libs/sdk-react-native/ios/RNBreezSDK.m | 28 +- libs/sdk-react-native/ios/RNBreezSDK.swift | 72 +- libs/sdk-react-native/src/index.ts | 76 +- tools/sdk-cli/src/command_handlers.rs | 29 +- tools/sdk-cli/src/commands.rs | 2 +- 23 files changed, 1623 insertions(+), 849 deletions(-) diff --git a/libs/sdk-bindings/src/breez_sdk.udl b/libs/sdk-bindings/src/breez_sdk.udl index 406354962..3c334c786 100644 --- a/libs/sdk-bindings/src/breez_sdk.udl +++ b/libs/sdk-bindings/src/breez_sdk.udl @@ -448,6 +448,12 @@ dictionary LnUrlErrorData { string reason; }; +dictionary LnUrlPayRequest { + LnUrlPayRequestData req_data; + u64 amount_msat; + string? comment; +}; + dictionary LnUrlPayRequestData { string callback; u64 min_sendable; @@ -533,6 +539,15 @@ dictionary SweepResponse { sequence txid; }; +dictionary SendPaymentResponse { + Payment payment; +}; + +dictionary SendSpontaneousPaymentRequest { + string node_id; + u64 amount_msat; +}; + dictionary SendOnchainRequest { u64 amount_sat; string onchain_recipient_address; @@ -563,13 +578,13 @@ interface BlockingBreezServices { Payment send_payment(string bolt11, u64? amount_msat); [Throws=SdkError] - Payment send_spontaneous_payment(string node_id, u64 amount_sats); + SendPaymentResponse send_spontaneous_payment(SendSpontaneousPaymentRequest req); [Throws=SdkError] ReceivePaymentResponse receive_payment(ReceivePaymentRequest req); [Throws=SdkError] - LnUrlPayResult pay_lnurl(LnUrlPayRequestData req_data, u64 amount_sats, string? comment); + LnUrlPayResult pay_lnurl(LnUrlPayRequest req); [Throws=SdkError] LnUrlWithdrawResult withdraw_lnurl(LnUrlWithdrawRequestData req_data, u64 amount_sats, string? description); diff --git a/libs/sdk-bindings/src/uniffi_binding.rs b/libs/sdk-bindings/src/uniffi_binding.rs index 62f22db92..e6e7e803f 100644 --- a/libs/sdk-bindings/src/uniffi_binding.rs +++ b/libs/sdk-bindings/src/uniffi_binding.rs @@ -12,7 +12,7 @@ use breez_sdk_core::{ ClosedChannelPaymentDetails, Config, CurrencyInfo, EnvironmentType, EventListener, FeeratePreset, FiatCurrency, GreenlightCredentials, GreenlightNodeConfig, InputType, InvoicePaidDetails, LNInvoice, ListPaymentsRequest, LnPaymentDetails, LnUrlAuthRequestData, - LnUrlCallbackStatus, LnUrlErrorData, LnUrlPayRequestData, LnUrlPayResult, + LnUrlCallbackStatus, LnUrlErrorData, LnUrlPayRequest, LnUrlPayRequestData, LnUrlPayResult, LnUrlWithdrawRequestData, LnUrlWithdrawResult, LnUrlWithdrawSuccessData, LocaleOverrides, LocalizedName, LogEntry, LogStream, LspInformation, MessageSuccessActionData, MetadataItem, Network, NodeConfig, NodeState, OpenChannelFeeRequest, OpenChannelFeeResponse, @@ -20,9 +20,10 @@ use breez_sdk_core::{ PaymentStatus, PaymentType, PaymentTypeFilter, Rate, ReceiveOnchainRequest, ReceivePaymentRequest, ReceivePaymentResponse, RecommendedFees, RefundRequest, RefundResponse, ReverseSwapFeesRequest, ReverseSwapInfo, ReverseSwapPairInfo, ReverseSwapStatus, RouteHint, - RouteHintHop, SendOnchainRequest, SendOnchainResponse, SignMessageRequest, SignMessageResponse, - StaticBackupRequest, StaticBackupResponse, SuccessActionProcessed, SwapInfo, SwapStatus, - SweepRequest, SweepResponse, Symbol, UnspentTransactionOutput, UrlSuccessActionData, + RouteHintHop, SendOnchainRequest, SendOnchainResponse, SendPaymentResponse, + SendSpontaneousPaymentRequest, SignMessageRequest, SignMessageResponse, StaticBackupRequest, + StaticBackupResponse, SuccessActionProcessed, SwapInfo, SwapStatus, SweepRequest, + SweepResponse, Symbol, UnspentTransactionOutput, UrlSuccessActionData, }; static RT: Lazy = Lazy::new(|| tokio::runtime::Runtime::new().unwrap()); static LOG_INIT: OnceCell = OnceCell::new(); @@ -118,13 +119,9 @@ impl BlockingBreezServices { pub fn send_spontaneous_payment( &self, - node_id: String, - amount_sats: u64, - ) -> SdkResult { - rt().block_on( - self.breez_services - .send_spontaneous_payment(node_id, amount_sats), - ) + req: SendSpontaneousPaymentRequest, + ) -> SdkResult { + rt().block_on(self.breez_services.send_spontaneous_payment(req)) } pub fn receive_payment(&self, req: ReceivePaymentRequest) -> SdkResult { @@ -163,17 +160,9 @@ impl BlockingBreezServices { .map_err(|e| e.into()) } - pub fn pay_lnurl( - &self, - req_data: LnUrlPayRequestData, - amount_sats: u64, - comment: Option, - ) -> SdkResult { - rt().block_on( - self.breez_services - .lnurl_pay(req_data, amount_sats, comment), - ) - .map_err(|e| e.into()) + pub fn pay_lnurl(&self, req: LnUrlPayRequest) -> SdkResult { + rt().block_on(self.breez_services.lnurl_pay(req)) + .map_err(|e| e.into()) } pub fn withdraw_lnurl( diff --git a/libs/sdk-core/src/binding.rs b/libs/sdk-core/src/binding.rs index d0e3abe99..8b115cae8 100644 --- a/libs/sdk-core/src/binding.rs +++ b/libs/sdk-core/src/binding.rs @@ -23,20 +23,20 @@ use crate::breez_services::{self, BreezEvent, BreezServices, EventListener}; use crate::chain::RecommendedFees; use crate::error::SdkError; use crate::fiat::{FiatCurrency, Rate}; -use crate::input_parser::{ - self, InputType, LnUrlAuthRequestData, LnUrlPayRequestData, LnUrlWithdrawRequestData, -}; +use crate::input_parser::{self, InputType, LnUrlAuthRequestData, LnUrlWithdrawRequestData}; use crate::invoice::{self, LNInvoice}; use crate::lnurl::pay::model::LnUrlPayResult; use crate::lsp::LspInformation; use crate::models::{Config, LogEntry, NodeState, Payment, SwapInfo}; use crate::{ BackupStatus, BuyBitcoinRequest, BuyBitcoinResponse, CheckMessageRequest, CheckMessageResponse, - EnvironmentType, ListPaymentsRequest, LnUrlCallbackStatus, LnUrlWithdrawResult, NodeConfig, - OpenChannelFeeRequest, OpenChannelFeeResponse, ReceiveOnchainRequest, ReceivePaymentRequest, - ReceivePaymentResponse, RefundRequest, RefundResponse, ReverseSwapFeesRequest, ReverseSwapInfo, - ReverseSwapPairInfo, SendOnchainRequest, SendOnchainResponse, SignMessageRequest, - SignMessageResponse, StaticBackupRequest, StaticBackupResponse, SweepRequest, SweepResponse, + EnvironmentType, ListPaymentsRequest, LnUrlCallbackStatus, LnUrlPayRequest, + LnUrlWithdrawResult, NodeConfig, OpenChannelFeeRequest, OpenChannelFeeResponse, + ReceiveOnchainRequest, ReceivePaymentRequest, ReceivePaymentResponse, RefundRequest, + RefundResponse, ReverseSwapFeesRequest, ReverseSwapInfo, ReverseSwapPairInfo, + SendOnchainRequest, SendOnchainResponse, SendPaymentResponse, SendSpontaneousPaymentRequest, + SignMessageRequest, SignMessageResponse, StaticBackupRequest, StaticBackupResponse, + SweepRequest, SweepResponse, }; /* @@ -238,11 +238,11 @@ pub fn send_payment(bolt11: String, amount_msat: Option) -> Result } /// See [BreezServices::send_spontaneous_payment] -pub fn send_spontaneous_payment(node_id: String, amount_sats: u64) -> Result { +pub fn send_spontaneous_payment(req: SendSpontaneousPaymentRequest) -> Result { block_on(async { get_breez_services() .await? - .send_spontaneous_payment(node_id, amount_sats) + .send_spontaneous_payment(req) .await }) .map_err(anyhow::Error::new::) @@ -257,17 +257,8 @@ pub fn receive_payment(req: ReceivePaymentRequest) -> Result, -) -> Result { - block_on(async { - get_breez_services() - .await? - .lnurl_pay(req_data, user_amount_sat, comment) - .await - }) +pub fn lnurl_pay(req: LnUrlPayRequest) -> Result { + block_on(async { get_breez_services().await?.lnurl_pay(req).await }) } /// See [BreezServices::lnurl_withdraw] diff --git a/libs/sdk-core/src/breez_services.rs b/libs/sdk-core/src/breez_services.rs index b174cf0ab..8e3073c07 100644 --- a/libs/sdk-core/src/breez_services.rs +++ b/libs/sdk-core/src/breez_services.rs @@ -32,7 +32,6 @@ use crate::grpc::information_client::InformationClient; use crate::grpc::signer_client::SignerClient; use crate::grpc::swapper_client::SwapperClient; use crate::grpc::PaymentInformation; -use crate::input_parser::LnUrlPayRequestData; use crate::invoice::{add_lsp_routing_hints, parse_invoice, LNInvoice, RouteHint, RouteHintHop}; use crate::lnurl::auth::perform_lnurl_auth; use crate::lnurl::pay::model::SuccessAction::Aes; @@ -278,36 +277,36 @@ impl BreezServices { /// /// # Arguments /// - /// * `node_id` - The destination node_id - /// * `amount_sats` - The amount to pay in satoshis + /// * `req` - Request parameters for sending a spontaneous payment pub async fn send_spontaneous_payment( &self, - node_id: String, - amount_sats: u64, - ) -> SdkResult { + req: SendSpontaneousPaymentRequest, + ) -> SdkResult { self.start_node().await?; let payment_res = self .node_api - .send_spontaneous_payment(node_id.clone(), amount_sats) + .send_spontaneous_payment(req.node_id.clone(), req.amount_msat) .await; - self.on_payment_completed(node_id, None, payment_res).await + let payment = self + .on_payment_completed(req.node_id, None, payment_res) + .await?; + Ok(SendPaymentResponse { payment }) } /// Second step of LNURL-pay. The first step is `parse()`, which also validates the LNURL destination /// and generates the `LnUrlPayRequestData` payload needed here. /// - /// This call will validate the given `user_amount_sat` and `comment` against the parameters + /// This call will validate the `amount_msat` and `comment` parameters of `req` against the parameters /// of the LNURL endpoint (`req_data`). If they match the endpoint requirements, the LNURL payment /// is made. /// /// This method will return an [anyhow::Error] when any validation check fails. - pub async fn lnurl_pay( - &self, - req_data: LnUrlPayRequestData, - user_amount_sat: u64, - comment: Option, - ) -> Result { - match validate_lnurl_pay(user_amount_sat, comment, req_data.clone()).await? { + /// + /// # Arguments + /// + /// * `req` - The [LnUrlPayRequest] request parameters for sending a LNURL payment + pub async fn lnurl_pay(&self, req: LnUrlPayRequest) -> Result { + match validate_lnurl_pay(req.amount_msat, req.comment, req.req_data.clone()).await? { ValidatedCallbackResponse::EndpointError { data: e } => { Ok(LnUrlPayResult::EndpointError { data: e }) } @@ -345,8 +344,8 @@ impl BreezServices { self.persister.insert_lnurl_payment_external_info( &details.payment_hash, maybe_sa_processed.as_ref(), - Some(req_data.metadata_str), - req_data.ln_address, + Some(req.req_data.metadata_str), + req.req_data.ln_address, None, )?; diff --git a/libs/sdk-core/src/bridge_generated.io.rs b/libs/sdk-core/src/bridge_generated.io.rs index 3eb475030..ae2e6170f 100644 --- a/libs/sdk-core/src/bridge_generated.io.rs +++ b/libs/sdk-core/src/bridge_generated.io.rs @@ -138,10 +138,9 @@ pub extern "C" fn wire_send_payment( #[no_mangle] pub extern "C" fn wire_send_spontaneous_payment( port_: i64, - node_id: *mut wire_uint_8_list, - amount_sats: u64, + req: *mut wire_SendSpontaneousPaymentRequest, ) { - wire_send_spontaneous_payment_impl(port_, node_id, amount_sats) + wire_send_spontaneous_payment_impl(port_, req) } #[no_mangle] @@ -150,13 +149,8 @@ pub extern "C" fn wire_receive_payment(port_: i64, req: *mut wire_ReceivePayment } #[no_mangle] -pub extern "C" fn wire_lnurl_pay( - port_: i64, - req_data: *mut wire_LnUrlPayRequestData, - user_amount_sat: u64, - comment: *mut wire_uint_8_list, -) { - wire_lnurl_pay_impl(port_, req_data, user_amount_sat, comment) +pub extern "C" fn wire_lnurl_pay(port_: i64, req: *mut wire_LnUrlPayRequest) { + wire_lnurl_pay_impl(port_, req) } #[no_mangle] @@ -292,8 +286,8 @@ pub extern "C" fn new_box_autoadd_ln_url_auth_request_data_0() -> *mut wire_LnUr } #[no_mangle] -pub extern "C" fn new_box_autoadd_ln_url_pay_request_data_0() -> *mut wire_LnUrlPayRequestData { - support::new_leak_box_ptr(wire_LnUrlPayRequestData::new_with_null_ptr()) +pub extern "C" fn new_box_autoadd_ln_url_pay_request_0() -> *mut wire_LnUrlPayRequest { + support::new_leak_box_ptr(wire_LnUrlPayRequest::new_with_null_ptr()) } #[no_mangle] @@ -343,6 +337,12 @@ pub extern "C" fn new_box_autoadd_send_onchain_request_0() -> *mut wire_SendOnch support::new_leak_box_ptr(wire_SendOnchainRequest::new_with_null_ptr()) } +#[no_mangle] +pub extern "C" fn new_box_autoadd_send_spontaneous_payment_request_0( +) -> *mut wire_SendSpontaneousPaymentRequest { + support::new_leak_box_ptr(wire_SendSpontaneousPaymentRequest::new_with_null_ptr()) +} + #[no_mangle] pub extern "C" fn new_box_autoadd_sign_message_request_0() -> *mut wire_SignMessageRequest { support::new_leak_box_ptr(wire_SignMessageRequest::new_with_null_ptr()) @@ -440,10 +440,10 @@ impl Wire2Api for *mut wire_LnUrlAuthRequestData { Wire2Api::::wire2api(*wrap).into() } } -impl Wire2Api for *mut wire_LnUrlPayRequestData { - fn wire2api(self) -> LnUrlPayRequestData { +impl Wire2Api for *mut wire_LnUrlPayRequest { + fn wire2api(self) -> LnUrlPayRequest { let wrap = unsafe { support::box_from_leak_ptr(self) }; - Wire2Api::::wire2api(*wrap).into() + Wire2Api::::wire2api(*wrap).into() } } impl Wire2Api for *mut wire_LnUrlWithdrawRequestData { @@ -500,6 +500,12 @@ impl Wire2Api for *mut wire_SendOnchainRequest { Wire2Api::::wire2api(*wrap).into() } } +impl Wire2Api for *mut wire_SendSpontaneousPaymentRequest { + fn wire2api(self) -> SendSpontaneousPaymentRequest { + let wrap = unsafe { support::box_from_leak_ptr(self) }; + Wire2Api::::wire2api(*wrap).into() + } +} impl Wire2Api for *mut wire_SignMessageRequest { fn wire2api(self) -> SignMessageRequest { let wrap = unsafe { support::box_from_leak_ptr(self) }; @@ -602,6 +608,15 @@ impl Wire2Api for wire_LnUrlAuthRequestData { } } } +impl Wire2Api for wire_LnUrlPayRequest { + fn wire2api(self) -> LnUrlPayRequest { + LnUrlPayRequest { + req_data: self.req_data.wire2api(), + amount_msat: self.amount_msat.wire2api(), + comment: self.comment.wire2api(), + } + } +} impl Wire2Api for wire_LnUrlPayRequestData { fn wire2api(self) -> LnUrlPayRequestData { LnUrlPayRequestData { @@ -708,6 +723,14 @@ impl Wire2Api for wire_SendOnchainRequest { } } } +impl Wire2Api for wire_SendSpontaneousPaymentRequest { + fn wire2api(self) -> SendSpontaneousPaymentRequest { + SendSpontaneousPaymentRequest { + node_id: self.node_id.wire2api(), + amount_msat: self.amount_msat.wire2api(), + } + } +} impl Wire2Api for wire_SignMessageRequest { fn wire2api(self) -> SignMessageRequest { SignMessageRequest { @@ -805,6 +828,14 @@ pub struct wire_LnUrlAuthRequestData { url: *mut wire_uint_8_list, } +#[repr(C)] +#[derive(Clone)] +pub struct wire_LnUrlPayRequest { + req_data: wire_LnUrlPayRequestData, + amount_msat: u64, + comment: *mut wire_uint_8_list, +} + #[repr(C)] #[derive(Clone)] pub struct wire_LnUrlPayRequestData { @@ -886,6 +917,13 @@ pub struct wire_SendOnchainRequest { sat_per_vbyte: u64, } +#[repr(C)] +#[derive(Clone)] +pub struct wire_SendSpontaneousPaymentRequest { + node_id: *mut wire_uint_8_list, + amount_msat: u64, +} + #[repr(C)] #[derive(Clone)] pub struct wire_SignMessageRequest { @@ -1062,6 +1100,22 @@ impl Default for wire_LnUrlAuthRequestData { } } +impl NewWithNullPtr for wire_LnUrlPayRequest { + fn new_with_null_ptr() -> Self { + Self { + req_data: Default::default(), + amount_msat: Default::default(), + comment: core::ptr::null_mut(), + } + } +} + +impl Default for wire_LnUrlPayRequest { + fn default() -> Self { + Self::new_with_null_ptr() + } +} + impl NewWithNullPtr for wire_LnUrlPayRequestData { fn new_with_null_ptr() -> Self { Self { @@ -1239,6 +1293,21 @@ impl Default for wire_SendOnchainRequest { } } +impl NewWithNullPtr for wire_SendSpontaneousPaymentRequest { + fn new_with_null_ptr() -> Self { + Self { + node_id: core::ptr::null_mut(), + amount_msat: Default::default(), + } + } +} + +impl Default for wire_SendSpontaneousPaymentRequest { + fn default() -> Self { + Self::new_with_null_ptr() + } +} + impl NewWithNullPtr for wire_SignMessageRequest { fn new_with_null_ptr() -> Self { Self { diff --git a/libs/sdk-core/src/bridge_generated.rs b/libs/sdk-core/src/bridge_generated.rs index ce900a79f..8a8121909 100644 --- a/libs/sdk-core/src/bridge_generated.rs +++ b/libs/sdk-core/src/bridge_generated.rs @@ -62,6 +62,7 @@ use crate::models::GreenlightNodeConfig; use crate::models::ListPaymentsRequest; use crate::models::LnPaymentDetails; use crate::models::LnUrlCallbackStatus; +use crate::models::LnUrlPayRequest; use crate::models::LnUrlWithdrawResult; use crate::models::LnUrlWithdrawSuccessData; use crate::models::LogEntry; @@ -88,6 +89,8 @@ use crate::models::ReverseSwapPairInfo; use crate::models::ReverseSwapStatus; use crate::models::SendOnchainRequest; use crate::models::SendOnchainResponse; +use crate::models::SendPaymentResponse; +use crate::models::SendSpontaneousPaymentRequest; use crate::models::StaticBackupRequest; use crate::models::StaticBackupResponse; use crate::models::SwapInfo; @@ -415,8 +418,7 @@ fn wire_send_payment_impl( } fn wire_send_spontaneous_payment_impl( port_: MessagePort, - node_id: impl Wire2Api + UnwindSafe, - amount_sats: impl Wire2Api + UnwindSafe, + req: impl Wire2Api + UnwindSafe, ) { FLUTTER_RUST_BRIDGE_HANDLER.wrap( WrapInfo { @@ -425,9 +427,8 @@ fn wire_send_spontaneous_payment_impl( mode: FfiCallMode::Normal, }, move || { - let api_node_id = node_id.wire2api(); - let api_amount_sats = amount_sats.wire2api(); - move |task_callback| send_spontaneous_payment(api_node_id, api_amount_sats) + let api_req = req.wire2api(); + move |task_callback| send_spontaneous_payment(api_req) }, ) } @@ -447,12 +448,7 @@ fn wire_receive_payment_impl( }, ) } -fn wire_lnurl_pay_impl( - port_: MessagePort, - req_data: impl Wire2Api + UnwindSafe, - user_amount_sat: impl Wire2Api + UnwindSafe, - comment: impl Wire2Api> + UnwindSafe, -) { +fn wire_lnurl_pay_impl(port_: MessagePort, req: impl Wire2Api + UnwindSafe) { FLUTTER_RUST_BRIDGE_HANDLER.wrap( WrapInfo { debug_name: "lnurl_pay", @@ -460,10 +456,8 @@ fn wire_lnurl_pay_impl( mode: FfiCallMode::Normal, }, move || { - let api_req_data = req_data.wire2api(); - let api_user_amount_sat = user_amount_sat.wire2api(); - let api_comment = comment.wire2api(); - move |task_callback| lnurl_pay(api_req_data, api_user_amount_sat, api_comment) + let api_req = req.wire2api(); + move |task_callback| lnurl_pay(api_req) }, ) } @@ -1388,6 +1382,13 @@ impl support::IntoDart for SendOnchainResponse { } impl support::IntoDartExceptPrimitive for SendOnchainResponse {} +impl support::IntoDart for SendPaymentResponse { + fn into_dart(self) -> support::DartAbi { + vec![self.payment.into_dart()].into_dart() + } +} +impl support::IntoDartExceptPrimitive for SendPaymentResponse {} + impl support::IntoDart for SignMessageResponse { fn into_dart(self) -> support::DartAbi { vec![self.signature.into_dart()].into_dart() diff --git a/libs/sdk-core/src/greenlight/node_api.rs b/libs/sdk-core/src/greenlight/node_api.rs index eafc5cf3c..e47715fbd 100644 --- a/libs/sdk-core/src/greenlight/node_api.rs +++ b/libs/sdk-core/src/greenlight/node_api.rs @@ -528,14 +528,12 @@ impl NodeAPI for Greenlight { async fn send_spontaneous_payment( &self, node_id: String, - amount_sats: u64, + amount_msat: u64, ) -> Result { let mut client: node::ClnClient = self.get_node_client().await?; let request = pb::cln::KeysendRequest { destination: hex::decode(node_id)?, - amount_msat: Some(gl_client::pb::cln::Amount { - msat: amount_sats * 1000, - }), + amount_msat: Some(gl_client::pb::cln::Amount { msat: amount_msat }), label: Some(format!( "breez-{}", SystemTime::now().duration_since(UNIX_EPOCH)?.as_millis() diff --git a/libs/sdk-core/src/lnurl/pay.rs b/libs/sdk-core/src/lnurl/pay.rs index 158896d1c..0ea24d150 100644 --- a/libs/sdk-core/src/lnurl/pay.rs +++ b/libs/sdk-core/src/lnurl/pay.rs @@ -15,19 +15,19 @@ type Aes256CbcDec = cbc::Decryptor; /// /// See the [parse] docs for more detail on the full workflow. pub(crate) async fn validate_lnurl_pay( - user_amount_sat: u64, + user_amount_msat: u64, comment: Option, req_data: LnUrlPayRequestData, ) -> Result { validate_user_input( - user_amount_sat * 1000, + user_amount_msat, &comment, req_data.min_sendable, req_data.max_sendable, req_data.comment_allowed, )?; - let callback_url = build_pay_callback_url(user_amount_sat, &comment, &req_data)?; + let callback_url = build_pay_callback_url(user_amount_msat, &comment, &req_data)?; let callback_resp_text = get_and_log_response(&callback_url).await?; if let Ok(err) = serde_json::from_str::(&callback_resp_text) { @@ -42,7 +42,7 @@ pub(crate) async fn validate_lnurl_pay( } } - validate_invoice(user_amount_sat, &callback_resp.pr, &req_data)?; + validate_invoice(user_amount_msat, &callback_resp.pr, &req_data)?; Ok(ValidatedCallbackResponse::EndpointSuccess { data: callback_resp, }) @@ -50,11 +50,11 @@ pub(crate) async fn validate_lnurl_pay( } fn build_pay_callback_url( - user_amount_sat: u64, + user_amount_msat: u64, user_comment: &Option, req_data: &LnUrlPayRequestData, ) -> Result { - let amount_msat = (user_amount_sat * 1000).to_string(); + let amount_msat = user_amount_msat.to_string(); let mut url = reqwest::Url::from_str(&req_data.callback)?; url.query_pairs_mut().append_pair("amount", &amount_msat); @@ -94,7 +94,7 @@ fn validate_user_input( } fn validate_invoice( - user_amount_sat: u64, + user_amount_msat: u64, bolt11: &str, req_data: &LnUrlPayRequestData, ) -> Result<()> { @@ -113,7 +113,7 @@ fn validate_invoice( match invoice.amount_msat { None => Err(anyhow!("Amount is bigger than the maximum allowed")), - Some(invoice_amount_msat) => match invoice_amount_msat == (user_amount_sat * 1000) { + Some(invoice_amount_msat) => match invoice_amount_msat == user_amount_msat { true => Ok(()), false => Err(anyhow!( "Invoice amount is different than the user chosen amount" @@ -345,11 +345,11 @@ mod tests { use mockito::Mock; use rand::random; - use crate::test_utils::*; + use crate::{test_utils::*, LnUrlPayRequest}; struct LnurlPayCallbackParams<'a> { pay_req: &'a LnUrlPayRequestData, - user_amount_sat: u64, + user_amount_msat: u64, error: Option, pr: Option, comment: String, @@ -357,7 +357,7 @@ mod tests { struct AesPayCallbackParams<'a> { pay_req: &'a LnUrlPayRequestData, - user_amount_sat: u64, + user_amount_msat: u64, error: Option, pr: Option, sa_data: AesSuccessActionDataDecrypted, @@ -372,13 +372,13 @@ mod tests { ) -> Result { let LnurlPayCallbackParams { pay_req, - user_amount_sat, + user_amount_msat, error, pr, comment, } = callback_params; - let callback_url = build_pay_callback_url(user_amount_sat, &Some(comment), pay_req)?; + let callback_url = build_pay_callback_url(user_amount_msat, &Some(comment), pay_req)?; let url = reqwest::Url::parse(&callback_url)?; let mockito_path: &str = &format!("{}?{}", url.path(), url.query().unwrap()); @@ -414,13 +414,13 @@ mod tests { ) -> Result { let LnurlPayCallbackParams { pay_req, - user_amount_sat, + user_amount_msat, error, pr: _pr, comment, } = callback_params; - let callback_url = build_pay_callback_url(user_amount_sat, &Some(comment), pay_req)?; + let callback_url = build_pay_callback_url(user_amount_msat, &Some(comment), pay_req)?; let url = reqwest::Url::parse(&callback_url)?; let mockito_path: &str = &format!("{}?{}", url.path(), url.query().unwrap()); @@ -455,13 +455,13 @@ mod tests { ) -> Result { let LnurlPayCallbackParams { pay_req, - user_amount_sat, + user_amount_msat, error, pr, comment, } = callback_params; - let callback_url = build_pay_callback_url(user_amount_sat, &Some(comment), pay_req)?; + let callback_url = build_pay_callback_url(user_amount_msat, &Some(comment), pay_req)?; let url = reqwest::Url::parse(&callback_url)?; let mockito_path: &str = &format!("{}?{}", url.path(), url.query().unwrap()); @@ -501,13 +501,13 @@ mod tests { ) -> Result { let LnurlPayCallbackParams { pay_req, - user_amount_sat, + user_amount_msat, error, pr, comment, } = callback_params; - let callback_url = build_pay_callback_url(user_amount_sat, &Some(comment), pay_req)?; + let callback_url = build_pay_callback_url(user_amount_msat, &Some(comment), pay_req)?; let url = reqwest::Url::parse(&callback_url)?; let mockito_path: &str = &format!("{}?{}", url.path(), url.query().unwrap()); @@ -548,7 +548,7 @@ mod tests { ) -> Result { let AesPayCallbackParams { pay_req, - user_amount_sat, + user_amount_msat, error, pr, sa_data, @@ -557,7 +557,7 @@ mod tests { comment, } = aes_callback_params; - let callback_url = build_pay_callback_url(user_amount_sat, &Some(comment), pay_req)?; + let callback_url = build_pay_callback_url(user_amount_msat, &Some(comment), pay_req)?; let url = reqwest::Url::parse(&callback_url)?; let mockito_path: &str = &format!("{}?{}", url.path(), url.query().unwrap()); let iv_base64 = base64::encode(iv_bytes); @@ -598,10 +598,14 @@ mod tests { .create()) } - fn get_test_pay_req_data(min_sat: u64, max_sat: u64, comment_len: u16) -> LnUrlPayRequestData { + fn get_test_pay_req_data( + min_sendable: u64, + max_sendable: u64, + comment_len: u16, + ) -> LnUrlPayRequestData { LnUrlPayRequestData { - min_sendable: min_sat * 1000, - max_sendable: max_sat * 1000, + min_sendable, + max_sendable, comment_allowed: comment_len, metadata_str: "".into(), callback: "https://localhost/callback".into(), @@ -612,32 +616,27 @@ mod tests { #[test] fn test_lnurl_pay_validate_input() -> Result<()> { - assert!(validate_user_input(100, &None, 0, 100, 0).is_ok()); - assert!(validate_user_input(100, &Some("test".into()), 0, 100, 5).is_ok()); + assert!(validate_user_input(100_000, &None, 0, 100_000, 0).is_ok()); + assert!(validate_user_input(100_000, &Some("test".into()), 0, 100_000, 5).is_ok()); - assert!(validate_user_input(5, &None, 10, 100, 5).is_err()); - assert!(validate_user_input(200, &None, 10, 100, 5).is_err()); - assert!(validate_user_input(100, &Some("test".into()), 10, 100, 0).is_err()); + assert!(validate_user_input(5000, &None, 10_000, 100_000, 5).is_err()); + assert!(validate_user_input(200_000, &None, 10_000, 100_000, 5).is_err()); + assert!(validate_user_input(100_000, &Some("test".into()), 10_000, 100_000, 0).is_err()); Ok(()) } #[test] fn test_lnurl_pay_validate_invoice() -> Result<()> { - let req = get_test_pay_req_data(0, 100, 0); + let req = get_test_pay_req_data(0, 100_000, 0); let temp_desc = req.metadata_str.clone(); let inv = rand_invoice_with_description_hash(temp_desc.clone())?; let payreq: String = rand_invoice_with_description_hash(temp_desc)?.to_string(); + assert!(validate_invoice(inv.amount_milli_satoshis().unwrap(), &payreq, &req).is_ok()); assert!( - validate_invoice(inv.amount_milli_satoshis().unwrap() / 1000, &payreq, &req).is_ok() + validate_invoice(inv.amount_milli_satoshis().unwrap() + 1000, &payreq, &req).is_err() ); - assert!(validate_invoice( - (inv.amount_milli_satoshis().unwrap() / 1000) + 1, - &payreq, - &req - ) - .is_err()); Ok(()) } @@ -773,7 +772,7 @@ mod tests { #[test] fn test_lnurl_pay_validate_success_url() -> Result<()> { - let pay_req_data = get_test_pay_req_data(0, 100, 100); + let pay_req_data = get_test_pay_req_data(0, 100_000, 100); assert!(UrlSuccessActionData { description: "short msg".into(), @@ -804,14 +803,14 @@ mod tests { #[tokio::test] async fn test_lnurl_pay_no_success_action() -> Result<()> { let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let temp_desc = pay_req.metadata_str.clone(); let inv = rand_invoice_with_description_hash(temp_desc)?; - let user_amount_sat = inv.amount_milli_satoshis().unwrap() / 1000; + let user_amount_msat = inv.amount_milli_satoshis().unwrap(); let _m = mock_lnurl_pay_callback_endpoint_no_success_action(LnurlPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: None, pr: Some(inv.to_string()), comment: comment.clone(), @@ -819,7 +818,11 @@ mod tests { let mock_breez_services = crate::breez_services::tests::breez_services().await?; match mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment), + }) .await? { LnUrlPayResult::EndpointSuccess { data: None } => Ok(()), @@ -834,13 +837,13 @@ mod tests { #[tokio::test] async fn test_lnurl_pay_unsupported_success_action() -> Result<()> { - let user_amount_sat = 11; + let user_amount_msat = 11000; let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let _m = mock_lnurl_pay_callback_endpoint_unsupported_success_action(LnurlPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: None, pr: None, comment: comment.clone(), @@ -848,7 +851,11 @@ mod tests { let mock_breez_services = crate::breez_services::tests::breez_services().await?; let r = mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment), + }) .await; // An unsupported Success Action results in an error assert!(r.is_err()); @@ -859,13 +866,13 @@ mod tests { #[tokio::test] async fn test_lnurl_pay_msg_success_action() -> Result<()> { let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let temp_desc = pay_req.metadata_str.clone(); let inv = rand_invoice_with_description_hash(temp_desc)?; - let user_amount_sat = inv.amount_milli_satoshis().unwrap() / 1000; + let user_amount_msat = inv.amount_milli_satoshis().unwrap(); let _m = mock_lnurl_pay_callback_endpoint_msg_success_action(LnurlPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: None, pr: Some(inv.to_string()), comment: comment.clone(), @@ -873,7 +880,11 @@ mod tests { let mock_breez_services = crate::breez_services::tests::breez_services().await?; match mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment), + }) .await? { LnUrlPayResult::EndpointSuccess { data: None } => Err(anyhow!( @@ -892,13 +903,13 @@ mod tests { #[tokio::test] async fn test_lnurl_pay_msg_success_action_incorrect_amount() -> Result<()> { let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let temp_desc = pay_req.metadata_str.clone(); let inv = rand_invoice_with_description_hash(temp_desc)?; - let user_amount_sat = (inv.amount_milli_satoshis().unwrap() / 1000) + 1; + let user_amount_msat = inv.amount_milli_satoshis().unwrap() + 1000; let _m = mock_lnurl_pay_callback_endpoint_msg_success_action(LnurlPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: None, pr: Some(inv.to_string()), comment: comment.clone(), @@ -906,7 +917,11 @@ mod tests { let mock_breez_services = crate::breez_services::tests::breez_services().await?; assert!(mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment) + }) .await .is_err()); @@ -916,14 +931,14 @@ mod tests { #[tokio::test] async fn test_lnurl_pay_msg_success_action_error_from_endpoint() -> Result<()> { let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let temp_desc = pay_req.metadata_str.clone(); let inv = rand_invoice_with_description_hash(temp_desc)?; - let user_amount_sat = inv.amount_milli_satoshis().unwrap() / 1000; + let user_amount_msat = inv.amount_milli_satoshis().unwrap(); let expected_error_msg = "Error message from LNURL endpoint"; let _m = mock_lnurl_pay_callback_endpoint_msg_success_action(LnurlPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: Some(expected_error_msg.to_string()), pr: Some(inv.to_string()), comment: comment.clone(), @@ -931,7 +946,11 @@ mod tests { let mock_breez_services = crate::breez_services::tests::breez_services().await?; let res = mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment), + }) .await; assert!(matches!(res, Ok(LnUrlPayResult::EndpointError { data: _ }))); @@ -949,13 +968,13 @@ mod tests { #[tokio::test] async fn test_lnurl_pay_url_success_action() -> Result<()> { let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let temp_desc = pay_req.metadata_str.clone(); let inv = rand_invoice_with_description_hash(temp_desc)?; - let user_amount_sat = inv.amount_milli_satoshis().unwrap() / 1000; + let user_amount_msat = inv.amount_milli_satoshis().unwrap(); let _m = mock_lnurl_pay_callback_endpoint_url_success_action(LnurlPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: None, pr: Some(inv.to_string()), comment: comment.clone(), @@ -963,7 +982,11 @@ mod tests { let mock_breez_services = crate::breez_services::tests::breez_services().await?; match mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment), + }) .await? { LnUrlPayResult::EndpointSuccess { @@ -1000,17 +1023,17 @@ mod tests { let preimage = sha256::Hash::hash(&rand_vec_u8(10)); let comment = rand_string(COMMENT_LENGHT as usize); - let pay_req = get_test_pay_req_data(0, 100, COMMENT_LENGHT); + let pay_req = get_test_pay_req_data(0, 100_000, COMMENT_LENGHT); let temp_desc = pay_req.metadata_str.clone(); // The invoice (served by LNURL-pay endpoint, matching preimage and description hash) let inv = rand_invoice_with_description_hash_and_preimage(temp_desc, preimage)?; - let user_amount_sat = inv.amount_milli_satoshis().unwrap() / 1000; + let user_amount_msat = inv.amount_milli_satoshis().unwrap(); let bolt11 = inv.to_string(); let _m = mock_lnurl_pay_callback_endpoint_aes_success_action(AesPayCallbackParams { pay_req: &pay_req, - user_amount_sat, + user_amount_msat, error: None, pr: Some(bolt11.clone()), sa_data: sa_data.clone(), @@ -1031,7 +1054,11 @@ mod tests { ) .await?; match mock_breez_services - .lnurl_pay(pay_req, user_amount_sat, Some(comment)) + .lnurl_pay(LnUrlPayRequest { + req_data: pay_req, + amount_msat: user_amount_msat, + comment: Some(comment), + }) .await? { LnUrlPayResult::EndpointSuccess { @@ -1051,19 +1078,19 @@ mod tests { #[test] fn test_lnurl_pay_build_pay_callback_url() -> Result<()> { - let pay_req = get_test_pay_req_data(0, 100, 0); - let user_amount_sat = 50; + let pay_req = get_test_pay_req_data(0, 100_000, 0); + let user_amount_msat = 50_000; - let amount_arg = format!("amount={}", user_amount_sat * 1000); + let amount_arg = format!("amount={}", user_amount_msat); let user_comment = "test comment".to_string(); let comment_arg = format!("comment={user_comment}"); - let url_amount_no_comment = build_pay_callback_url(user_amount_sat, &None, &pay_req)?; + let url_amount_no_comment = build_pay_callback_url(user_amount_msat, &None, &pay_req)?; assert!(url_amount_no_comment.contains(&amount_arg)); assert!(!url_amount_no_comment.contains(&comment_arg)); let url_amount_with_comment = - build_pay_callback_url(user_amount_sat, &Some(user_comment), &pay_req)?; + build_pay_callback_url(user_amount_msat, &Some(user_comment), &pay_req)?; assert!(url_amount_with_comment.contains(&amount_arg)); assert!(url_amount_with_comment.contains("comment=test+comment")); diff --git a/libs/sdk-core/src/models.rs b/libs/sdk-core/src/models.rs index 9fd44ae67..0669abcbb 100644 --- a/libs/sdk-core/src/models.rs +++ b/libs/sdk-core/src/models.rs @@ -28,7 +28,7 @@ use crate::grpc::{self, GetReverseRoutingNodeRequest, PaymentInformation, Regist use crate::lnurl::pay::model::SuccessActionProcessed; use crate::lsp::LspInformation; use crate::models::Network::*; -use crate::{LNInvoice, LnUrlErrorData}; +use crate::{LNInvoice, LnUrlErrorData, LnUrlPayRequestData}; use crate::breez_services::BreezServer; use crate::error::{SdkError, SdkResult}; @@ -84,7 +84,7 @@ pub trait NodeAPI: Send + Sync { async fn send_spontaneous_payment( &self, node_id: String, - amount_sats: u64, + amount_msat: u64, ) -> Result; async fn start(&self) -> Result<()>; async fn sweep(&self, to_address: String, fee_rate_sats_per_vbyte: u32) -> Result>; @@ -756,6 +756,21 @@ pub struct ReceivePaymentResponse { pub opening_fee_msat: Option, } +/// Represents a send payment response. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct SendPaymentResponse { + pub payment: Payment, +} + +/// Represents a send spontaneous payment request. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct SendSpontaneousPaymentRequest { + /// The node id to send this payment is + pub node_id: String, + /// The amount in millisatoshis for this payment + pub amount_msat: u64, +} + #[derive(Clone)] pub struct StaticBackupRequest { pub working_dir: String, @@ -1164,6 +1179,17 @@ pub enum LnUrlCallbackStatus { }, } +/// Represents a LNURL-pay request. +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct LnUrlPayRequest { + /// The [LnUrlPayRequestData] returned by [BreezServices::parse_input] + pub req_data: LnUrlPayRequestData, + /// The amount in millisatoshis for this payment + pub amount_msat: u64, + /// An optional comment for this payment + pub comment: Option, +} + /// [LnUrlCallbackStatus] specific to LNURL-withdraw, where the success case contains the invoice. #[derive(Serialize)] pub enum LnUrlWithdrawResult { diff --git a/libs/sdk-core/src/test_utils.rs b/libs/sdk-core/src/test_utils.rs index 8bb354b59..e734a6fa4 100644 --- a/libs/sdk-core/src/test_utils.rs +++ b/libs/sdk-core/src/test_utils.rs @@ -313,7 +313,7 @@ impl NodeAPI for MockNodeAPI { async fn send_spontaneous_payment( &self, _node_id: String, - _amount_sats: u64, + _amount_msat: u64, ) -> Result { let payment = self.add_dummy_payment_rand().await?; payment.try_into() diff --git a/libs/sdk-flutter/ios/Classes/bridge_generated.h b/libs/sdk-flutter/ios/Classes/bridge_generated.h index ee81283c1..deeedff2e 100644 --- a/libs/sdk-flutter/ios/Classes/bridge_generated.h +++ b/libs/sdk-flutter/ios/Classes/bridge_generated.h @@ -81,6 +81,11 @@ typedef struct wire_ListPaymentsRequest { uint32_t *limit; } wire_ListPaymentsRequest; +typedef struct wire_SendSpontaneousPaymentRequest { + struct wire_uint_8_list *node_id; + uint64_t amount_msat; +} wire_SendSpontaneousPaymentRequest; + typedef struct wire_OpeningFeeParams { uint64_t min_msat; uint32_t proportional; @@ -110,6 +115,12 @@ typedef struct wire_LnUrlPayRequestData { struct wire_uint_8_list *ln_address; } wire_LnUrlPayRequestData; +typedef struct wire_LnUrlPayRequest { + struct wire_LnUrlPayRequestData req_data; + uint64_t amount_msat; + struct wire_uint_8_list *comment; +} wire_LnUrlPayRequest; + typedef struct wire_LnUrlWithdrawRequestData { struct wire_uint_8_list *callback; struct wire_uint_8_list *k1; @@ -226,16 +237,11 @@ void wire_payment_by_hash(int64_t port_, struct wire_uint_8_list *hash); void wire_send_payment(int64_t port_, struct wire_uint_8_list *bolt11, uint64_t *amount_msat); -void wire_send_spontaneous_payment(int64_t port_, - struct wire_uint_8_list *node_id, - uint64_t amount_sats); +void wire_send_spontaneous_payment(int64_t port_, struct wire_SendSpontaneousPaymentRequest *req); void wire_receive_payment(int64_t port_, struct wire_ReceivePaymentRequest *req); -void wire_lnurl_pay(int64_t port_, - struct wire_LnUrlPayRequestData *req_data, - uint64_t user_amount_sat, - struct wire_uint_8_list *comment); +void wire_lnurl_pay(int64_t port_, struct wire_LnUrlPayRequest *req); void wire_lnurl_withdraw(int64_t port_, struct wire_LnUrlWithdrawRequestData *req_data, @@ -290,7 +296,7 @@ struct wire_ListPaymentsRequest *new_box_autoadd_list_payments_request_0(void); struct wire_LnUrlAuthRequestData *new_box_autoadd_ln_url_auth_request_data_0(void); -struct wire_LnUrlPayRequestData *new_box_autoadd_ln_url_pay_request_data_0(void); +struct wire_LnUrlPayRequest *new_box_autoadd_ln_url_pay_request_0(void); struct wire_LnUrlWithdrawRequestData *new_box_autoadd_ln_url_withdraw_request_data_0(void); @@ -310,6 +316,8 @@ struct wire_ReverseSwapFeesRequest *new_box_autoadd_reverse_swap_fees_request_0( struct wire_SendOnchainRequest *new_box_autoadd_send_onchain_request_0(void); +struct wire_SendSpontaneousPaymentRequest *new_box_autoadd_send_spontaneous_payment_request_0(void); + struct wire_SignMessageRequest *new_box_autoadd_sign_message_request_0(void); struct wire_StaticBackupRequest *new_box_autoadd_static_backup_request_0(void); @@ -381,7 +389,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) new_box_autoadd_i64_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_list_payments_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_ln_url_auth_request_data_0); - dummy_var ^= ((int64_t) (void*) new_box_autoadd_ln_url_pay_request_data_0); + dummy_var ^= ((int64_t) (void*) new_box_autoadd_ln_url_pay_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_ln_url_withdraw_request_data_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_node_config_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_open_channel_fee_request_0); @@ -391,6 +399,7 @@ static int64_t dummy_method_to_enforce_bundling(void) { dummy_var ^= ((int64_t) (void*) new_box_autoadd_refund_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_reverse_swap_fees_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_send_onchain_request_0); + dummy_var ^= ((int64_t) (void*) new_box_autoadd_send_spontaneous_payment_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_sign_message_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_static_backup_request_0); dummy_var ^= ((int64_t) (void*) new_box_autoadd_sweep_request_0); diff --git a/libs/sdk-flutter/lib/breez_sdk.dart b/libs/sdk-flutter/lib/breez_sdk.dart index 3a23a3b1c..3799bda3e 100644 --- a/libs/sdk-flutter/lib/breez_sdk.dart +++ b/libs/sdk-flutter/lib/breez_sdk.dart @@ -227,16 +227,11 @@ class BreezSDK { /// /// # Arguments /// - /// * `nodeId` - The destination nodeId - /// * `amountSats` - The amount to pay in satoshis - Future sendSpontaneousPayment({ - required String nodeId, - required int amountSats, + /// * `req` - The send spontaneous payment request + Future sendSpontaneousPayment({ + required SendSpontaneousPaymentRequest req, }) async { - return await _lnToolkit.sendSpontaneousPayment( - nodeId: nodeId, - amountSats: amountSats, - ); + return await _lnToolkit.sendSpontaneousPayment(req: req); } /// Creates an bolt11 payment request. @@ -259,15 +254,9 @@ class BreezSDK { /// Second step of LNURL-pay. The first step is `parse()`, which also validates the LNURL destination /// and generates the `LnUrlPayRequestData` payload needed here. Future lnurlPay({ - required LnUrlPayRequestData reqData, - required int userAmountSat, - String? comment, + required LnUrlPayRequest req, }) async { - return await _lnToolkit.lnurlPay( - reqData: reqData, - userAmountSat: userAmountSat, - comment: comment, - ); + return await _lnToolkit.lnurlPay(req: req); } /// Second step of LNURL-withdraw. The first step is `parse()`, which also validates the LNURL destination diff --git a/libs/sdk-flutter/lib/bridge_generated.dart b/libs/sdk-flutter/lib/bridge_generated.dart index 9496aebcb..949216176 100644 --- a/libs/sdk-flutter/lib/bridge_generated.dart +++ b/libs/sdk-flutter/lib/bridge_generated.dart @@ -142,7 +142,8 @@ abstract class BreezSdkCore { FlutterRustBridgeTaskConstMeta get kSendPaymentConstMeta; /// See [BreezServices::send_spontaneous_payment] - Future sendSpontaneousPayment({required String nodeId, required int amountSats, dynamic hint}); + Future sendSpontaneousPayment( + {required SendSpontaneousPaymentRequest req, dynamic hint}); FlutterRustBridgeTaskConstMeta get kSendSpontaneousPaymentConstMeta; @@ -152,8 +153,7 @@ abstract class BreezSdkCore { FlutterRustBridgeTaskConstMeta get kReceivePaymentConstMeta; /// See [BreezServices::lnurl_pay] - Future lnurlPay( - {required LnUrlPayRequestData reqData, required int userAmountSat, String? comment, dynamic hint}); + Future lnurlPay({required LnUrlPayRequest req, dynamic hint}); FlutterRustBridgeTaskConstMeta get kLnurlPayConstMeta; @@ -703,6 +703,19 @@ class LnUrlErrorData { }); } +/// Represents a LNURL-pay request. +class LnUrlPayRequest { + final LnUrlPayRequestData reqData; + final int amountMsat; + final String? comment; + + const LnUrlPayRequest({ + required this.reqData, + required this.amountMsat, + this.comment, + }); +} + /// Wrapped in a [LnUrlPay], this is the result of [parse] when given a LNURL-pay endpoint. /// /// It represents the endpoint's parameters for the LNURL workflow. @@ -1325,6 +1338,29 @@ class SendOnchainResponse { }); } +/// Represents a send payment response. +class SendPaymentResponse { + final Payment payment; + + const SendPaymentResponse({ + required this.payment, + }); +} + +/// Represents a send spontaneous payment request. +class SendSpontaneousPaymentRequest { + /// The node id to send this payment is + final String nodeId; + + /// The amount in millisatoshis for this payment + final int amountMsat; + + const SendSpontaneousPaymentRequest({ + required this.nodeId, + required this.amountMsat, + }); +} + /// Request to sign a message with the node's private key. class SignMessageRequest { /// The message to be signed by the node's private key. @@ -1914,21 +1950,21 @@ class BreezSdkCoreImpl implements BreezSdkCore { argNames: ["bolt11", "amountMsat"], ); - Future sendSpontaneousPayment({required String nodeId, required int amountSats, dynamic hint}) { - var arg0 = _platform.api2wire_String(nodeId); - var arg1 = _platform.api2wire_u64(amountSats); + Future sendSpontaneousPayment( + {required SendSpontaneousPaymentRequest req, dynamic hint}) { + var arg0 = _platform.api2wire_box_autoadd_send_spontaneous_payment_request(req); return _platform.executeNormal(FlutterRustBridgeTask( - callFfi: (port_) => _platform.inner.wire_send_spontaneous_payment(port_, arg0, arg1), - parseSuccessData: _wire2api_payment, + callFfi: (port_) => _platform.inner.wire_send_spontaneous_payment(port_, arg0), + parseSuccessData: _wire2api_send_payment_response, constMeta: kSendSpontaneousPaymentConstMeta, - argValues: [nodeId, amountSats], + argValues: [req], hint: hint, )); } FlutterRustBridgeTaskConstMeta get kSendSpontaneousPaymentConstMeta => const FlutterRustBridgeTaskConstMeta( debugName: "send_spontaneous_payment", - argNames: ["nodeId", "amountSats"], + argNames: ["req"], ); Future receivePayment({required ReceivePaymentRequest req, dynamic hint}) { @@ -1947,23 +1983,20 @@ class BreezSdkCoreImpl implements BreezSdkCore { argNames: ["req"], ); - Future lnurlPay( - {required LnUrlPayRequestData reqData, required int userAmountSat, String? comment, dynamic hint}) { - var arg0 = _platform.api2wire_box_autoadd_ln_url_pay_request_data(reqData); - var arg1 = _platform.api2wire_u64(userAmountSat); - var arg2 = _platform.api2wire_opt_String(comment); + Future lnurlPay({required LnUrlPayRequest req, dynamic hint}) { + var arg0 = _platform.api2wire_box_autoadd_ln_url_pay_request(req); return _platform.executeNormal(FlutterRustBridgeTask( - callFfi: (port_) => _platform.inner.wire_lnurl_pay(port_, arg0, arg1, arg2), + callFfi: (port_) => _platform.inner.wire_lnurl_pay(port_, arg0), parseSuccessData: _wire2api_ln_url_pay_result, constMeta: kLnurlPayConstMeta, - argValues: [reqData, userAmountSat, comment], + argValues: [req], hint: hint, )); } FlutterRustBridgeTaskConstMeta get kLnurlPayConstMeta => const FlutterRustBridgeTaskConstMeta( debugName: "lnurl_pay", - argNames: ["reqData", "userAmountSat", "comment"], + argNames: ["req"], ); Future lnurlWithdraw( @@ -3069,6 +3102,14 @@ class BreezSdkCoreImpl implements BreezSdkCore { ); } + SendPaymentResponse _wire2api_send_payment_response(dynamic raw) { + final arr = raw as List; + if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); + return SendPaymentResponse( + payment: _wire2api_payment(arr[0]), + ); + } + SignMessageResponse _wire2api_sign_message_response(dynamic raw) { final arr = raw as List; if (arr.length != 1) throw Exception('unexpected arr length: expect 1 but see ${arr.length}'); @@ -3328,10 +3369,9 @@ class BreezSdkCorePlatform extends FlutterRustBridgeBase { } @protected - ffi.Pointer api2wire_box_autoadd_ln_url_pay_request_data( - LnUrlPayRequestData raw) { - final ptr = inner.new_box_autoadd_ln_url_pay_request_data_0(); - _api_fill_to_wire_ln_url_pay_request_data(raw, ptr.ref); + ffi.Pointer api2wire_box_autoadd_ln_url_pay_request(LnUrlPayRequest raw) { + final ptr = inner.new_box_autoadd_ln_url_pay_request_0(); + _api_fill_to_wire_ln_url_pay_request(raw, ptr.ref); return ptr; } @@ -3403,6 +3443,14 @@ class BreezSdkCorePlatform extends FlutterRustBridgeBase { return ptr; } + @protected + ffi.Pointer api2wire_box_autoadd_send_spontaneous_payment_request( + SendSpontaneousPaymentRequest raw) { + final ptr = inner.new_box_autoadd_send_spontaneous_payment_request_0(); + _api_fill_to_wire_send_spontaneous_payment_request(raw, ptr.ref); + return ptr; + } + @protected ffi.Pointer api2wire_box_autoadd_sign_message_request(SignMessageRequest raw) { final ptr = inner.new_box_autoadd_sign_message_request_0(); @@ -3529,9 +3577,9 @@ class BreezSdkCorePlatform extends FlutterRustBridgeBase { _api_fill_to_wire_ln_url_auth_request_data(apiObj, wireObj.ref); } - void _api_fill_to_wire_box_autoadd_ln_url_pay_request_data( - LnUrlPayRequestData apiObj, ffi.Pointer wireObj) { - _api_fill_to_wire_ln_url_pay_request_data(apiObj, wireObj.ref); + void _api_fill_to_wire_box_autoadd_ln_url_pay_request( + LnUrlPayRequest apiObj, ffi.Pointer wireObj) { + _api_fill_to_wire_ln_url_pay_request(apiObj, wireObj.ref); } void _api_fill_to_wire_box_autoadd_ln_url_withdraw_request_data( @@ -3578,6 +3626,11 @@ class BreezSdkCorePlatform extends FlutterRustBridgeBase { _api_fill_to_wire_send_onchain_request(apiObj, wireObj.ref); } + void _api_fill_to_wire_box_autoadd_send_spontaneous_payment_request( + SendSpontaneousPaymentRequest apiObj, ffi.Pointer wireObj) { + _api_fill_to_wire_send_spontaneous_payment_request(apiObj, wireObj.ref); + } + void _api_fill_to_wire_box_autoadd_sign_message_request( SignMessageRequest apiObj, ffi.Pointer wireObj) { _api_fill_to_wire_sign_message_request(apiObj, wireObj.ref); @@ -3646,6 +3699,12 @@ class BreezSdkCorePlatform extends FlutterRustBridgeBase { wireObj.url = api2wire_String(apiObj.url); } + void _api_fill_to_wire_ln_url_pay_request(LnUrlPayRequest apiObj, wire_LnUrlPayRequest wireObj) { + _api_fill_to_wire_ln_url_pay_request_data(apiObj.reqData, wireObj.req_data); + wireObj.amount_msat = api2wire_u64(apiObj.amountMsat); + wireObj.comment = api2wire_opt_String(apiObj.comment); + } + void _api_fill_to_wire_ln_url_pay_request_data( LnUrlPayRequestData apiObj, wire_LnUrlPayRequestData wireObj) { wireObj.callback = api2wire_String(apiObj.callback); @@ -3735,6 +3794,12 @@ class BreezSdkCorePlatform extends FlutterRustBridgeBase { wireObj.sat_per_vbyte = api2wire_u64(apiObj.satPerVbyte); } + void _api_fill_to_wire_send_spontaneous_payment_request( + SendSpontaneousPaymentRequest apiObj, wire_SendSpontaneousPaymentRequest wireObj) { + wireObj.node_id = api2wire_String(apiObj.nodeId); + wireObj.amount_msat = api2wire_u64(apiObj.amountMsat); + } + void _api_fill_to_wire_sign_message_request(SignMessageRequest apiObj, wire_SignMessageRequest wireObj) { wireObj.message = api2wire_String(apiObj.message); } @@ -4192,21 +4257,19 @@ class BreezSdkCoreWire implements FlutterRustBridgeWireBase { void wire_send_spontaneous_payment( int port_, - ffi.Pointer node_id, - int amount_sats, + ffi.Pointer req, ) { return _wire_send_spontaneous_payment( port_, - node_id, - amount_sats, + req, ); } - late final _wire_send_spontaneous_paymentPtr = - _lookup, ffi.Uint64)>>( - 'wire_send_spontaneous_payment'); - late final _wire_send_spontaneous_payment = - _wire_send_spontaneous_paymentPtr.asFunction, int)>(); + late final _wire_send_spontaneous_paymentPtr = _lookup< + ffi.NativeFunction)>>( + 'wire_send_spontaneous_payment'); + late final _wire_send_spontaneous_payment = _wire_send_spontaneous_paymentPtr + .asFunction)>(); void wire_receive_payment( int port_, @@ -4226,24 +4289,19 @@ class BreezSdkCoreWire implements FlutterRustBridgeWireBase { void wire_lnurl_pay( int port_, - ffi.Pointer req_data, - int user_amount_sat, - ffi.Pointer comment, + ffi.Pointer req, ) { return _wire_lnurl_pay( port_, - req_data, - user_amount_sat, - comment, + req, ); } - late final _wire_lnurl_payPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Int64, ffi.Pointer, ffi.Uint64, - ffi.Pointer)>>('wire_lnurl_pay'); - late final _wire_lnurl_pay = _wire_lnurl_payPtr.asFunction< - void Function(int, ffi.Pointer, int, ffi.Pointer)>(); + late final _wire_lnurl_payPtr = + _lookup)>>( + 'wire_lnurl_pay'); + late final _wire_lnurl_pay = + _wire_lnurl_payPtr.asFunction)>(); void wire_lnurl_withdraw( int port_, @@ -4575,15 +4633,15 @@ class BreezSdkCoreWire implements FlutterRustBridgeWireBase { late final _new_box_autoadd_ln_url_auth_request_data_0 = _new_box_autoadd_ln_url_auth_request_data_0Ptr .asFunction Function()>(); - ffi.Pointer new_box_autoadd_ln_url_pay_request_data_0() { - return _new_box_autoadd_ln_url_pay_request_data_0(); + ffi.Pointer new_box_autoadd_ln_url_pay_request_0() { + return _new_box_autoadd_ln_url_pay_request_0(); } - late final _new_box_autoadd_ln_url_pay_request_data_0Ptr = - _lookup Function()>>( - 'new_box_autoadd_ln_url_pay_request_data_0'); - late final _new_box_autoadd_ln_url_pay_request_data_0 = _new_box_autoadd_ln_url_pay_request_data_0Ptr - .asFunction Function()>(); + late final _new_box_autoadd_ln_url_pay_request_0Ptr = + _lookup Function()>>( + 'new_box_autoadd_ln_url_pay_request_0'); + late final _new_box_autoadd_ln_url_pay_request_0 = + _new_box_autoadd_ln_url_pay_request_0Ptr.asFunction Function()>(); ffi.Pointer new_box_autoadd_ln_url_withdraw_request_data_0() { return _new_box_autoadd_ln_url_withdraw_request_data_0(); @@ -4675,6 +4733,17 @@ class BreezSdkCoreWire implements FlutterRustBridgeWireBase { late final _new_box_autoadd_send_onchain_request_0 = _new_box_autoadd_send_onchain_request_0Ptr .asFunction Function()>(); + ffi.Pointer new_box_autoadd_send_spontaneous_payment_request_0() { + return _new_box_autoadd_send_spontaneous_payment_request_0(); + } + + late final _new_box_autoadd_send_spontaneous_payment_request_0Ptr = + _lookup Function()>>( + 'new_box_autoadd_send_spontaneous_payment_request_0'); + late final _new_box_autoadd_send_spontaneous_payment_request_0 = + _new_box_autoadd_send_spontaneous_payment_request_0Ptr + .asFunction Function()>(); + ffi.Pointer new_box_autoadd_sign_message_request_0() { return _new_box_autoadd_sign_message_request_0(); } @@ -4859,6 +4928,13 @@ class wire_ListPaymentsRequest extends ffi.Struct { external ffi.Pointer limit; } +class wire_SendSpontaneousPaymentRequest extends ffi.Struct { + external ffi.Pointer node_id; + + @ffi.Uint64() + external int amount_msat; +} + class wire_OpeningFeeParams extends ffi.Struct { @ffi.Uint64() external int min_msat; @@ -4913,6 +4989,15 @@ class wire_LnUrlPayRequestData extends ffi.Struct { external ffi.Pointer ln_address; } +class wire_LnUrlPayRequest extends ffi.Struct { + external wire_LnUrlPayRequestData req_data; + + @ffi.Uint64() + external int amount_msat; + + external ffi.Pointer comment; +} + class wire_LnUrlWithdrawRequestData extends ffi.Struct { external ffi.Pointer callback; diff --git a/libs/sdk-flutter/lib/bridge_generated.freezed.dart b/libs/sdk-flutter/lib/bridge_generated.freezed.dart index 659acf80a..d4445660c 100644 --- a/libs/sdk-flutter/lib/bridge_generated.freezed.dart +++ b/libs/sdk-flutter/lib/bridge_generated.freezed.dart @@ -109,19 +109,20 @@ class _$BreezEventCopyWithImpl<$Res, $Val extends BreezEvent> implements $BreezE } /// @nodoc -abstract class _$$BreezEvent_NewBlockCopyWith<$Res> { - factory _$$BreezEvent_NewBlockCopyWith( - _$BreezEvent_NewBlock value, $Res Function(_$BreezEvent_NewBlock) then) = - __$$BreezEvent_NewBlockCopyWithImpl<$Res>; +abstract class _$$BreezEvent_NewBlockImplCopyWith<$Res> { + factory _$$BreezEvent_NewBlockImplCopyWith( + _$BreezEvent_NewBlockImpl value, $Res Function(_$BreezEvent_NewBlockImpl) then) = + __$$BreezEvent_NewBlockImplCopyWithImpl<$Res>; @useResult $Res call({int block}); } /// @nodoc -class __$$BreezEvent_NewBlockCopyWithImpl<$Res> extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_NewBlock> - implements _$$BreezEvent_NewBlockCopyWith<$Res> { - __$$BreezEvent_NewBlockCopyWithImpl( - _$BreezEvent_NewBlock _value, $Res Function(_$BreezEvent_NewBlock) _then) +class __$$BreezEvent_NewBlockImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_NewBlockImpl> + implements _$$BreezEvent_NewBlockImplCopyWith<$Res> { + __$$BreezEvent_NewBlockImplCopyWithImpl( + _$BreezEvent_NewBlockImpl _value, $Res Function(_$BreezEvent_NewBlockImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -129,7 +130,7 @@ class __$$BreezEvent_NewBlockCopyWithImpl<$Res> extends _$BreezEventCopyWithImpl $Res call({ Object? block = null, }) { - return _then(_$BreezEvent_NewBlock( + return _then(_$BreezEvent_NewBlockImpl( block: null == block ? _value.block : block // ignore: cast_nullable_to_non_nullable @@ -140,8 +141,8 @@ class __$$BreezEvent_NewBlockCopyWithImpl<$Res> extends _$BreezEventCopyWithImpl /// @nodoc -class _$BreezEvent_NewBlock implements BreezEvent_NewBlock { - const _$BreezEvent_NewBlock({required this.block}); +class _$BreezEvent_NewBlockImpl implements BreezEvent_NewBlock { + const _$BreezEvent_NewBlockImpl({required this.block}); @override final int block; @@ -155,7 +156,7 @@ class _$BreezEvent_NewBlock implements BreezEvent_NewBlock { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BreezEvent_NewBlock && + other is _$BreezEvent_NewBlockImpl && (identical(other.block, block) || other.block == block)); } @@ -165,8 +166,8 @@ class _$BreezEvent_NewBlock implements BreezEvent_NewBlock { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BreezEvent_NewBlockCopyWith<_$BreezEvent_NewBlock> get copyWith => - __$$BreezEvent_NewBlockCopyWithImpl<_$BreezEvent_NewBlock>(this, _$identity); + _$$BreezEvent_NewBlockImplCopyWith<_$BreezEvent_NewBlockImpl> get copyWith => + __$$BreezEvent_NewBlockImplCopyWithImpl<_$BreezEvent_NewBlockImpl>(this, _$identity); @override @optionalTypeArgs @@ -268,28 +269,29 @@ class _$BreezEvent_NewBlock implements BreezEvent_NewBlock { } abstract class BreezEvent_NewBlock implements BreezEvent { - const factory BreezEvent_NewBlock({required final int block}) = _$BreezEvent_NewBlock; + const factory BreezEvent_NewBlock({required final int block}) = _$BreezEvent_NewBlockImpl; int get block; @JsonKey(ignore: true) - _$$BreezEvent_NewBlockCopyWith<_$BreezEvent_NewBlock> get copyWith => throw _privateConstructorUsedError; + _$$BreezEvent_NewBlockImplCopyWith<_$BreezEvent_NewBlockImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$BreezEvent_InvoicePaidCopyWith<$Res> { - factory _$$BreezEvent_InvoicePaidCopyWith( - _$BreezEvent_InvoicePaid value, $Res Function(_$BreezEvent_InvoicePaid) then) = - __$$BreezEvent_InvoicePaidCopyWithImpl<$Res>; +abstract class _$$BreezEvent_InvoicePaidImplCopyWith<$Res> { + factory _$$BreezEvent_InvoicePaidImplCopyWith( + _$BreezEvent_InvoicePaidImpl value, $Res Function(_$BreezEvent_InvoicePaidImpl) then) = + __$$BreezEvent_InvoicePaidImplCopyWithImpl<$Res>; @useResult $Res call({InvoicePaidDetails details}); } /// @nodoc -class __$$BreezEvent_InvoicePaidCopyWithImpl<$Res> - extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_InvoicePaid> - implements _$$BreezEvent_InvoicePaidCopyWith<$Res> { - __$$BreezEvent_InvoicePaidCopyWithImpl( - _$BreezEvent_InvoicePaid _value, $Res Function(_$BreezEvent_InvoicePaid) _then) +class __$$BreezEvent_InvoicePaidImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_InvoicePaidImpl> + implements _$$BreezEvent_InvoicePaidImplCopyWith<$Res> { + __$$BreezEvent_InvoicePaidImplCopyWithImpl( + _$BreezEvent_InvoicePaidImpl _value, $Res Function(_$BreezEvent_InvoicePaidImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -297,7 +299,7 @@ class __$$BreezEvent_InvoicePaidCopyWithImpl<$Res> $Res call({ Object? details = null, }) { - return _then(_$BreezEvent_InvoicePaid( + return _then(_$BreezEvent_InvoicePaidImpl( details: null == details ? _value.details : details // ignore: cast_nullable_to_non_nullable @@ -308,8 +310,8 @@ class __$$BreezEvent_InvoicePaidCopyWithImpl<$Res> /// @nodoc -class _$BreezEvent_InvoicePaid implements BreezEvent_InvoicePaid { - const _$BreezEvent_InvoicePaid({required this.details}); +class _$BreezEvent_InvoicePaidImpl implements BreezEvent_InvoicePaid { + const _$BreezEvent_InvoicePaidImpl({required this.details}); @override final InvoicePaidDetails details; @@ -323,7 +325,7 @@ class _$BreezEvent_InvoicePaid implements BreezEvent_InvoicePaid { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BreezEvent_InvoicePaid && + other is _$BreezEvent_InvoicePaidImpl && (identical(other.details, details) || other.details == details)); } @@ -333,8 +335,8 @@ class _$BreezEvent_InvoicePaid implements BreezEvent_InvoicePaid { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BreezEvent_InvoicePaidCopyWith<_$BreezEvent_InvoicePaid> get copyWith => - __$$BreezEvent_InvoicePaidCopyWithImpl<_$BreezEvent_InvoicePaid>(this, _$identity); + _$$BreezEvent_InvoicePaidImplCopyWith<_$BreezEvent_InvoicePaidImpl> get copyWith => + __$$BreezEvent_InvoicePaidImplCopyWithImpl<_$BreezEvent_InvoicePaidImpl>(this, _$identity); @override @optionalTypeArgs @@ -437,31 +439,34 @@ class _$BreezEvent_InvoicePaid implements BreezEvent_InvoicePaid { abstract class BreezEvent_InvoicePaid implements BreezEvent { const factory BreezEvent_InvoicePaid({required final InvoicePaidDetails details}) = - _$BreezEvent_InvoicePaid; + _$BreezEvent_InvoicePaidImpl; InvoicePaidDetails get details; @JsonKey(ignore: true) - _$$BreezEvent_InvoicePaidCopyWith<_$BreezEvent_InvoicePaid> get copyWith => + _$$BreezEvent_InvoicePaidImplCopyWith<_$BreezEvent_InvoicePaidImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$BreezEvent_SyncedCopyWith<$Res> { - factory _$$BreezEvent_SyncedCopyWith(_$BreezEvent_Synced value, $Res Function(_$BreezEvent_Synced) then) = - __$$BreezEvent_SyncedCopyWithImpl<$Res>; +abstract class _$$BreezEvent_SyncedImplCopyWith<$Res> { + factory _$$BreezEvent_SyncedImplCopyWith( + _$BreezEvent_SyncedImpl value, $Res Function(_$BreezEvent_SyncedImpl) then) = + __$$BreezEvent_SyncedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$BreezEvent_SyncedCopyWithImpl<$Res> extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_Synced> - implements _$$BreezEvent_SyncedCopyWith<$Res> { - __$$BreezEvent_SyncedCopyWithImpl(_$BreezEvent_Synced _value, $Res Function(_$BreezEvent_Synced) _then) +class __$$BreezEvent_SyncedImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_SyncedImpl> + implements _$$BreezEvent_SyncedImplCopyWith<$Res> { + __$$BreezEvent_SyncedImplCopyWithImpl( + _$BreezEvent_SyncedImpl _value, $Res Function(_$BreezEvent_SyncedImpl) _then) : super(_value, _then); } /// @nodoc -class _$BreezEvent_Synced implements BreezEvent_Synced { - const _$BreezEvent_Synced(); +class _$BreezEvent_SyncedImpl implements BreezEvent_Synced { + const _$BreezEvent_SyncedImpl(); @override String toString() { @@ -470,7 +475,7 @@ class _$BreezEvent_Synced implements BreezEvent_Synced { @override bool operator ==(dynamic other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$BreezEvent_Synced); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$BreezEvent_SyncedImpl); } @override @@ -576,24 +581,24 @@ class _$BreezEvent_Synced implements BreezEvent_Synced { } abstract class BreezEvent_Synced implements BreezEvent { - const factory BreezEvent_Synced() = _$BreezEvent_Synced; + const factory BreezEvent_Synced() = _$BreezEvent_SyncedImpl; } /// @nodoc -abstract class _$$BreezEvent_PaymentSucceedCopyWith<$Res> { - factory _$$BreezEvent_PaymentSucceedCopyWith( - _$BreezEvent_PaymentSucceed value, $Res Function(_$BreezEvent_PaymentSucceed) then) = - __$$BreezEvent_PaymentSucceedCopyWithImpl<$Res>; +abstract class _$$BreezEvent_PaymentSucceedImplCopyWith<$Res> { + factory _$$BreezEvent_PaymentSucceedImplCopyWith( + _$BreezEvent_PaymentSucceedImpl value, $Res Function(_$BreezEvent_PaymentSucceedImpl) then) = + __$$BreezEvent_PaymentSucceedImplCopyWithImpl<$Res>; @useResult $Res call({Payment details}); } /// @nodoc -class __$$BreezEvent_PaymentSucceedCopyWithImpl<$Res> - extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_PaymentSucceed> - implements _$$BreezEvent_PaymentSucceedCopyWith<$Res> { - __$$BreezEvent_PaymentSucceedCopyWithImpl( - _$BreezEvent_PaymentSucceed _value, $Res Function(_$BreezEvent_PaymentSucceed) _then) +class __$$BreezEvent_PaymentSucceedImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_PaymentSucceedImpl> + implements _$$BreezEvent_PaymentSucceedImplCopyWith<$Res> { + __$$BreezEvent_PaymentSucceedImplCopyWithImpl( + _$BreezEvent_PaymentSucceedImpl _value, $Res Function(_$BreezEvent_PaymentSucceedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -601,7 +606,7 @@ class __$$BreezEvent_PaymentSucceedCopyWithImpl<$Res> $Res call({ Object? details = null, }) { - return _then(_$BreezEvent_PaymentSucceed( + return _then(_$BreezEvent_PaymentSucceedImpl( details: null == details ? _value.details : details // ignore: cast_nullable_to_non_nullable @@ -612,8 +617,8 @@ class __$$BreezEvent_PaymentSucceedCopyWithImpl<$Res> /// @nodoc -class _$BreezEvent_PaymentSucceed implements BreezEvent_PaymentSucceed { - const _$BreezEvent_PaymentSucceed({required this.details}); +class _$BreezEvent_PaymentSucceedImpl implements BreezEvent_PaymentSucceed { + const _$BreezEvent_PaymentSucceedImpl({required this.details}); @override final Payment details; @@ -627,7 +632,7 @@ class _$BreezEvent_PaymentSucceed implements BreezEvent_PaymentSucceed { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BreezEvent_PaymentSucceed && + other is _$BreezEvent_PaymentSucceedImpl && (identical(other.details, details) || other.details == details)); } @@ -637,8 +642,8 @@ class _$BreezEvent_PaymentSucceed implements BreezEvent_PaymentSucceed { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BreezEvent_PaymentSucceedCopyWith<_$BreezEvent_PaymentSucceed> get copyWith => - __$$BreezEvent_PaymentSucceedCopyWithImpl<_$BreezEvent_PaymentSucceed>(this, _$identity); + _$$BreezEvent_PaymentSucceedImplCopyWith<_$BreezEvent_PaymentSucceedImpl> get copyWith => + __$$BreezEvent_PaymentSucceedImplCopyWithImpl<_$BreezEvent_PaymentSucceedImpl>(this, _$identity); @override @optionalTypeArgs @@ -740,29 +745,29 @@ class _$BreezEvent_PaymentSucceed implements BreezEvent_PaymentSucceed { } abstract class BreezEvent_PaymentSucceed implements BreezEvent { - const factory BreezEvent_PaymentSucceed({required final Payment details}) = _$BreezEvent_PaymentSucceed; + const factory BreezEvent_PaymentSucceed({required final Payment details}) = _$BreezEvent_PaymentSucceedImpl; Payment get details; @JsonKey(ignore: true) - _$$BreezEvent_PaymentSucceedCopyWith<_$BreezEvent_PaymentSucceed> get copyWith => + _$$BreezEvent_PaymentSucceedImplCopyWith<_$BreezEvent_PaymentSucceedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$BreezEvent_PaymentFailedCopyWith<$Res> { - factory _$$BreezEvent_PaymentFailedCopyWith( - _$BreezEvent_PaymentFailed value, $Res Function(_$BreezEvent_PaymentFailed) then) = - __$$BreezEvent_PaymentFailedCopyWithImpl<$Res>; +abstract class _$$BreezEvent_PaymentFailedImplCopyWith<$Res> { + factory _$$BreezEvent_PaymentFailedImplCopyWith( + _$BreezEvent_PaymentFailedImpl value, $Res Function(_$BreezEvent_PaymentFailedImpl) then) = + __$$BreezEvent_PaymentFailedImplCopyWithImpl<$Res>; @useResult $Res call({PaymentFailedData details}); } /// @nodoc -class __$$BreezEvent_PaymentFailedCopyWithImpl<$Res> - extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_PaymentFailed> - implements _$$BreezEvent_PaymentFailedCopyWith<$Res> { - __$$BreezEvent_PaymentFailedCopyWithImpl( - _$BreezEvent_PaymentFailed _value, $Res Function(_$BreezEvent_PaymentFailed) _then) +class __$$BreezEvent_PaymentFailedImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_PaymentFailedImpl> + implements _$$BreezEvent_PaymentFailedImplCopyWith<$Res> { + __$$BreezEvent_PaymentFailedImplCopyWithImpl( + _$BreezEvent_PaymentFailedImpl _value, $Res Function(_$BreezEvent_PaymentFailedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -770,7 +775,7 @@ class __$$BreezEvent_PaymentFailedCopyWithImpl<$Res> $Res call({ Object? details = null, }) { - return _then(_$BreezEvent_PaymentFailed( + return _then(_$BreezEvent_PaymentFailedImpl( details: null == details ? _value.details : details // ignore: cast_nullable_to_non_nullable @@ -781,8 +786,8 @@ class __$$BreezEvent_PaymentFailedCopyWithImpl<$Res> /// @nodoc -class _$BreezEvent_PaymentFailed implements BreezEvent_PaymentFailed { - const _$BreezEvent_PaymentFailed({required this.details}); +class _$BreezEvent_PaymentFailedImpl implements BreezEvent_PaymentFailed { + const _$BreezEvent_PaymentFailedImpl({required this.details}); @override final PaymentFailedData details; @@ -796,7 +801,7 @@ class _$BreezEvent_PaymentFailed implements BreezEvent_PaymentFailed { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BreezEvent_PaymentFailed && + other is _$BreezEvent_PaymentFailedImpl && (identical(other.details, details) || other.details == details)); } @@ -806,8 +811,8 @@ class _$BreezEvent_PaymentFailed implements BreezEvent_PaymentFailed { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BreezEvent_PaymentFailedCopyWith<_$BreezEvent_PaymentFailed> get copyWith => - __$$BreezEvent_PaymentFailedCopyWithImpl<_$BreezEvent_PaymentFailed>(this, _$identity); + _$$BreezEvent_PaymentFailedImplCopyWith<_$BreezEvent_PaymentFailedImpl> get copyWith => + __$$BreezEvent_PaymentFailedImplCopyWithImpl<_$BreezEvent_PaymentFailedImpl>(this, _$identity); @override @optionalTypeArgs @@ -910,34 +915,34 @@ class _$BreezEvent_PaymentFailed implements BreezEvent_PaymentFailed { abstract class BreezEvent_PaymentFailed implements BreezEvent { const factory BreezEvent_PaymentFailed({required final PaymentFailedData details}) = - _$BreezEvent_PaymentFailed; + _$BreezEvent_PaymentFailedImpl; PaymentFailedData get details; @JsonKey(ignore: true) - _$$BreezEvent_PaymentFailedCopyWith<_$BreezEvent_PaymentFailed> get copyWith => + _$$BreezEvent_PaymentFailedImplCopyWith<_$BreezEvent_PaymentFailedImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$BreezEvent_BackupStartedCopyWith<$Res> { - factory _$$BreezEvent_BackupStartedCopyWith( - _$BreezEvent_BackupStarted value, $Res Function(_$BreezEvent_BackupStarted) then) = - __$$BreezEvent_BackupStartedCopyWithImpl<$Res>; +abstract class _$$BreezEvent_BackupStartedImplCopyWith<$Res> { + factory _$$BreezEvent_BackupStartedImplCopyWith( + _$BreezEvent_BackupStartedImpl value, $Res Function(_$BreezEvent_BackupStartedImpl) then) = + __$$BreezEvent_BackupStartedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$BreezEvent_BackupStartedCopyWithImpl<$Res> - extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_BackupStarted> - implements _$$BreezEvent_BackupStartedCopyWith<$Res> { - __$$BreezEvent_BackupStartedCopyWithImpl( - _$BreezEvent_BackupStarted _value, $Res Function(_$BreezEvent_BackupStarted) _then) +class __$$BreezEvent_BackupStartedImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_BackupStartedImpl> + implements _$$BreezEvent_BackupStartedImplCopyWith<$Res> { + __$$BreezEvent_BackupStartedImplCopyWithImpl( + _$BreezEvent_BackupStartedImpl _value, $Res Function(_$BreezEvent_BackupStartedImpl) _then) : super(_value, _then); } /// @nodoc -class _$BreezEvent_BackupStarted implements BreezEvent_BackupStarted { - const _$BreezEvent_BackupStarted(); +class _$BreezEvent_BackupStartedImpl implements BreezEvent_BackupStarted { + const _$BreezEvent_BackupStartedImpl(); @override String toString() { @@ -947,7 +952,7 @@ class _$BreezEvent_BackupStarted implements BreezEvent_BackupStarted { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$BreezEvent_BackupStarted); + (other.runtimeType == runtimeType && other is _$BreezEvent_BackupStartedImpl); } @override @@ -1053,29 +1058,29 @@ class _$BreezEvent_BackupStarted implements BreezEvent_BackupStarted { } abstract class BreezEvent_BackupStarted implements BreezEvent { - const factory BreezEvent_BackupStarted() = _$BreezEvent_BackupStarted; + const factory BreezEvent_BackupStarted() = _$BreezEvent_BackupStartedImpl; } /// @nodoc -abstract class _$$BreezEvent_BackupSucceededCopyWith<$Res> { - factory _$$BreezEvent_BackupSucceededCopyWith( - _$BreezEvent_BackupSucceeded value, $Res Function(_$BreezEvent_BackupSucceeded) then) = - __$$BreezEvent_BackupSucceededCopyWithImpl<$Res>; +abstract class _$$BreezEvent_BackupSucceededImplCopyWith<$Res> { + factory _$$BreezEvent_BackupSucceededImplCopyWith( + _$BreezEvent_BackupSucceededImpl value, $Res Function(_$BreezEvent_BackupSucceededImpl) then) = + __$$BreezEvent_BackupSucceededImplCopyWithImpl<$Res>; } /// @nodoc -class __$$BreezEvent_BackupSucceededCopyWithImpl<$Res> - extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_BackupSucceeded> - implements _$$BreezEvent_BackupSucceededCopyWith<$Res> { - __$$BreezEvent_BackupSucceededCopyWithImpl( - _$BreezEvent_BackupSucceeded _value, $Res Function(_$BreezEvent_BackupSucceeded) _then) +class __$$BreezEvent_BackupSucceededImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_BackupSucceededImpl> + implements _$$BreezEvent_BackupSucceededImplCopyWith<$Res> { + __$$BreezEvent_BackupSucceededImplCopyWithImpl( + _$BreezEvent_BackupSucceededImpl _value, $Res Function(_$BreezEvent_BackupSucceededImpl) _then) : super(_value, _then); } /// @nodoc -class _$BreezEvent_BackupSucceeded implements BreezEvent_BackupSucceeded { - const _$BreezEvent_BackupSucceeded(); +class _$BreezEvent_BackupSucceededImpl implements BreezEvent_BackupSucceeded { + const _$BreezEvent_BackupSucceededImpl(); @override String toString() { @@ -1085,7 +1090,7 @@ class _$BreezEvent_BackupSucceeded implements BreezEvent_BackupSucceeded { @override bool operator ==(dynamic other) { return identical(this, other) || - (other.runtimeType == runtimeType && other is _$BreezEvent_BackupSucceeded); + (other.runtimeType == runtimeType && other is _$BreezEvent_BackupSucceededImpl); } @override @@ -1191,24 +1196,24 @@ class _$BreezEvent_BackupSucceeded implements BreezEvent_BackupSucceeded { } abstract class BreezEvent_BackupSucceeded implements BreezEvent { - const factory BreezEvent_BackupSucceeded() = _$BreezEvent_BackupSucceeded; + const factory BreezEvent_BackupSucceeded() = _$BreezEvent_BackupSucceededImpl; } /// @nodoc -abstract class _$$BreezEvent_BackupFailedCopyWith<$Res> { - factory _$$BreezEvent_BackupFailedCopyWith( - _$BreezEvent_BackupFailed value, $Res Function(_$BreezEvent_BackupFailed) then) = - __$$BreezEvent_BackupFailedCopyWithImpl<$Res>; +abstract class _$$BreezEvent_BackupFailedImplCopyWith<$Res> { + factory _$$BreezEvent_BackupFailedImplCopyWith( + _$BreezEvent_BackupFailedImpl value, $Res Function(_$BreezEvent_BackupFailedImpl) then) = + __$$BreezEvent_BackupFailedImplCopyWithImpl<$Res>; @useResult $Res call({BackupFailedData details}); } /// @nodoc -class __$$BreezEvent_BackupFailedCopyWithImpl<$Res> - extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_BackupFailed> - implements _$$BreezEvent_BackupFailedCopyWith<$Res> { - __$$BreezEvent_BackupFailedCopyWithImpl( - _$BreezEvent_BackupFailed _value, $Res Function(_$BreezEvent_BackupFailed) _then) +class __$$BreezEvent_BackupFailedImplCopyWithImpl<$Res> + extends _$BreezEventCopyWithImpl<$Res, _$BreezEvent_BackupFailedImpl> + implements _$$BreezEvent_BackupFailedImplCopyWith<$Res> { + __$$BreezEvent_BackupFailedImplCopyWithImpl( + _$BreezEvent_BackupFailedImpl _value, $Res Function(_$BreezEvent_BackupFailedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1216,7 +1221,7 @@ class __$$BreezEvent_BackupFailedCopyWithImpl<$Res> $Res call({ Object? details = null, }) { - return _then(_$BreezEvent_BackupFailed( + return _then(_$BreezEvent_BackupFailedImpl( details: null == details ? _value.details : details // ignore: cast_nullable_to_non_nullable @@ -1227,8 +1232,8 @@ class __$$BreezEvent_BackupFailedCopyWithImpl<$Res> /// @nodoc -class _$BreezEvent_BackupFailed implements BreezEvent_BackupFailed { - const _$BreezEvent_BackupFailed({required this.details}); +class _$BreezEvent_BackupFailedImpl implements BreezEvent_BackupFailed { + const _$BreezEvent_BackupFailedImpl({required this.details}); @override final BackupFailedData details; @@ -1242,7 +1247,7 @@ class _$BreezEvent_BackupFailed implements BreezEvent_BackupFailed { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$BreezEvent_BackupFailed && + other is _$BreezEvent_BackupFailedImpl && (identical(other.details, details) || other.details == details)); } @@ -1252,8 +1257,8 @@ class _$BreezEvent_BackupFailed implements BreezEvent_BackupFailed { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$BreezEvent_BackupFailedCopyWith<_$BreezEvent_BackupFailed> get copyWith => - __$$BreezEvent_BackupFailedCopyWithImpl<_$BreezEvent_BackupFailed>(this, _$identity); + _$$BreezEvent_BackupFailedImplCopyWith<_$BreezEvent_BackupFailedImpl> get copyWith => + __$$BreezEvent_BackupFailedImplCopyWithImpl<_$BreezEvent_BackupFailedImpl>(this, _$identity); @override @optionalTypeArgs @@ -1356,11 +1361,11 @@ class _$BreezEvent_BackupFailed implements BreezEvent_BackupFailed { abstract class BreezEvent_BackupFailed implements BreezEvent { const factory BreezEvent_BackupFailed({required final BackupFailedData details}) = - _$BreezEvent_BackupFailed; + _$BreezEvent_BackupFailedImpl; BackupFailedData get details; @JsonKey(ignore: true) - _$$BreezEvent_BackupFailedCopyWith<_$BreezEvent_BackupFailed> get copyWith => + _$$BreezEvent_BackupFailedImplCopyWith<_$BreezEvent_BackupFailedImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1459,20 +1464,20 @@ class _$InputTypeCopyWithImpl<$Res, $Val extends InputType> implements $InputTyp } /// @nodoc -abstract class _$$InputType_BitcoinAddressCopyWith<$Res> { - factory _$$InputType_BitcoinAddressCopyWith( - _$InputType_BitcoinAddress value, $Res Function(_$InputType_BitcoinAddress) then) = - __$$InputType_BitcoinAddressCopyWithImpl<$Res>; +abstract class _$$InputType_BitcoinAddressImplCopyWith<$Res> { + factory _$$InputType_BitcoinAddressImplCopyWith( + _$InputType_BitcoinAddressImpl value, $Res Function(_$InputType_BitcoinAddressImpl) then) = + __$$InputType_BitcoinAddressImplCopyWithImpl<$Res>; @useResult $Res call({BitcoinAddressData address}); } /// @nodoc -class __$$InputType_BitcoinAddressCopyWithImpl<$Res> - extends _$InputTypeCopyWithImpl<$Res, _$InputType_BitcoinAddress> - implements _$$InputType_BitcoinAddressCopyWith<$Res> { - __$$InputType_BitcoinAddressCopyWithImpl( - _$InputType_BitcoinAddress _value, $Res Function(_$InputType_BitcoinAddress) _then) +class __$$InputType_BitcoinAddressImplCopyWithImpl<$Res> + extends _$InputTypeCopyWithImpl<$Res, _$InputType_BitcoinAddressImpl> + implements _$$InputType_BitcoinAddressImplCopyWith<$Res> { + __$$InputType_BitcoinAddressImplCopyWithImpl( + _$InputType_BitcoinAddressImpl _value, $Res Function(_$InputType_BitcoinAddressImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1480,7 +1485,7 @@ class __$$InputType_BitcoinAddressCopyWithImpl<$Res> $Res call({ Object? address = null, }) { - return _then(_$InputType_BitcoinAddress( + return _then(_$InputType_BitcoinAddressImpl( address: null == address ? _value.address : address // ignore: cast_nullable_to_non_nullable @@ -1491,8 +1496,8 @@ class __$$InputType_BitcoinAddressCopyWithImpl<$Res> /// @nodoc -class _$InputType_BitcoinAddress implements InputType_BitcoinAddress { - const _$InputType_BitcoinAddress({required this.address}); +class _$InputType_BitcoinAddressImpl implements InputType_BitcoinAddress { + const _$InputType_BitcoinAddressImpl({required this.address}); @override final BitcoinAddressData address; @@ -1506,7 +1511,7 @@ class _$InputType_BitcoinAddress implements InputType_BitcoinAddress { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_BitcoinAddress && + other is _$InputType_BitcoinAddressImpl && (identical(other.address, address) || other.address == address)); } @@ -1516,8 +1521,8 @@ class _$InputType_BitcoinAddress implements InputType_BitcoinAddress { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_BitcoinAddressCopyWith<_$InputType_BitcoinAddress> get copyWith => - __$$InputType_BitcoinAddressCopyWithImpl<_$InputType_BitcoinAddress>(this, _$identity); + _$$InputType_BitcoinAddressImplCopyWith<_$InputType_BitcoinAddressImpl> get copyWith => + __$$InputType_BitcoinAddressImplCopyWithImpl<_$InputType_BitcoinAddressImpl>(this, _$identity); @override @optionalTypeArgs @@ -1620,26 +1625,28 @@ class _$InputType_BitcoinAddress implements InputType_BitcoinAddress { abstract class InputType_BitcoinAddress implements InputType { const factory InputType_BitcoinAddress({required final BitcoinAddressData address}) = - _$InputType_BitcoinAddress; + _$InputType_BitcoinAddressImpl; BitcoinAddressData get address; @JsonKey(ignore: true) - _$$InputType_BitcoinAddressCopyWith<_$InputType_BitcoinAddress> get copyWith => + _$$InputType_BitcoinAddressImplCopyWith<_$InputType_BitcoinAddressImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_Bolt11CopyWith<$Res> { - factory _$$InputType_Bolt11CopyWith(_$InputType_Bolt11 value, $Res Function(_$InputType_Bolt11) then) = - __$$InputType_Bolt11CopyWithImpl<$Res>; +abstract class _$$InputType_Bolt11ImplCopyWith<$Res> { + factory _$$InputType_Bolt11ImplCopyWith( + _$InputType_Bolt11Impl value, $Res Function(_$InputType_Bolt11Impl) then) = + __$$InputType_Bolt11ImplCopyWithImpl<$Res>; @useResult $Res call({LNInvoice invoice}); } /// @nodoc -class __$$InputType_Bolt11CopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_Bolt11> - implements _$$InputType_Bolt11CopyWith<$Res> { - __$$InputType_Bolt11CopyWithImpl(_$InputType_Bolt11 _value, $Res Function(_$InputType_Bolt11) _then) +class __$$InputType_Bolt11ImplCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_Bolt11Impl> + implements _$$InputType_Bolt11ImplCopyWith<$Res> { + __$$InputType_Bolt11ImplCopyWithImpl( + _$InputType_Bolt11Impl _value, $Res Function(_$InputType_Bolt11Impl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1647,7 +1654,7 @@ class __$$InputType_Bolt11CopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Re $Res call({ Object? invoice = null, }) { - return _then(_$InputType_Bolt11( + return _then(_$InputType_Bolt11Impl( invoice: null == invoice ? _value.invoice : invoice // ignore: cast_nullable_to_non_nullable @@ -1658,8 +1665,8 @@ class __$$InputType_Bolt11CopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Re /// @nodoc -class _$InputType_Bolt11 implements InputType_Bolt11 { - const _$InputType_Bolt11({required this.invoice}); +class _$InputType_Bolt11Impl implements InputType_Bolt11 { + const _$InputType_Bolt11Impl({required this.invoice}); @override final LNInvoice invoice; @@ -1673,7 +1680,7 @@ class _$InputType_Bolt11 implements InputType_Bolt11 { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_Bolt11 && + other is _$InputType_Bolt11Impl && (identical(other.invoice, invoice) || other.invoice == invoice)); } @@ -1683,8 +1690,8 @@ class _$InputType_Bolt11 implements InputType_Bolt11 { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_Bolt11CopyWith<_$InputType_Bolt11> get copyWith => - __$$InputType_Bolt11CopyWithImpl<_$InputType_Bolt11>(this, _$identity); + _$$InputType_Bolt11ImplCopyWith<_$InputType_Bolt11Impl> get copyWith => + __$$InputType_Bolt11ImplCopyWithImpl<_$InputType_Bolt11Impl>(this, _$identity); @override @optionalTypeArgs @@ -1786,25 +1793,27 @@ class _$InputType_Bolt11 implements InputType_Bolt11 { } abstract class InputType_Bolt11 implements InputType { - const factory InputType_Bolt11({required final LNInvoice invoice}) = _$InputType_Bolt11; + const factory InputType_Bolt11({required final LNInvoice invoice}) = _$InputType_Bolt11Impl; LNInvoice get invoice; @JsonKey(ignore: true) - _$$InputType_Bolt11CopyWith<_$InputType_Bolt11> get copyWith => throw _privateConstructorUsedError; + _$$InputType_Bolt11ImplCopyWith<_$InputType_Bolt11Impl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_NodeIdCopyWith<$Res> { - factory _$$InputType_NodeIdCopyWith(_$InputType_NodeId value, $Res Function(_$InputType_NodeId) then) = - __$$InputType_NodeIdCopyWithImpl<$Res>; +abstract class _$$InputType_NodeIdImplCopyWith<$Res> { + factory _$$InputType_NodeIdImplCopyWith( + _$InputType_NodeIdImpl value, $Res Function(_$InputType_NodeIdImpl) then) = + __$$InputType_NodeIdImplCopyWithImpl<$Res>; @useResult $Res call({String nodeId}); } /// @nodoc -class __$$InputType_NodeIdCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_NodeId> - implements _$$InputType_NodeIdCopyWith<$Res> { - __$$InputType_NodeIdCopyWithImpl(_$InputType_NodeId _value, $Res Function(_$InputType_NodeId) _then) +class __$$InputType_NodeIdImplCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_NodeIdImpl> + implements _$$InputType_NodeIdImplCopyWith<$Res> { + __$$InputType_NodeIdImplCopyWithImpl( + _$InputType_NodeIdImpl _value, $Res Function(_$InputType_NodeIdImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1812,7 +1821,7 @@ class __$$InputType_NodeIdCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Re $Res call({ Object? nodeId = null, }) { - return _then(_$InputType_NodeId( + return _then(_$InputType_NodeIdImpl( nodeId: null == nodeId ? _value.nodeId : nodeId // ignore: cast_nullable_to_non_nullable @@ -1823,8 +1832,8 @@ class __$$InputType_NodeIdCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Re /// @nodoc -class _$InputType_NodeId implements InputType_NodeId { - const _$InputType_NodeId({required this.nodeId}); +class _$InputType_NodeIdImpl implements InputType_NodeId { + const _$InputType_NodeIdImpl({required this.nodeId}); @override final String nodeId; @@ -1838,7 +1847,7 @@ class _$InputType_NodeId implements InputType_NodeId { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_NodeId && + other is _$InputType_NodeIdImpl && (identical(other.nodeId, nodeId) || other.nodeId == nodeId)); } @@ -1848,8 +1857,8 @@ class _$InputType_NodeId implements InputType_NodeId { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_NodeIdCopyWith<_$InputType_NodeId> get copyWith => - __$$InputType_NodeIdCopyWithImpl<_$InputType_NodeId>(this, _$identity); + _$$InputType_NodeIdImplCopyWith<_$InputType_NodeIdImpl> get copyWith => + __$$InputType_NodeIdImplCopyWithImpl<_$InputType_NodeIdImpl>(this, _$identity); @override @optionalTypeArgs @@ -1951,25 +1960,25 @@ class _$InputType_NodeId implements InputType_NodeId { } abstract class InputType_NodeId implements InputType { - const factory InputType_NodeId({required final String nodeId}) = _$InputType_NodeId; + const factory InputType_NodeId({required final String nodeId}) = _$InputType_NodeIdImpl; String get nodeId; @JsonKey(ignore: true) - _$$InputType_NodeIdCopyWith<_$InputType_NodeId> get copyWith => throw _privateConstructorUsedError; + _$$InputType_NodeIdImplCopyWith<_$InputType_NodeIdImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_UrlCopyWith<$Res> { - factory _$$InputType_UrlCopyWith(_$InputType_Url value, $Res Function(_$InputType_Url) then) = - __$$InputType_UrlCopyWithImpl<$Res>; +abstract class _$$InputType_UrlImplCopyWith<$Res> { + factory _$$InputType_UrlImplCopyWith(_$InputType_UrlImpl value, $Res Function(_$InputType_UrlImpl) then) = + __$$InputType_UrlImplCopyWithImpl<$Res>; @useResult $Res call({String url}); } /// @nodoc -class __$$InputType_UrlCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_Url> - implements _$$InputType_UrlCopyWith<$Res> { - __$$InputType_UrlCopyWithImpl(_$InputType_Url _value, $Res Function(_$InputType_Url) _then) +class __$$InputType_UrlImplCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_UrlImpl> + implements _$$InputType_UrlImplCopyWith<$Res> { + __$$InputType_UrlImplCopyWithImpl(_$InputType_UrlImpl _value, $Res Function(_$InputType_UrlImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1977,7 +1986,7 @@ class __$$InputType_UrlCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, $Res call({ Object? url = null, }) { - return _then(_$InputType_Url( + return _then(_$InputType_UrlImpl( url: null == url ? _value.url : url // ignore: cast_nullable_to_non_nullable @@ -1988,8 +1997,8 @@ class __$$InputType_UrlCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, /// @nodoc -class _$InputType_Url implements InputType_Url { - const _$InputType_Url({required this.url}); +class _$InputType_UrlImpl implements InputType_Url { + const _$InputType_UrlImpl({required this.url}); @override final String url; @@ -2003,7 +2012,7 @@ class _$InputType_Url implements InputType_Url { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_Url && + other is _$InputType_UrlImpl && (identical(other.url, url) || other.url == url)); } @@ -2013,8 +2022,8 @@ class _$InputType_Url implements InputType_Url { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_UrlCopyWith<_$InputType_Url> get copyWith => - __$$InputType_UrlCopyWithImpl<_$InputType_Url>(this, _$identity); + _$$InputType_UrlImplCopyWith<_$InputType_UrlImpl> get copyWith => + __$$InputType_UrlImplCopyWithImpl<_$InputType_UrlImpl>(this, _$identity); @override @optionalTypeArgs @@ -2116,26 +2125,28 @@ class _$InputType_Url implements InputType_Url { } abstract class InputType_Url implements InputType { - const factory InputType_Url({required final String url}) = _$InputType_Url; + const factory InputType_Url({required final String url}) = _$InputType_UrlImpl; String get url; @JsonKey(ignore: true) - _$$InputType_UrlCopyWith<_$InputType_Url> get copyWith => throw _privateConstructorUsedError; + _$$InputType_UrlImplCopyWith<_$InputType_UrlImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_LnUrlPayCopyWith<$Res> { - factory _$$InputType_LnUrlPayCopyWith( - _$InputType_LnUrlPay value, $Res Function(_$InputType_LnUrlPay) then) = - __$$InputType_LnUrlPayCopyWithImpl<$Res>; +abstract class _$$InputType_LnUrlPayImplCopyWith<$Res> { + factory _$$InputType_LnUrlPayImplCopyWith( + _$InputType_LnUrlPayImpl value, $Res Function(_$InputType_LnUrlPayImpl) then) = + __$$InputType_LnUrlPayImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlPayRequestData data}); } /// @nodoc -class __$$InputType_LnUrlPayCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlPay> - implements _$$InputType_LnUrlPayCopyWith<$Res> { - __$$InputType_LnUrlPayCopyWithImpl(_$InputType_LnUrlPay _value, $Res Function(_$InputType_LnUrlPay) _then) +class __$$InputType_LnUrlPayImplCopyWithImpl<$Res> + extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlPayImpl> + implements _$$InputType_LnUrlPayImplCopyWith<$Res> { + __$$InputType_LnUrlPayImplCopyWithImpl( + _$InputType_LnUrlPayImpl _value, $Res Function(_$InputType_LnUrlPayImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2143,7 +2154,7 @@ class __$$InputType_LnUrlPayCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$ $Res call({ Object? data = null, }) { - return _then(_$InputType_LnUrlPay( + return _then(_$InputType_LnUrlPayImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -2154,8 +2165,8 @@ class __$$InputType_LnUrlPayCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$ /// @nodoc -class _$InputType_LnUrlPay implements InputType_LnUrlPay { - const _$InputType_LnUrlPay({required this.data}); +class _$InputType_LnUrlPayImpl implements InputType_LnUrlPay { + const _$InputType_LnUrlPayImpl({required this.data}); @override final LnUrlPayRequestData data; @@ -2169,7 +2180,7 @@ class _$InputType_LnUrlPay implements InputType_LnUrlPay { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_LnUrlPay && + other is _$InputType_LnUrlPayImpl && (identical(other.data, data) || other.data == data)); } @@ -2179,8 +2190,8 @@ class _$InputType_LnUrlPay implements InputType_LnUrlPay { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_LnUrlPayCopyWith<_$InputType_LnUrlPay> get copyWith => - __$$InputType_LnUrlPayCopyWithImpl<_$InputType_LnUrlPay>(this, _$identity); + _$$InputType_LnUrlPayImplCopyWith<_$InputType_LnUrlPayImpl> get copyWith => + __$$InputType_LnUrlPayImplCopyWithImpl<_$InputType_LnUrlPayImpl>(this, _$identity); @override @optionalTypeArgs @@ -2282,28 +2293,29 @@ class _$InputType_LnUrlPay implements InputType_LnUrlPay { } abstract class InputType_LnUrlPay implements InputType { - const factory InputType_LnUrlPay({required final LnUrlPayRequestData data}) = _$InputType_LnUrlPay; + const factory InputType_LnUrlPay({required final LnUrlPayRequestData data}) = _$InputType_LnUrlPayImpl; LnUrlPayRequestData get data; @JsonKey(ignore: true) - _$$InputType_LnUrlPayCopyWith<_$InputType_LnUrlPay> get copyWith => throw _privateConstructorUsedError; + _$$InputType_LnUrlPayImplCopyWith<_$InputType_LnUrlPayImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_LnUrlWithdrawCopyWith<$Res> { - factory _$$InputType_LnUrlWithdrawCopyWith( - _$InputType_LnUrlWithdraw value, $Res Function(_$InputType_LnUrlWithdraw) then) = - __$$InputType_LnUrlWithdrawCopyWithImpl<$Res>; +abstract class _$$InputType_LnUrlWithdrawImplCopyWith<$Res> { + factory _$$InputType_LnUrlWithdrawImplCopyWith( + _$InputType_LnUrlWithdrawImpl value, $Res Function(_$InputType_LnUrlWithdrawImpl) then) = + __$$InputType_LnUrlWithdrawImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlWithdrawRequestData data}); } /// @nodoc -class __$$InputType_LnUrlWithdrawCopyWithImpl<$Res> - extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlWithdraw> - implements _$$InputType_LnUrlWithdrawCopyWith<$Res> { - __$$InputType_LnUrlWithdrawCopyWithImpl( - _$InputType_LnUrlWithdraw _value, $Res Function(_$InputType_LnUrlWithdraw) _then) +class __$$InputType_LnUrlWithdrawImplCopyWithImpl<$Res> + extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlWithdrawImpl> + implements _$$InputType_LnUrlWithdrawImplCopyWith<$Res> { + __$$InputType_LnUrlWithdrawImplCopyWithImpl( + _$InputType_LnUrlWithdrawImpl _value, $Res Function(_$InputType_LnUrlWithdrawImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2311,7 +2323,7 @@ class __$$InputType_LnUrlWithdrawCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$InputType_LnUrlWithdraw( + return _then(_$InputType_LnUrlWithdrawImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -2322,8 +2334,8 @@ class __$$InputType_LnUrlWithdrawCopyWithImpl<$Res> /// @nodoc -class _$InputType_LnUrlWithdraw implements InputType_LnUrlWithdraw { - const _$InputType_LnUrlWithdraw({required this.data}); +class _$InputType_LnUrlWithdrawImpl implements InputType_LnUrlWithdraw { + const _$InputType_LnUrlWithdrawImpl({required this.data}); @override final LnUrlWithdrawRequestData data; @@ -2337,7 +2349,7 @@ class _$InputType_LnUrlWithdraw implements InputType_LnUrlWithdraw { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_LnUrlWithdraw && + other is _$InputType_LnUrlWithdrawImpl && (identical(other.data, data) || other.data == data)); } @@ -2347,8 +2359,8 @@ class _$InputType_LnUrlWithdraw implements InputType_LnUrlWithdraw { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_LnUrlWithdrawCopyWith<_$InputType_LnUrlWithdraw> get copyWith => - __$$InputType_LnUrlWithdrawCopyWithImpl<_$InputType_LnUrlWithdraw>(this, _$identity); + _$$InputType_LnUrlWithdrawImplCopyWith<_$InputType_LnUrlWithdrawImpl> get copyWith => + __$$InputType_LnUrlWithdrawImplCopyWithImpl<_$InputType_LnUrlWithdrawImpl>(this, _$identity); @override @optionalTypeArgs @@ -2451,28 +2463,29 @@ class _$InputType_LnUrlWithdraw implements InputType_LnUrlWithdraw { abstract class InputType_LnUrlWithdraw implements InputType { const factory InputType_LnUrlWithdraw({required final LnUrlWithdrawRequestData data}) = - _$InputType_LnUrlWithdraw; + _$InputType_LnUrlWithdrawImpl; LnUrlWithdrawRequestData get data; @JsonKey(ignore: true) - _$$InputType_LnUrlWithdrawCopyWith<_$InputType_LnUrlWithdraw> get copyWith => + _$$InputType_LnUrlWithdrawImplCopyWith<_$InputType_LnUrlWithdrawImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_LnUrlAuthCopyWith<$Res> { - factory _$$InputType_LnUrlAuthCopyWith( - _$InputType_LnUrlAuth value, $Res Function(_$InputType_LnUrlAuth) then) = - __$$InputType_LnUrlAuthCopyWithImpl<$Res>; +abstract class _$$InputType_LnUrlAuthImplCopyWith<$Res> { + factory _$$InputType_LnUrlAuthImplCopyWith( + _$InputType_LnUrlAuthImpl value, $Res Function(_$InputType_LnUrlAuthImpl) then) = + __$$InputType_LnUrlAuthImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlAuthRequestData data}); } /// @nodoc -class __$$InputType_LnUrlAuthCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlAuth> - implements _$$InputType_LnUrlAuthCopyWith<$Res> { - __$$InputType_LnUrlAuthCopyWithImpl( - _$InputType_LnUrlAuth _value, $Res Function(_$InputType_LnUrlAuth) _then) +class __$$InputType_LnUrlAuthImplCopyWithImpl<$Res> + extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlAuthImpl> + implements _$$InputType_LnUrlAuthImplCopyWith<$Res> { + __$$InputType_LnUrlAuthImplCopyWithImpl( + _$InputType_LnUrlAuthImpl _value, $Res Function(_$InputType_LnUrlAuthImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2480,7 +2493,7 @@ class __$$InputType_LnUrlAuthCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl< $Res call({ Object? data = null, }) { - return _then(_$InputType_LnUrlAuth( + return _then(_$InputType_LnUrlAuthImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -2491,8 +2504,8 @@ class __$$InputType_LnUrlAuthCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl< /// @nodoc -class _$InputType_LnUrlAuth implements InputType_LnUrlAuth { - const _$InputType_LnUrlAuth({required this.data}); +class _$InputType_LnUrlAuthImpl implements InputType_LnUrlAuth { + const _$InputType_LnUrlAuthImpl({required this.data}); @override final LnUrlAuthRequestData data; @@ -2506,7 +2519,7 @@ class _$InputType_LnUrlAuth implements InputType_LnUrlAuth { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_LnUrlAuth && + other is _$InputType_LnUrlAuthImpl && (identical(other.data, data) || other.data == data)); } @@ -2516,8 +2529,8 @@ class _$InputType_LnUrlAuth implements InputType_LnUrlAuth { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_LnUrlAuthCopyWith<_$InputType_LnUrlAuth> get copyWith => - __$$InputType_LnUrlAuthCopyWithImpl<_$InputType_LnUrlAuth>(this, _$identity); + _$$InputType_LnUrlAuthImplCopyWith<_$InputType_LnUrlAuthImpl> get copyWith => + __$$InputType_LnUrlAuthImplCopyWithImpl<_$InputType_LnUrlAuthImpl>(this, _$identity); @override @optionalTypeArgs @@ -2619,27 +2632,29 @@ class _$InputType_LnUrlAuth implements InputType_LnUrlAuth { } abstract class InputType_LnUrlAuth implements InputType { - const factory InputType_LnUrlAuth({required final LnUrlAuthRequestData data}) = _$InputType_LnUrlAuth; + const factory InputType_LnUrlAuth({required final LnUrlAuthRequestData data}) = _$InputType_LnUrlAuthImpl; LnUrlAuthRequestData get data; @JsonKey(ignore: true) - _$$InputType_LnUrlAuthCopyWith<_$InputType_LnUrlAuth> get copyWith => throw _privateConstructorUsedError; + _$$InputType_LnUrlAuthImplCopyWith<_$InputType_LnUrlAuthImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$InputType_LnUrlErrorCopyWith<$Res> { - factory _$$InputType_LnUrlErrorCopyWith( - _$InputType_LnUrlError value, $Res Function(_$InputType_LnUrlError) then) = - __$$InputType_LnUrlErrorCopyWithImpl<$Res>; +abstract class _$$InputType_LnUrlErrorImplCopyWith<$Res> { + factory _$$InputType_LnUrlErrorImplCopyWith( + _$InputType_LnUrlErrorImpl value, $Res Function(_$InputType_LnUrlErrorImpl) then) = + __$$InputType_LnUrlErrorImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlErrorData data}); } /// @nodoc -class __$$InputType_LnUrlErrorCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlError> - implements _$$InputType_LnUrlErrorCopyWith<$Res> { - __$$InputType_LnUrlErrorCopyWithImpl( - _$InputType_LnUrlError _value, $Res Function(_$InputType_LnUrlError) _then) +class __$$InputType_LnUrlErrorImplCopyWithImpl<$Res> + extends _$InputTypeCopyWithImpl<$Res, _$InputType_LnUrlErrorImpl> + implements _$$InputType_LnUrlErrorImplCopyWith<$Res> { + __$$InputType_LnUrlErrorImplCopyWithImpl( + _$InputType_LnUrlErrorImpl _value, $Res Function(_$InputType_LnUrlErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2647,7 +2662,7 @@ class __$$InputType_LnUrlErrorCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl $Res call({ Object? data = null, }) { - return _then(_$InputType_LnUrlError( + return _then(_$InputType_LnUrlErrorImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -2658,8 +2673,8 @@ class __$$InputType_LnUrlErrorCopyWithImpl<$Res> extends _$InputTypeCopyWithImpl /// @nodoc -class _$InputType_LnUrlError implements InputType_LnUrlError { - const _$InputType_LnUrlError({required this.data}); +class _$InputType_LnUrlErrorImpl implements InputType_LnUrlError { + const _$InputType_LnUrlErrorImpl({required this.data}); @override final LnUrlErrorData data; @@ -2673,7 +2688,7 @@ class _$InputType_LnUrlError implements InputType_LnUrlError { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$InputType_LnUrlError && + other is _$InputType_LnUrlErrorImpl && (identical(other.data, data) || other.data == data)); } @@ -2683,8 +2698,8 @@ class _$InputType_LnUrlError implements InputType_LnUrlError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$InputType_LnUrlErrorCopyWith<_$InputType_LnUrlError> get copyWith => - __$$InputType_LnUrlErrorCopyWithImpl<_$InputType_LnUrlError>(this, _$identity); + _$$InputType_LnUrlErrorImplCopyWith<_$InputType_LnUrlErrorImpl> get copyWith => + __$$InputType_LnUrlErrorImplCopyWithImpl<_$InputType_LnUrlErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -2786,11 +2801,12 @@ class _$InputType_LnUrlError implements InputType_LnUrlError { } abstract class InputType_LnUrlError implements InputType { - const factory InputType_LnUrlError({required final LnUrlErrorData data}) = _$InputType_LnUrlError; + const factory InputType_LnUrlError({required final LnUrlErrorData data}) = _$InputType_LnUrlErrorImpl; LnUrlErrorData get data; @JsonKey(ignore: true) - _$$InputType_LnUrlErrorCopyWith<_$InputType_LnUrlError> get copyWith => throw _privateConstructorUsedError; + _$$InputType_LnUrlErrorImplCopyWith<_$InputType_LnUrlErrorImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc @@ -2853,25 +2869,25 @@ class _$LnUrlCallbackStatusCopyWithImpl<$Res, $Val extends LnUrlCallbackStatus> } /// @nodoc -abstract class _$$LnUrlCallbackStatus_OkCopyWith<$Res> { - factory _$$LnUrlCallbackStatus_OkCopyWith( - _$LnUrlCallbackStatus_Ok value, $Res Function(_$LnUrlCallbackStatus_Ok) then) = - __$$LnUrlCallbackStatus_OkCopyWithImpl<$Res>; +abstract class _$$LnUrlCallbackStatus_OkImplCopyWith<$Res> { + factory _$$LnUrlCallbackStatus_OkImplCopyWith( + _$LnUrlCallbackStatus_OkImpl value, $Res Function(_$LnUrlCallbackStatus_OkImpl) then) = + __$$LnUrlCallbackStatus_OkImplCopyWithImpl<$Res>; } /// @nodoc -class __$$LnUrlCallbackStatus_OkCopyWithImpl<$Res> - extends _$LnUrlCallbackStatusCopyWithImpl<$Res, _$LnUrlCallbackStatus_Ok> - implements _$$LnUrlCallbackStatus_OkCopyWith<$Res> { - __$$LnUrlCallbackStatus_OkCopyWithImpl( - _$LnUrlCallbackStatus_Ok _value, $Res Function(_$LnUrlCallbackStatus_Ok) _then) +class __$$LnUrlCallbackStatus_OkImplCopyWithImpl<$Res> + extends _$LnUrlCallbackStatusCopyWithImpl<$Res, _$LnUrlCallbackStatus_OkImpl> + implements _$$LnUrlCallbackStatus_OkImplCopyWith<$Res> { + __$$LnUrlCallbackStatus_OkImplCopyWithImpl( + _$LnUrlCallbackStatus_OkImpl _value, $Res Function(_$LnUrlCallbackStatus_OkImpl) _then) : super(_value, _then); } /// @nodoc -class _$LnUrlCallbackStatus_Ok implements LnUrlCallbackStatus_Ok { - const _$LnUrlCallbackStatus_Ok(); +class _$LnUrlCallbackStatus_OkImpl implements LnUrlCallbackStatus_Ok { + const _$LnUrlCallbackStatus_OkImpl(); @override String toString() { @@ -2880,7 +2896,8 @@ class _$LnUrlCallbackStatus_Ok implements LnUrlCallbackStatus_Ok { @override bool operator ==(dynamic other) { - return identical(this, other) || (other.runtimeType == runtimeType && other is _$LnUrlCallbackStatus_Ok); + return identical(this, other) || + (other.runtimeType == runtimeType && other is _$LnUrlCallbackStatus_OkImpl); } @override @@ -2950,24 +2967,24 @@ class _$LnUrlCallbackStatus_Ok implements LnUrlCallbackStatus_Ok { } abstract class LnUrlCallbackStatus_Ok implements LnUrlCallbackStatus { - const factory LnUrlCallbackStatus_Ok() = _$LnUrlCallbackStatus_Ok; + const factory LnUrlCallbackStatus_Ok() = _$LnUrlCallbackStatus_OkImpl; } /// @nodoc -abstract class _$$LnUrlCallbackStatus_ErrorStatusCopyWith<$Res> { - factory _$$LnUrlCallbackStatus_ErrorStatusCopyWith( - _$LnUrlCallbackStatus_ErrorStatus value, $Res Function(_$LnUrlCallbackStatus_ErrorStatus) then) = - __$$LnUrlCallbackStatus_ErrorStatusCopyWithImpl<$Res>; +abstract class _$$LnUrlCallbackStatus_ErrorStatusImplCopyWith<$Res> { + factory _$$LnUrlCallbackStatus_ErrorStatusImplCopyWith(_$LnUrlCallbackStatus_ErrorStatusImpl value, + $Res Function(_$LnUrlCallbackStatus_ErrorStatusImpl) then) = + __$$LnUrlCallbackStatus_ErrorStatusImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlErrorData data}); } /// @nodoc -class __$$LnUrlCallbackStatus_ErrorStatusCopyWithImpl<$Res> - extends _$LnUrlCallbackStatusCopyWithImpl<$Res, _$LnUrlCallbackStatus_ErrorStatus> - implements _$$LnUrlCallbackStatus_ErrorStatusCopyWith<$Res> { - __$$LnUrlCallbackStatus_ErrorStatusCopyWithImpl( - _$LnUrlCallbackStatus_ErrorStatus _value, $Res Function(_$LnUrlCallbackStatus_ErrorStatus) _then) +class __$$LnUrlCallbackStatus_ErrorStatusImplCopyWithImpl<$Res> + extends _$LnUrlCallbackStatusCopyWithImpl<$Res, _$LnUrlCallbackStatus_ErrorStatusImpl> + implements _$$LnUrlCallbackStatus_ErrorStatusImplCopyWith<$Res> { + __$$LnUrlCallbackStatus_ErrorStatusImplCopyWithImpl(_$LnUrlCallbackStatus_ErrorStatusImpl _value, + $Res Function(_$LnUrlCallbackStatus_ErrorStatusImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -2975,7 +2992,7 @@ class __$$LnUrlCallbackStatus_ErrorStatusCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$LnUrlCallbackStatus_ErrorStatus( + return _then(_$LnUrlCallbackStatus_ErrorStatusImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -2986,8 +3003,8 @@ class __$$LnUrlCallbackStatus_ErrorStatusCopyWithImpl<$Res> /// @nodoc -class _$LnUrlCallbackStatus_ErrorStatus implements LnUrlCallbackStatus_ErrorStatus { - const _$LnUrlCallbackStatus_ErrorStatus({required this.data}); +class _$LnUrlCallbackStatus_ErrorStatusImpl implements LnUrlCallbackStatus_ErrorStatus { + const _$LnUrlCallbackStatus_ErrorStatusImpl({required this.data}); @override final LnUrlErrorData data; @@ -3001,7 +3018,7 @@ class _$LnUrlCallbackStatus_ErrorStatus implements LnUrlCallbackStatus_ErrorStat bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LnUrlCallbackStatus_ErrorStatus && + other is _$LnUrlCallbackStatus_ErrorStatusImpl && (identical(other.data, data) || other.data == data)); } @@ -3011,8 +3028,9 @@ class _$LnUrlCallbackStatus_ErrorStatus implements LnUrlCallbackStatus_ErrorStat @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LnUrlCallbackStatus_ErrorStatusCopyWith<_$LnUrlCallbackStatus_ErrorStatus> get copyWith => - __$$LnUrlCallbackStatus_ErrorStatusCopyWithImpl<_$LnUrlCallbackStatus_ErrorStatus>(this, _$identity); + _$$LnUrlCallbackStatus_ErrorStatusImplCopyWith<_$LnUrlCallbackStatus_ErrorStatusImpl> get copyWith => + __$$LnUrlCallbackStatus_ErrorStatusImplCopyWithImpl<_$LnUrlCallbackStatus_ErrorStatusImpl>( + this, _$identity); @override @optionalTypeArgs @@ -3079,11 +3097,11 @@ class _$LnUrlCallbackStatus_ErrorStatus implements LnUrlCallbackStatus_ErrorStat abstract class LnUrlCallbackStatus_ErrorStatus implements LnUrlCallbackStatus { const factory LnUrlCallbackStatus_ErrorStatus({required final LnUrlErrorData data}) = - _$LnUrlCallbackStatus_ErrorStatus; + _$LnUrlCallbackStatus_ErrorStatusImpl; LnUrlErrorData get data; @JsonKey(ignore: true) - _$$LnUrlCallbackStatus_ErrorStatusCopyWith<_$LnUrlCallbackStatus_ErrorStatus> get copyWith => + _$$LnUrlCallbackStatus_ErrorStatusImplCopyWith<_$LnUrlCallbackStatus_ErrorStatusImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3148,10 +3166,10 @@ class _$LnUrlPayResultCopyWithImpl<$Res, $Val extends LnUrlPayResult> } /// @nodoc -abstract class _$$LnUrlPayResult_EndpointSuccessCopyWith<$Res> { - factory _$$LnUrlPayResult_EndpointSuccessCopyWith( - _$LnUrlPayResult_EndpointSuccess value, $Res Function(_$LnUrlPayResult_EndpointSuccess) then) = - __$$LnUrlPayResult_EndpointSuccessCopyWithImpl<$Res>; +abstract class _$$LnUrlPayResult_EndpointSuccessImplCopyWith<$Res> { + factory _$$LnUrlPayResult_EndpointSuccessImplCopyWith(_$LnUrlPayResult_EndpointSuccessImpl value, + $Res Function(_$LnUrlPayResult_EndpointSuccessImpl) then) = + __$$LnUrlPayResult_EndpointSuccessImplCopyWithImpl<$Res>; @useResult $Res call({SuccessActionProcessed? data}); @@ -3159,11 +3177,11 @@ abstract class _$$LnUrlPayResult_EndpointSuccessCopyWith<$Res> { } /// @nodoc -class __$$LnUrlPayResult_EndpointSuccessCopyWithImpl<$Res> - extends _$LnUrlPayResultCopyWithImpl<$Res, _$LnUrlPayResult_EndpointSuccess> - implements _$$LnUrlPayResult_EndpointSuccessCopyWith<$Res> { - __$$LnUrlPayResult_EndpointSuccessCopyWithImpl( - _$LnUrlPayResult_EndpointSuccess _value, $Res Function(_$LnUrlPayResult_EndpointSuccess) _then) +class __$$LnUrlPayResult_EndpointSuccessImplCopyWithImpl<$Res> + extends _$LnUrlPayResultCopyWithImpl<$Res, _$LnUrlPayResult_EndpointSuccessImpl> + implements _$$LnUrlPayResult_EndpointSuccessImplCopyWith<$Res> { + __$$LnUrlPayResult_EndpointSuccessImplCopyWithImpl( + _$LnUrlPayResult_EndpointSuccessImpl _value, $Res Function(_$LnUrlPayResult_EndpointSuccessImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3171,7 +3189,7 @@ class __$$LnUrlPayResult_EndpointSuccessCopyWithImpl<$Res> $Res call({ Object? data = freezed, }) { - return _then(_$LnUrlPayResult_EndpointSuccess( + return _then(_$LnUrlPayResult_EndpointSuccessImpl( data: freezed == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -3194,8 +3212,8 @@ class __$$LnUrlPayResult_EndpointSuccessCopyWithImpl<$Res> /// @nodoc -class _$LnUrlPayResult_EndpointSuccess implements LnUrlPayResult_EndpointSuccess { - const _$LnUrlPayResult_EndpointSuccess({this.data}); +class _$LnUrlPayResult_EndpointSuccessImpl implements LnUrlPayResult_EndpointSuccess { + const _$LnUrlPayResult_EndpointSuccessImpl({this.data}); @override final SuccessActionProcessed? data; @@ -3209,7 +3227,7 @@ class _$LnUrlPayResult_EndpointSuccess implements LnUrlPayResult_EndpointSuccess bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LnUrlPayResult_EndpointSuccess && + other is _$LnUrlPayResult_EndpointSuccessImpl && (identical(other.data, data) || other.data == data)); } @@ -3219,8 +3237,9 @@ class _$LnUrlPayResult_EndpointSuccess implements LnUrlPayResult_EndpointSuccess @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LnUrlPayResult_EndpointSuccessCopyWith<_$LnUrlPayResult_EndpointSuccess> get copyWith => - __$$LnUrlPayResult_EndpointSuccessCopyWithImpl<_$LnUrlPayResult_EndpointSuccess>(this, _$identity); + _$$LnUrlPayResult_EndpointSuccessImplCopyWith<_$LnUrlPayResult_EndpointSuccessImpl> get copyWith => + __$$LnUrlPayResult_EndpointSuccessImplCopyWithImpl<_$LnUrlPayResult_EndpointSuccessImpl>( + this, _$identity); @override @optionalTypeArgs @@ -3287,30 +3306,30 @@ class _$LnUrlPayResult_EndpointSuccess implements LnUrlPayResult_EndpointSuccess abstract class LnUrlPayResult_EndpointSuccess implements LnUrlPayResult { const factory LnUrlPayResult_EndpointSuccess({final SuccessActionProcessed? data}) = - _$LnUrlPayResult_EndpointSuccess; + _$LnUrlPayResult_EndpointSuccessImpl; @override SuccessActionProcessed? get data; @JsonKey(ignore: true) - _$$LnUrlPayResult_EndpointSuccessCopyWith<_$LnUrlPayResult_EndpointSuccess> get copyWith => + _$$LnUrlPayResult_EndpointSuccessImplCopyWith<_$LnUrlPayResult_EndpointSuccessImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LnUrlPayResult_EndpointErrorCopyWith<$Res> { - factory _$$LnUrlPayResult_EndpointErrorCopyWith( - _$LnUrlPayResult_EndpointError value, $Res Function(_$LnUrlPayResult_EndpointError) then) = - __$$LnUrlPayResult_EndpointErrorCopyWithImpl<$Res>; +abstract class _$$LnUrlPayResult_EndpointErrorImplCopyWith<$Res> { + factory _$$LnUrlPayResult_EndpointErrorImplCopyWith( + _$LnUrlPayResult_EndpointErrorImpl value, $Res Function(_$LnUrlPayResult_EndpointErrorImpl) then) = + __$$LnUrlPayResult_EndpointErrorImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlErrorData data}); } /// @nodoc -class __$$LnUrlPayResult_EndpointErrorCopyWithImpl<$Res> - extends _$LnUrlPayResultCopyWithImpl<$Res, _$LnUrlPayResult_EndpointError> - implements _$$LnUrlPayResult_EndpointErrorCopyWith<$Res> { - __$$LnUrlPayResult_EndpointErrorCopyWithImpl( - _$LnUrlPayResult_EndpointError _value, $Res Function(_$LnUrlPayResult_EndpointError) _then) +class __$$LnUrlPayResult_EndpointErrorImplCopyWithImpl<$Res> + extends _$LnUrlPayResultCopyWithImpl<$Res, _$LnUrlPayResult_EndpointErrorImpl> + implements _$$LnUrlPayResult_EndpointErrorImplCopyWith<$Res> { + __$$LnUrlPayResult_EndpointErrorImplCopyWithImpl( + _$LnUrlPayResult_EndpointErrorImpl _value, $Res Function(_$LnUrlPayResult_EndpointErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3318,7 +3337,7 @@ class __$$LnUrlPayResult_EndpointErrorCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$LnUrlPayResult_EndpointError( + return _then(_$LnUrlPayResult_EndpointErrorImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -3329,8 +3348,8 @@ class __$$LnUrlPayResult_EndpointErrorCopyWithImpl<$Res> /// @nodoc -class _$LnUrlPayResult_EndpointError implements LnUrlPayResult_EndpointError { - const _$LnUrlPayResult_EndpointError({required this.data}); +class _$LnUrlPayResult_EndpointErrorImpl implements LnUrlPayResult_EndpointError { + const _$LnUrlPayResult_EndpointErrorImpl({required this.data}); @override final LnUrlErrorData data; @@ -3344,7 +3363,7 @@ class _$LnUrlPayResult_EndpointError implements LnUrlPayResult_EndpointError { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LnUrlPayResult_EndpointError && + other is _$LnUrlPayResult_EndpointErrorImpl && (identical(other.data, data) || other.data == data)); } @@ -3354,8 +3373,8 @@ class _$LnUrlPayResult_EndpointError implements LnUrlPayResult_EndpointError { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LnUrlPayResult_EndpointErrorCopyWith<_$LnUrlPayResult_EndpointError> get copyWith => - __$$LnUrlPayResult_EndpointErrorCopyWithImpl<_$LnUrlPayResult_EndpointError>(this, _$identity); + _$$LnUrlPayResult_EndpointErrorImplCopyWith<_$LnUrlPayResult_EndpointErrorImpl> get copyWith => + __$$LnUrlPayResult_EndpointErrorImplCopyWithImpl<_$LnUrlPayResult_EndpointErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -3422,12 +3441,12 @@ class _$LnUrlPayResult_EndpointError implements LnUrlPayResult_EndpointError { abstract class LnUrlPayResult_EndpointError implements LnUrlPayResult { const factory LnUrlPayResult_EndpointError({required final LnUrlErrorData data}) = - _$LnUrlPayResult_EndpointError; + _$LnUrlPayResult_EndpointErrorImpl; @override LnUrlErrorData get data; @JsonKey(ignore: true) - _$$LnUrlPayResult_EndpointErrorCopyWith<_$LnUrlPayResult_EndpointError> get copyWith => + _$$LnUrlPayResult_EndpointErrorImplCopyWith<_$LnUrlPayResult_EndpointErrorImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3492,20 +3511,20 @@ class _$LnUrlWithdrawResultCopyWithImpl<$Res, $Val extends LnUrlWithdrawResult> } /// @nodoc -abstract class _$$LnUrlWithdrawResult_OkCopyWith<$Res> { - factory _$$LnUrlWithdrawResult_OkCopyWith( - _$LnUrlWithdrawResult_Ok value, $Res Function(_$LnUrlWithdrawResult_Ok) then) = - __$$LnUrlWithdrawResult_OkCopyWithImpl<$Res>; +abstract class _$$LnUrlWithdrawResult_OkImplCopyWith<$Res> { + factory _$$LnUrlWithdrawResult_OkImplCopyWith( + _$LnUrlWithdrawResult_OkImpl value, $Res Function(_$LnUrlWithdrawResult_OkImpl) then) = + __$$LnUrlWithdrawResult_OkImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlWithdrawSuccessData data}); } /// @nodoc -class __$$LnUrlWithdrawResult_OkCopyWithImpl<$Res> - extends _$LnUrlWithdrawResultCopyWithImpl<$Res, _$LnUrlWithdrawResult_Ok> - implements _$$LnUrlWithdrawResult_OkCopyWith<$Res> { - __$$LnUrlWithdrawResult_OkCopyWithImpl( - _$LnUrlWithdrawResult_Ok _value, $Res Function(_$LnUrlWithdrawResult_Ok) _then) +class __$$LnUrlWithdrawResult_OkImplCopyWithImpl<$Res> + extends _$LnUrlWithdrawResultCopyWithImpl<$Res, _$LnUrlWithdrawResult_OkImpl> + implements _$$LnUrlWithdrawResult_OkImplCopyWith<$Res> { + __$$LnUrlWithdrawResult_OkImplCopyWithImpl( + _$LnUrlWithdrawResult_OkImpl _value, $Res Function(_$LnUrlWithdrawResult_OkImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3513,7 +3532,7 @@ class __$$LnUrlWithdrawResult_OkCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$LnUrlWithdrawResult_Ok( + return _then(_$LnUrlWithdrawResult_OkImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -3524,8 +3543,8 @@ class __$$LnUrlWithdrawResult_OkCopyWithImpl<$Res> /// @nodoc -class _$LnUrlWithdrawResult_Ok implements LnUrlWithdrawResult_Ok { - const _$LnUrlWithdrawResult_Ok({required this.data}); +class _$LnUrlWithdrawResult_OkImpl implements LnUrlWithdrawResult_Ok { + const _$LnUrlWithdrawResult_OkImpl({required this.data}); @override final LnUrlWithdrawSuccessData data; @@ -3539,7 +3558,7 @@ class _$LnUrlWithdrawResult_Ok implements LnUrlWithdrawResult_Ok { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LnUrlWithdrawResult_Ok && + other is _$LnUrlWithdrawResult_OkImpl && (identical(other.data, data) || other.data == data)); } @@ -3549,8 +3568,8 @@ class _$LnUrlWithdrawResult_Ok implements LnUrlWithdrawResult_Ok { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LnUrlWithdrawResult_OkCopyWith<_$LnUrlWithdrawResult_Ok> get copyWith => - __$$LnUrlWithdrawResult_OkCopyWithImpl<_$LnUrlWithdrawResult_Ok>(this, _$identity); + _$$LnUrlWithdrawResult_OkImplCopyWith<_$LnUrlWithdrawResult_OkImpl> get copyWith => + __$$LnUrlWithdrawResult_OkImplCopyWithImpl<_$LnUrlWithdrawResult_OkImpl>(this, _$identity); @override @optionalTypeArgs @@ -3617,30 +3636,30 @@ class _$LnUrlWithdrawResult_Ok implements LnUrlWithdrawResult_Ok { abstract class LnUrlWithdrawResult_Ok implements LnUrlWithdrawResult { const factory LnUrlWithdrawResult_Ok({required final LnUrlWithdrawSuccessData data}) = - _$LnUrlWithdrawResult_Ok; + _$LnUrlWithdrawResult_OkImpl; @override LnUrlWithdrawSuccessData get data; @JsonKey(ignore: true) - _$$LnUrlWithdrawResult_OkCopyWith<_$LnUrlWithdrawResult_Ok> get copyWith => + _$$LnUrlWithdrawResult_OkImplCopyWith<_$LnUrlWithdrawResult_OkImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LnUrlWithdrawResult_ErrorStatusCopyWith<$Res> { - factory _$$LnUrlWithdrawResult_ErrorStatusCopyWith( - _$LnUrlWithdrawResult_ErrorStatus value, $Res Function(_$LnUrlWithdrawResult_ErrorStatus) then) = - __$$LnUrlWithdrawResult_ErrorStatusCopyWithImpl<$Res>; +abstract class _$$LnUrlWithdrawResult_ErrorStatusImplCopyWith<$Res> { + factory _$$LnUrlWithdrawResult_ErrorStatusImplCopyWith(_$LnUrlWithdrawResult_ErrorStatusImpl value, + $Res Function(_$LnUrlWithdrawResult_ErrorStatusImpl) then) = + __$$LnUrlWithdrawResult_ErrorStatusImplCopyWithImpl<$Res>; @useResult $Res call({LnUrlErrorData data}); } /// @nodoc -class __$$LnUrlWithdrawResult_ErrorStatusCopyWithImpl<$Res> - extends _$LnUrlWithdrawResultCopyWithImpl<$Res, _$LnUrlWithdrawResult_ErrorStatus> - implements _$$LnUrlWithdrawResult_ErrorStatusCopyWith<$Res> { - __$$LnUrlWithdrawResult_ErrorStatusCopyWithImpl( - _$LnUrlWithdrawResult_ErrorStatus _value, $Res Function(_$LnUrlWithdrawResult_ErrorStatus) _then) +class __$$LnUrlWithdrawResult_ErrorStatusImplCopyWithImpl<$Res> + extends _$LnUrlWithdrawResultCopyWithImpl<$Res, _$LnUrlWithdrawResult_ErrorStatusImpl> + implements _$$LnUrlWithdrawResult_ErrorStatusImplCopyWith<$Res> { + __$$LnUrlWithdrawResult_ErrorStatusImplCopyWithImpl(_$LnUrlWithdrawResult_ErrorStatusImpl _value, + $Res Function(_$LnUrlWithdrawResult_ErrorStatusImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3648,7 +3667,7 @@ class __$$LnUrlWithdrawResult_ErrorStatusCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$LnUrlWithdrawResult_ErrorStatus( + return _then(_$LnUrlWithdrawResult_ErrorStatusImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -3659,8 +3678,8 @@ class __$$LnUrlWithdrawResult_ErrorStatusCopyWithImpl<$Res> /// @nodoc -class _$LnUrlWithdrawResult_ErrorStatus implements LnUrlWithdrawResult_ErrorStatus { - const _$LnUrlWithdrawResult_ErrorStatus({required this.data}); +class _$LnUrlWithdrawResult_ErrorStatusImpl implements LnUrlWithdrawResult_ErrorStatus { + const _$LnUrlWithdrawResult_ErrorStatusImpl({required this.data}); @override final LnUrlErrorData data; @@ -3674,7 +3693,7 @@ class _$LnUrlWithdrawResult_ErrorStatus implements LnUrlWithdrawResult_ErrorStat bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$LnUrlWithdrawResult_ErrorStatus && + other is _$LnUrlWithdrawResult_ErrorStatusImpl && (identical(other.data, data) || other.data == data)); } @@ -3684,8 +3703,9 @@ class _$LnUrlWithdrawResult_ErrorStatus implements LnUrlWithdrawResult_ErrorStat @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LnUrlWithdrawResult_ErrorStatusCopyWith<_$LnUrlWithdrawResult_ErrorStatus> get copyWith => - __$$LnUrlWithdrawResult_ErrorStatusCopyWithImpl<_$LnUrlWithdrawResult_ErrorStatus>(this, _$identity); + _$$LnUrlWithdrawResult_ErrorStatusImplCopyWith<_$LnUrlWithdrawResult_ErrorStatusImpl> get copyWith => + __$$LnUrlWithdrawResult_ErrorStatusImplCopyWithImpl<_$LnUrlWithdrawResult_ErrorStatusImpl>( + this, _$identity); @override @optionalTypeArgs @@ -3752,12 +3772,12 @@ class _$LnUrlWithdrawResult_ErrorStatus implements LnUrlWithdrawResult_ErrorStat abstract class LnUrlWithdrawResult_ErrorStatus implements LnUrlWithdrawResult { const factory LnUrlWithdrawResult_ErrorStatus({required final LnUrlErrorData data}) = - _$LnUrlWithdrawResult_ErrorStatus; + _$LnUrlWithdrawResult_ErrorStatusImpl; @override LnUrlErrorData get data; @JsonKey(ignore: true) - _$$LnUrlWithdrawResult_ErrorStatusCopyWith<_$LnUrlWithdrawResult_ErrorStatus> get copyWith => + _$$LnUrlWithdrawResult_ErrorStatusImplCopyWith<_$LnUrlWithdrawResult_ErrorStatusImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3833,21 +3853,21 @@ class _$NodeConfigCopyWithImpl<$Res, $Val extends NodeConfig> implements $NodeCo } /// @nodoc -abstract class _$$NodeConfig_GreenlightCopyWith<$Res> implements $NodeConfigCopyWith<$Res> { - factory _$$NodeConfig_GreenlightCopyWith( - _$NodeConfig_Greenlight value, $Res Function(_$NodeConfig_Greenlight) then) = - __$$NodeConfig_GreenlightCopyWithImpl<$Res>; +abstract class _$$NodeConfig_GreenlightImplCopyWith<$Res> implements $NodeConfigCopyWith<$Res> { + factory _$$NodeConfig_GreenlightImplCopyWith( + _$NodeConfig_GreenlightImpl value, $Res Function(_$NodeConfig_GreenlightImpl) then) = + __$$NodeConfig_GreenlightImplCopyWithImpl<$Res>; @override @useResult $Res call({GreenlightNodeConfig config}); } /// @nodoc -class __$$NodeConfig_GreenlightCopyWithImpl<$Res> - extends _$NodeConfigCopyWithImpl<$Res, _$NodeConfig_Greenlight> - implements _$$NodeConfig_GreenlightCopyWith<$Res> { - __$$NodeConfig_GreenlightCopyWithImpl( - _$NodeConfig_Greenlight _value, $Res Function(_$NodeConfig_Greenlight) _then) +class __$$NodeConfig_GreenlightImplCopyWithImpl<$Res> + extends _$NodeConfigCopyWithImpl<$Res, _$NodeConfig_GreenlightImpl> + implements _$$NodeConfig_GreenlightImplCopyWith<$Res> { + __$$NodeConfig_GreenlightImplCopyWithImpl( + _$NodeConfig_GreenlightImpl _value, $Res Function(_$NodeConfig_GreenlightImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -3855,7 +3875,7 @@ class __$$NodeConfig_GreenlightCopyWithImpl<$Res> $Res call({ Object? config = null, }) { - return _then(_$NodeConfig_Greenlight( + return _then(_$NodeConfig_GreenlightImpl( config: null == config ? _value.config : config // ignore: cast_nullable_to_non_nullable @@ -3866,8 +3886,8 @@ class __$$NodeConfig_GreenlightCopyWithImpl<$Res> /// @nodoc -class _$NodeConfig_Greenlight implements NodeConfig_Greenlight { - const _$NodeConfig_Greenlight({required this.config}); +class _$NodeConfig_GreenlightImpl implements NodeConfig_Greenlight { + const _$NodeConfig_GreenlightImpl({required this.config}); @override final GreenlightNodeConfig config; @@ -3881,7 +3901,7 @@ class _$NodeConfig_Greenlight implements NodeConfig_Greenlight { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$NodeConfig_Greenlight && + other is _$NodeConfig_GreenlightImpl && (identical(other.config, config) || other.config == config)); } @@ -3891,8 +3911,8 @@ class _$NodeConfig_Greenlight implements NodeConfig_Greenlight { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$NodeConfig_GreenlightCopyWith<_$NodeConfig_Greenlight> get copyWith => - __$$NodeConfig_GreenlightCopyWithImpl<_$NodeConfig_Greenlight>(this, _$identity); + _$$NodeConfig_GreenlightImplCopyWith<_$NodeConfig_GreenlightImpl> get copyWith => + __$$NodeConfig_GreenlightImplCopyWithImpl<_$NodeConfig_GreenlightImpl>(this, _$identity); @override @optionalTypeArgs @@ -3952,13 +3972,14 @@ class _$NodeConfig_Greenlight implements NodeConfig_Greenlight { } abstract class NodeConfig_Greenlight implements NodeConfig { - const factory NodeConfig_Greenlight({required final GreenlightNodeConfig config}) = _$NodeConfig_Greenlight; + const factory NodeConfig_Greenlight({required final GreenlightNodeConfig config}) = + _$NodeConfig_GreenlightImpl; @override GreenlightNodeConfig get config; @override @JsonKey(ignore: true) - _$$NodeConfig_GreenlightCopyWith<_$NodeConfig_Greenlight> get copyWith => + _$$NodeConfig_GreenlightImplCopyWith<_$NodeConfig_GreenlightImpl> get copyWith => throw _privateConstructorUsedError; } @@ -4023,17 +4044,20 @@ class _$PaymentDetailsCopyWithImpl<$Res, $Val extends PaymentDetails> } /// @nodoc -abstract class _$$PaymentDetails_LnCopyWith<$Res> { - factory _$$PaymentDetails_LnCopyWith(_$PaymentDetails_Ln value, $Res Function(_$PaymentDetails_Ln) then) = - __$$PaymentDetails_LnCopyWithImpl<$Res>; +abstract class _$$PaymentDetails_LnImplCopyWith<$Res> { + factory _$$PaymentDetails_LnImplCopyWith( + _$PaymentDetails_LnImpl value, $Res Function(_$PaymentDetails_LnImpl) then) = + __$$PaymentDetails_LnImplCopyWithImpl<$Res>; @useResult $Res call({LnPaymentDetails data}); } /// @nodoc -class __$$PaymentDetails_LnCopyWithImpl<$Res> extends _$PaymentDetailsCopyWithImpl<$Res, _$PaymentDetails_Ln> - implements _$$PaymentDetails_LnCopyWith<$Res> { - __$$PaymentDetails_LnCopyWithImpl(_$PaymentDetails_Ln _value, $Res Function(_$PaymentDetails_Ln) _then) +class __$$PaymentDetails_LnImplCopyWithImpl<$Res> + extends _$PaymentDetailsCopyWithImpl<$Res, _$PaymentDetails_LnImpl> + implements _$$PaymentDetails_LnImplCopyWith<$Res> { + __$$PaymentDetails_LnImplCopyWithImpl( + _$PaymentDetails_LnImpl _value, $Res Function(_$PaymentDetails_LnImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4041,7 +4065,7 @@ class __$$PaymentDetails_LnCopyWithImpl<$Res> extends _$PaymentDetailsCopyWithIm $Res call({ Object? data = null, }) { - return _then(_$PaymentDetails_Ln( + return _then(_$PaymentDetails_LnImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -4052,8 +4076,8 @@ class __$$PaymentDetails_LnCopyWithImpl<$Res> extends _$PaymentDetailsCopyWithIm /// @nodoc -class _$PaymentDetails_Ln implements PaymentDetails_Ln { - const _$PaymentDetails_Ln({required this.data}); +class _$PaymentDetails_LnImpl implements PaymentDetails_Ln { + const _$PaymentDetails_LnImpl({required this.data}); @override final LnPaymentDetails data; @@ -4067,7 +4091,7 @@ class _$PaymentDetails_Ln implements PaymentDetails_Ln { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PaymentDetails_Ln && + other is _$PaymentDetails_LnImpl && (identical(other.data, data) || other.data == data)); } @@ -4077,8 +4101,8 @@ class _$PaymentDetails_Ln implements PaymentDetails_Ln { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PaymentDetails_LnCopyWith<_$PaymentDetails_Ln> get copyWith => - __$$PaymentDetails_LnCopyWithImpl<_$PaymentDetails_Ln>(this, _$identity); + _$$PaymentDetails_LnImplCopyWith<_$PaymentDetails_LnImpl> get copyWith => + __$$PaymentDetails_LnImplCopyWithImpl<_$PaymentDetails_LnImpl>(this, _$identity); @override @optionalTypeArgs @@ -4144,29 +4168,30 @@ class _$PaymentDetails_Ln implements PaymentDetails_Ln { } abstract class PaymentDetails_Ln implements PaymentDetails { - const factory PaymentDetails_Ln({required final LnPaymentDetails data}) = _$PaymentDetails_Ln; + const factory PaymentDetails_Ln({required final LnPaymentDetails data}) = _$PaymentDetails_LnImpl; @override LnPaymentDetails get data; @JsonKey(ignore: true) - _$$PaymentDetails_LnCopyWith<_$PaymentDetails_Ln> get copyWith => throw _privateConstructorUsedError; + _$$PaymentDetails_LnImplCopyWith<_$PaymentDetails_LnImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$PaymentDetails_ClosedChannelCopyWith<$Res> { - factory _$$PaymentDetails_ClosedChannelCopyWith( - _$PaymentDetails_ClosedChannel value, $Res Function(_$PaymentDetails_ClosedChannel) then) = - __$$PaymentDetails_ClosedChannelCopyWithImpl<$Res>; +abstract class _$$PaymentDetails_ClosedChannelImplCopyWith<$Res> { + factory _$$PaymentDetails_ClosedChannelImplCopyWith( + _$PaymentDetails_ClosedChannelImpl value, $Res Function(_$PaymentDetails_ClosedChannelImpl) then) = + __$$PaymentDetails_ClosedChannelImplCopyWithImpl<$Res>; @useResult $Res call({ClosedChannelPaymentDetails data}); } /// @nodoc -class __$$PaymentDetails_ClosedChannelCopyWithImpl<$Res> - extends _$PaymentDetailsCopyWithImpl<$Res, _$PaymentDetails_ClosedChannel> - implements _$$PaymentDetails_ClosedChannelCopyWith<$Res> { - __$$PaymentDetails_ClosedChannelCopyWithImpl( - _$PaymentDetails_ClosedChannel _value, $Res Function(_$PaymentDetails_ClosedChannel) _then) +class __$$PaymentDetails_ClosedChannelImplCopyWithImpl<$Res> + extends _$PaymentDetailsCopyWithImpl<$Res, _$PaymentDetails_ClosedChannelImpl> + implements _$$PaymentDetails_ClosedChannelImplCopyWith<$Res> { + __$$PaymentDetails_ClosedChannelImplCopyWithImpl( + _$PaymentDetails_ClosedChannelImpl _value, $Res Function(_$PaymentDetails_ClosedChannelImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4174,7 +4199,7 @@ class __$$PaymentDetails_ClosedChannelCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$PaymentDetails_ClosedChannel( + return _then(_$PaymentDetails_ClosedChannelImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -4185,8 +4210,8 @@ class __$$PaymentDetails_ClosedChannelCopyWithImpl<$Res> /// @nodoc -class _$PaymentDetails_ClosedChannel implements PaymentDetails_ClosedChannel { - const _$PaymentDetails_ClosedChannel({required this.data}); +class _$PaymentDetails_ClosedChannelImpl implements PaymentDetails_ClosedChannel { + const _$PaymentDetails_ClosedChannelImpl({required this.data}); @override final ClosedChannelPaymentDetails data; @@ -4200,7 +4225,7 @@ class _$PaymentDetails_ClosedChannel implements PaymentDetails_ClosedChannel { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$PaymentDetails_ClosedChannel && + other is _$PaymentDetails_ClosedChannelImpl && (identical(other.data, data) || other.data == data)); } @@ -4210,8 +4235,8 @@ class _$PaymentDetails_ClosedChannel implements PaymentDetails_ClosedChannel { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$PaymentDetails_ClosedChannelCopyWith<_$PaymentDetails_ClosedChannel> get copyWith => - __$$PaymentDetails_ClosedChannelCopyWithImpl<_$PaymentDetails_ClosedChannel>(this, _$identity); + _$$PaymentDetails_ClosedChannelImplCopyWith<_$PaymentDetails_ClosedChannelImpl> get copyWith => + __$$PaymentDetails_ClosedChannelImplCopyWithImpl<_$PaymentDetails_ClosedChannelImpl>(this, _$identity); @override @optionalTypeArgs @@ -4278,12 +4303,12 @@ class _$PaymentDetails_ClosedChannel implements PaymentDetails_ClosedChannel { abstract class PaymentDetails_ClosedChannel implements PaymentDetails { const factory PaymentDetails_ClosedChannel({required final ClosedChannelPaymentDetails data}) = - _$PaymentDetails_ClosedChannel; + _$PaymentDetails_ClosedChannelImpl; @override ClosedChannelPaymentDetails get data; @JsonKey(ignore: true) - _$$PaymentDetails_ClosedChannelCopyWith<_$PaymentDetails_ClosedChannel> get copyWith => + _$$PaymentDetails_ClosedChannelImplCopyWith<_$PaymentDetails_ClosedChannelImpl> get copyWith => throw _privateConstructorUsedError; } @@ -4355,20 +4380,20 @@ class _$SuccessActionProcessedCopyWithImpl<$Res, $Val extends SuccessActionProce } /// @nodoc -abstract class _$$SuccessActionProcessed_AesCopyWith<$Res> { - factory _$$SuccessActionProcessed_AesCopyWith( - _$SuccessActionProcessed_Aes value, $Res Function(_$SuccessActionProcessed_Aes) then) = - __$$SuccessActionProcessed_AesCopyWithImpl<$Res>; +abstract class _$$SuccessActionProcessed_AesImplCopyWith<$Res> { + factory _$$SuccessActionProcessed_AesImplCopyWith( + _$SuccessActionProcessed_AesImpl value, $Res Function(_$SuccessActionProcessed_AesImpl) then) = + __$$SuccessActionProcessed_AesImplCopyWithImpl<$Res>; @useResult $Res call({AesSuccessActionDataDecrypted data}); } /// @nodoc -class __$$SuccessActionProcessed_AesCopyWithImpl<$Res> - extends _$SuccessActionProcessedCopyWithImpl<$Res, _$SuccessActionProcessed_Aes> - implements _$$SuccessActionProcessed_AesCopyWith<$Res> { - __$$SuccessActionProcessed_AesCopyWithImpl( - _$SuccessActionProcessed_Aes _value, $Res Function(_$SuccessActionProcessed_Aes) _then) +class __$$SuccessActionProcessed_AesImplCopyWithImpl<$Res> + extends _$SuccessActionProcessedCopyWithImpl<$Res, _$SuccessActionProcessed_AesImpl> + implements _$$SuccessActionProcessed_AesImplCopyWith<$Res> { + __$$SuccessActionProcessed_AesImplCopyWithImpl( + _$SuccessActionProcessed_AesImpl _value, $Res Function(_$SuccessActionProcessed_AesImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4376,7 +4401,7 @@ class __$$SuccessActionProcessed_AesCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$SuccessActionProcessed_Aes( + return _then(_$SuccessActionProcessed_AesImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -4387,8 +4412,8 @@ class __$$SuccessActionProcessed_AesCopyWithImpl<$Res> /// @nodoc -class _$SuccessActionProcessed_Aes implements SuccessActionProcessed_Aes { - const _$SuccessActionProcessed_Aes({required this.data}); +class _$SuccessActionProcessed_AesImpl implements SuccessActionProcessed_Aes { + const _$SuccessActionProcessed_AesImpl({required this.data}); @override final AesSuccessActionDataDecrypted data; @@ -4402,7 +4427,7 @@ class _$SuccessActionProcessed_Aes implements SuccessActionProcessed_Aes { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SuccessActionProcessed_Aes && + other is _$SuccessActionProcessed_AesImpl && (identical(other.data, data) || other.data == data)); } @@ -4412,8 +4437,8 @@ class _$SuccessActionProcessed_Aes implements SuccessActionProcessed_Aes { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SuccessActionProcessed_AesCopyWith<_$SuccessActionProcessed_Aes> get copyWith => - __$$SuccessActionProcessed_AesCopyWithImpl<_$SuccessActionProcessed_Aes>(this, _$identity); + _$$SuccessActionProcessed_AesImplCopyWith<_$SuccessActionProcessed_AesImpl> get copyWith => + __$$SuccessActionProcessed_AesImplCopyWithImpl<_$SuccessActionProcessed_AesImpl>(this, _$identity); @override @optionalTypeArgs @@ -4486,30 +4511,30 @@ class _$SuccessActionProcessed_Aes implements SuccessActionProcessed_Aes { abstract class SuccessActionProcessed_Aes implements SuccessActionProcessed { const factory SuccessActionProcessed_Aes({required final AesSuccessActionDataDecrypted data}) = - _$SuccessActionProcessed_Aes; + _$SuccessActionProcessed_AesImpl; @override AesSuccessActionDataDecrypted get data; @JsonKey(ignore: true) - _$$SuccessActionProcessed_AesCopyWith<_$SuccessActionProcessed_Aes> get copyWith => + _$$SuccessActionProcessed_AesImplCopyWith<_$SuccessActionProcessed_AesImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SuccessActionProcessed_MessageCopyWith<$Res> { - factory _$$SuccessActionProcessed_MessageCopyWith( - _$SuccessActionProcessed_Message value, $Res Function(_$SuccessActionProcessed_Message) then) = - __$$SuccessActionProcessed_MessageCopyWithImpl<$Res>; +abstract class _$$SuccessActionProcessed_MessageImplCopyWith<$Res> { + factory _$$SuccessActionProcessed_MessageImplCopyWith(_$SuccessActionProcessed_MessageImpl value, + $Res Function(_$SuccessActionProcessed_MessageImpl) then) = + __$$SuccessActionProcessed_MessageImplCopyWithImpl<$Res>; @useResult $Res call({MessageSuccessActionData data}); } /// @nodoc -class __$$SuccessActionProcessed_MessageCopyWithImpl<$Res> - extends _$SuccessActionProcessedCopyWithImpl<$Res, _$SuccessActionProcessed_Message> - implements _$$SuccessActionProcessed_MessageCopyWith<$Res> { - __$$SuccessActionProcessed_MessageCopyWithImpl( - _$SuccessActionProcessed_Message _value, $Res Function(_$SuccessActionProcessed_Message) _then) +class __$$SuccessActionProcessed_MessageImplCopyWithImpl<$Res> + extends _$SuccessActionProcessedCopyWithImpl<$Res, _$SuccessActionProcessed_MessageImpl> + implements _$$SuccessActionProcessed_MessageImplCopyWith<$Res> { + __$$SuccessActionProcessed_MessageImplCopyWithImpl( + _$SuccessActionProcessed_MessageImpl _value, $Res Function(_$SuccessActionProcessed_MessageImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4517,7 +4542,7 @@ class __$$SuccessActionProcessed_MessageCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$SuccessActionProcessed_Message( + return _then(_$SuccessActionProcessed_MessageImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -4528,8 +4553,8 @@ class __$$SuccessActionProcessed_MessageCopyWithImpl<$Res> /// @nodoc -class _$SuccessActionProcessed_Message implements SuccessActionProcessed_Message { - const _$SuccessActionProcessed_Message({required this.data}); +class _$SuccessActionProcessed_MessageImpl implements SuccessActionProcessed_Message { + const _$SuccessActionProcessed_MessageImpl({required this.data}); @override final MessageSuccessActionData data; @@ -4543,7 +4568,7 @@ class _$SuccessActionProcessed_Message implements SuccessActionProcessed_Message bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SuccessActionProcessed_Message && + other is _$SuccessActionProcessed_MessageImpl && (identical(other.data, data) || other.data == data)); } @@ -4553,8 +4578,9 @@ class _$SuccessActionProcessed_Message implements SuccessActionProcessed_Message @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SuccessActionProcessed_MessageCopyWith<_$SuccessActionProcessed_Message> get copyWith => - __$$SuccessActionProcessed_MessageCopyWithImpl<_$SuccessActionProcessed_Message>(this, _$identity); + _$$SuccessActionProcessed_MessageImplCopyWith<_$SuccessActionProcessed_MessageImpl> get copyWith => + __$$SuccessActionProcessed_MessageImplCopyWithImpl<_$SuccessActionProcessed_MessageImpl>( + this, _$identity); @override @optionalTypeArgs @@ -4627,30 +4653,30 @@ class _$SuccessActionProcessed_Message implements SuccessActionProcessed_Message abstract class SuccessActionProcessed_Message implements SuccessActionProcessed { const factory SuccessActionProcessed_Message({required final MessageSuccessActionData data}) = - _$SuccessActionProcessed_Message; + _$SuccessActionProcessed_MessageImpl; @override MessageSuccessActionData get data; @JsonKey(ignore: true) - _$$SuccessActionProcessed_MessageCopyWith<_$SuccessActionProcessed_Message> get copyWith => + _$$SuccessActionProcessed_MessageImplCopyWith<_$SuccessActionProcessed_MessageImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$SuccessActionProcessed_UrlCopyWith<$Res> { - factory _$$SuccessActionProcessed_UrlCopyWith( - _$SuccessActionProcessed_Url value, $Res Function(_$SuccessActionProcessed_Url) then) = - __$$SuccessActionProcessed_UrlCopyWithImpl<$Res>; +abstract class _$$SuccessActionProcessed_UrlImplCopyWith<$Res> { + factory _$$SuccessActionProcessed_UrlImplCopyWith( + _$SuccessActionProcessed_UrlImpl value, $Res Function(_$SuccessActionProcessed_UrlImpl) then) = + __$$SuccessActionProcessed_UrlImplCopyWithImpl<$Res>; @useResult $Res call({UrlSuccessActionData data}); } /// @nodoc -class __$$SuccessActionProcessed_UrlCopyWithImpl<$Res> - extends _$SuccessActionProcessedCopyWithImpl<$Res, _$SuccessActionProcessed_Url> - implements _$$SuccessActionProcessed_UrlCopyWith<$Res> { - __$$SuccessActionProcessed_UrlCopyWithImpl( - _$SuccessActionProcessed_Url _value, $Res Function(_$SuccessActionProcessed_Url) _then) +class __$$SuccessActionProcessed_UrlImplCopyWithImpl<$Res> + extends _$SuccessActionProcessedCopyWithImpl<$Res, _$SuccessActionProcessed_UrlImpl> + implements _$$SuccessActionProcessed_UrlImplCopyWith<$Res> { + __$$SuccessActionProcessed_UrlImplCopyWithImpl( + _$SuccessActionProcessed_UrlImpl _value, $Res Function(_$SuccessActionProcessed_UrlImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -4658,7 +4684,7 @@ class __$$SuccessActionProcessed_UrlCopyWithImpl<$Res> $Res call({ Object? data = null, }) { - return _then(_$SuccessActionProcessed_Url( + return _then(_$SuccessActionProcessed_UrlImpl( data: null == data ? _value.data : data // ignore: cast_nullable_to_non_nullable @@ -4669,8 +4695,8 @@ class __$$SuccessActionProcessed_UrlCopyWithImpl<$Res> /// @nodoc -class _$SuccessActionProcessed_Url implements SuccessActionProcessed_Url { - const _$SuccessActionProcessed_Url({required this.data}); +class _$SuccessActionProcessed_UrlImpl implements SuccessActionProcessed_Url { + const _$SuccessActionProcessed_UrlImpl({required this.data}); @override final UrlSuccessActionData data; @@ -4684,7 +4710,7 @@ class _$SuccessActionProcessed_Url implements SuccessActionProcessed_Url { bool operator ==(dynamic other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$SuccessActionProcessed_Url && + other is _$SuccessActionProcessed_UrlImpl && (identical(other.data, data) || other.data == data)); } @@ -4694,8 +4720,8 @@ class _$SuccessActionProcessed_Url implements SuccessActionProcessed_Url { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$SuccessActionProcessed_UrlCopyWith<_$SuccessActionProcessed_Url> get copyWith => - __$$SuccessActionProcessed_UrlCopyWithImpl<_$SuccessActionProcessed_Url>(this, _$identity); + _$$SuccessActionProcessed_UrlImplCopyWith<_$SuccessActionProcessed_UrlImpl> get copyWith => + __$$SuccessActionProcessed_UrlImplCopyWithImpl<_$SuccessActionProcessed_UrlImpl>(this, _$identity); @override @optionalTypeArgs @@ -4768,11 +4794,11 @@ class _$SuccessActionProcessed_Url implements SuccessActionProcessed_Url { abstract class SuccessActionProcessed_Url implements SuccessActionProcessed { const factory SuccessActionProcessed_Url({required final UrlSuccessActionData data}) = - _$SuccessActionProcessed_Url; + _$SuccessActionProcessed_UrlImpl; @override UrlSuccessActionData get data; @JsonKey(ignore: true) - _$$SuccessActionProcessed_UrlCopyWith<_$SuccessActionProcessed_Url> get copyWith => + _$$SuccessActionProcessed_UrlImplCopyWith<_$SuccessActionProcessed_UrlImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/libs/sdk-flutter/pubspec.lock b/libs/sdk-flutter/pubspec.lock index c19a061d8..3cd43cc31 100644 --- a/libs/sdk-flutter/pubspec.lock +++ b/libs/sdk-flutter/pubspec.lock @@ -21,10 +21,10 @@ packages: dependency: transitive description: name: archive - sha256: "06a96f1249f38a00435b3b0c9a3246d934d7dbc8183fc7c9e56989860edb99d4" + sha256: "7e0d52067d05f2e0324268097ba723b71cb41ac8a6a2b24d1edf9c536b987b03" url: "https://pub.dev" source: hosted - version: "3.4.4" + version: "3.4.6" args: dependency: transitive description: @@ -37,10 +37,10 @@ packages: dependency: transitive description: name: async - sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0 + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" url: "https://pub.dev" source: hosted - version: "2.10.0" + version: "2.11.0" boolean_selector: dependency: transitive description: @@ -85,10 +85,10 @@ packages: dependency: transitive description: name: build_resolvers - sha256: "0713a05b0386bd97f9e63e78108805a4feca5898a4b821d6610857f10c91e975" + sha256: "64e12b0521812d1684b1917bc80945625391cb9bdd4312536b1d69dcb6133ed8" url: "https://pub.dev" source: hosted - version: "2.4.0" + version: "2.4.1" build_runner: dependency: "direct dev" description: @@ -125,10 +125,10 @@ packages: dependency: transitive description: name: characters - sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.3.0" checked_yaml: dependency: transitive description: @@ -165,10 +165,10 @@ packages: dependency: transitive description: name: collection - sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0 + sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 url: "https://pub.dev" source: hosted - version: "1.17.0" + version: "1.17.2" colorize: dependency: transitive description: @@ -213,10 +213,10 @@ packages: dependency: "direct main" description: name: ffi - sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" url: "https://pub.dev" source: hosted - version: "2.0.2" + version: "2.1.0" ffigen: dependency: "direct dev" description: @@ -271,10 +271,10 @@ packages: dependency: "direct main" description: name: freezed - sha256: "2df89855fe181baae3b6d714dc3c4317acf4fccd495a6f36e5e00f24144c6c3b" + sha256: "21bf2825311de65501d22e563e3d7605dff57fb5e6da982db785ae5372ff018a" url: "https://pub.dev" source: hosted - version: "2.4.1" + version: "2.4.5" freezed_annotation: dependency: "direct main" description: @@ -343,10 +343,10 @@ packages: dependency: transitive description: name: js - sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7" + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 url: "https://pub.dev" source: hosted - version: "0.6.5" + version: "0.6.7" json_annotation: dependency: transitive description: @@ -359,10 +359,10 @@ packages: dependency: transitive description: name: lints - sha256: "5e4a9cd06d447758280a8ac2405101e0e2094d2a1dbdd3756aec3fe7775ba593" + sha256: "0a217c6c989d21039f1498c3ed9f3ed71b354e69873f13a8dfc3c9fe76f1b452" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "2.1.1" logging: dependency: transitive description: @@ -375,26 +375,26 @@ packages: dependency: transitive description: name: matcher - sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72" + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.13" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.2.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42" + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" url: "https://pub.dev" source: hosted - version: "1.8.0" + version: "1.9.1" mime: dependency: transitive description: @@ -415,18 +415,18 @@ packages: dependency: transitive description: name: path - sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.8.2" + version: "1.8.3" petitparser: dependency: transitive description: name: petitparser - sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 url: "https://pub.dev" source: hosted - version: "5.1.0" + version: "5.4.0" pointycastle: dependency: transitive description: @@ -516,18 +516,18 @@ packages: dependency: transitive description: name: source_gen - sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33" + sha256: fc0da689e5302edb6177fdd964efcb7f58912f43c28c2047a808f5bfff643d16 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" source_span: dependency: transitive description: name: source_span - sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" stack_trace: dependency: transitive description: @@ -572,10 +572,10 @@ packages: dependency: transitive description: name: test_api - sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206 + sha256: "75760ffd7786fffdfb9597c35c5b27eaeec82be8edfb6d71d32651128ed7aab8" url: "https://pub.dev" source: hosted - version: "0.4.16" + version: "0.6.0" timing: dependency: transitive description: @@ -620,10 +620,18 @@ packages: dependency: transitive description: name: watcher - sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + web: + dependency: transitive + description: + name: web + sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 url: "https://pub.dev" source: hosted - version: "1.0.2" + version: "0.1.4-beta" web_socket_channel: dependency: transitive description: @@ -649,5 +657,5 @@ packages: source: hosted version: "2.1.1" sdks: - dart: ">=2.19.6 <3.0.0" + dart: ">=3.1.0-185.0.dev <4.0.0" flutter: ">=3.7.12" diff --git a/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt b/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt index 706d27e41..34c95076c 100644 --- a/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt +++ b/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKMapper.kt @@ -900,6 +900,46 @@ fun asLnUrlErrorDataList(arr: ReadableArray): List { return list } +fun asLnUrlPayRequest(data: ReadableMap): LnUrlPayRequest? { + if (!validateMandatoryFields( + data, + arrayOf( + "reqData", + "amountMsat", + ), + ) + ) { + return null + } + val reqData = data.getMap("reqData")?.let { asLnUrlPayRequestData(it) }!! + val amountMsat = data.getDouble("amountMsat").toULong() + val comment = if (hasNonNullKey(data, "comment")) data.getString("comment") else null + return LnUrlPayRequest( + reqData, + amountMsat, + comment, + ) +} + +fun readableMapOf(lnUrlPayRequest: LnUrlPayRequest): ReadableMap { + return readableMapOf( + "reqData" to readableMapOf(lnUrlPayRequest.reqData), + "amountMsat" to lnUrlPayRequest.amountMsat, + "comment" to lnUrlPayRequest.comment, + ) +} + +fun asLnUrlPayRequestList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asLnUrlPayRequest(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + fun asLnUrlPayRequestData(data: ReadableMap): LnUrlPayRequestData? { if (!validateMandatoryFields( data, @@ -1863,6 +1903,80 @@ fun asRecommendedFeesList(arr: ReadableArray): List { return list } +fun asRefundRequest(data: ReadableMap): RefundRequest? { + if (!validateMandatoryFields( + data, + arrayOf( + "swapAddress", + "toAddress", + "satPerVbyte", + ), + ) + ) { + return null + } + val swapAddress = data.getString("swapAddress")!! + val toAddress = data.getString("toAddress")!! + val satPerVbyte = data.getInt("satPerVbyte").toUInt() + return RefundRequest( + swapAddress, + toAddress, + satPerVbyte, + ) +} + +fun readableMapOf(refundRequest: RefundRequest): ReadableMap { + return readableMapOf( + "swapAddress" to refundRequest.swapAddress, + "toAddress" to refundRequest.toAddress, + "satPerVbyte" to refundRequest.satPerVbyte, + ) +} + +fun asRefundRequestList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asRefundRequest(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + +fun asRefundResponse(data: ReadableMap): RefundResponse? { + if (!validateMandatoryFields( + data, + arrayOf( + "refundTxId", + ), + ) + ) { + return null + } + val refundTxId = data.getString("refundTxId")!! + return RefundResponse( + refundTxId, + ) +} + +fun readableMapOf(refundResponse: RefundResponse): ReadableMap { + return readableMapOf( + "refundTxId" to refundResponse.refundTxId, + ) +} + +fun asRefundResponseList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asRefundResponse(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + fun asReverseSwapFeesRequest(data: ReadableMap): ReverseSwapFeesRequest? { if (!validateMandatoryFields( data, @@ -2089,6 +2203,154 @@ fun asRouteHintHopList(arr: ReadableArray): List { return list } +fun asSendOnchainRequest(data: ReadableMap): SendOnchainRequest? { + if (!validateMandatoryFields( + data, + arrayOf( + "amountSat", + "onchainRecipientAddress", + "pairHash", + "satPerVbyte", + ), + ) + ) { + return null + } + val amountSat = data.getDouble("amountSat").toULong() + val onchainRecipientAddress = data.getString("onchainRecipientAddress")!! + val pairHash = data.getString("pairHash")!! + val satPerVbyte = data.getDouble("satPerVbyte").toULong() + return SendOnchainRequest( + amountSat, + onchainRecipientAddress, + pairHash, + satPerVbyte, + ) +} + +fun readableMapOf(sendOnchainRequest: SendOnchainRequest): ReadableMap { + return readableMapOf( + "amountSat" to sendOnchainRequest.amountSat, + "onchainRecipientAddress" to sendOnchainRequest.onchainRecipientAddress, + "pairHash" to sendOnchainRequest.pairHash, + "satPerVbyte" to sendOnchainRequest.satPerVbyte, + ) +} + +fun asSendOnchainRequestList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asSendOnchainRequest(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + +fun asSendOnchainResponse(data: ReadableMap): SendOnchainResponse? { + if (!validateMandatoryFields( + data, + arrayOf( + "reverseSwapInfo", + ), + ) + ) { + return null + } + val reverseSwapInfo = data.getMap("reverseSwapInfo")?.let { asReverseSwapInfo(it) }!! + return SendOnchainResponse( + reverseSwapInfo, + ) +} + +fun readableMapOf(sendOnchainResponse: SendOnchainResponse): ReadableMap { + return readableMapOf( + "reverseSwapInfo" to readableMapOf(sendOnchainResponse.reverseSwapInfo), + ) +} + +fun asSendOnchainResponseList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asSendOnchainResponse(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + +fun asSendPaymentResponse(data: ReadableMap): SendPaymentResponse? { + if (!validateMandatoryFields( + data, + arrayOf( + "payment", + ), + ) + ) { + return null + } + val payment = data.getMap("payment")?.let { asPayment(it) }!! + return SendPaymentResponse( + payment, + ) +} + +fun readableMapOf(sendPaymentResponse: SendPaymentResponse): ReadableMap { + return readableMapOf( + "payment" to readableMapOf(sendPaymentResponse.payment), + ) +} + +fun asSendPaymentResponseList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asSendPaymentResponse(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + +fun asSendSpontaneousPaymentRequest(data: ReadableMap): SendSpontaneousPaymentRequest? { + if (!validateMandatoryFields( + data, + arrayOf( + "nodeId", + "amountMsat", + ), + ) + ) { + return null + } + val nodeId = data.getString("nodeId")!! + val amountMsat = data.getDouble("amountMsat").toULong() + return SendSpontaneousPaymentRequest( + nodeId, + amountMsat, + ) +} + +fun readableMapOf(sendSpontaneousPaymentRequest: SendSpontaneousPaymentRequest): ReadableMap { + return readableMapOf( + "nodeId" to sendSpontaneousPaymentRequest.nodeId, + "amountMsat" to sendSpontaneousPaymentRequest.amountMsat, + ) +} + +fun asSendSpontaneousPaymentRequestList(arr: ReadableArray): List { + val list = ArrayList() + for (value in arr.toArrayList()) { + when (value) { + is ReadableMap -> list.add(asSendSpontaneousPaymentRequest(value)!!) + else -> throw IllegalArgumentException("Unsupported type ${value::class.java.name}") + } + } + return list +} + fun asSignMessageRequest(data: ReadableMap): SignMessageRequest? { if (!validateMandatoryFields( data, diff --git a/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKModule.kt b/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKModule.kt index 27cf9635d..9c1150686 100644 --- a/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKModule.kt +++ b/libs/sdk-react-native/android/src/main/java/com/breezsdk/BreezSDKModule.kt @@ -115,14 +115,14 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun staticBackup( - request: ReadableMap, + req: ReadableMap, promise: Promise, ) { executor.execute { try { val staticBackupRequest = - asStaticBackupRequest(request) ?: run { - throw SdkException.Generic("Missing mandatory field request of type StaticBackupRequest") + asStaticBackupRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type StaticBackupRequest") } val res = staticBackup(staticBackupRequest) promise.resolve(readableMapOf(res)) @@ -199,13 +199,16 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun sendSpontaneousPayment( - nodeId: String, - amountSats: Double, + req: ReadableMap, promise: Promise, ) { executor.execute { try { - val res = getBreezServices().sendSpontaneousPayment(nodeId, amountSats.toULong()) + val sendSpontaneousPaymentRequest = + asSendSpontaneousPaymentRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type SendSpontaneousPaymentRequest") + } + val res = getBreezServices().sendSpontaneousPayment(sendSpontaneousPaymentRequest) promise.resolve(readableMapOf(res)) } catch (e: SdkException) { promise.reject(e.javaClass.simpleName, e.message, e) @@ -215,14 +218,14 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun receivePayment( - reqData: ReadableMap, + req: ReadableMap, promise: Promise, ) { executor.execute { try { val receivePaymentRequest = - asReceivePaymentRequest(reqData) ?: run { - throw SdkException.Generic("Missing mandatory field reqData of type ReceivePaymentRequest") + asReceivePaymentRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type ReceivePaymentRequest") } val res = getBreezServices().receivePayment(receivePaymentRequest) promise.resolve(readableMapOf(res)) @@ -234,19 +237,13 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun payLnurl( - reqData: ReadableMap, - amountSats: Double, - comment: String, + req: ReadableMap, promise: Promise, ) { executor.execute { try { - val lnUrlPayRequestData = - asLnUrlPayRequestData(reqData) ?: run { - throw SdkException.Generic("Missing mandatory field reqData of type LnUrlPayRequestData") - } - val commentTmp = comment.takeUnless { it.isEmpty() } - val res = getBreezServices().payLnurl(lnUrlPayRequestData, amountSats.toULong(), commentTmp) + val lnUrlPayRequest = asLnUrlPayRequest(req) ?: run { throw SdkException.Generic("Missing mandatory field req of type LnUrlPayRequest") } + val res = getBreezServices().payLnurl(lnUrlPayRequest) promise.resolve(readableMapOf(res)) } catch (e: SdkException) { promise.reject(e.javaClass.simpleName, e.message, e) @@ -309,14 +306,14 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun signMessage( - request: ReadableMap, + req: ReadableMap, promise: Promise, ) { executor.execute { try { val signMessageRequest = - asSignMessageRequest(request) ?: run { - throw SdkException.Generic("Missing mandatory field request of type SignMessageRequest") + asSignMessageRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type SignMessageRequest") } val res = getBreezServices().signMessage(signMessageRequest) promise.resolve(readableMapOf(res)) @@ -328,14 +325,14 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun checkMessage( - request: ReadableMap, + req: ReadableMap, promise: Promise, ) { executor.execute { try { val checkMessageRequest = - asCheckMessageRequest(request) ?: run { - throw SdkException.Generic("Missing mandatory field request of type CheckMessageRequest") + asCheckMessageRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type CheckMessageRequest") } val res = getBreezServices().checkMessage(checkMessageRequest) promise.resolve(readableMapOf(res)) @@ -386,14 +383,14 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun listPayments( - request: ReadableMap, + req: ReadableMap, promise: Promise, ) { executor.execute { try { val listPaymentsRequest = - asListPaymentsRequest(request) ?: run { - throw SdkException.Generic("Missing mandatory field request of type ListPaymentsRequest") + asListPaymentsRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type ListPaymentsRequest") } val res = getBreezServices().listPayments(listPaymentsRequest) promise.resolve(readableArrayOf(res)) @@ -405,12 +402,12 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun sweep( - request: ReadableMap, + req: ReadableMap, promise: Promise, ) { executor.execute { try { - val sweepRequest = asSweepRequest(request) ?: run { throw SdkException.Generic("Missing mandatory field request of type SweepRequest") } + val sweepRequest = asSweepRequest(req) ?: run { throw SdkException.Generic("Missing mandatory field req of type SweepRequest") } val res = getBreezServices().sweep(sweepRequest) promise.resolve(readableMapOf(res)) } catch (e: SdkException) { @@ -585,15 +582,14 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun refund( - swapAddress: String, - toAddress: String, - satPerVbyte: Int, + req: ReadableMap, promise: Promise, ) { executor.execute { try { - val res = getBreezServices().refund(swapAddress, toAddress, satPerVbyte.toUInt()) - promise.resolve(res) + val refundRequest = asRefundRequest(req) ?: run { throw SdkException.Generic("Missing mandatory field req of type RefundRequest") } + val res = getBreezServices().refund(refundRequest) + promise.resolve(readableMapOf(res)) } catch (e: SdkException) { promise.reject(e.javaClass.simpleName, e.message, e) } @@ -633,15 +629,16 @@ class BreezSDKModule(reactContext: ReactApplicationContext) : ReactContextBaseJa @ReactMethod fun sendOnchain( - amountSat: Double, - onchainRecipientAddress: String, - pairHash: String, - satPerVbyte: Double, + req: ReadableMap, promise: Promise, ) { executor.execute { try { - val res = getBreezServices().sendOnchain(amountSat.toULong(), onchainRecipientAddress, pairHash, satPerVbyte.toULong()) + val sendOnchainRequest = + asSendOnchainRequest(req) ?: run { + throw SdkException.Generic("Missing mandatory field req of type SendOnchainRequest") + } + val res = getBreezServices().sendOnchain(sendOnchainRequest) promise.resolve(readableMapOf(res)) } catch (e: SdkException) { promise.reject(e.javaClass.simpleName, e.message, e) diff --git a/libs/sdk-react-native/ios/BreezSDKMapper.swift b/libs/sdk-react-native/ios/BreezSDKMapper.swift index f0e692533..838541efe 100644 --- a/libs/sdk-react-native/ios/BreezSDKMapper.swift +++ b/libs/sdk-react-native/ios/BreezSDKMapper.swift @@ -836,6 +836,45 @@ class BreezSDKMapper { return lnUrlErrorDataList.map { v -> [String: Any?] in dictionaryOf(lnUrlErrorData: v) } } + static func asLnUrlPayRequest(data: [String: Any?]) throws -> LnUrlPayRequest { + guard let reqDataTmp = data["reqData"] as? [String: Any?] else { throw SdkError.Generic(message: "Missing mandatory field reqData for type LnUrlPayRequest") } + let reqData = try asLnUrlPayRequestData(data: reqDataTmp) + + guard let amountMsat = data["amountMsat"] as? UInt64 else { throw SdkError.Generic(message: "Missing mandatory field amountMsat for type LnUrlPayRequest") } + let comment = data["comment"] as? String + + return LnUrlPayRequest( + reqData: reqData, + amountMsat: amountMsat, + comment: comment + ) + } + + static func dictionaryOf(lnUrlPayRequest: LnUrlPayRequest) -> [String: Any?] { + return [ + "reqData": dictionaryOf(lnUrlPayRequestData: lnUrlPayRequest.reqData), + "amountMsat": lnUrlPayRequest.amountMsat, + "comment": lnUrlPayRequest.comment == nil ? nil : lnUrlPayRequest.comment, + ] + } + + static func asLnUrlPayRequestList(arr: [Any]) throws -> [LnUrlPayRequest] { + var list = [LnUrlPayRequest]() + for value in arr { + if let val = value as? [String: Any?] { + var lnUrlPayRequest = try asLnUrlPayRequest(data: val) + list.append(lnUrlPayRequest) + } else { + throw SdkError.Generic(message: "Invalid element type LnUrlPayRequest") + } + } + return list + } + + static func arrayOf(lnUrlPayRequestList: [LnUrlPayRequest]) -> [Any] { + return lnUrlPayRequestList.map { v -> [String: Any?] in dictionaryOf(lnUrlPayRequest: v) } + } + static func asLnUrlPayRequestData(data: [String: Any?]) throws -> LnUrlPayRequestData { guard let callback = data["callback"] as? String else { throw SdkError.Generic(message: "Missing mandatory field callback for type LnUrlPayRequestData") } guard let minSendable = data["minSendable"] as? UInt64 else { throw SdkError.Generic(message: "Missing mandatory field minSendable for type LnUrlPayRequestData") } @@ -1711,6 +1750,73 @@ class BreezSDKMapper { return recommendedFeesList.map { v -> [String: Any?] in dictionaryOf(recommendedFees: v) } } + static func asRefundRequest(data: [String: Any?]) throws -> RefundRequest { + guard let swapAddress = data["swapAddress"] as? String else { throw SdkError.Generic(message: "Missing mandatory field swapAddress for type RefundRequest") } + guard let toAddress = data["toAddress"] as? String else { throw SdkError.Generic(message: "Missing mandatory field toAddress for type RefundRequest") } + guard let satPerVbyte = data["satPerVbyte"] as? UInt32 else { throw SdkError.Generic(message: "Missing mandatory field satPerVbyte for type RefundRequest") } + + return RefundRequest( + swapAddress: swapAddress, + toAddress: toAddress, + satPerVbyte: satPerVbyte + ) + } + + static func dictionaryOf(refundRequest: RefundRequest) -> [String: Any?] { + return [ + "swapAddress": refundRequest.swapAddress, + "toAddress": refundRequest.toAddress, + "satPerVbyte": refundRequest.satPerVbyte, + ] + } + + static func asRefundRequestList(arr: [Any]) throws -> [RefundRequest] { + var list = [RefundRequest]() + for value in arr { + if let val = value as? [String: Any?] { + var refundRequest = try asRefundRequest(data: val) + list.append(refundRequest) + } else { + throw SdkError.Generic(message: "Invalid element type RefundRequest") + } + } + return list + } + + static func arrayOf(refundRequestList: [RefundRequest]) -> [Any] { + return refundRequestList.map { v -> [String: Any?] in dictionaryOf(refundRequest: v) } + } + + static func asRefundResponse(data: [String: Any?]) throws -> RefundResponse { + guard let refundTxId = data["refundTxId"] as? String else { throw SdkError.Generic(message: "Missing mandatory field refundTxId for type RefundResponse") } + + return RefundResponse( + refundTxId: refundTxId) + } + + static func dictionaryOf(refundResponse: RefundResponse) -> [String: Any?] { + return [ + "refundTxId": refundResponse.refundTxId, + ] + } + + static func asRefundResponseList(arr: [Any]) throws -> [RefundResponse] { + var list = [RefundResponse]() + for value in arr { + if let val = value as? [String: Any?] { + var refundResponse = try asRefundResponse(data: val) + list.append(refundResponse) + } else { + throw SdkError.Generic(message: "Invalid element type RefundResponse") + } + } + return list + } + + static func arrayOf(refundResponseList: [RefundResponse]) -> [Any] { + return refundResponseList.map { v -> [String: Any?] in dictionaryOf(refundResponse: v) } + } + static func asReverseSwapFeesRequest(data: [String: Any?]) throws -> ReverseSwapFeesRequest { let sendAmountSat = data["sendAmountSat"] as? UInt64 @@ -1917,6 +2023,142 @@ class BreezSDKMapper { return routeHintHopList.map { v -> [String: Any?] in dictionaryOf(routeHintHop: v) } } + static func asSendOnchainRequest(data: [String: Any?]) throws -> SendOnchainRequest { + guard let amountSat = data["amountSat"] as? UInt64 else { throw SdkError.Generic(message: "Missing mandatory field amountSat for type SendOnchainRequest") } + guard let onchainRecipientAddress = data["onchainRecipientAddress"] as? String else { throw SdkError.Generic(message: "Missing mandatory field onchainRecipientAddress for type SendOnchainRequest") } + guard let pairHash = data["pairHash"] as? String else { throw SdkError.Generic(message: "Missing mandatory field pairHash for type SendOnchainRequest") } + guard let satPerVbyte = data["satPerVbyte"] as? UInt64 else { throw SdkError.Generic(message: "Missing mandatory field satPerVbyte for type SendOnchainRequest") } + + return SendOnchainRequest( + amountSat: amountSat, + onchainRecipientAddress: onchainRecipientAddress, + pairHash: pairHash, + satPerVbyte: satPerVbyte + ) + } + + static func dictionaryOf(sendOnchainRequest: SendOnchainRequest) -> [String: Any?] { + return [ + "amountSat": sendOnchainRequest.amountSat, + "onchainRecipientAddress": sendOnchainRequest.onchainRecipientAddress, + "pairHash": sendOnchainRequest.pairHash, + "satPerVbyte": sendOnchainRequest.satPerVbyte, + ] + } + + static func asSendOnchainRequestList(arr: [Any]) throws -> [SendOnchainRequest] { + var list = [SendOnchainRequest]() + for value in arr { + if let val = value as? [String: Any?] { + var sendOnchainRequest = try asSendOnchainRequest(data: val) + list.append(sendOnchainRequest) + } else { + throw SdkError.Generic(message: "Invalid element type SendOnchainRequest") + } + } + return list + } + + static func arrayOf(sendOnchainRequestList: [SendOnchainRequest]) -> [Any] { + return sendOnchainRequestList.map { v -> [String: Any?] in dictionaryOf(sendOnchainRequest: v) } + } + + static func asSendOnchainResponse(data: [String: Any?]) throws -> SendOnchainResponse { + guard let reverseSwapInfoTmp = data["reverseSwapInfo"] as? [String: Any?] else { throw SdkError.Generic(message: "Missing mandatory field reverseSwapInfo for type SendOnchainResponse") } + let reverseSwapInfo = try asReverseSwapInfo(data: reverseSwapInfoTmp) + + return SendOnchainResponse( + reverseSwapInfo: reverseSwapInfo) + } + + static func dictionaryOf(sendOnchainResponse: SendOnchainResponse) -> [String: Any?] { + return [ + "reverseSwapInfo": dictionaryOf(reverseSwapInfo: sendOnchainResponse.reverseSwapInfo), + ] + } + + static func asSendOnchainResponseList(arr: [Any]) throws -> [SendOnchainResponse] { + var list = [SendOnchainResponse]() + for value in arr { + if let val = value as? [String: Any?] { + var sendOnchainResponse = try asSendOnchainResponse(data: val) + list.append(sendOnchainResponse) + } else { + throw SdkError.Generic(message: "Invalid element type SendOnchainResponse") + } + } + return list + } + + static func arrayOf(sendOnchainResponseList: [SendOnchainResponse]) -> [Any] { + return sendOnchainResponseList.map { v -> [String: Any?] in dictionaryOf(sendOnchainResponse: v) } + } + + static func asSendPaymentResponse(data: [String: Any?]) throws -> SendPaymentResponse { + guard let paymentTmp = data["payment"] as? [String: Any?] else { throw SdkError.Generic(message: "Missing mandatory field payment for type SendPaymentResponse") } + let payment = try asPayment(data: paymentTmp) + + return SendPaymentResponse( + payment: payment) + } + + static func dictionaryOf(sendPaymentResponse: SendPaymentResponse) -> [String: Any?] { + return [ + "payment": dictionaryOf(payment: sendPaymentResponse.payment), + ] + } + + static func asSendPaymentResponseList(arr: [Any]) throws -> [SendPaymentResponse] { + var list = [SendPaymentResponse]() + for value in arr { + if let val = value as? [String: Any?] { + var sendPaymentResponse = try asSendPaymentResponse(data: val) + list.append(sendPaymentResponse) + } else { + throw SdkError.Generic(message: "Invalid element type SendPaymentResponse") + } + } + return list + } + + static func arrayOf(sendPaymentResponseList: [SendPaymentResponse]) -> [Any] { + return sendPaymentResponseList.map { v -> [String: Any?] in dictionaryOf(sendPaymentResponse: v) } + } + + static func asSendSpontaneousPaymentRequest(data: [String: Any?]) throws -> SendSpontaneousPaymentRequest { + guard let nodeId = data["nodeId"] as? String else { throw SdkError.Generic(message: "Missing mandatory field nodeId for type SendSpontaneousPaymentRequest") } + guard let amountMsat = data["amountMsat"] as? UInt64 else { throw SdkError.Generic(message: "Missing mandatory field amountMsat for type SendSpontaneousPaymentRequest") } + + return SendSpontaneousPaymentRequest( + nodeId: nodeId, + amountMsat: amountMsat + ) + } + + static func dictionaryOf(sendSpontaneousPaymentRequest: SendSpontaneousPaymentRequest) -> [String: Any?] { + return [ + "nodeId": sendSpontaneousPaymentRequest.nodeId, + "amountMsat": sendSpontaneousPaymentRequest.amountMsat, + ] + } + + static func asSendSpontaneousPaymentRequestList(arr: [Any]) throws -> [SendSpontaneousPaymentRequest] { + var list = [SendSpontaneousPaymentRequest]() + for value in arr { + if let val = value as? [String: Any?] { + var sendSpontaneousPaymentRequest = try asSendSpontaneousPaymentRequest(data: val) + list.append(sendSpontaneousPaymentRequest) + } else { + throw SdkError.Generic(message: "Invalid element type SendSpontaneousPaymentRequest") + } + } + return list + } + + static func arrayOf(sendSpontaneousPaymentRequestList: [SendSpontaneousPaymentRequest]) -> [Any] { + return sendSpontaneousPaymentRequestList.map { v -> [String: Any?] in dictionaryOf(sendSpontaneousPaymentRequest: v) } + } + static func asSignMessageRequest(data: [String: Any?]) throws -> SignMessageRequest { guard let message = data["message"] as? String else { throw SdkError.Generic(message: "Missing mandatory field message for type SignMessageRequest") } diff --git a/libs/sdk-react-native/ios/RNBreezSDK.m b/libs/sdk-react-native/ios/RNBreezSDK.m index 70dda26e2..a8f44afbb 100644 --- a/libs/sdk-react-native/ios/RNBreezSDK.m +++ b/libs/sdk-react-native/ios/RNBreezSDK.m @@ -30,7 +30,7 @@ @interface RCT_EXTERN_MODULE(RNBreezSDK, RCTEventEmitter) ) RCT_EXTERN_METHOD( - staticBackup: (NSDictionary*)request + staticBackup: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) @@ -60,22 +60,19 @@ @interface RCT_EXTERN_MODULE(RNBreezSDK, RCTEventEmitter) ) RCT_EXTERN_METHOD( - sendSpontaneousPayment: (NSString*)nodeId - amountSats: (NSUInteger*)amountSats + sendSpontaneousPayment: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) RCT_EXTERN_METHOD( - receivePayment: (NSDictionary*)reqData + receivePayment: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) RCT_EXTERN_METHOD( - payLnurl: (NSDictionary*)reqData - amountSats: (NSUInteger*)amountSats - comment: (NSString*)comment + payLnurl: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) @@ -100,13 +97,13 @@ @interface RCT_EXTERN_MODULE(RNBreezSDK, RCTEventEmitter) ) RCT_EXTERN_METHOD( - signMessage: (NSDictionary*)request + signMessage: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) RCT_EXTERN_METHOD( - checkMessage: (NSDictionary*)request + checkMessage: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) @@ -128,13 +125,13 @@ @interface RCT_EXTERN_MODULE(RNBreezSDK, RCTEventEmitter) ) RCT_EXTERN_METHOD( - listPayments: (NSDictionary*)request + listPayments: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) RCT_EXTERN_METHOD( - sweep: (NSDictionary*)request + sweep: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) @@ -204,9 +201,7 @@ @interface RCT_EXTERN_MODULE(RNBreezSDK, RCTEventEmitter) ) RCT_EXTERN_METHOD( - refund: (NSString*)swapAddress - toAddress: (NSString*)toAddress - satPerVbyte: (NSUInteger*)satPerVbyte + refund: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) @@ -223,10 +218,7 @@ @interface RCT_EXTERN_MODULE(RNBreezSDK, RCTEventEmitter) ) RCT_EXTERN_METHOD( - sendOnchain: (NSUInteger*)amountSat - onchainRecipientAddress: (NSString*)onchainRecipientAddress - pairHash: (NSString*)pairHash - satPerVbyte: (NSUInteger*)satPerVbyte + sendOnchain: (NSDictionary*)req resolve: (RCTPromiseResolveBlock)resolve reject: (RCTPromiseRejectBlock)reject ) diff --git a/libs/sdk-react-native/ios/RNBreezSDK.swift b/libs/sdk-react-native/ios/RNBreezSDK.swift index d90eed8f7..d5c6342ac 100644 --- a/libs/sdk-react-native/ios/RNBreezSDK.swift +++ b/libs/sdk-react-native/ios/RNBreezSDK.swift @@ -84,10 +84,10 @@ class RNBreezSDK: RCTEventEmitter { } @objc(staticBackup:resolve:reject:) - func staticBackup(_ request: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + func staticBackup(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let staticBackupRequest = try BreezSDKMapper.asStaticBackupRequest(data: request) - var res = try BreezSDK.staticBackup(request: staticBackupRequest) + let staticBackupRequest = try BreezSDKMapper.asStaticBackupRequest(data: req) + var res = try BreezSDK.staticBackup(req: staticBackupRequest) resolve(BreezSDKMapper.dictionaryOf(staticBackupResponse: res)) } catch let err { rejectErr(err: err, reject: reject) @@ -141,33 +141,33 @@ class RNBreezSDK: RCTEventEmitter { } } - @objc(sendSpontaneousPayment:amountSats:resolve:reject:) - func sendSpontaneousPayment(_ nodeId: String, amountSats: UInt64, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + @objc(sendSpontaneousPayment:resolve:reject:) + func sendSpontaneousPayment(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - var res = try getBreezServices().sendSpontaneousPayment(nodeId: nodeId, amountSats: amountSats) - resolve(BreezSDKMapper.dictionaryOf(payment: res)) + let sendSpontaneousPaymentRequest = try BreezSDKMapper.asSendSpontaneousPaymentRequest(data: req) + var res = try getBreezServices().sendSpontaneousPayment(req: sendSpontaneousPaymentRequest) + resolve(BreezSDKMapper.dictionaryOf(sendPaymentResponse: res)) } catch let err { rejectErr(err: err, reject: reject) } } @objc(receivePayment:resolve:reject:) - func receivePayment(_ reqData: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + func receivePayment(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let receivePaymentRequest = try BreezSDKMapper.asReceivePaymentRequest(data: reqData) - var res = try getBreezServices().receivePayment(reqData: receivePaymentRequest) + let receivePaymentRequest = try BreezSDKMapper.asReceivePaymentRequest(data: req) + var res = try getBreezServices().receivePayment(req: receivePaymentRequest) resolve(BreezSDKMapper.dictionaryOf(receivePaymentResponse: res)) } catch let err { rejectErr(err: err, reject: reject) } } - @objc(payLnurl:amountSats:comment:resolve:reject:) - func payLnurl(_ reqData: [String: Any], amountSats: UInt64, comment: String, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + @objc(payLnurl:resolve:reject:) + func payLnurl(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let lnUrlPayRequestData = try BreezSDKMapper.asLnUrlPayRequestData(data: reqData) - let commentTmp = comment.isEmpty ? nil : comment - var res = try getBreezServices().payLnurl(reqData: lnUrlPayRequestData, amountSats: amountSats, comment: commentTmp) + let lnUrlPayRequest = try BreezSDKMapper.asLnUrlPayRequest(data: req) + var res = try getBreezServices().payLnurl(req: lnUrlPayRequest) resolve(BreezSDKMapper.dictionaryOf(lnUrlPayResult: res)) } catch let err { rejectErr(err: err, reject: reject) @@ -208,10 +208,10 @@ class RNBreezSDK: RCTEventEmitter { } @objc(signMessage:resolve:reject:) - func signMessage(_ request: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + func signMessage(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let signMessageRequest = try BreezSDKMapper.asSignMessageRequest(data: request) - var res = try getBreezServices().signMessage(request: signMessageRequest) + let signMessageRequest = try BreezSDKMapper.asSignMessageRequest(data: req) + var res = try getBreezServices().signMessage(req: signMessageRequest) resolve(BreezSDKMapper.dictionaryOf(signMessageResponse: res)) } catch let err { rejectErr(err: err, reject: reject) @@ -219,10 +219,10 @@ class RNBreezSDK: RCTEventEmitter { } @objc(checkMessage:resolve:reject:) - func checkMessage(_ request: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + func checkMessage(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let checkMessageRequest = try BreezSDKMapper.asCheckMessageRequest(data: request) - var res = try getBreezServices().checkMessage(request: checkMessageRequest) + let checkMessageRequest = try BreezSDKMapper.asCheckMessageRequest(data: req) + var res = try getBreezServices().checkMessage(req: checkMessageRequest) resolve(BreezSDKMapper.dictionaryOf(checkMessageResponse: res)) } catch let err { rejectErr(err: err, reject: reject) @@ -264,10 +264,10 @@ class RNBreezSDK: RCTEventEmitter { } @objc(listPayments:resolve:reject:) - func listPayments(_ request: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + func listPayments(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let listPaymentsRequest = try BreezSDKMapper.asListPaymentsRequest(data: request) - var res = try getBreezServices().listPayments(request: listPaymentsRequest) + let listPaymentsRequest = try BreezSDKMapper.asListPaymentsRequest(data: req) + var res = try getBreezServices().listPayments(req: listPaymentsRequest) resolve(BreezSDKMapper.arrayOf(paymentList: res)) } catch let err { rejectErr(err: err, reject: reject) @@ -275,10 +275,10 @@ class RNBreezSDK: RCTEventEmitter { } @objc(sweep:resolve:reject:) - func sweep(_ request: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + func sweep(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - let sweepRequest = try BreezSDKMapper.asSweepRequest(data: request) - var res = try getBreezServices().sweep(request: sweepRequest) + let sweepRequest = try BreezSDKMapper.asSweepRequest(data: req) + var res = try getBreezServices().sweep(req: sweepRequest) resolve(BreezSDKMapper.dictionaryOf(sweepResponse: res)) } catch let err { rejectErr(err: err, reject: reject) @@ -419,11 +419,12 @@ class RNBreezSDK: RCTEventEmitter { } } - @objc(refund:toAddress:satPerVbyte:resolve:reject:) - func refund(_ swapAddress: String, toAddress: String, satPerVbyte: UInt32, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + @objc(refund:resolve:reject:) + func refund(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - var res = try getBreezServices().refund(swapAddress: swapAddress, toAddress: toAddress, satPerVbyte: satPerVbyte) - resolve(res) + let refundRequest = try BreezSDKMapper.asRefundRequest(data: req) + var res = try getBreezServices().refund(req: refundRequest) + resolve(BreezSDKMapper.dictionaryOf(refundResponse: res)) } catch let err { rejectErr(err: err, reject: reject) } @@ -450,11 +451,12 @@ class RNBreezSDK: RCTEventEmitter { } } - @objc(sendOnchain:onchainRecipientAddress:pairHash:satPerVbyte:resolve:reject:) - func sendOnchain(_ amountSat: UInt64, onchainRecipientAddress: String, pairHash: String, satPerVbyte: UInt64, resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { + @objc(sendOnchain:resolve:reject:) + func sendOnchain(_ req: [String: Any], resolve: @escaping RCTPromiseResolveBlock, reject: @escaping RCTPromiseRejectBlock) { do { - var res = try getBreezServices().sendOnchain(amountSat: amountSat, onchainRecipientAddress: onchainRecipientAddress, pairHash: pairHash, satPerVbyte: satPerVbyte) - resolve(BreezSDKMapper.dictionaryOf(reverseSwapInfo: res)) + let sendOnchainRequest = try BreezSDKMapper.asSendOnchainRequest(data: req) + var res = try getBreezServices().sendOnchain(req: sendOnchainRequest) + resolve(BreezSDKMapper.dictionaryOf(sendOnchainResponse: res)) } catch let err { rejectErr(err: err, reject: reject) } diff --git a/libs/sdk-react-native/src/index.ts b/libs/sdk-react-native/src/index.ts index 91ef7ea58..0fb01a5fe 100644 --- a/libs/sdk-react-native/src/index.ts +++ b/libs/sdk-react-native/src/index.ts @@ -157,6 +157,12 @@ export type LnUrlErrorData = { reason: string } +export type LnUrlPayRequest = { + reqData: LnUrlPayRequestData + amountMsat: number + comment?: string +} + export type LnUrlPayRequestData = { callback: string minSendable: number @@ -307,6 +313,16 @@ export type RecommendedFees = { minimumFee: number } +export type RefundRequest = { + swapAddress: string + toAddress: string + satPerVbyte: number +} + +export type RefundResponse = { + refundTxId: string +} + export type ReverseSwapFeesRequest = { sendAmountSat?: number } @@ -344,6 +360,26 @@ export type RouteHintHop = { htlcMaximumMsat?: number } +export type SendOnchainRequest = { + amountSat: number + onchainRecipientAddress: string + pairHash: string + satPerVbyte: number +} + +export type SendOnchainResponse = { + reverseSwapInfo: ReverseSwapInfo +} + +export type SendPaymentResponse = { + payment: Payment +} + +export type SendSpontaneousPaymentRequest = { + nodeId: string + amountMsat: number +} + export type SignMessageRequest = { message: string } @@ -660,8 +696,8 @@ export const defaultConfig = async (envType: EnvironmentType, apiKey: string, no return response } -export const staticBackup = async (request: StaticBackupRequest): Promise => { - const response = await BreezSDK.staticBackup(request) +export const staticBackup = async (req: StaticBackupRequest): Promise => { + const response = await BreezSDK.staticBackup(req) return response } @@ -675,18 +711,18 @@ export const sendPayment = async (bolt11: string, amountMsat: number = 0): Promi return response } -export const sendSpontaneousPayment = async (nodeId: string, amountSats: number): Promise => { - const response = await BreezSDK.sendSpontaneousPayment(nodeId, amountSats) +export const sendSpontaneousPayment = async (req: SendSpontaneousPaymentRequest): Promise => { + const response = await BreezSDK.sendSpontaneousPayment(req) return response } -export const receivePayment = async (reqData: ReceivePaymentRequest): Promise => { - const response = await BreezSDK.receivePayment(reqData) +export const receivePayment = async (req: ReceivePaymentRequest): Promise => { + const response = await BreezSDK.receivePayment(req) return response } -export const payLnurl = async (reqData: LnUrlPayRequestData, amountSats: number, comment: string = ""): Promise => { - const response = await BreezSDK.payLnurl(reqData, amountSats, comment) +export const payLnurl = async (req: LnUrlPayRequest): Promise => { + const response = await BreezSDK.payLnurl(req) return response } @@ -705,13 +741,13 @@ export const nodeInfo = async (): Promise => { return response } -export const signMessage = async (request: SignMessageRequest): Promise => { - const response = await BreezSDK.signMessage(request) +export const signMessage = async (req: SignMessageRequest): Promise => { + const response = await BreezSDK.signMessage(req) return response } -export const checkMessage = async (request: CheckMessageRequest): Promise => { - const response = await BreezSDK.checkMessage(request) +export const checkMessage = async (req: CheckMessageRequest): Promise => { + const response = await BreezSDK.checkMessage(req) return response } @@ -729,13 +765,13 @@ export const paymentByHash = async (hash: string): Promise => { return response } -export const listPayments = async (request: ListPaymentsRequest): Promise => { - const response = await BreezSDK.listPayments(request) +export const listPayments = async (req: ListPaymentsRequest): Promise => { + const response = await BreezSDK.listPayments(req) return response } -export const sweep = async (request: SweepRequest): Promise => { - const response = await BreezSDK.sweep(request) +export const sweep = async (req: SweepRequest): Promise => { + const response = await BreezSDK.sweep(req) return response } @@ -797,8 +833,8 @@ export const listRefundables = async (): Promise => { return response } -export const refund = async (swapAddress: string, toAddress: string, satPerVbyte: number): Promise => { - const response = await BreezSDK.refund(swapAddress, toAddress, satPerVbyte) +export const refund = async (req: RefundRequest): Promise => { + const response = await BreezSDK.refund(req) return response } @@ -812,8 +848,8 @@ export const inProgressReverseSwaps = async (): Promise => { return response } -export const sendOnchain = async (amountSat: number, onchainRecipientAddress: string, pairHash: string, satPerVbyte: number): Promise => { - const response = await BreezSDK.sendOnchain(amountSat, onchainRecipientAddress, pairHash, satPerVbyte) +export const sendOnchain = async (req: SendOnchainRequest): Promise => { + const response = await BreezSDK.sendOnchain(req) return response } diff --git a/tools/sdk-cli/src/command_handlers.rs b/tools/sdk-cli/src/command_handlers.rs index 7e31b7b23..7065aab52 100644 --- a/tools/sdk-cli/src/command_handlers.rs +++ b/tools/sdk-cli/src/command_handlers.rs @@ -7,7 +7,7 @@ use breez_sdk_core::{ parse, BreezEvent, BreezServices, BuyBitcoinRequest, CheckMessageRequest, EventListener, GreenlightCredentials, ListPaymentsRequest, PaymentTypeFilter, ReceiveOnchainRequest, ReceivePaymentRequest, RefundRequest, ReverseSwapFeesRequest, SendOnchainRequest, - SignMessageRequest, StaticBackupRequest, SweepRequest, + SendSpontaneousPaymentRequest, SignMessageRequest, StaticBackupRequest, SweepRequest, }; use breez_sdk_core::{Config, GreenlightNodeConfig, NodeConfig}; use once_cell::sync::OnceCell; @@ -189,9 +189,17 @@ pub(crate) async fn handle_command( let payment = sdk()?.send_payment(bolt11, amount_msat).await?; serde_json::to_string_pretty(&payment).map_err(|e| e.into()) } - Commands::SendSpontaneousPayment { node_id, amount } => { - let payment = sdk()?.send_spontaneous_payment(node_id, amount).await?; - serde_json::to_string_pretty(&payment).map_err(|e| e.into()) + Commands::SendSpontaneousPayment { + node_id, + amount_msat, + } => { + let response = sdk()? + .send_spontaneous_payment(SendSpontaneousPaymentRequest { + node_id, + amount_msat, + }) + .await?; + serde_json::to_string_pretty(&response.payment).map_err(|e| e.into()) } Commands::ListPayments { from_timestamp, @@ -318,14 +326,17 @@ pub(crate) async fn handle_command( Commands::LnurlPay { lnurl } => match parse(&lnurl).await? { LnUrlPay { data: pd } => { let prompt = format!( - "Amount to pay in sats (min {} sat, max {} sat: ", - pd.min_sendable / 1000, - pd.max_sendable / 1000 + "Amount to pay in millisatoshi (min {} msat, max {} msat: ", + pd.min_sendable, pd.max_sendable ); - let amount_sat = rl.readline(&prompt)?; + let amount_msat = rl.readline(&prompt)?; let pay_res = sdk()? - .lnurl_pay(pd, amount_sat.parse::()?, None) + .lnurl_pay(breez_sdk_core::LnUrlPayRequest { + req_data: pd, + amount_msat: amount_msat.parse::()?, + comment: None, + }) .await?; //show_results(pay_res); serde_json::to_string_pretty(&pay_res).map_err(|e| e.into()) diff --git a/tools/sdk-cli/src/commands.rs b/tools/sdk-cli/src/commands.rs index 8053a82a8..d22e5f892 100644 --- a/tools/sdk-cli/src/commands.rs +++ b/tools/sdk-cli/src/commands.rs @@ -98,7 +98,7 @@ pub(crate) enum Commands { }, /// Send a spontaneous (keysend) payment - SendSpontaneousPayment { node_id: String, amount: u64 }, + SendSpontaneousPayment { node_id: String, amount_msat: u64 }, /// Sign a message with the node's private key SignMessage { message: String },