@@ -15,9 +15,7 @@ pub use crate::config::{
15
15
EsploraSyncConfig , MaxDustHTLCExposure ,
16
16
} ;
17
17
pub use crate :: graph:: { ChannelInfo , ChannelUpdateInfo , NodeAnnouncementInfo , NodeInfo } ;
18
- pub use crate :: liquidity:: {
19
- LSPS1OnchainPaymentInfo , LSPS1OrderStatus , LSPS1PaymentInfo , LSPS2ServiceConfig ,
20
- } ;
18
+ pub use crate :: liquidity:: { LSPS1OrderStatus , LSPS2ServiceConfig } ;
21
19
pub use crate :: logger:: { LogLevel , LogRecord , LogWriter } ;
22
20
pub use crate :: payment:: store:: {
23
21
ConfirmationStatus , LSPFeeLimits , PaymentDirection , PaymentKind , PaymentStatus ,
@@ -1068,6 +1066,64 @@ impl std::fmt::Display for Bolt11Invoice {
1068
1066
}
1069
1067
}
1070
1068
1069
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
1070
+ pub struct LSPS1PaymentInfo {
1071
+ /// A Lightning payment using BOLT 11.
1072
+ pub bolt11 : Option < crate :: ffi:: LSPS1Bolt11PaymentInfo > ,
1073
+ /// An onchain payment.
1074
+ pub onchain : Option < LSPS1OnchainPaymentInfo > ,
1075
+ }
1076
+
1077
+ #[ cfg( feature = "uniffi" ) ]
1078
+ impl From < lightning_liquidity:: lsps1:: msgs:: LSPS1PaymentInfo > for LSPS1PaymentInfo {
1079
+ fn from ( value : lightning_liquidity:: lsps1:: msgs:: LSPS1PaymentInfo ) -> Self {
1080
+ LSPS1PaymentInfo {
1081
+ bolt11 : value. bolt11 . map ( |b| b. into ( ) ) ,
1082
+ onchain : value. onchain . map ( |o| o. into ( ) ) ,
1083
+ }
1084
+ }
1085
+ }
1086
+
1087
+ /// An onchain payment.
1088
+ #[ cfg( feature = "uniffi" ) ]
1089
+ #[ derive( Clone , Debug , PartialEq , Eq ) ]
1090
+ pub struct LSPS1OnchainPaymentInfo {
1091
+ /// Indicates the current state of the payment.
1092
+ pub state : lightning_liquidity:: lsps1:: msgs:: LSPS1PaymentState ,
1093
+ /// The datetime when the payment option expires.
1094
+ pub expires_at : LSPSDateTime ,
1095
+ /// The total fee the LSP will charge to open this channel in satoshi.
1096
+ pub fee_total_sat : u64 ,
1097
+ /// The amount the client needs to pay to have the requested channel openend.
1098
+ pub order_total_sat : u64 ,
1099
+ /// An on-chain address the client can send [`Self::order_total_sat`] to to have the channel
1100
+ /// opened.
1101
+ pub address : bitcoin:: Address ,
1102
+ /// The minimum number of block confirmations that are required for the on-chain payment to be
1103
+ /// considered confirmed.
1104
+ pub min_onchain_payment_confirmations : Option < u16 > ,
1105
+ /// The minimum fee rate for the on-chain payment in case the client wants the payment to be
1106
+ /// confirmed without a confirmation.
1107
+ pub min_fee_for_0conf : Arc < bitcoin:: FeeRate > ,
1108
+ /// The address where the LSP will send the funds if the order fails.
1109
+ pub refund_onchain_address : Option < bitcoin:: Address > ,
1110
+ }
1111
+
1112
+ #[ cfg( feature = "uniffi" ) ]
1113
+ impl From < lightning_liquidity:: lsps1:: msgs:: LSPS1OnchainPaymentInfo > for LSPS1OnchainPaymentInfo {
1114
+ fn from ( value : lightning_liquidity:: lsps1:: msgs:: LSPS1OnchainPaymentInfo ) -> Self {
1115
+ Self {
1116
+ state : value. state ,
1117
+ expires_at : value. expires_at ,
1118
+ fee_total_sat : value. fee_total_sat ,
1119
+ order_total_sat : value. order_total_sat ,
1120
+ address : value. address ,
1121
+ min_onchain_payment_confirmations : value. min_onchain_payment_confirmations ,
1122
+ min_fee_for_0conf : Arc :: new ( value. min_fee_for_0conf ) ,
1123
+ refund_onchain_address : value. refund_onchain_address ,
1124
+ }
1125
+ }
1126
+ }
1071
1127
/// A Lightning payment using BOLT 11.
1072
1128
#[ derive( Clone , Debug , PartialEq , Eq ) ]
1073
1129
pub struct LSPS1Bolt11PaymentInfo {
0 commit comments