cbat 0.0.19

The unofficial Rust crate for the Coinbase Advanced Trade API
Documentation
use serde::Deserialize;

#[derive(Debug, Clone, Deserialize)]
pub struct Ticker {
    #[serde(rename = "type")]
    pub ticker_type: String,
    pub product_id: String,
    pub price: String,
    pub volume_24_h: String,
    pub low_24_h: String,
    pub high_24_h: String,
    pub low_52_w: String,
    pub high_52_w: String,
    pub price_percent_chg_24_h: String,
    pub best_bid: String,
    pub best_bid_quantity: String,
    pub best_ask: String,
    pub best_ask_quantity: String,
}

#[derive(Debug, Clone, Deserialize)]
pub struct TickerEvent {
    #[serde(rename = "type")]
    pub event_type: String,
    pub tickers: Vec<Ticker>,
}

#[derive(Debug, Clone, Deserialize)]
pub struct TickerMessage {
    pub channel: String,
    pub client_id: String,
    pub timestamp: String,
    pub sequence_num: i64,
    pub events: Vec<TickerEvent>,
}