Add kraken_ticker CLI for local testing of the client
parent
60d6d50246
commit
7575d412b8
@ -0,0 +1,21 @@
|
|||||||
|
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),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue