Skip to main content

Module binance_rest

Module binance_rest 

Source
Available on crate feature live-binance only.
Expand description

Binance spot REST historical kline fetcher.

Where super::binance streams live klines over a WebSocket, this module pulls historical candles from Binance’s public REST endpoint (GET /api/v3/klines) with a single blocking request. It is the native, dependency-free replacement for hand-rolled urllib / jackson / jsonlite download helpers in every binding.

Example (requires the live-binance feature):

use wickra_data::live::binance::Interval;
use wickra_data::live::binance_rest::fetch_klines;
let candles = fetch_klines("BTCUSDT", Interval::OneHour, 500, None, None)?;
println!("got {} candles", candles.len());

Structs§

BinanceRestConfig
Endpoint configuration for fetch_klines_with_config. The default points at Binance’s public production REST host; tests and Testnet users override base_url to aim the request elsewhere.

Functions§

fetch_klines
Fetch historical klines from Binance’s production endpoint.
fetch_klines_with_config
Like fetch_klines but against a custom BinanceRestConfig (Testnet or a local mock server).