polyte-cli 0.4.0

CLI tool for querying Polymarket Gamma API
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use clap::Args;
use color_eyre::eyre::Result;
use polyte_data::DataApi;

#[derive(Args)]
pub struct LiveVolumeCommand {
    /// Event ID (must be >= 1)
    #[arg(short, long)]
    pub event_id: u64,
}

impl LiveVolumeCommand {
    pub async fn run(self, data: &DataApi) -> Result<()> {
        let volume = data.live_volume().get(self.event_id).await?;
        println!("{}", serde_json::to_string_pretty(&volume)?);
        Ok(())
    }
}