pub struct LSPS2ClientHandler<ES: Deref, K: Deref + Clone>{ /* private fields */ }Expand description
The main object allowing to send and receive bLIP-52 / LSPS2 messages.
Note that currently only the ‘client-trusts-LSP’ trust model is supported, i.e., we don’t
provide any additional API guidance to allow withholding the preimage until the channel is
opened. Please refer to the bLIP-52 / LSPS2 specification for more information.
Implementations§
Source§impl<ES: Deref, K: Deref + Clone> LSPS2ClientHandler<ES, K>
impl<ES: Deref, K: Deref + Clone> LSPS2ClientHandler<ES, K>
Sourcepub fn config(&self) -> &LSPS2ClientConfig
pub fn config(&self) -> &LSPS2ClientConfig
Returns a reference to the used config.
Sourcepub fn request_opening_params(
&self,
counterparty_node_id: PublicKey,
token: Option<String>,
) -> LSPSRequestId
pub fn request_opening_params( &self, counterparty_node_id: PublicKey, token: Option<String>, ) -> LSPSRequestId
Request the channel opening parameters from the LSP.
This initiates the JIT-channel flow that, at the end of it, will have the LSP open a channel with sufficient inbound liquidity to be able to receive the payment.
The user will receive the LSP’s response via an OpeningParametersReady event.
counterparty_node_id is the node_id of the LSP you would like to use.
token is an optional String that will be provided to the LSP.
It can be used by the LSP as an API key, coupon code, or some other way to identify a user.
Returns the used LSPSRequestId, which will be returned via OpeningParametersReady.
Sourcepub fn select_opening_params(
&self,
counterparty_node_id: PublicKey,
payment_size_msat: Option<u64>,
opening_fee_params: LSPS2OpeningFeeParams,
) -> Result<LSPSRequestId, APIError>
pub fn select_opening_params( &self, counterparty_node_id: PublicKey, payment_size_msat: Option<u64>, opening_fee_params: LSPS2OpeningFeeParams, ) -> Result<LSPSRequestId, APIError>
Confirms a set of chosen channel opening parameters to use for the JIT channel and requests the necessary invoice generation parameters from the LSP.
Should be called in response to receiving a OpeningParametersReady event.
The user will receive the LSP’s response via an InvoiceParametersReady event.
If payment_size_msat is Option::Some then the invoice will be for a fixed amount
and MPP can be used to pay it.
If payment_size_msat is Option::None then the invoice can be for an arbitrary amount
but MPP can no longer be used to pay it.
The client agrees to paying an opening fee equal to
max(min_fee_msat, proportional * (payment_size_msat / 1_000_000)).
Returns the used LSPSRequestId that was used for the buy request.