-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
221 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,66 +1,62 @@ | ||
use bitcoin::secp256k1::PublicKey; | ||
|
||
use super::msgs::{ChannelInfo, OptionsSupported, Order, OrderId, Payment}; | ||
use crate::transport::msgs::RequestId; | ||
use super::msgs::{OptionsSupported, ChannelInfo, Order, Payment, OrderId}; | ||
|
||
#[derive(Clone, Debug, PartialEq, Eq)] | ||
pub enum Event { | ||
|
||
// Information from the LSP regarding fees and channel parameters. | ||
// The client should validate if the LSP's parameters supported match | ||
// requirements. | ||
// used by LSP to provide options supported by it to client | ||
GetInfoResponse { | ||
request_id: RequestId, | ||
|
||
// Information from the LSP regarding fees and channel parameters. | ||
// The client should validate if the LSP's parameters supported match | ||
// requirements. | ||
// used by LSP to provide options supported by it to client | ||
GetInfoResponse { | ||
request_id: RequestId, | ||
|
||
/// The node id of the LSP that provided this response. | ||
counterparty_node_id: PublicKey, | ||
|
||
version: Vec<u16>, | ||
|
||
website: String, | ||
version: Vec<u16>, | ||
|
||
options_supported: OptionsSupported | ||
}, | ||
website: String, | ||
|
||
// Channel opening request from the client after selecting the LSP with desired parameters. | ||
// Client selects the fee and channel parameters and requests the LSP to create a channel. | ||
// LSP should check the validity of the create channel order. | ||
options_supported: OptionsSupported, | ||
}, | ||
|
||
CreateInvoice { | ||
request_id: RequestId, | ||
// Channel opening request from the client after selecting the LSP with desired parameters. | ||
// Client selects the fee and channel parameters and requests the LSP to create a channel. | ||
// LSP should check the validity of the create channel order. | ||
CreateInvoice { | ||
request_id: RequestId, | ||
|
||
counterparty_node_id: PublicKey, | ||
|
||
order: Order, | ||
order: Order, | ||
|
||
order_id: OrderId, | ||
}, | ||
order_id: OrderId, | ||
}, | ||
|
||
// LSP accepts the request parameters and sends an onchain address and invoice along with channel | ||
// parameters to the client. After payment by the client this event should be updated, | ||
// to show the LSP to poll for the payment now. | ||
PayforChaPennnel { | ||
|
||
request_id: RequestId, | ||
// LSP accepts the request parameters and sends an onchain address and invoice along with channel | ||
// parameters to the client. After payment by the client this event should be updated, | ||
// to show the LSP to poll for the payment now. | ||
PayforChaPennnel { | ||
request_id: RequestId, | ||
counterparty_node_id: PublicKey, | ||
order: Order, | ||
payment: Payment, | ||
channel: Option<ChannelInfo>, | ||
|
||
}, | ||
}, | ||
|
||
CheckPaymentConfirmation { | ||
request_id: RequestId, | ||
counterparty_node_id: PublicKey, | ||
order_id: OrderId, | ||
}, | ||
CheckPaymentConfirmation { | ||
request_id: RequestId, | ||
counterparty_node_id: PublicKey, | ||
order_id: OrderId, | ||
}, | ||
|
||
// On payment confirmation, channel is opened. After payment confirms, | ||
// LSP should open a channel and open to client. | ||
OpenChannel {}, | ||
// On payment confirmation, channel is opened. After payment confirms, | ||
// LSP should open a channel and open to client. | ||
OpenChannel {}, | ||
|
||
// If order fails, refund is initiated. | ||
// | ||
Refund {}, | ||
} | ||
// If order fails, refund is initiated. | ||
// | ||
Refund {}, | ||
} |
Oops, something went wrong.