Skip to content

Commit a12ceaf

Browse files
committed
f Account for changes in BOLT11 interface
1 parent 00d4e0f commit a12ceaf

File tree

7 files changed

+173
-234
lines changed

7 files changed

+173
-234
lines changed

bindings/ldk_node.udl

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dictionary Config {
1212
sequence<PublicKey> trusted_peers_0conf;
1313
u64 probing_liquidity_limit_multiplier;
1414
AnchorChannelsConfig? anchor_channels_config;
15-
SendingParameters? sending_parameters;
15+
RouteParametersConfig? route_parameters;
1616
};
1717

1818
dictionary AnchorChannelsConfig {
@@ -166,13 +166,13 @@ interface Bolt11InvoiceDescription {
166166

167167
interface Bolt11Payment {
168168
[Throws=NodeError]
169-
PaymentId send([ByRef]Bolt11Invoice invoice, SendingParameters? sending_parameters);
169+
PaymentId send([ByRef]Bolt11Invoice invoice, RouteParametersConfig? route_parameters);
170170
[Throws=NodeError]
171-
PaymentId send_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, SendingParameters? sending_parameters);
171+
PaymentId send_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, RouteParametersConfig? route_parameters);
172172
[Throws=NodeError]
173-
void send_probes([ByRef]Bolt11Invoice invoice);
173+
void send_probes([ByRef]Bolt11Invoice invoice, RouteParametersConfig? route_parameters);
174174
[Throws=NodeError]
175-
void send_probes_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat);
175+
void send_probes_using_amount([ByRef]Bolt11Invoice invoice, u64 amount_msat, RouteParametersConfig? route_parameters);
176176
[Throws=NodeError]
177177
void claim_for_hash(PaymentHash payment_hash, u64 claimable_amount_msat, PaymentPreimage preimage);
178178
[Throws=NodeError]
@@ -208,9 +208,9 @@ interface Bolt12Payment {
208208

209209
interface SpontaneousPayment {
210210
[Throws=NodeError]
211-
PaymentId send(u64 amount_msat, PublicKey node_id, SendingParameters? sending_parameters);
211+
PaymentId send(u64 amount_msat, PublicKey node_id, RouteParametersConfig? route_parameters);
212212
[Throws=NodeError]
213-
PaymentId send_with_custom_tlvs(u64 amount_msat, PublicKey node_id, SendingParameters? sending_parameters, sequence<CustomTlvRecord> custom_tlvs);
213+
PaymentId send_with_custom_tlvs(u64 amount_msat, PublicKey node_id, RouteParametersConfig? route_parameters, sequence<CustomTlvRecord> custom_tlvs);
214214
[Throws=NodeError]
215215
void send_probes(u64 amount_msat, PublicKey node_id);
216216
};
@@ -446,11 +446,11 @@ dictionary PaymentDetails {
446446
u64 latest_update_timestamp;
447447
};
448448

449-
dictionary SendingParameters {
450-
MaxTotalRoutingFeeLimit? max_total_routing_fee_msat;
451-
u32? max_total_cltv_expiry_delta;
452-
u8? max_path_count;
453-
u8? max_channel_saturation_power_of_half;
449+
dictionary RouteParametersConfig {
450+
u64? max_total_routing_fee_msat;
451+
u32 max_total_cltv_expiry_delta;
452+
u8 max_path_count;
453+
u8 max_channel_saturation_power_of_half;
454454
};
455455

456456
dictionary CustomTlvRecord {
@@ -511,12 +511,6 @@ enum LSPS1PaymentState {
511511
"Refunded",
512512
};
513513

514-
[Enum]
515-
interface MaxTotalRoutingFeeLimit {
516-
None ();
517-
Some ( u64 amount_msat );
518-
};
519-
520514
[NonExhaustive]
521515
enum Network {
522516
"Bitcoin",

src/config.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
//! Objects for configuring the node.
99
1010
use crate::logger::LogLevel;
11-
use crate::payment::SendingParameters;
1211

1312
use lightning::ln::msgs::SocketAddress;
1413
use lightning::routing::gossip::NodeAlias;
14+
use lightning::routing::router::RouteParametersConfig;
1515
use lightning::util::config::ChannelConfig as LdkChannelConfig;
1616
use lightning::util::config::MaxDustHTLCExposure as LdkMaxDustHTLCExposure;
1717
use lightning::util::config::UserConfig;
@@ -102,9 +102,9 @@ pub const WALLET_KEYS_SEED_LEN: usize = 64;
102102
/// | `probing_liquidity_limit_multiplier` | 3 |
103103
/// | `log_level` | Debug |
104104
/// | `anchor_channels_config` | Some(..) |
105-
/// | `sending_parameters` | None |
105+
/// | `route_parameters` | None |
106106
///
107-
/// See [`AnchorChannelsConfig`] and [`SendingParameters`] for more information regarding their
107+
/// See [`AnchorChannelsConfig`] and [`RouteParametersConfig`] for more information regarding their
108108
/// respective default values.
109109
///
110110
/// [`Node`]: crate::Node
@@ -161,12 +161,12 @@ pub struct Config {
161161
pub anchor_channels_config: Option<AnchorChannelsConfig>,
162162
/// Configuration options for payment routing and pathfinding.
163163
///
164-
/// Setting the `SendingParameters` provides flexibility to customize how payments are routed,
164+
/// Setting the [`RouteParametersConfig`] provides flexibility to customize how payments are routed,
165165
/// including setting limits on routing fees, CLTV expiry, and channel utilization.
166166
///
167167
/// **Note:** If unset, default parameters will be used, and you will be able to override the
168168
/// parameters on a per-payment basis in the corresponding method calls.
169-
pub sending_parameters: Option<SendingParameters>,
169+
pub route_parameters: Option<RouteParametersConfig>,
170170
}
171171

172172
impl Default for Config {
@@ -179,7 +179,7 @@ impl Default for Config {
179179
trusted_peers_0conf: Vec::new(),
180180
probing_liquidity_limit_multiplier: DEFAULT_PROBING_LIQUIDITY_LIMIT_MULTIPLIER,
181181
anchor_channels_config: Some(AnchorChannelsConfig::default()),
182-
sending_parameters: None,
182+
route_parameters: None,
183183
node_alias: None,
184184
}
185185
}

0 commit comments

Comments
 (0)