Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ pub enum Commands {
/// Invoice string
#[arg(short, long)]
invoice: Option<String>,
/// Amount of fiat to buy
/// Amount of fiat to pay (someone is selling sats, you are buying)
#[arg(short, long)]
amount: Option<u32>,
},
Expand All @@ -154,7 +154,7 @@ pub enum Commands {
/// Order id
#[arg(short, long)]
order_id: Uuid,
/// Amount of fiat to sell
/// Amount of fiat to receive (someone is buying sats, you are selling)
#[arg(short, long)]
amount: Option<u32>,
},
Expand Down
8 changes: 6 additions & 2 deletions src/cli/take_order.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub async fn execute_take_order(
amount: Option<u32>,
ctx: &Context,
) -> Result<()> {
let action_name = match action {
let action_name = match &action {
Action::TakeBuy => "take buy",
Action::TakeSell => "take sell",
_ => return Err(anyhow::anyhow!("Invalid action for take order")),
Expand All @@ -79,9 +79,13 @@ pub async fn execute_take_order(
table.add_row(create_emoji_field_row("⚡ ", "Invoice", inv));
}
if let Some(amt) = amount {
let amount_label = match &action {
Action::TakeBuy | Action::TakeSell => "Fiat Amount",
_ => "Amount (sats)",
};
table.add_row(create_emoji_field_row(
"💰 ",
"Amount (sats)",
amount_label,
&amt.to_string(),
Comment thread
coderabbitai[bot] marked this conversation as resolved.
));
}
Expand Down