const o="/api/v1";async function c(){try{const t=await fetch("/api/active");return t.ok?await t.json():(console.warn("Failed to check API status, assuming inactive"),!1)}catch(t){return console.error("Error checking API status:",t),!1}}const n={XTZ:{price:.5748,price_change_percentage_24h:a()},LRC:{price:.1073,price_change_percentage_24h:a()}};function a(){return(Math.random()*10-5).toFixed(2)}async function s(){if(!await c())return console.warn("CoinGecko API is inactive, returning empty array"),[];try{const e=await fetch(`${o}/tokens`);if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return[...await e.json(),...Object.keys(n)]}catch(e){console.error("Error loading tokens from API:",e);const r=["BTC","ETH","USDT","BNB","ADA","SOL","POL","LINK"];return console.warn("Using fallback tokens:",r),[...r,...Object.keys(n)]}}export{n as C,c as i,s as l};
