Skip to content

Commit 95e010b

Browse files
committed
Merge branch 'refs/heads/main' into monitor-upd-persister
2 parents 907677f + 6de3500 commit 95e010b

16 files changed

+1149
-223
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ fn main() {
4444
node.event_handled();
4545

4646
let invoice = Bolt11Invoice::from_str("INVOICE_STR").unwrap();
47-
node.bolt11_payment().send(&invoice).unwrap();
47+
node.bolt11_payment().send(&invoice, None).unwrap();
4848

4949
node.stop().unwrap();
5050
}

bindings/ldk_node.udl

+75-3
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,11 @@ interface Builder {
5858
void set_chain_source_bitcoind_rpc(string rpc_host, u16 rpc_port, string rpc_user, string rpc_password);
5959
void set_gossip_source_p2p();
6060
void set_gossip_source_rgs(string rgs_server_url);
61-
void set_liquidity_source_lsps2(SocketAddress address, PublicKey node_id, string? token);
61+
void set_liquidity_source_lsps1(PublicKey node_id, SocketAddress address, string? token);
62+
void set_liquidity_source_lsps2(PublicKey node_id, SocketAddress address, string? token);
6263
void set_storage_dir_path(string storage_dir_path);
63-
void set_filesystem_logger(string? log_file_path, LogLevel? log_level);
64-
void set_log_facade_logger(LogLevel log_level);
64+
void set_filesystem_logger(string? log_file_path, LogLevel? max_log_level);
65+
void set_log_facade_logger(LogLevel? max_log_level);
6566
void set_custom_logger(LogWriter log_writer);
6667
void set_network(Network network);
6768
[Throws=BuildError]
@@ -100,6 +101,7 @@ interface Node {
100101
SpontaneousPayment spontaneous_payment();
101102
OnchainPayment onchain_payment();
102103
UnifiedQrPayment unified_qr_payment();
104+
LSPS1Liquidity lsps1_liquidity();
103105
[Throws=NodeError]
104106
void connect(PublicKey node_id, SocketAddress address, boolean persist);
105107
[Throws=NodeError]
@@ -126,6 +128,8 @@ interface Node {
126128
NetworkGraph network_graph();
127129
string sign_message([ByRef]sequence<u8> msg);
128130
boolean verify_signature([ByRef]sequence<u8> msg, [ByRef]string sig, [ByRef]PublicKey pkey);
131+
[Throws=NodeError]
132+
bytes export_pathfinding_scores();
129133
};
130134

131135
[Enum]
@@ -211,6 +215,13 @@ interface UnifiedQrPayment {
211215
QrPaymentResult send([ByRef]string uri_str);
212216
};
213217

218+
interface LSPS1Liquidity {
219+
[Throws=NodeError]
220+
LSPS1OrderStatus request_channel(u64 lsp_balance_sat, u64 client_balance_sat, u32 channel_expiry_blocks, boolean announce_channel);
221+
[Throws=NodeError]
222+
LSPS1OrderStatus check_order_status(OrderId order_id);
223+
};
224+
214225
[Error]
215226
enum NodeError {
216227
"AlreadyRunning",
@@ -258,6 +269,8 @@ enum NodeError {
258269
"InvalidUri",
259270
"InvalidQuantity",
260271
"InvalidNodeAlias",
272+
"InvalidDateTime",
273+
"InvalidFeeRate",
261274
"DuplicatePayment",
262275
"UnsupportedCurrency",
263276
"InsufficientFunds",
@@ -416,6 +429,59 @@ dictionary CustomTlvRecord {
416429
sequence<u8> value;
417430
};
418431

432+
dictionary LSPS1OrderStatus {
433+
OrderId order_id;
434+
OrderParameters order_params;
435+
PaymentInfo payment_options;
436+
ChannelOrderInfo? channel_state;
437+
};
438+
439+
dictionary OrderParameters {
440+
u64 lsp_balance_sat;
441+
u64 client_balance_sat;
442+
u16 required_channel_confirmations;
443+
u16 funding_confirms_within_blocks;
444+
u32 channel_expiry_blocks;
445+
string? token;
446+
boolean announce_channel;
447+
};
448+
449+
dictionary PaymentInfo {
450+
Bolt11PaymentInfo? bolt11;
451+
OnchainPaymentInfo? onchain;
452+
};
453+
454+
dictionary Bolt11PaymentInfo {
455+
PaymentState state;
456+
DateTime expires_at;
457+
u64 fee_total_sat;
458+
u64 order_total_sat;
459+
Bolt11Invoice invoice;
460+
};
461+
462+
dictionary OnchainPaymentInfo {
463+
PaymentState state;
464+
DateTime expires_at;
465+
u64 fee_total_sat;
466+
u64 order_total_sat;
467+
Address address;
468+
u16? min_onchain_payment_confirmations;
469+
FeeRate min_fee_for_0conf;
470+
Address? refund_onchain_address;
471+
};
472+
473+
dictionary ChannelOrderInfo {
474+
DateTime funded_at;
475+
OutPoint funding_outpoint;
476+
DateTime expires_at;
477+
};
478+
479+
enum PaymentState {
480+
"ExpectPayment",
481+
"Paid",
482+
"Refunded",
483+
};
484+
419485
[Enum]
420486
interface MaxTotalRoutingFeeLimit {
421487
None ();
@@ -662,3 +728,9 @@ typedef string UntrustedString;
662728

663729
[Custom]
664730
typedef string NodeAlias;
731+
732+
[Custom]
733+
typedef string OrderId;
734+
735+
[Custom]
736+
typedef string DateTime;

src/balance.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -325,9 +325,9 @@ pub enum PendingSweepBalance {
325325
},
326326
/// A spending transaction has been confirmed on-chain and is awaiting threshold confirmations.
327327
///
328-
/// It will be considered irrevocably confirmed after reaching [`ANTI_REORG_DELAY`].
328+
/// It will be pruned after reaching [`PRUNE_DELAY_BLOCKS`] confirmations.
329329
///
330-
/// [`ANTI_REORG_DELAY`]: lightning::chain::channelmonitor::ANTI_REORG_DELAY
330+
/// [`PRUNE_DELAY_BLOCKS`]: lightning::util::sweep::PRUNE_DELAY_BLOCKS
331331
AwaitingThresholdConfirmations {
332332
/// The identifier of the channel this balance belongs to.
333333
channel_id: Option<ChannelId>,

0 commit comments

Comments
 (0)