|
|
@@ -21,7 +21,7 @@ use screen::{
|
|
|
modal::{confirmation_modal, dashboard_modal}
|
|
|
};
|
|
|
use data_providers::{
|
|
|
- binance, bybit, Exchange, MarketType, StreamType, Ticker, TickerInfo, TickerStats, Timeframe
|
|
|
+ binance, china_futures, Exchange, MarketType, StreamType, Ticker, TickerInfo, TickerStats, Timeframe
|
|
|
};
|
|
|
use window::{window_events, Window, WindowEvent};
|
|
|
use iced::{
|
|
|
@@ -169,8 +169,8 @@ impl State {
|
|
|
Exchange::BinanceFutures | Exchange::BinanceSpot => {
|
|
|
fetch_ticker_info(*exchange, binance::fetch_ticksize(*market_type))
|
|
|
}
|
|
|
- Exchange::BybitLinear | Exchange::BybitSpot => {
|
|
|
- fetch_ticker_info(*exchange, bybit::fetch_ticksize(*market_type))
|
|
|
+ Exchange::ChinaFutures => {
|
|
|
+ fetch_ticker_info(*exchange, china_futures::fetch_ticksize(*market_type))
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -178,8 +178,8 @@ impl State {
|
|
|
Exchange::BinanceFutures | Exchange::BinanceSpot => {
|
|
|
fetch_ticker_prices(*exchange, binance::fetch_ticker_prices(*market_type))
|
|
|
}
|
|
|
- Exchange::BybitLinear | Exchange::BybitSpot => {
|
|
|
- fetch_ticker_prices(*exchange, bybit::fetch_ticker_prices(*market_type))
|
|
|
+ Exchange::ChinaFutures => {
|
|
|
+ fetch_ticker_prices(*exchange, china_futures::fetch_ticker_prices(*market_type))
|
|
|
}
|
|
|
};
|
|
|
|
|
|
@@ -197,7 +197,7 @@ impl State {
|
|
|
active_modal: DashboardModal::None,
|
|
|
notification: None,
|
|
|
tickers_info,
|
|
|
- show_tickers_dashboard: false,
|
|
|
+ show_tickers_dashboard: true,
|
|
|
sidebar_location: saved_state.sidebar,
|
|
|
tickers_table: TickersTable::new(saved_state.favorited_tickers),
|
|
|
confirmation_dialog: None,
|
|
|
@@ -434,9 +434,9 @@ impl State {
|
|
|
self.tickers_table.update_table(exchange, tickers_info);
|
|
|
}
|
|
|
Message::FetchAndUpdateTickersTable => {
|
|
|
- let bybit_linear_fetch = fetch_ticker_prices(
|
|
|
- Exchange::BybitLinear,
|
|
|
- bybit::fetch_ticker_prices(MarketType::LinearPerps),
|
|
|
+ let china_futures_fetch = fetch_ticker_prices(
|
|
|
+ Exchange::ChinaFutures,
|
|
|
+ china_futures::fetch_ticker_prices(MarketType::LinearPerps),
|
|
|
);
|
|
|
let binance_linear_fetch = fetch_ticker_prices(
|
|
|
Exchange::BinanceFutures,
|
|
|
@@ -446,16 +446,11 @@ impl State {
|
|
|
Exchange::BinanceSpot,
|
|
|
binance::fetch_ticker_prices(MarketType::Spot),
|
|
|
);
|
|
|
- let bybit_spot_fetch = fetch_ticker_prices(
|
|
|
- Exchange::BybitSpot,
|
|
|
- bybit::fetch_ticker_prices(MarketType::Spot),
|
|
|
- );
|
|
|
|
|
|
return Task::batch(vec![
|
|
|
- bybit_linear_fetch,
|
|
|
+ china_futures_fetch,
|
|
|
binance_linear_fetch,
|
|
|
binance_spot_fetch,
|
|
|
- bybit_spot_fetch,
|
|
|
]);
|
|
|
}
|
|
|
Message::TickersTable(message) => {
|
|
|
@@ -932,8 +927,8 @@ impl State {
|
|
|
.map(move |evt| create_market_event(exchange, evt));
|
|
|
Subscription::run_with_id(ticker, stream)
|
|
|
},
|
|
|
- Exchange::BybitLinear | Exchange::BybitSpot => {
|
|
|
- let stream = bybit::connect_market_stream(ticker)
|
|
|
+ Exchange::ChinaFutures => {
|
|
|
+ let stream = china_futures::connect_market_stream(ticker)
|
|
|
.map(move |evt| create_market_event(exchange, evt));
|
|
|
Subscription::run_with_id(ticker, stream)
|
|
|
},
|
|
|
@@ -947,8 +942,8 @@ impl State {
|
|
|
let kline_streams_id: Vec<(Ticker, Timeframe)> = kline_streams.clone();
|
|
|
|
|
|
let market_type = match exchange {
|
|
|
- Exchange::BinanceFutures | Exchange::BybitLinear => MarketType::LinearPerps,
|
|
|
- Exchange::BinanceSpot | Exchange::BybitSpot => MarketType::Spot,
|
|
|
+ Exchange::BinanceFutures | Exchange::ChinaFutures => MarketType::LinearPerps,
|
|
|
+ Exchange::BinanceSpot => MarketType::Spot,
|
|
|
};
|
|
|
|
|
|
let kline_subscription = match exchange {
|
|
|
@@ -961,8 +956,8 @@ impl State {
|
|
|
|
|
|
Subscription::run_with_id(kline_streams_id, stream)
|
|
|
},
|
|
|
- Exchange::BybitLinear | Exchange::BybitSpot => {
|
|
|
- let stream = bybit::connect_kline_stream(
|
|
|
+ Exchange::ChinaFutures => {
|
|
|
+ let stream = china_futures::connect_kline_stream(
|
|
|
kline_streams,
|
|
|
market_type,
|
|
|
)
|