瀏覽代碼

add more klines(to fetch) to initial kline fetch method

Berke 1 年之前
父節點
當前提交
e5160f2d78
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/ws_binance.rs

+ 1 - 1
src/ws_binance.rs

@@ -213,7 +213,7 @@ impl From<FetchedKlines> for Kline {
     }
 }
 pub async fn fetch_klines(ticker: String) -> Result<Vec<Kline>, reqwest::Error> {
-    let url = format!("https://fapi.binance.com/fapi/v1/klines?symbol={}&interval=1m&limit=30", ticker.to_lowercase());
+    let url = format!("https://fapi.binance.com/fapi/v1/klines?symbol={}&interval=1m&limit=180", ticker.to_lowercase());
     let response = reqwest::get(&url).await?;
     let value: serde_json::Value = response.json().await?;
     let fetched_klines: Result<Vec<FetchedKlines>, _> = serde_json::from_value(value);