pub enum LSPS2ServiceEvent {
GetInfo {
request_id: LSPSRequestId,
counterparty_node_id: PublicKey,
token: Option<String>,
},
BuyRequest {
request_id: LSPSRequestId,
counterparty_node_id: PublicKey,
opening_fee_params: LSPS2OpeningFeeParams,
payment_size_msat: Option<u64>,
},
OpenChannel {
their_network_key: PublicKey,
amt_to_forward_msat: u64,
opening_fee_msat: u64,
user_channel_id: u128,
intercept_scid: u64,
},
}Expand description
An event which an bLIP-52 / LSPS2 server should take some action in response to.
Variants§
GetInfo
A request from a client for information about JIT Channel parameters.
You must calculate the parameters for this client and pass them to
LSPS2ServiceHandler::opening_fee_params_generated.
If an unrecognized or stale token is provided you can use
[LSPS2ServiceHandler::invalid_token_provided] to error the request.
**Note: ** This event will not be persisted across restarts.
Fields
request_id: LSPSRequestIdAn identifier that must be passed to LSPS2ServiceHandler::opening_fee_params_generated.
BuyRequest
A client has selected a opening fee parameter to use and would like to purchase a channel with an optional initial payment size.
If payment_size_msat is Option::Some then the payer is allowed to use MPP.
If payment_size_msat is Option::None then the payer cannot use MPP.
You must generate a cltv_expiry_delta and obtain an intercept scid using
ChannelManager::get_intercept_scid for them to use and then call
LSPS2ServiceHandler::invoice_parameters_generated.
**Note: ** This event will not be persisted across restarts.
Fields
request_id: LSPSRequestIdAn identifier that must be passed into LSPS2ServiceHandler::invoice_parameters_generated.
opening_fee_params: LSPS2OpeningFeeParamsThe channel parameters they have selected.
OpenChannel
You should open a channel using ChannelManager::create_channel.
**Note: ** As this event is persisted and might get replayed after restart, you’ll need to
ensure channel creation idempotency. I.e., please check if you already created a
corresponding channel based on the given their_network_key and user_channel_id and
ignore this event in case you did.
Fields
Trait Implementations§
Source§impl Clone for LSPS2ServiceEvent
impl Clone for LSPS2ServiceEvent
Source§fn clone(&self) -> LSPS2ServiceEvent
fn clone(&self) -> LSPS2ServiceEvent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LSPS2ServiceEvent
impl Debug for LSPS2ServiceEvent
Source§impl From<LSPS2ServiceEvent> for LiquidityEvent
impl From<LSPS2ServiceEvent> for LiquidityEvent
Source§fn from(event: LSPS2ServiceEvent) -> Self
fn from(event: LSPS2ServiceEvent) -> Self
Source§impl PartialEq for LSPS2ServiceEvent
impl PartialEq for LSPS2ServiceEvent
Source§impl Readable for LSPS2ServiceEvent
impl Readable for LSPS2ServiceEvent
Source§impl Writeable for LSPS2ServiceEvent
impl Writeable for LSPS2ServiceEvent
impl Eq for LSPS2ServiceEvent
impl StructuralPartialEq for LSPS2ServiceEvent
Auto Trait Implementations§
impl Freeze for LSPS2ServiceEvent
impl RefUnwindSafe for LSPS2ServiceEvent
impl Send for LSPS2ServiceEvent
impl Sync for LSPS2ServiceEvent
impl Unpin for LSPS2ServiceEvent
impl UnwindSafe for LSPS2ServiceEvent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LengthReadable for Twhere
T: Readable,
impl<T> LengthReadable for Twhere
T: Readable,
Source§fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>where
R: LengthLimitedRead,
Self in from the given LengthLimitedRead.