fix: sembol listesi ve WS stream her zaman canlı Binance'tan
This commit is contained in:
parent
5a43e42a0e
commit
3e2491e1f8
2 changed files with 4 additions and 9 deletions
|
|
@ -18,14 +18,8 @@ pub struct SymbolInfo {
|
|||
}
|
||||
|
||||
pub async fn list_symbols(State(state): State<AppState>) -> impl IntoResponse {
|
||||
let mode = state.current_mode.lock().await.clone();
|
||||
let is_testnet = mode == "testnet";
|
||||
let (key, secret) = if is_testnet {
|
||||
(state.testnet_api_key, state.testnet_api_secret)
|
||||
} else {
|
||||
(state.live_api_key, state.live_api_secret)
|
||||
};
|
||||
let client = BinanceClient::new(key, secret, is_testnet);
|
||||
// Sembol listesi her zaman canlı Binance'tan çekilir
|
||||
let client = BinanceClient::new(state.live_api_key, state.live_api_secret, false);
|
||||
match client.get_usdt_symbols_with_min().await {
|
||||
Ok(mut symbols) => {
|
||||
symbols.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@ impl BotRunner {
|
|||
event_tx: broadcast::Sender<TradeEvent>,
|
||||
) {
|
||||
let client = BinanceClient::new(api_key, api_secret, config.testnet);
|
||||
let ws_base = if config.testnet { BINANCE_TESTNET_WS_URL } else { BINANCE_WS_URL };
|
||||
// Fiyat verisi her zaman canlı Binance stream'inden gelir
|
||||
let ws_base = BINANCE_WS_URL;
|
||||
let stream = format!(
|
||||
"{}/{}@kline_{}",
|
||||
ws_base,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue