@@ -10,6 +10,7 @@ use ldk_server_client::ldk_server_protos::api::{
1010 ListChannelsRequest , ListPaymentsRequest , OnchainReceiveRequest , OnchainSendRequest ,
1111 OpenChannelRequest ,
1212} ;
13+ use ldk_server_client:: ldk_server_protos:: types:: RouteParametersConfig ;
1314use ldk_server_client:: ldk_server_protos:: types:: {
1415 bolt11_invoice_description, Bolt11InvoiceDescription , PageToken , Payment ,
1516} ;
@@ -55,6 +56,14 @@ enum Commands {
5556 invoice : String ,
5657 #[ arg( long) ]
5758 amount_msat : Option < u64 > ,
59+ #[ arg( long) ]
60+ max_total_routing_fee_msat : Option < u64 > ,
61+ #[ arg( long) ]
62+ max_total_cltv_expiry_delta : Option < u32 > ,
63+ #[ arg( long) ]
64+ max_path_count : Option < u32 > ,
65+ #[ arg( long) ]
66+ max_channel_saturation_power_of_half : Option < u32 > ,
5867 } ,
5968 Bolt12Receive {
6069 #[ arg( short, long) ]
@@ -161,9 +170,29 @@ async fn main() {
161170
162171 handle_response_result ( client. bolt11_receive ( request) . await ) ;
163172 } ,
164- Commands :: Bolt11Send { invoice, amount_msat } => {
173+ Commands :: Bolt11Send {
174+ invoice,
175+ amount_msat,
176+ max_total_routing_fee_msat,
177+ max_total_cltv_expiry_delta,
178+ max_path_count,
179+ max_channel_saturation_power_of_half,
180+ } => {
181+ let route_parameters = RouteParametersConfig {
182+ max_total_routing_fee_msat,
183+ max_total_cltv_expiry_delta : max_total_cltv_expiry_delta. unwrap_or_default ( ) ,
184+ max_path_count : max_path_count. unwrap_or_default ( ) ,
185+ max_channel_saturation_power_of_half : max_channel_saturation_power_of_half
186+ . unwrap_or_default ( ) ,
187+ } ;
165188 handle_response_result (
166- client. bolt11_send ( Bolt11SendRequest { invoice, amount_msat } ) . await ,
189+ client
190+ . bolt11_send ( Bolt11SendRequest {
191+ invoice,
192+ amount_msat,
193+ route_parameters : Some ( route_parameters) ,
194+ } )
195+ . await ,
167196 ) ;
168197 } ,
169198 Commands :: Bolt12Receive { description, amount_msat, expiry_secs, quantity } => {
0 commit comments