mirror of
https://github.com/BitMaker-hub/NerdMiner_v2.git
synced 2025-09-27 19:16:12 +02:00
Merge pull request #677 from BitMaker-hub/develop
fix bitcoin price update
This commit is contained in:
@@ -178,7 +178,9 @@ String getBTCprice(void){
|
||||
StaticJsonDocument<1024> doc;
|
||||
deserializeJson(doc, payload);
|
||||
|
||||
if (doc.containsKey("last_trade_price")) bitcoin_price = doc["last_trade_price"];
|
||||
if (doc.containsKey("bitcoin") && doc["bitcoin"].containsKey("usd")) {
|
||||
bitcoin_price = doc["bitcoin"]["usd"];
|
||||
}
|
||||
|
||||
doc.clear();
|
||||
|
||||
|
@@ -15,7 +15,8 @@
|
||||
//API BTC price (Update to USDT cus it's more liquidity and flow price updade)
|
||||
|
||||
//#define getBTCAPI "https://api.coindesk.com/v1/bpi/currentprice.json" -- doesn't work anymore
|
||||
#define getBTCAPI "https://api.blockchain.com/v3/exchange/tickers/BTC-USDT"
|
||||
//#define getBTCAPI "https://api.blockchain.com/v3/exchange/tickers/BTC-USDT" -- updates infrequently
|
||||
#define getBTCAPI "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
|
||||
|
||||
#define UPDATE_BTC_min 1
|
||||
|
||||
|
Reference in New Issue
Block a user