UNPKG

lightningdevkit

Version:
174 lines (173 loc) 6.96 kB
import { LSPSRequestId } from '../structs/LSPSRequestId.mjs'; import { LSPS1Options } from '../structs/LSPS1Options.mjs'; import { LSPSResponseError } from '../structs/LSPSResponseError.mjs'; import { LSPS1OrderId } from '../structs/LSPS1OrderId.mjs'; import { LSPS1OrderParams } from '../structs/LSPS1OrderParams.mjs'; import { LSPS1PaymentInfo } from '../structs/LSPS1PaymentInfo.mjs'; import { LSPS1ChannelInfo } from '../structs/LSPS1ChannelInfo.mjs'; import { CommonBase } from './CommonBase.mjs'; /** * An event which an bLIP-51 / LSPS1 client should take some action in response to. */ export declare class LSPS1ClientEvent extends CommonBase { protected constructor(_dummy: null, ptr: bigint); clone_ptr(): bigint; /** * Creates a copy of the LSPS1ClientEvent */ clone(): LSPS1ClientEvent; /** * Utility method to constructs a new SupportedOptionsReady-variant LSPS1ClientEvent */ static constructor_supported_options_ready(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, supported_options: LSPS1Options): LSPS1ClientEvent; /** * Utility method to constructs a new SupportedOptionsRequestFailed-variant LSPS1ClientEvent */ static constructor_supported_options_request_failed(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, error: LSPSResponseError): LSPS1ClientEvent; /** * Utility method to constructs a new OrderCreated-variant LSPS1ClientEvent */ static constructor_order_created(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, order_id: LSPS1OrderId, order: LSPS1OrderParams, payment: LSPS1PaymentInfo, channel: LSPS1ChannelInfo): LSPS1ClientEvent; /** * Utility method to constructs a new OrderStatus-variant LSPS1ClientEvent */ static constructor_order_status(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, order_id: LSPS1OrderId, order: LSPS1OrderParams, payment: LSPS1PaymentInfo, channel: LSPS1ChannelInfo): LSPS1ClientEvent; /** * Utility method to constructs a new OrderRequestFailed-variant LSPS1ClientEvent */ static constructor_order_request_failed(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, error: LSPSResponseError): LSPS1ClientEvent; /** * Checks if two LSPS1ClientEvents contain equal inner contents. * This ignores pointers and is_owned flags and looks at the values in fields. */ eq(b: LSPS1ClientEvent): boolean; } /** A LSPS1ClientEvent of type SupportedOptionsReady */ export declare class LSPS1ClientEvent_SupportedOptionsReady extends LSPS1ClientEvent { /** * The identifier of the issued bLIP-51 / LSPS1 `get_info` request, as returned by * [`LSPS1ClientHandler::request_supported_options`] * * This can be used to track which request this event corresponds to. * * [`LSPS1ClientHandler::request_supported_options`]: crate::lsps1::client::LSPS1ClientHandler::request_supported_options */ request_id: LSPSRequestId; /** * The node id of the LSP that provided this response. */ counterparty_node_id: Uint8Array; /** * All options supported by the LSP. */ supported_options: LSPS1Options; } /** A LSPS1ClientEvent of type SupportedOptionsRequestFailed */ export declare class LSPS1ClientEvent_SupportedOptionsRequestFailed extends LSPS1ClientEvent { /** * The identifier of the issued bLIP-51 / LSPS1 `get_info` request, as returned by * [`LSPS1ClientHandler::request_supported_options`] * * This can be used to track which request this event corresponds to. * * [`LSPS1ClientHandler::request_supported_options`]: crate::lsps1::client::LSPS1ClientHandler::request_supported_options */ request_id: LSPSRequestId; /** * The node id of the LSP that provided this response. */ counterparty_node_id: Uint8Array; /** * The error that was returned. */ error: LSPSResponseError; } /** A LSPS1ClientEvent of type OrderCreated */ export declare class LSPS1ClientEvent_OrderCreated extends LSPS1ClientEvent { /** * The identifier of the issued bLIP-51 / LSPS1 `create_order` request, as returned by * [`LSPS1ClientHandler::create_order`] * * This can be used to track which request this event corresponds to. * * [`LSPS1ClientHandler::create_order`]: crate::lsps1::client::LSPS1ClientHandler::create_order */ request_id: LSPSRequestId; /** * The node id of the LSP. */ counterparty_node_id: Uint8Array; /** * The id of the channel order. */ order_id: LSPS1OrderId; /** * The order created by client and approved by LSP. */ order: LSPS1OrderParams; /** * The details regarding payment of the order */ payment: LSPS1PaymentInfo; /** * The details regarding state of the channel ordered. * * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ channel: LSPS1ChannelInfo; } /** A LSPS1ClientEvent of type OrderStatus */ export declare class LSPS1ClientEvent_OrderStatus extends LSPS1ClientEvent { /** * The identifier of the issued bLIP-51 / LSPS1 `get_order` request, as returned by * [`LSPS1ClientHandler::check_order_status`] * * This can be used to track which request this event corresponds to. * * [`LSPS1ClientHandler::check_order_status`]: crate::lsps1::client::LSPS1ClientHandler::check_order_status */ request_id: LSPSRequestId; /** * The node id of the LSP. */ counterparty_node_id: Uint8Array; /** * The id of the channel order. */ order_id: LSPS1OrderId; /** * The order created by client and approved by LSP. */ order: LSPS1OrderParams; /** * The details regarding payment of the order */ payment: LSPS1PaymentInfo; /** * The details regarding state of the channel ordered. * * Note that this (or a relevant inner pointer) may be NULL or all-0s to represent None */ channel: LSPS1ChannelInfo; } /** A LSPS1ClientEvent of type OrderRequestFailed */ export declare class LSPS1ClientEvent_OrderRequestFailed extends LSPS1ClientEvent { /** * 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. * * [`LSPS1ClientHandler::create_order`]: crate::lsps1::client::LSPS1ClientHandler::create_order * [`LSPS1ClientHandler::check_order_status`]: crate::lsps1::client::LSPS1ClientHandler::check_order_status */ request_id: LSPSRequestId; /** * The node id of the LSP. */ counterparty_node_id: Uint8Array; /** * The error that was returned. */ error: LSPSResponseError; }