@@ -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
@@ -885,6 +883,67 @@ pub struct LSPS1OrderStatus {
885883 pub channel_state : Option < ChannelInfo > ,
886884}
887885
886+ #[ cfg( not( feature = "uniffi" ) ) ]
887+ type PaymentInfo = lightning_liquidity:: lsps1:: msgs:: PaymentInfo ;
888+
889+ /// Details regarding how to pay for an order.
890+ #[ cfg( feature = "uniffi" ) ]
891+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
892+ pub struct PaymentInfo {
893+ /// A Lightning payment using BOLT 11.
894+ pub bolt11 : Option < lightning_liquidity:: lsps1:: msgs:: Bolt11PaymentInfo > ,
895+ /// An onchain payment.
896+ pub onchain : Option < OnchainPaymentInfo > ,
897+ }
898+
899+ #[ cfg( feature = "uniffi" ) ]
900+ impl From < lightning_liquidity:: lsps1:: msgs:: PaymentInfo > for PaymentInfo {
901+ fn from ( value : lightning_liquidity:: lsps1:: msgs:: PaymentInfo ) -> Self {
902+ PaymentInfo { bolt11 : value. bolt11 , onchain : value. onchain . map ( |o| o. into ( ) ) }
903+ }
904+ }
905+
906+ /// An onchain payment.
907+ #[ cfg( feature = "uniffi" ) ]
908+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
909+ pub struct OnchainPaymentInfo {
910+ /// Indicates the current state of the payment.
911+ pub state : lightning_liquidity:: lsps1:: msgs:: PaymentState ,
912+ /// The datetime when the payment option expires.
913+ pub expires_at : chrono:: DateTime < chrono:: Utc > ,
914+ /// The total fee the LSP will charge to open this channel in satoshi.
915+ pub fee_total_sat : u64 ,
916+ /// The amount the client needs to pay to have the requested channel openend.
917+ pub order_total_sat : u64 ,
918+ /// An on-chain address the client can send [`Self::order_total_sat`] to to have the channel
919+ /// opened.
920+ pub address : bitcoin:: Address ,
921+ /// The minimum number of block confirmations that are required for the on-chain payment to be
922+ /// considered confirmed.
923+ pub min_onchain_payment_confirmations : Option < u16 > ,
924+ /// The minimum fee rate for the on-chain payment in case the client wants the payment to be
925+ /// confirmed without a confirmation.
926+ pub min_fee_for_0conf : Arc < bitcoin:: FeeRate > ,
927+ /// The address where the LSP will send the funds if the order fails.
928+ pub refund_onchain_address : Option < bitcoin:: Address > ,
929+ }
930+
931+ #[ cfg( feature = "uniffi" ) ]
932+ impl From < lightning_liquidity:: lsps1:: msgs:: OnchainPaymentInfo > for OnchainPaymentInfo {
933+ fn from ( value : lightning_liquidity:: lsps1:: msgs:: OnchainPaymentInfo ) -> Self {
934+ Self {
935+ state : value. state ,
936+ expires_at : value. expires_at ,
937+ fee_total_sat : value. fee_total_sat ,
938+ order_total_sat : value. order_total_sat ,
939+ address : value. address ,
940+ min_onchain_payment_confirmations : value. min_onchain_payment_confirmations ,
941+ min_fee_for_0conf : Arc :: new ( value. min_fee_for_0conf ) ,
942+ refund_onchain_address : value. refund_onchain_address ,
943+ }
944+ }
945+ }
946+
888947#[ derive( Debug , Clone ) ]
889948pub ( crate ) struct LSPS2FeeResponse {
890949 opening_fee_params_menu : Vec < OpeningFeeParams > ,
0 commit comments