use coinpaprika_api::client::Client; use coinpaprika_api::exchanges::{Exchange, ExchangeMarket}; use std::error::Error; #[tokio::main] async fn main() -> Result<(), Box> { let client = Client::new(); // // Get exchanges. // let exchanges: Vec = client.exchanges().quotes(vec!["PLN"]).send().await?; println!( "first 3 exchanges: {:#?}", exchanges.iter().take(3).collect::>() ); // // Get "binance" exchange. // let exchange: Exchange = client .exchange("binance") .quotes(vec!["CZK", "USD"]) .send() .await?; println!("exchange info: {:#?}", exchange); // // Get "binance" exchange markets. // let exchange_markets: Vec = client .exchange_markets("binance") .quotes(vec!["GBP"]) .send() .await?; println!( "first 3 exchange markets: {:#?}", exchange_markets .iter() .take(3) .collect::>() ); Ok(()) }