mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-01-11 15:39:37 -05:00
22 lines
519 B
Rust
22 lines
519 B
Rust
|
use anyhow::{Context, Result};
|
||
|
|
||
|
#[tokio::main]
|
||
|
async fn main() -> Result<()> {
|
||
|
tracing::subscriber::set_global_default(
|
||
|
tracing_subscriber::fmt().with_env_filter("trace").finish(),
|
||
|
)?;
|
||
|
|
||
|
let mut ticker = swap::kraken::connect()
|
||
|
.await
|
||
|
.context("Failed to connect to kraken")?;
|
||
|
|
||
|
loop {
|
||
|
ticker.changed().await?;
|
||
|
|
||
|
match &*ticker.borrow() {
|
||
|
Ok(rate) => println!("Rate update: {}", rate),
|
||
|
Err(e) => println!("Error: {:#}", e),
|
||
|
}
|
||
|
}
|
||
|
}
|