Skip to content

Commit

Permalink
Format swap info in cli app (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-21 authored Dec 20, 2024
1 parent 6b8307c commit be2b12e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/node/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1322,7 +1322,18 @@ fn print_activity(activity: Activity) -> Result<()> {
if let Some(incoming_payment_info) = incoming_payment_info {
print_incoming_payment(incoming_payment_info)?;
}
println!(" Swap: {swap_info:?}");
let created_at: DateTime<Utc> = swap_info.created_at.time.into();
let timezone = FixedOffset::east_opt(swap_info.created_at.timezone_utc_offset_secs)
.ok_or(anyhow!("east_opt failed"))?;
let created_at = created_at
.with_timezone(&timezone)
.format("%d/%m/%Y %T UTC");
println!(" Swap address: {}", swap_info.bitcoin_address);
println!(" Swap created at: {created_at}");
println!(
" Swap amount: {}",
amount_to_string(&swap_info.paid_amount)
);
Ok(())
}
Activity::ReverseSwap {
Expand Down

0 comments on commit be2b12e

Please sign in to comment.