LSPS1ClientEvent

Enum LSPS1ClientEvent 

Source
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.

§counterparty_node_id: PublicKey

The node id of the LSP that provided this response.

§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.

§counterparty_node_id: PublicKey

The node id of the LSP that provided this response.

§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.

§counterparty_node_id: PublicKey

The node id of the LSP.

§order_id: OrderId

The id of the channel order.

§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.

§counterparty_node_id: PublicKey

The node id of the LSP.

§order_id: OrderId

The id of the channel order.

§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.

§counterparty_node_id: PublicKey

The node id of the LSP.

§error: ResponseError

The error that was returned.

Trait Implementations§

Source§

impl Clone for LSPS1ClientEvent

Source§

fn clone(&self) -> LSPS1ClientEvent

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 LSPS1ClientEvent

Source§

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

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

impl PartialEq for LSPS1ClientEvent

Source§

fn eq(&self, other: &LSPS1ClientEvent) -> 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 LSPS1ClientEvent

Source§

impl StructuralPartialEq for LSPS1ClientEvent

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.