Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 08ffddc

Browse files
committed
LSPS1 doc fixes
1 parent aac3418 commit 08ffddc

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

src/lsps1/client.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,13 +237,11 @@ where
237237
}
238238
}
239239

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.
240+
/// Retrieve information from the LSP regarding the options supported.
242241
///
243242
/// `counterparty_node_id` is the node_id of the LSP you would like to use.
244243
///
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.
244+
/// 'channel_id' is the id used to uniquely identify the channel with counterparty node.
247245
pub fn request_for_info(&self, counterparty_node_id: PublicKey, channel_id: u128) {
248246
let channel = InboundCRChannel::new(channel_id);
249247

@@ -321,9 +319,8 @@ where
321319
Ok(())
322320
}
323321

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.
322+
/// Places an order with the connected LSP given its `counterparty_node_id`.
323+
/// The client agrees to paying channel fees according to the provided parameters.
327324
///
328325
/// Should be called in response to receiving a [`LSPS1ClientEvent::GetInfoResponse`] event.
329326
///
@@ -481,12 +478,12 @@ where
481478
}
482479
}
483480

484-
/// Used by client to check whether payment is received by LSP and status of order.
481+
/// Queries the status of a pending payment, i.e., whether a payment has been received by the LSP.
485482
///
486483
/// Should be called in response to receiving a [`LSPS1ClientEvent::DisplayOrder`] event.
487484
///
488485
/// [`LSPS1ClientEvent::DisplayOrder`]: crate::lsps1::event::LSPS1ClientEvent::DisplayOrder
489-
fn check_order_status(
486+
pub fn check_order_status(
490487
&self, counterparty_node_id: &PublicKey, order_id: OrderId, channel_id: u128,
491488
) -> Result<(), APIError> {
492489
let outer_state_lock = self.per_peer_state.write().unwrap();

src/lsps1/event.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ use bitcoin::secp256k1::PublicKey;
2121
pub enum LSPS1ClientEvent {
2222
/// Information from the LSP about their supported protocol options.
2323
///
24-
/// You must check whether LSP supports the params the client wants and then call
24+
/// You must check whether LSP supports the parameters the client wants and then call
2525
/// [`LSPS1ClientHandler::place_order`] to place an order.
2626
///
27-
/// [`LSPS1ClientHandler::place_order`] : crate::lsps1::client::LSPS1ClientHandler::place_order
27+
/// [`LSPS1ClientHandler::place_order`]: crate::lsps1::client::LSPS1ClientHandler::place_order
2828
GetInfoResponse {
2929
/// This is a randomly generated identifier used to track the channel state.
30+
///
3031
/// It is not related in anyway to the eventual lightning channel id.
3132
/// It needs to be passed to [`LSPS1ClientHandler::place_order`].
3233
///
@@ -43,7 +44,7 @@ pub enum LSPS1ClientEvent {
4344
},
4445
/// Confirmation from the LSP about the order created by the client.
4546
///
46-
/// When the invoice is paid, the LSP will open a channel to you
47+
/// When the payment is confirmed, the LSP will open a channel to you
4748
/// with the below agreed upon parameters.
4849
///
4950
/// You must pay the invoice if you want to continue and then
@@ -72,8 +73,8 @@ pub enum LSPS1ClientEvent {
7273
/// An event which an LSPS1 server should take some action in response to.
7374
#[derive(Clone, Debug, PartialEq, Eq)]
7475
pub enum LSPS1ServiceEvent {
75-
/// A client has selected the parameters to use from the supported options of LSP
76-
/// and would like to open a channel with the given invoice.
76+
/// A client has selected the parameters to use from the supported options of the LSP
77+
/// and would like to open a channel with the given payment parameters.
7778
///
7879
/// You must call [`LSPS1ServiceHandler::send_invoice_for_order`] to
7980
/// generate a complete invoice including the details regarding the
@@ -97,7 +98,7 @@ pub enum LSPS1ServiceEvent {
9798
/// You must call [`LSPS1ServiceHandler::update_order_status`] to update the client
9899
/// regarding the status of the payment and order.
99100
///
100-
/// [`LSPS1ServiceHandler::send_invoice_for_order`]: crate::lsps1::service::LSPS1ServiceHandler::send_invoice_for_order
101+
/// [`LSPS1ServiceHandler::update_order_status`]: crate::lsps1::service::LSPS1ServiceHandler::update_order_status
101102
CheckPaymentConfirmation {
102103
/// An identifier that must be passed to [`LSPS1ServiceHandler::update_order_status`].
103104
///

0 commit comments

Comments
 (0)