Coinecko API adjustments

This commit is contained in:
aglkm
2026-01-21 01:43:55 +03:00
parent a45e371b52
commit fb97449c2a
2 changed files with 10 additions and 1 deletions
+3 -1
View File
@@ -202,7 +202,9 @@ pub async fn get_market(dashboard: Arc<Mutex<Dashboard>>) -> Result<(), anyhow::
// Call CG API only once every 20 calls (15sec * 20)
if CONFIG.coingecko_api == "enabled" && count % 20 == 0 {
client = reqwest::Client::new();
result = client.get("https://api.coingecko.com/api/v3/simple/price?ids=grin&vs_currencies=usd%2Cbtc&include_24hr_vol=true").send().await?;
result = client.get("https://api.coingecko.com/api/v3/simple/price?ids=grin&vs_currencies=usd%2Cbtc&include_24hr_vol=true")
.header("User-Agent", "https://github.com/aglkm/grin-explorer")
.send().await?;
val = serde_json::from_str(&result.text().await?)?;
}
+7
View File
@@ -353,6 +353,13 @@
</div>
</div>
</div>
{% if cg_api == "enabled" %}
<div class="row mb-2">
<div class="d-flex justify-content-center">
<span style="color:grey">Price data by CoinGecko</span>
</div>
</div>
{% endif %}
</div>
</code>
</footer>