LSPS2ServiceEvent

Enum LSPS2ServiceEvent 

Source
pub enum LSPS2ServiceEvent {
    GetInfo {
        request_id: RequestId,
        counterparty_node_id: PublicKey,
        token: Option<String>,
    },
    BuyRequest {
        request_id: RequestId,
        counterparty_node_id: PublicKey,
        opening_fee_params: OpeningFeeParams,
        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 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.

Fields

§request_id: RequestId

An identifier that must be passed to LSPS2ServiceHandler::opening_fee_params_generated.

§counterparty_node_id: PublicKey

The node id of the client making the information request.

§token: Option<String>

An optional token that can be used as an API key, coupon code, etc.

§

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 an intercept scid and cltv_expiry_delta for them to use and call LSPS2ServiceHandler::invoice_parameters_generated.

Fields

§request_id: RequestId

An identifier that must be passed into LSPS2ServiceHandler::invoice_parameters_generated.

§counterparty_node_id: PublicKey

The client node id that is making this request.

§opening_fee_params: OpeningFeeParams

The channel parameters they have selected.

§payment_size_msat: Option<u64>

The size of the initial payment they would like to receive.

§

OpenChannel

You should open a channel using ChannelManager::create_channel.

Fields

§their_network_key: PublicKey

The node to open channel with.

§amt_to_forward_msat: u64

The amount to forward after fees.

§opening_fee_msat: u64

The fee earned for opening the channel.

§user_channel_id: u128

A user specified id used to track channel open.

§intercept_scid: u64

The intercept short channel id to use in the route hint.

Trait Implementations§

Source§

impl Clone for LSPS2ServiceEvent

Source§

fn clone(&self) -> LSPS2ServiceEvent

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LSPS2ServiceEvent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for LSPS2ServiceEvent

Source§

fn eq(&self, other: &LSPS2ServiceEvent) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for LSPS2ServiceEvent

Source§

impl StructuralPartialEq for LSPS2ServiceEvent

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.