mirror of
https://github.com/BitMaker-hub/NerdMiner_v2.git
synced 2025-03-17 21:31:58 +01:00
update BTC price API
This commit is contained in:
parent
f174d623e9
commit
f19eab36a9
@ -157,7 +157,9 @@ String getBTCprice(void){
|
||||
|
||||
DynamicJsonDocument doc(1024);
|
||||
deserializeJson(doc, payload);
|
||||
if (doc.containsKey("last_trade_price")) bitcoin_price = doc["last_trade_price"];
|
||||
if (doc.containsKey("bpi") && doc["bpi"].containsKey("USD")) {
|
||||
bitcoin_price = doc["bpi"]["USD"]["rate_float"].as<unsigned int>();
|
||||
}
|
||||
|
||||
doc.clear();
|
||||
|
||||
@ -168,7 +170,7 @@ String getBTCprice(void){
|
||||
} catch(...) {
|
||||
http.end();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return (String(bitcoin_price) + "$");
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#define UPDATE_PERIOD_h 5
|
||||
|
||||
//API BTC price (Update to USDT cus it's more liquidity and flow price updade)
|
||||
#define getBTCAPI "https://api.blockchain.com/v3/exchange/tickers/BTC-USDT"
|
||||
#define getBTCAPI "https://api.coindesk.com/v1/bpi/currentprice.json"
|
||||
#define UPDATE_BTC_min 1
|
||||
|
||||
//API Block height
|
||||
|
Loading…
x
Reference in New Issue
Block a user