lightningdevkit
Version:
Lightning Development Kit
37 lines (36 loc) • 1.71 kB
text/typescript
import { Option_AddressZ } from '../structs/Option_AddressZ.mjs';
import { LSPSRequestId } from '../structs/LSPSRequestId.mjs';
import { LSPS1OrderId } from '../structs/LSPS1OrderId.mjs';
import { LSPS1OrderParams } from '../structs/LSPS1OrderParams.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* The main object allowing to send and receive bLIP-51 / LSPS1 messages.
*/
export declare class LSPS1ClientHandler extends CommonBase {
/**
* Request the supported options from the LSP.
*
* The user will receive the LSP's response via an [`SupportedOptionsReady`] event.
*
* `counterparty_node_id` is the `node_id` of the LSP you would like to use.
*
* Returns the used [`LSPSRequestId`], which will be returned via [`SupportedOptionsReady`].
*
* [`SupportedOptionsReady`]: crate::lsps1::event::LSPS1ClientEvent::SupportedOptionsReady
*/
request_supported_options(counterparty_node_id: Uint8Array): LSPSRequestId;
/**
* Places an order with the connected LSP given its `counterparty_node_id`.
*
* The client agrees to paying channel fees according to the provided parameters.
*/
create_order(counterparty_node_id: Uint8Array, order: LSPS1OrderParams, refund_onchain_address: Option_AddressZ): LSPSRequestId;
/**
* Queries the status of a pending payment, i.e., whether a payment has been received by the LSP.
*
* Upon success an [`LSPS1ClientEvent::OrderStatus`] event will be emitted.
*
* [`LSPS1ClientEvent::OrderStatus`]: crate::lsps1::event::LSPS1ClientEvent::OrderStatus
*/
check_order_status(counterparty_node_id: Uint8Array, order_id: LSPS1OrderId): LSPSRequestId;
}