A rock-solid cryprocurrency crawler.
```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawltrade, MarketType, Message};
fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));
// Crawl BitMEX inverse_swap market, for all symbols
crawl_trade("bitmex", MarketType::InverseSwap, None, on_msg, None);
} ```
```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll2_event, MarketType, Message};
fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));
// Crawl BitMEX inverse_swap market, for all symbols
crawl_l2_event("bitmex", MarketType::InverseSwap, None, on_msg, None);
} ```
```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll2_snapshot, MarketType, Message};
fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));
// Crawl BitMEX inverse_swap market level2 orderbook snapshots every 60 seconds, for all symbols
crawl_l2_snapshot("bitmex", MarketType::InverseSwap, None, on_msg, Some(60), None);
} ```
```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll3_event, MarketType, Message};
fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));
// Crawl CoinbasePro spot market, for all symbols
crawl_l3_event("coinbase_pro", MarketType::Spot, None, on_msg, None);
} ```
```rust use std::sync::{Arc, Mutex}; use cryptocrawler::{crawll3_snapshot, MarketType, Message};
fn main() { let on_msg = Arc::new(Mutex::new(|msg: Message| { println!("{}", msg); }));
// Crawl CoinbasePro spot market level2 orderbook snapshots every 60 seconds, for all symbols
crawl_l3_snapshot("coinbase_pro", MarketType::Spot, None, on_msg, Some(60), None);
} ```