Skip to content

Commit ba77f54

Browse files
committed
_
1 parent 9947e97 commit ba77f54

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
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-3918-lightblue)
5+
![Lines Of Code](https://img.shields.io/badge/LoC-3916-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/binance/market_futures.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use v_exchanges::prelude::*;
44

55
#[tokio::main]
66
async fn main() {
7-
color_eyre::install().unwrap();
8-
v_utils::utils::init_subscriber(v_utils::utils::LogDestination::xdg("v_exchanges"));
7+
v_utils::clientside!();
98

109
let m: AbsMarket = "Binance/Futures".into();
1110
let mut c = m.client();
1211

13-
println!("m: {m}");
12+
println!("market: {m}");
13+
println!("source client: {}", c.source_market());
1414

1515
let exchange_info = c.exchange_info(m).await.unwrap();
1616
dbg!(&exchange_info.pairs.iter().take(2).collect::<Vec<_>>());

examples/binance/market_spot.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use v_exchanges::prelude::*;
22

33
#[tokio::main]
44
async fn main() {
5-
color_eyre::install().unwrap();
6-
v_utils::utils::init_subscriber(v_utils::utils::LogDestination::xdg("v_exchanges"));
5+
v_utils::clientside!();
76

87
let m: AbsMarket = "Binance/Spot".into();
98
let c = m.client();

examples/data.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use v_exchanges::{binance::Binance, bitmex::Bitmex};
33
/// things in here are not on [Exchange](v_exchanges::core::Exchange) trait, so can't use generics, must specify exact exchange client methods are referenced from.
44
#[tokio::main]
55
async fn main() {
6-
color_eyre::install().unwrap();
7-
v_utils::utils::init_subscriber(v_utils::utils::LogDestination::xdg("v_exchanges"));
6+
v_utils::clientside!();
7+
88
let bm = Bitmex::default();
99
let bvol = bm.bvol(2).await.unwrap();
1010
dbg!(&bvol);

v_exchanges/src/bybit/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ pub struct Bybit {
2424
#[async_trait::async_trait]
2525
impl Exchange for Bybit {
2626
fn source_market(&self) -> AbsMarket {
27-
todo!()
27+
self.source_market
2828
}
2929

3030
fn exchange_name(&self) -> &'static str {

v_exchanges/src/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use v_utils::{
1111

1212
//TODO!!!!!!!!!!!!!: klines switch to defining the range via an Enum over either limit either start and end times
1313
#[async_trait::async_trait]
14-
pub trait Exchange: std::fmt::Debug {
14+
pub trait Exchange: std::fmt::Debug + Send {
1515
fn source_market(&self) -> AbsMarket;
1616
fn exchange_name(&self) -> &'static str;
1717
fn auth(&mut self, key: String, secret: String);

v_exchanges/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ pub extern crate v_exchanges_adapters as adapters;
33
pub mod core;
44

55
pub mod prelude {
6-
pub use crate::core::{AbsMarket, Exchange, MarketTrait as _};
6+
//pub use crate::core::{AbsMarket, Exchange, MarketTrait as _};
7+
pub use crate::core::*;
78
}
89
pub use prelude::*;
910

0 commit comments

Comments
 (0)