[−][src]Function crypto_markets::fetch_markets
pub fn fetch_markets(
exchange: &str,
market_type: MarketType
) -> Result<Vec<Market>, Error>
Fetch trading markets of a cryptocurrency exchange.
Arguments
exchange
- The exchange namemarket_type
- The market type
Example
use crypto_markets::{fetch_markets, MarketType}; let markets = fetch_markets("binance", MarketType::Spot).unwrap(); assert!(!markets.is_empty()); println!("{}", serde_json::to_string_pretty(&markets).unwrap())