xapi-binance 0.0.1

Binance API client
Documentation
use crate::data::enums::price_qty::BnPriceQty;
use serde::{Deserialize, Serialize};
use typed_builder::TypedBuilder;
use xapi_shared::data::crypto_symbol::CryptoSymbol;

#[derive(Debug, TypedBuilder, Serialize)]
pub struct BnGetOrderBookParams {
    #[builder(setter(into))]
    pub symbol: CryptoSymbol,

    /// spot: Default: 100; Maximum: 5000.
    /// usdm: Default 500; Valid limits:[5, 10, 20, 50, 100, 500, 1000]
    #[builder(default, setter(strip_option))]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub limit: Option<u32>,
}

#[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BnSpotOrderBook {
    pub last_update_id: u64,
    pub bids: Vec<BnPriceQty>,
    pub asks: Vec<BnPriceQty>,
}