@@ -203,20 +203,26 @@ where
203203 }
204204 }
205205
206- /// Initiate the creation of an invoice that when paid will open a channel
207- /// with enough inbound liquidity to be able to receive the payment.
206+ /// Request the channel opening parameters from the LSP.
208207 ///
209- /// `counterparty_node_id` is the node_id of the LSP you would like to use.
208+ /// This initiates the JIT-channel flow that, at the end of it, will have the LSP
209+ /// open a channel with sufficient inbound liquidity to be able to receive the payment.
210+ ///
211+ /// The user will receive the LSP's response via an [`OpeningParametersReady`] event.
212+ ///
213+ /// `counterparty_node_id` is the `node_id` of the LSP you would like to use.
210214 ///
211215 /// If `payment_size_msat` is [`Option::Some`] then the invoice will be for a fixed amount
212216 /// and MPP can be used to pay it.
213217 ///
214218 /// If `payment_size_msat` is [`Option::None`] then the invoice can be for an arbitrary amount
215219 /// but MPP can no longer be used to pay it.
216220 ///
217- /// `token` is an optional String that will be provided to the LSP.
221+ /// `token` is an optional ` String` that will be provided to the LSP.
218222 /// It can be used by the LSP as an API key, coupon code, or some other way to identify a user.
219- pub fn create_invoice (
223+ ///
224+ /// [`OpeningParametersReady`]: crate::lsps2::event::LSPS2ClientEvent::OpeningParametersReady
225+ pub fn request_opening_params (
220226 & self , counterparty_node_id : PublicKey , payment_size_msat : Option < u64 > ,
221227 token : Option < String > , user_channel_id : u128 ,
222228 ) {
@@ -239,14 +245,19 @@ where
239245 ) ;
240246 }
241247
242- /// Used by client to confirm which channel parameters to use for the JIT Channel buy request.
248+ /// Confirms a set of chosen channel opening parameters to use for the JIT channel and
249+ /// requests the necessary invoice generation parameters from the LSP.
250+ ///
251+ /// Should be called in response to receiving a [`OpeningParametersReady`] event.
252+ ///
253+ /// The user will receive the LSP's response via an [`InvoiceParametersReady`] event.
254+ ///
243255 /// The client agrees to paying an opening fee equal to
244256 /// `max(min_fee_msat, proportional*(payment_size_msat/1_000_000))`.
245257 ///
246- /// Should be called in response to receiving a [`LSPS2ClientEvent::GetInfoResponse`] event.
247- ///
248- /// [`LSPS2ClientEvent::GetInfoResponse`]: crate::lsps2::event::LSPS2ClientEvent::GetInfoResponse
249- pub fn opening_fee_params_selected (
258+ /// [`OpeningParametersReady`]: crate::lsps2::event::LSPS2ClientEvent::OpeningParametersReady
259+ /// [`InvoiceParametersReady`]: crate::lsps2::event::LSPS2ClientEvent::InvoiceParametersReady
260+ pub fn select_opening_params (
250261 & self , counterparty_node_id : PublicKey , jit_channel_id : u128 ,
251262 opening_fee_params : OpeningFeeParams ,
252263 ) -> Result < ( ) , APIError > {
@@ -334,7 +345,7 @@ where
334345 }
335346
336347 self . pending_events . enqueue ( Event :: LSPS2Client (
337- LSPS2ClientEvent :: GetInfoResponse {
348+ LSPS2ClientEvent :: OpeningParametersReady {
338349 counterparty_node_id : * counterparty_node_id,
339350 opening_fee_params_menu : result. opening_fee_params_menu ,
340351 min_payment_size_msat : result. min_payment_size_msat ,
@@ -442,7 +453,7 @@ where
442453
443454 if let Ok ( intercept_scid) = result. intercept_scid . to_scid ( ) {
444455 self . pending_events . enqueue ( Event :: LSPS2Client (
445- LSPS2ClientEvent :: InvoiceGenerationReady {
456+ LSPS2ClientEvent :: InvoiceParametersReady {
446457 counterparty_node_id : * counterparty_node_id,
447458 intercept_scid,
448459 cltv_expiry_delta : result. lsp_cltv_expiry_delta ,
0 commit comments