@@ -39,6 +39,7 @@ interface Builder {
3939 void set_chain_source_bitcoind_rpc(string rpc_host, u16 rpc_port, string rpc_user, string rpc_password);
4040 void set_gossip_source_p2p();
4141 void set_gossip_source_rgs(string rgs_server_url);
42+ void set_liquidity_source_lsps1(PublicKey node_id, SocketAddress address, string? token);
4243 void set_liquidity_source_lsps2(PublicKey node_id, SocketAddress address, string? token);
4344 void set_storage_dir_path(string storage_dir_path);
4445 void set_network(Network network);
@@ -78,6 +79,7 @@ interface Node {
7879 SpontaneousPayment spontaneous_payment();
7980 OnchainPayment onchain_payment();
8081 UnifiedQrPayment unified_qr_payment();
82+ Lsps1Liquidity lsps1_liquidity();
8183 [Throws=NodeError]
8284 void connect(PublicKey node_id, SocketAddress address, boolean persist);
8385 [Throws=NodeError]
@@ -171,6 +173,13 @@ interface UnifiedQrPayment {
171173 QrPaymentResult send([ByRef]string uri_str);
172174};
173175
176+ interface Lsps1Liquidity {
177+ [Throws=NodeError]
178+ LSPS1OrderStatus request_channel(u64 lsp_balance_sat, u64 client_balance_sat, u32 channel_expiry_blocks, boolean announce_channel);
179+ [Throws=NodeError]
180+ LSPS1OrderStatus check_order_status(OrderId order_id);
181+ };
182+
174183[Error]
175184enum NodeError {
176185 "AlreadyRunning",
@@ -217,6 +226,8 @@ enum NodeError {
217226 "InvalidUri",
218227 "InvalidQuantity",
219228 "InvalidNodeAlias",
229+ "InvalidTimestamp",
230+ "InvalidFeeRate",
220231 "DuplicatePayment",
221232 "UnsupportedCurrency",
222233 "InsufficientFunds",
@@ -362,6 +373,59 @@ dictionary SendingParameters {
362373 u8? max_channel_saturation_power_of_half;
363374};
364375
376+ dictionary LSPS1OrderStatus {
377+ OrderId order_id;
378+ OrderParameters order_params;
379+ PaymentInfo payment_options;
380+ ChannelOrderInfo? channel_state;
381+ };
382+
383+ dictionary OrderParameters {
384+ u64 lsp_balance_sat;
385+ u64 client_balance_sat;
386+ u16 required_channel_confirmations;
387+ u16 funding_confirms_within_blocks;
388+ u32 channel_expiry_blocks;
389+ string? token;
390+ boolean announce_channel;
391+ };
392+
393+ dictionary PaymentInfo {
394+ Bolt11PaymentInfo? bolt11;
395+ OnchainPaymentInfo? onchain;
396+ };
397+
398+ dictionary Bolt11PaymentInfo {
399+ PaymentState state;
400+ DateTime expires_at;
401+ u64 fee_total_sat;
402+ u64 order_total_sat;
403+ Bolt11Invoice invoice;
404+ };
405+
406+ dictionary OnchainPaymentInfo {
407+ PaymentState state;
408+ DateTime expires_at;
409+ u64 fee_total_sat;
410+ u64 order_total_sat;
411+ Address address;
412+ u16? min_onchain_payment_confirmations;
413+ FeeRate min_fee_for_0conf;
414+ Address? refund_onchain_address;
415+ };
416+
417+ dictionary ChannelOrderInfo {
418+ DateTime funded_at;
419+ OutPoint funding_outpoint;
420+ DateTime expires_at;
421+ };
422+
423+ enum PaymentState {
424+ "ExpectPayment",
425+ "Paid",
426+ "Refunded",
427+ };
428+
365429[Enum]
366430interface MaxTotalRoutingFeeLimit {
367431 None ();
@@ -614,3 +678,12 @@ typedef string UntrustedString;
614678
615679[Custom]
616680typedef string NodeAlias;
681+
682+ [Custom]
683+ typedef string OrderId;
684+
685+ [Custom]
686+ typedef i64 DateTime;
687+
688+ [Custom]
689+ typedef string FeeRate;
0 commit comments