@@ -21,9 +21,7 @@ use lightning_liquidity::events::Event;
2121use lightning_liquidity:: lsps0:: ser:: RequestId ;
2222use lightning_liquidity:: lsps1:: client:: LSPS1ClientConfig ;
2323use lightning_liquidity:: lsps1:: event:: LSPS1ClientEvent ;
24- use lightning_liquidity:: lsps1:: msgs:: {
25- ChannelInfo , LSPS1Options , OrderId , OrderParameters , PaymentInfo ,
26- } ;
24+ use lightning_liquidity:: lsps1:: msgs:: { ChannelInfo , LSPS1Options , OrderId , OrderParameters } ;
2725use lightning_liquidity:: lsps2:: client:: LSPS2ClientConfig ;
2826use lightning_liquidity:: lsps2:: event:: LSPS2ClientEvent ;
2927use lightning_liquidity:: lsps2:: msgs:: OpeningFeeParams ;
@@ -280,7 +278,7 @@ where
280278 let response = LSPS1OrderStatus {
281279 order_id,
282280 order_params : order,
283- payment_options : payment,
281+ payment_options : payment. into ( ) ,
284282 channel_state : channel,
285283 } ;
286284
@@ -338,7 +336,7 @@ where
338336 let response = LSPS1OrderStatus {
339337 order_id,
340338 order_params : order,
341- payment_options : payment,
339+ payment_options : payment. into ( ) ,
342340 channel_state : channel,
343341 } ;
344342
@@ -889,6 +887,67 @@ pub struct LSPS1OrderStatus {
889887 pub channel_state : Option < ChannelInfo > ,
890888}
891889
890+ #[ cfg( not( feature = "uniffi" ) ) ]
891+ type PaymentInfo = lightning_liquidity:: lsps1:: msgs:: PaymentInfo ;
892+
893+ /// Details regarding how to pay for an order.
894+ #[ cfg( feature = "uniffi" ) ]
895+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
896+ pub struct PaymentInfo {
897+ /// A Lightning payment using BOLT 11.
898+ pub bolt11 : Option < lightning_liquidity:: lsps1:: msgs:: Bolt11PaymentInfo > ,
899+ /// An onchain payment.
900+ pub onchain : Option < OnchainPaymentInfo > ,
901+ }
902+
903+ #[ cfg( feature = "uniffi" ) ]
904+ impl From < lightning_liquidity:: lsps1:: msgs:: PaymentInfo > for PaymentInfo {
905+ fn from ( value : lightning_liquidity:: lsps1:: msgs:: PaymentInfo ) -> Self {
906+ PaymentInfo { bolt11 : value. bolt11 , onchain : value. onchain . map ( |o| o. into ( ) ) }
907+ }
908+ }
909+
910+ /// An onchain payment.
911+ #[ cfg( feature = "uniffi" ) ]
912+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
913+ pub struct OnchainPaymentInfo {
914+ /// Indicates the current state of the payment.
915+ pub state : lightning_liquidity:: lsps1:: msgs:: PaymentState ,
916+ /// The datetime when the payment option expires.
917+ pub expires_at : chrono:: DateTime < chrono:: Utc > ,
918+ /// The total fee the LSP will charge to open this channel in satoshi.
919+ pub fee_total_sat : u64 ,
920+ /// The amount the client needs to pay to have the requested channel openend.
921+ pub order_total_sat : u64 ,
922+ /// An on-chain address the client can send [`Self::order_total_sat`] to to have the channel
923+ /// opened.
924+ pub address : bitcoin:: Address ,
925+ /// The minimum number of block confirmations that are required for the on-chain payment to be
926+ /// considered confirmed.
927+ pub min_onchain_payment_confirmations : Option < u16 > ,
928+ /// The minimum fee rate for the on-chain payment in case the client wants the payment to be
929+ /// confirmed without a confirmation.
930+ pub min_fee_for_0conf : Arc < bitcoin:: FeeRate > ,
931+ /// The address where the LSP will send the funds if the order fails.
932+ pub refund_onchain_address : Option < bitcoin:: Address > ,
933+ }
934+
935+ #[ cfg( feature = "uniffi" ) ]
936+ impl From < lightning_liquidity:: lsps1:: msgs:: OnchainPaymentInfo > for OnchainPaymentInfo {
937+ fn from ( value : lightning_liquidity:: lsps1:: msgs:: OnchainPaymentInfo ) -> Self {
938+ Self {
939+ state : value. state ,
940+ expires_at : value. expires_at ,
941+ fee_total_sat : value. fee_total_sat ,
942+ order_total_sat : value. order_total_sat ,
943+ address : value. address ,
944+ min_onchain_payment_confirmations : value. min_onchain_payment_confirmations ,
945+ min_fee_for_0conf : Arc :: new ( value. min_fee_for_0conf ) ,
946+ refund_onchain_address : value. refund_onchain_address ,
947+ }
948+ }
949+ }
950+
892951#[ derive( Debug , Clone ) ]
893952pub ( crate ) struct LSPS2FeeResponse {
894953 opening_fee_params_menu : Vec < OpeningFeeParams > ,
0 commit comments