Skip to content

Commit 848b178

Browse files
committed
_
1 parent fa483d5 commit 848b178

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-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-3757-lightblue)
5+
![Lines Of Code](https://img.shields.io/badge/LoC-3759-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-->

examples/bybit/market.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,8 @@ async fn main() {
1414
let m = bybit::Market::Linear;
1515
let mut bb = m.client();
1616

17-
//let ticker: serde_json::Value =
18-
//bb.get("/v5/market/tickers", &[("category", "spot"), ("symbol", "BTCUSDT")], [BybitOption::Default])
19-
// .await
20-
// .expect("failed to get ticker");
21-
//println!("Ticker:\n{ticker}");
22-
23-
//let klines = bb.futures_klines(("BTC", "USDT").into(), "1m".into(), 2.into()).await.unwrap();
24-
//dbg!(&klines);
17+
let klines = bb.klines(("BTC", "USDT").into(), "1m".into(), 2.into(), m).await.unwrap();
18+
dbg!(&klines);
2519
let price = bb.price(("BTC", "USDT").into(), m).await.unwrap();
2620
dbg!(&price);
2721

v_exchanges/src/binance/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub enum Market {
7171
Margin,
7272
}
7373
impl crate::core::MarketTrait for Market {
74-
type Client = Binance;
74+
type Ex = Binance;
7575

7676
fn client(&self) -> Binance {
7777
Binance::default()

v_exchanges/src/bybit/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub enum Market {
6969
Inverse,
7070
}
7171
impl crate::core::MarketTrait for Market {
72-
type Client = Bybit;
72+
type Ex = Bybit;
7373

7474
fn client(&self) -> Bybit {
7575
Bybit::default()

v_exchanges/src/core.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ pub trait Exchange {
4141

4242
// Market {{{
4343
pub trait MarketTrait {
44-
type Client: Exchange;
45-
fn client(&self) -> Self::Client;
44+
type Ex: Exchange;
45+
fn client(&self) -> Self::Ex;
4646
fn fmt_abs(&self) -> String;
4747
//TODO; require them to impl Display and FromStr
4848
}

0 commit comments

Comments
 (0)