@@ -39,6 +39,7 @@ interface Builder {
39
39
void set_chain_source_bitcoind_rpc(string rpc_host, u16 rpc_port, string rpc_user, string rpc_password);
40
40
void set_gossip_source_p2p();
41
41
void set_gossip_source_rgs(string rgs_server_url);
42
+ void set_liquidity_source_lsps1(PublicKey node_id, SocketAddress address, string? token);
42
43
void set_liquidity_source_lsps2(PublicKey node_id, SocketAddress address, string? token);
43
44
void set_storage_dir_path(string storage_dir_path);
44
45
void set_network(Network network);
@@ -78,6 +79,7 @@ interface Node {
78
79
SpontaneousPayment spontaneous_payment();
79
80
OnchainPayment onchain_payment();
80
81
UnifiedQrPayment unified_qr_payment();
82
+ Lsps1Liquidity lsps1_liquidity();
81
83
[Throws=NodeError]
82
84
void connect(PublicKey node_id, SocketAddress address, boolean persist);
83
85
[Throws=NodeError]
@@ -173,6 +175,13 @@ interface UnifiedQrPayment {
173
175
QrPaymentResult send([ByRef]string uri_str);
174
176
};
175
177
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
+
176
185
[Error]
177
186
enum NodeError {
178
187
"AlreadyRunning",
@@ -220,6 +229,8 @@ enum NodeError {
220
229
"InvalidUri",
221
230
"InvalidQuantity",
222
231
"InvalidNodeAlias",
232
+ "InvalidDateTime",
233
+ "InvalidFeeRate",
223
234
"DuplicatePayment",
224
235
"UnsupportedCurrency",
225
236
"InsufficientFunds",
@@ -372,6 +383,59 @@ dictionary CustomTlvRecord {
372
383
sequence<u8> value;
373
384
};
374
385
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
+
375
439
[Enum]
376
440
interface MaxTotalRoutingFeeLimit {
377
441
None ();
@@ -624,3 +688,12 @@ typedef string UntrustedString;
624
688
625
689
[Custom]
626
690
typedef 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