polyoxide_binance/lib.rs
1//! Rust client for Binance USDⓈ-M futures public market data
2//! (`fapi.binance.com`) and, with the `ws` feature, its market streams
3//! (`fstream.binance.com`).
4//!
5//! No credentials are needed. Every request is charged against a
6//! [`WeightBudget`], because Binance limits each IP by request *weight*, which
7//! varies by route and parameters, rather than by request count.
8//!
9//! ```no_run
10//! use polyoxide_binance::{usdm::types::Symbol, Usdm};
11//!
12//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
13//! let usdm = Usdm::new()?;
14//! let btc = Symbol::new("BTCUSDT")?;
15//! let index = usdm.market().premium_index(&btc).send().await?;
16//! println!("BTCUSDT mark {} funding {}", index.mark_price, index.last_funding_rate);
17//! # Ok(())
18//! # }
19//! ```
20
21#[cfg(doctest)]
22#[doc = include_str!("../README.md")]
23struct ReadmeDoctests;
24
25pub mod error;
26pub mod usdm;
27pub mod weight;
28
29pub use error::BinanceError;
30pub use usdm::{Usdm, UsdmBuilder};
31pub use weight::WeightBudget;