Skip to content

Commit 7546ae0

Browse files
committed
Add Cli command for Bolt11Receive
1 parent b685389 commit 7546ae0

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

cli/src/main.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::{Parser, Subcommand};
22
use client::client::LdkNodeServerClient;
33
use client::error::LdkNodeServerError;
4-
use client::protos::{OnchainReceiveRequest, OnchainSendRequest};
4+
use client::protos::{Bolt11ReceiveRequest, OnchainReceiveRequest, OnchainSendRequest};
55

66
#[derive(Parser, Debug)]
77
#[command(version, about, long_about = None)]
@@ -24,6 +24,14 @@ enum Commands {
2424
#[arg(long)]
2525
send_all: Option<bool>,
2626
},
27+
Bolt11Receive {
28+
#[arg(short, long)]
29+
description: String,
30+
#[arg(short, long)]
31+
expiry_secs: u32,
32+
#[arg(long)]
33+
amount_msat: Option<u64>,
34+
},
2735
}
2836

2937
#[tokio::main]
@@ -40,6 +48,13 @@ async fn main() {
4048
client.onchain_send(OnchainSendRequest { address, amount_sats, send_all }).await,
4149
);
4250
},
51+
Commands::Bolt11Receive { description, expiry_secs, amount_msat } => {
52+
handle_response(
53+
client
54+
.bolt11_receive(Bolt11ReceiveRequest { description, expiry_secs, amount_msat })
55+
.await,
56+
);
57+
},
4358
}
4459
}
4560

0 commit comments

Comments
 (0)