@@ -221,6 +221,7 @@ where
221
221
C :: Target : Filter ,
222
222
ES :: Target : EntropySource ,
223
223
{
224
+ /// Constructs an `LSPS1ClientHandler`.
224
225
pub ( crate ) fn new (
225
226
entropy_source : ES , pending_messages : Arc < MessageQueue > , pending_events : Arc < EventQueue > ,
226
227
channel_manager : CM , chain_source : Option < C > , config : LSPS1ClientConfig ,
@@ -236,7 +237,14 @@ where
236
237
}
237
238
}
238
239
239
- fn request_for_info ( & self , counterparty_node_id : PublicKey , channel_id : u128 ) {
240
+ /// Initiate the creation of an invoice that when paid will open a channel
241
+ /// with enough inbound liquidity to be able to receive the payment.
242
+ ///
243
+ /// `counterparty_node_id` is the node_id of the LSP you would like to use.
244
+ ///
245
+ /// `token` is an optional String that will be provided to the LSP.
246
+ /// It can be used by the LSP as an API key, coupon code, or some other way to identify a user.
247
+ pub fn request_for_info ( & self , counterparty_node_id : PublicKey , channel_id : u128 ) {
240
248
let channel = InboundCRChannel :: new ( channel_id) ;
241
249
242
250
let mut outer_state_lock = self . per_peer_state . write ( ) . unwrap ( ) ;
@@ -313,7 +321,14 @@ where
313
321
Ok ( ( ) )
314
322
}
315
323
316
- fn place_order (
324
+ /// Used by client to place an order to LSP with the provided parameters.
325
+ /// The client agrees to paying an channel fees as per requested by
326
+ /// the LSP.
327
+ ///
328
+ /// Should be called in response to receiving a [`LSPS1ClientEvent::GetInfoResponse`] event.
329
+ ///
330
+ /// [`LSPS1ClientEvent::GetInfoResponse`]: crate::lsps1::event::LSPS1ClientEvent::GetInfoResponse
331
+ pub fn place_order (
317
332
& self , channel_id : u128 , counterparty_node_id : & PublicKey , order : OrderParams ,
318
333
) -> Result < ( ) , APIError > {
319
334
let outer_state_lock = self . per_peer_state . write ( ) . unwrap ( ) ;
@@ -466,6 +481,11 @@ where
466
481
}
467
482
}
468
483
484
+ /// Used by client to check whether payment is received by LSP and status of order.
485
+ ///
486
+ /// Should be called in response to receiving a [`LSPS1ClientEvent::DisplayOrder`] event.
487
+ ///
488
+ /// [`LSPS1ClientEvent::DisplayOrder`]: crate::lsps1::event::LSPS1ClientEvent::DisplayOrder
469
489
fn check_order_status (
470
490
& self , counterparty_node_id : & PublicKey , order_id : OrderId , channel_id : u128 ,
471
491
) -> Result < ( ) , APIError > {
0 commit comments