LSPS2ServiceEvent

Enum LSPS2ServiceEvent 

Source
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: LSPSRequestId

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 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: LSPSRequestId

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: LSPS2OpeningFeeParams

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.

**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

§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 From<LSPS2ServiceEvent> for LiquidityEvent

Source§

fn from(event: LSPS2ServiceEvent) -> Self

Converts to this type from the input type.
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 Readable for LSPS2ServiceEvent

Source§

fn read<R: Read>(reader: &mut R) -> Result<Self, DecodeError>

Reads a Self in from the given Read.
Source§

impl Writeable for LSPS2ServiceEvent

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Writes self out to the given Writer.
Source§

fn encode(&self) -> Vec<u8>

Writes self out to a Vec<u8>.
Source§

fn serialized_length(&self) -> usize

Gets the length of this object after it has been serialized. This can be overridden to optimize cases where we prepend an object with its length.
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> LengthReadable for T
where T: Readable,

Source§

fn read_from_fixed_length_buffer<R>(reader: &mut R) -> Result<T, DecodeError>

Reads a Self in from the given LengthLimitedRead.
Source§

impl<T> MaybeReadable for T
where T: Readable,

Source§

fn read<R>(reader: &mut R) -> Result<Option<T>, DecodeError>
where R: Read,

Reads a Self in from the given Read.
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.