mostro_client/cli/
list_disputes.rs

1use anyhow::Result;
2
3use crate::cli::Context;
4use crate::parser::common::{print_key_value, print_section_header};
5use crate::parser::disputes::print_disputes_table;
6use crate::util::{fetch_events_list, ListKind};
7
8pub async fn execute_list_disputes(ctx: &Context) -> Result<()> {
9    print_section_header("⚖️  List Disputes");
10    print_key_value("🎯", "Mostro PubKey", &ctx.mostro_pubkey.to_string());
11    print_key_value("💡", "Action", "Fetching disputes from relays...");
12    println!();
13
14    // Get orders from relays
15    let table_of_disputes =
16        fetch_events_list(ListKind::Disputes, None, None, None, ctx, None).await?;
17    let table = print_disputes_table(table_of_disputes)?;
18    println!("{table}");
19
20    Ok(())
21}