@@ -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]
@@ -173,6 +175,13 @@ interface UnifiedQrPayment {
173175 QrPaymentResult send([ByRef]string uri_str);
174176};
175177
178+ interface Lsps1Liquidity {
179+ [Throws=NodeError]
180+ LSPS1OrderStatus request_channel(u64 lsp_balance_sat, u64 client_balance_sat, u32 channel_expiry_blocks, boolean announce_channel);
181+ [Throws=NodeError]
182+ LSPS1OrderStatus check_order_status(OrderId order_id);
183+ };
184+
176185[Error]
177186enum NodeError {
178187 "AlreadyRunning",
@@ -220,6 +229,8 @@ enum NodeError {
220229 "InvalidUri",
221230 "InvalidQuantity",
222231 "InvalidNodeAlias",
232+ "InvalidDateTime",
233+ "InvalidFeeRate",
223234 "DuplicatePayment",
224235 "UnsupportedCurrency",
225236 "InsufficientFunds",
@@ -372,6 +383,59 @@ dictionary CustomTlvRecord {
372383 sequence<u8> value;
373384};
374385
386+ dictionary LSPS1OrderStatus {
387+ OrderId order_id;
388+ OrderParameters order_params;
389+ PaymentInfo payment_options;
390+ ChannelOrderInfo? channel_state;
391+ };
392+
393+ dictionary OrderParameters {
394+ u64 lsp_balance_sat;
395+ u64 client_balance_sat;
396+ u16 required_channel_confirmations;
397+ u16 funding_confirms_within_blocks;
398+ u32 channel_expiry_blocks;
399+ string? token;
400+ boolean announce_channel;
401+ };
402+
403+ dictionary PaymentInfo {
404+ Bolt11PaymentInfo? bolt11;
405+ OnchainPaymentInfo? onchain;
406+ };
407+
408+ dictionary Bolt11PaymentInfo {
409+ PaymentState state;
410+ DateTime expires_at;
411+ u64 fee_total_sat;
412+ u64 order_total_sat;
413+ Bolt11Invoice invoice;
414+ };
415+
416+ dictionary OnchainPaymentInfo {
417+ PaymentState state;
418+ DateTime expires_at;
419+ u64 fee_total_sat;
420+ u64 order_total_sat;
421+ Address address;
422+ u16? min_onchain_payment_confirmations;
423+ FeeRate min_fee_for_0conf;
424+ Address? refund_onchain_address;
425+ };
426+
427+ dictionary ChannelOrderInfo {
428+ DateTime funded_at;
429+ OutPoint funding_outpoint;
430+ DateTime expires_at;
431+ };
432+
433+ enum PaymentState {
434+ "ExpectPayment",
435+ "Paid",
436+ "Refunded",
437+ };
438+
375439[Enum]
376440interface MaxTotalRoutingFeeLimit {
377441 None ();
@@ -624,3 +688,12 @@ typedef string UntrustedString;
624688
625689[Custom]
626690typedef string NodeAlias;
691+
692+ [Custom]
693+ typedef string OrderId;
694+
695+ [Custom]
696+ typedef string DateTime;
697+
698+ [Custom]
699+ typedef string FeeRate;
0 commit comments