global: MASSIVE snapshot

This commit is contained in:
nym21
2026-01-02 19:08:20 +01:00
parent ac6175688d
commit 3e9b1cc2b2
462 changed files with 34975 additions and 20072 deletions

View File

@@ -73,7 +73,8 @@ impl Binance {
default_retry(|_| {
let url = Self::url("interval=1m&limit=1000");
info!("Fetching {url} ...");
let json: Value = serde_json::from_slice(minreq::get(url).send()?.as_bytes())?;
let json: Value =
serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?;
Self::parse_ohlc_array(&json)
})
}
@@ -95,7 +96,8 @@ impl Binance {
default_retry(|_| {
let url = Self::url("interval=1d");
info!("Fetching {url} ...");
let json: Value = serde_json::from_slice(minreq::get(url).send()?.as_bytes())?;
let json: Value =
serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?;
Self::parse_date_ohlc_array(&json)
})
}
@@ -205,6 +207,7 @@ impl Binance {
pub fn ping() -> Result<()> {
minreq::get("https://api.binance.com/api/v3/ping")
.with_timeout(10)
.send()?;
Ok(())
}

View File

@@ -46,7 +46,8 @@ impl BRK {
);
info!("Fetching {url} ...");
let body: Value = serde_json::from_slice(minreq::get(url).send()?.as_bytes())?;
let body: Value =
serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?;
body.as_array()
.ok_or(Error::Parse("Expected JSON array".into()))?
@@ -86,7 +87,8 @@ impl BRK {
);
info!("Fetching {url}...");
let body: Value = serde_json::from_slice(minreq::get(url).send()?.as_bytes())?;
let body: Value =
serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?;
body.as_array()
.ok_or(Error::Parse("Expected JSON array".into()))?
@@ -120,6 +122,7 @@ impl BRK {
pub fn ping() -> Result<()> {
minreq::get(API_URL)
.with_timeout(10)
.send()?;
Ok(())
}

View File

@@ -39,7 +39,8 @@ impl Kraken {
default_retry(|_| {
let url = Self::url(1);
info!("Fetching {url} ...");
let json: Value = serde_json::from_slice(minreq::get(url).send()?.as_bytes())?;
let json: Value =
serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?;
Self::parse_ohlc_response(&json)
})
}
@@ -60,7 +61,8 @@ impl Kraken {
default_retry(|_| {
let url = Self::url(1440);
info!("Fetching {url} ...");
let json: Value = serde_json::from_slice(minreq::get(url).send()?.as_bytes())?;
let json: Value =
serde_json::from_slice(minreq::get(url).with_timeout(30).send()?.as_bytes())?;
Self::parse_date_ohlc_response(&json)
})
}
@@ -96,6 +98,7 @@ impl Kraken {
pub fn ping() -> Result<()> {
minreq::get("https://api.kraken.com/0/public/Time")
.with_timeout(10)
.send()?;
Ok(())
}