2021-03-04 21:39:42 -05:00
|
|
|
use anyhow::{Context, Result};
|
|
|
|
|
|
|
|
#[tokio::main]
|
|
|
|
async fn main() -> Result<()> {
|
|
|
|
tracing::subscriber::set_global_default(
|
2021-03-08 23:35:22 -05:00
|
|
|
tracing_subscriber::fmt().with_env_filter("debug").finish(),
|
2021-03-04 21:39:42 -05:00
|
|
|
)?;
|
|
|
|
|
2021-03-08 23:35:22 -05:00
|
|
|
let mut ticker = swap::kraken::connect().context("Failed to connect to kraken")?;
|
2021-03-04 21:39:42 -05:00
|
|
|
|
|
|
|
loop {
|
2021-03-04 21:52:24 -05:00
|
|
|
match ticker.wait_for_update().await? {
|
2021-03-04 21:39:42 -05:00
|
|
|
Ok(rate) => println!("Rate update: {}", rate),
|
|
|
|
Err(e) => println!("Error: {:#}", e),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|