diff --git a/index.html b/index.html index 025d152afdd7965f5843299c8378ac34386095eb..ba29a147408158fa4ebb7a89c8d315a1839a6cc9 100644 --- a/index.html +++ b/index.html @@ -250,12 +250,14 @@ a { -->
-

$ 1.49

+

$ 1.49

--> -
+

Why so many options?

@@ -605,6 +607,22 @@ a { return decodeURIComponent(name[1]); } + function fetchHivedexPrice() { + try { + fetch('https://api2.hivedex.io/price').then(res => res.json()).then(res => { + if ('price' in res && 'assets' in res && Array.isArray(res.assets) && !isNaN(res.price)) { + document.getElementById('hivedex-price').textContent = `$ ${res.price}` + const assets = [] + for (let i = 0; i < res.assets.length; i++) { + assets.push(res.assets[i].currency) + } + document.getElementById('hivedex-assets').textContent = assets.join(', ') + } + }).catch(_e => {}) + } catch (_e) {} + } + fetchHivedexPrice() + })();