Skip to content

Commit cbe6ea6

Browse files
committed
Add Cli command for Bolt12Send
1 parent 68473b5 commit cbe6ea6

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

cli/src/main.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use clap::{Parser, Subcommand};
22
use client::client::LdkNodeServerClient;
33
use client::error::LdkNodeServerError;
44
use client::protos::{
5-
Bolt11ReceiveRequest, Bolt11SendRequest, Bolt12ReceiveRequest, OnchainReceiveRequest,
6-
OnchainSendRequest,
5+
Bolt11ReceiveRequest, Bolt11SendRequest, Bolt12ReceiveRequest, Bolt12SendRequest,
6+
OnchainReceiveRequest, OnchainSendRequest,
77
};
88

99
#[derive(Parser, Debug)]
@@ -47,6 +47,16 @@ enum Commands {
4747
#[arg(long)]
4848
amount_msat: Option<u64>,
4949
},
50+
Bolt12Send {
51+
#[arg(short, long)]
52+
offer: String,
53+
#[arg(long)]
54+
amount_msat: Option<u64>,
55+
#[arg(short, long)]
56+
quantity: Option<u64>,
57+
#[arg(short, long)]
58+
payer_note: Option<String>,
59+
},
5060
}
5161

5262
#[tokio::main]
@@ -78,6 +88,13 @@ async fn main() {
7888
client.bolt12_receive(Bolt12ReceiveRequest { description, amount_msat }).await,
7989
);
8090
},
91+
Commands::Bolt12Send { offer, amount_msat, quantity, payer_note } => {
92+
handle_response(
93+
client
94+
.bolt12_send(Bolt12SendRequest { offer, amount_msat, quantity, payer_note })
95+
.await,
96+
);
97+
},
8198
}
8299
}
83100

0 commit comments

Comments
 (0)