From 1ef277edc55ee87f7fb3bc87c2860c70247041e0 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 13 Aug 2024 18:53:59 +0100 Subject: [PATCH] Change chart endpoints to use get_json route --- static/js/bitcoin-price.js | 2 +- static/js/feerate-percentile.js | 3 ++- static/js/hashrate.js | 3 ++- static/js/miner-rewards.js | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/static/js/bitcoin-price.js b/static/js/bitcoin-price.js index 51cb321..3452cdf 100644 --- a/static/js/bitcoin-price.js +++ b/static/js/bitcoin-price.js @@ -3,7 +3,7 @@ const myChart = echarts.init(document.getElementById("chart")); async function fetchDataForChart() { try { - const apiEndpoint = "https://api.bitlab21.com/price"; + const apiEndpoint = "https://api.bitlab21.com/get_json/final__price.json"; const response = await fetch(apiEndpoint); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); diff --git a/static/js/feerate-percentile.js b/static/js/feerate-percentile.js index d992394..c908451 100644 --- a/static/js/feerate-percentile.js +++ b/static/js/feerate-percentile.js @@ -3,7 +3,8 @@ const myChart = echarts.init(document.getElementById("chart")); async function fetchDataForChart() { try { - const apiEndpoint = "https://api.bitlab21.com/feerates"; + const apiEndpoint = + "https://api.bitlab21.com/get_json/final__feerate_percentiles.json"; const response = await fetch(apiEndpoint); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); diff --git a/static/js/hashrate.js b/static/js/hashrate.js index 01673f2..91d00b6 100644 --- a/static/js/hashrate.js +++ b/static/js/hashrate.js @@ -3,7 +3,8 @@ const myChart = echarts.init(document.getElementById("chart")); async function fetchDataForChart() { try { - const apiEndpoint = "https://api.bitlab21.com/hashrate"; + const apiEndpoint = + "https://api.bitlab21.com/get_json/final__hashrate.json"; const response = await fetch(apiEndpoint); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); diff --git a/static/js/miner-rewards.js b/static/js/miner-rewards.js index f9774e6..44f9db5 100644 --- a/static/js/miner-rewards.js +++ b/static/js/miner-rewards.js @@ -3,7 +3,8 @@ const myChart = echarts.init(document.getElementById("chart")); async function fetchDataForChart() { try { - const apiEndpoint = "https://api.bitlab21.com/miner_rewards"; + const apiEndpoint = + "https://api.bitlab21.com/get_json/final__miner_rewards.json"; const response = await fetch(apiEndpoint); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`);