@@ -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]
@@ -171,6 +173,13 @@ interface UnifiedQrPayment {
171
173
QrPaymentResult send([ByRef]string uri_str);
172
174
};
173
175
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
+
174
183
[Error]
175
184
enum NodeError {
176
185
"AlreadyRunning",
@@ -217,6 +226,8 @@ enum NodeError {
217
226
"InvalidUri",
218
227
"InvalidQuantity",
219
228
"InvalidNodeAlias",
229
+ "InvalidTimestamp",
230
+ "InvalidFeeRate",
220
231
"DuplicatePayment",
221
232
"UnsupportedCurrency",
222
233
"InsufficientFunds",
@@ -362,6 +373,59 @@ dictionary SendingParameters {
362
373
u8? max_channel_saturation_power_of_half;
363
374
};
364
375
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
+
365
429
[Enum]
366
430
interface MaxTotalRoutingFeeLimit {
367
431
None ();
@@ -614,3 +678,12 @@ typedef string UntrustedString;
614
678
615
679
[Custom]
616
680
typedef 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