lightningdevkit
Version:
Lightning Development Kit
95 lines (94 loc) • 3.64 kB
text/typescript
import { Option_u64Z } from '../structs/Option_u64Z.mjs';
import { Option_StrZ } from '../structs/Option_StrZ.mjs';
import { LSPSRequestId } from '../structs/LSPSRequestId.mjs';
import { LSPS2OpeningFeeParams } from '../structs/LSPS2OpeningFeeParams.mjs';
import { CommonBase } from './CommonBase.mjs';
/**
* An event which an bLIP-52 / LSPS2 server should take some action in response to.
*/
export declare class LSPS2ServiceEvent extends CommonBase {
protected constructor(_dummy: null, ptr: bigint);
clone_ptr(): bigint;
/**
* Creates a copy of the LSPS2ServiceEvent
*/
clone(): LSPS2ServiceEvent;
/**
* Utility method to constructs a new GetInfo-variant LSPS2ServiceEvent
*/
static constructor_get_info(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, token: Option_StrZ): LSPS2ServiceEvent;
/**
* Utility method to constructs a new BuyRequest-variant LSPS2ServiceEvent
*/
static constructor_buy_request(request_id: LSPSRequestId, counterparty_node_id: Uint8Array, opening_fee_params: LSPS2OpeningFeeParams, payment_size_msat: Option_u64Z): LSPS2ServiceEvent;
/**
* Utility method to constructs a new OpenChannel-variant LSPS2ServiceEvent
*/
static constructor_open_channel(their_network_key: Uint8Array, amt_to_forward_msat: bigint, opening_fee_msat: bigint, user_channel_id: bigint, intercept_scid: bigint): LSPS2ServiceEvent;
/**
* Checks if two LSPS2ServiceEvents contain equal inner contents.
* This ignores pointers and is_owned flags and looks at the values in fields.
*/
eq(b: LSPS2ServiceEvent): boolean;
}
/** A LSPS2ServiceEvent of type GetInfo */
export declare class LSPS2ServiceEvent_GetInfo extends LSPS2ServiceEvent {
/**
* An identifier that must be passed to [`LSPS2ServiceHandler::opening_fee_params_generated`].
*
* [`LSPS2ServiceHandler::opening_fee_params_generated`]: crate::lsps2::service::LSPS2ServiceHandler::opening_fee_params_generated
*/
request_id: LSPSRequestId;
/**
* The node id of the client making the information request.
*/
counterparty_node_id: Uint8Array;
/**
* An optional token that can be used as an API key, coupon code, etc.
*/
token: Option_StrZ;
}
/** A LSPS2ServiceEvent of type BuyRequest */
export declare class LSPS2ServiceEvent_BuyRequest extends LSPS2ServiceEvent {
/**
* An identifier that must be passed into [`LSPS2ServiceHandler::invoice_parameters_generated`].
*
* [`LSPS2ServiceHandler::invoice_parameters_generated`]: crate::lsps2::service::LSPS2ServiceHandler::invoice_parameters_generated
*/
request_id: LSPSRequestId;
/**
* The client node id that is making this request.
*/
counterparty_node_id: Uint8Array;
/**
* The channel parameters they have selected.
*/
opening_fee_params: LSPS2OpeningFeeParams;
/**
* The size of the initial payment they would like to receive.
*/
payment_size_msat: Option_u64Z;
}
/** A LSPS2ServiceEvent of type OpenChannel */
export declare class LSPS2ServiceEvent_OpenChannel extends LSPS2ServiceEvent {
/**
* The node to open channel with.
*/
their_network_key: Uint8Array;
/**
* The amount to forward after fees.
*/
amt_to_forward_msat: bigint;
/**
* The fee earned for opening the channel.
*/
opening_fee_msat: bigint;
/**
* A user specified id used to track channel open.
*/
user_channel_id: bigint;
/**
* The intercept short channel id to use in the route hint.
*/
intercept_scid: bigint;
}