Skip to content

Commit 01d806d

Browse files
committed
_
1 parent 3e37a82 commit 01d806d

File tree

4 files changed

+8
-13
lines changed

4 files changed

+8
-13
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
![Minimum Supported Rust Version](https://img.shields.io/badge/nightly-1.85+-ab6000.svg)
33
[<img alt="crates.io" src="https://img.shields.io/crates/v/v_exchanges.svg?color=fc8d62&logo=rust" height="20" style=flat-square>](https://crates.io/crates/v_exchanges)
44
[<img alt="docs.rs" src="https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs&style=flat-square" height="20">](https://docs.rs/v_exchanges)
5-
![Lines Of Code](https://img.shields.io/badge/LoC-3924-lightblue)
5+
![Lines Of Code](https://img.shields.io/badge/LoC-3919-lightblue)
66
<br>
77
[<img alt="ci errors" src="https://img.shields.io/github/actions/workflow/status/valeratrades/v_exchanges/errors.yml?branch=master&style=for-the-badge&style=flat-square&label=errors&labelColor=420d09" height="20">](https://github.com/valeratrades/v_exchanges/actions?query=branch%3Amaster) <!--NB: Won't find it if repo is private-->
88
[<img alt="ci warnings" src="https://img.shields.io/github/actions/workflow/status/valeratrades/v_exchanges/warnings.yml?branch=master&style=for-the-badge&style=flat-square&label=warnings&labelColor=d16002" height="20">](https://github.com/valeratrades/v_exchanges/actions?query=branch%3Amaster) <!--NB: Won't find it if repo is private-->

v_exchanges/src/binance/market.rs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,9 @@ pub async fn klines(client: &v_exchanges_adapters::Client, pair: Pair, tf: Timef
2525
});
2626
let params = join_params(base_params, range_params);
2727

28-
let endpoint_prefix = match market {
29-
Market::Spot => "/api/v3",
30-
Market::Futures => "/fapi/v1",
31-
Market::Margin => unimplemented!(),
32-
};
33-
let base_url: BinanceHttpUrl = match market {
34-
Market::Spot => BinanceHttpUrl::Spot,
35-
Market::Futures => BinanceHttpUrl::FuturesUsdM,
28+
let (endpoint_prefix, base_url) = match market {
29+
Market::Spot => ("/api/v3", BinanceHttpUrl::Spot),
30+
Market::Futures => ("/fapi/v1", BinanceHttpUrl::FuturesUsdM),
3631
Market::Margin => unimplemented!(),
3732
};
3833

@@ -51,7 +46,7 @@ pub async fn klines(client: &v_exchanges_adapters::Client, pair: Pair, tf: Timef
5146
low: k.low,
5247
close: k.close,
5348
};
54-
klines.push_front(Kline {
49+
klines.push_back(Kline {
5550
open_time: DateTime::from_timestamp_millis(k.open_time).unwrap(),
5651
ohlc,
5752
volume_quote: k.quote_asset_volume,
@@ -61,7 +56,7 @@ pub async fn klines(client: &v_exchanges_adapters::Client, pair: Pair, tf: Timef
6156
}
6257
false => match i == r_len - 1 {
6358
true => tracing::trace!("Skipped last kline in binance request, as it's incomplete (expected behavior)"),
64-
false => tracing::warn!("Skipped kline in binance request, as it's incomplete"),
59+
false => tracing::warn!("Skipped a kline in binance request, as it's incomplete"),
6560
},
6661
}
6762
}

v_exchanges/src/binance/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mod data;
1+
pub mod data; // interfaced with directly, not through `Exchange` trait, thus must be public.
22
mod futures;
33
mod market;
44
mod spot;

v_exchanges_api_generics/src/http.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ impl Default for RequestConfig {
278278
#[derive(Error, std::fmt::Debug)]
279279
pub enum RequestError<E, R> {
280280
/// An error which occurred while sending a HTTP request.
281-
#[error("failed to send reqeust")]
281+
#[error("failed to send request")]
282282
SendRequest(#[source] reqwest::Error),
283283
/// An error which occurred while receiving a HTTP response.
284284
#[error("failed to receive response")]

0 commit comments

Comments
 (0)