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 TradedCommand {
    /// User address (0x-prefixed, 40 hex chars)
    #[arg(short, long)]
    user: String,
}

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