pub enum LSPS1ClientEvent {
SupportedOptionsReady {
request_id: RequestId,
counterparty_node_id: PublicKey,
supported_options: LSPS1Options,
},
SupportedOptionsRequestFailed {
request_id: RequestId,
counterparty_node_id: PublicKey,
error: ResponseError,
},
OrderCreated {
request_id: RequestId,
counterparty_node_id: PublicKey,
order_id: OrderId,
order: OrderParameters,
payment: PaymentInfo,
channel: Option<ChannelInfo>,
},
OrderStatus {
request_id: RequestId,
counterparty_node_id: PublicKey,
order_id: OrderId,
order: OrderParameters,
payment: PaymentInfo,
channel: Option<ChannelInfo>,
},
OrderRequestFailed {
request_id: RequestId,
counterparty_node_id: PublicKey,
error: ResponseError,
},
}
Expand description
An event which an LSPS1 client should take some action in response to.
Variants§
SupportedOptionsReady
A request previously issued via LSPS1ClientHandler::request_supported_options
succeeded as the LSP returned the options it supports.
You must check whether LSP supports the parameters the client wants and then call
LSPS1ClientHandler::create_order
to place an order.
Fields
request_id: RequestId
The identifier of the issued LSPS1 get_info
request, as returned by
LSPS1ClientHandler::request_supported_options
This can be used to track which request this event corresponds to.
supported_options: LSPS1Options
All options supported by the LSP.
SupportedOptionsRequestFailed
A request previously issued via LSPS1ClientHandler::request_supported_options
failed as the LSP returned an error response.
Fields
request_id: RequestId
The identifier of the issued LSPS1 get_info
request, as returned by
LSPS1ClientHandler::request_supported_options
This can be used to track which request this event corresponds to.
error: ResponseError
The error that was returned.
OrderCreated
Confirmation from the LSP about the order created by the client.
When the payment is confirmed, the LSP will open a channel to you with the below agreed upon parameters.
You must pay the invoice or onchain address if you want to continue and then
call LSPS1ClientHandler::check_order_status
with the order id
to get information from LSP about progress of the order.
Fields
request_id: RequestId
The identifier of the issued LSPS1 create_order
request, as returned by
LSPS1ClientHandler::create_order
This can be used to track which request this event corresponds to.
order: OrderParameters
The order created by client and approved by LSP.
payment: PaymentInfo
The details regarding payment of the order
channel: Option<ChannelInfo>
The details regarding state of the channel ordered.
OrderStatus
Information from the LSP about the status of a previously created order.
Will be emitted in response to calling LSPS1ClientHandler::check_order_status
.
Fields
request_id: RequestId
The identifier of the issued LSPS1 get_order
request, as returned by
LSPS1ClientHandler::check_order_status
This can be used to track which request this event corresponds to.
order: OrderParameters
The order created by client and approved by LSP.
payment: PaymentInfo
The details regarding payment of the order
channel: Option<ChannelInfo>
The details regarding state of the channel ordered.
OrderRequestFailed
A request previously issued via LSPS1ClientHandler::create_order
or LSPS1ClientHandler::check_order_status
.
failed as the LSP returned an error response.
Fields
request_id: RequestId
The identifier of the issued LSPS1 create_order
or get_order
request, as returned by
LSPS1ClientHandler::create_order
or LSPS1ClientHandler::check_order_status
.
This can be used to track which request this event corresponds to.
error: ResponseError
The error that was returned.
Trait Implementations§
Source§impl Clone for LSPS1ClientEvent
impl Clone for LSPS1ClientEvent
Source§fn clone(&self) -> LSPS1ClientEvent
fn clone(&self) -> LSPS1ClientEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more