From f3fb31e65169b42e28616e04db64cd6157249cec Mon Sep 17 00:00:00 2001 From: Local Dev Date: Tue, 22 Sep 2026 21:31:43 +0200 Subject: [PATCH] =?UTF-8?q?chore(aegis):=200.8.5=20=E2=80=94=20Coin-Spectr?= =?UTF-8?q?um=20price=20parser=20reads=20body.asset.price=5Fusd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every Coin-Spectrum poll silently returned an empty map because we were reading body.price_usd (top-level) while the API wraps its data under body.asset. Every chain's Number(undefined) came back NaN, so Settings › Prices showed "✓ 0 coins" and majority-vote reconciliation had one fewer source than intended. Now reads body.asset.price_usd (with a top-level fallback in case the API is ever flattened). --- bundled-addons/aegis/addon.json | 2 +- bundled-addons/aegis/lib/prices.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bundled-addons/aegis/addon.json b/bundled-addons/aegis/addon.json index f4caa1c7..ac3ccce7 100644 --- a/bundled-addons/aegis/addon.json +++ b/bundled-addons/aegis/addon.json @@ -1,7 +1,7 @@ { "id": "aegis", "name": "Aegis Wallet", - "version": "0.8.4", + "version": "0.8.5", "category": "plugin", "description": "Multi-chain wallet (BCH, BTC, TRX, ETH, SOL, SC, DGB) derived from your Theseus vault. Dapps get window.bitcoincash on .x sites; window.tronWeb / window.tronLink / window.ethereum / window.solana on any https page.", "author": "Silent Mode", diff --git a/bundled-addons/aegis/lib/prices.js b/bundled-addons/aegis/lib/prices.js index 9e91f58f..91c049d5 100644 --- a/bundled-addons/aegis/lib/prices.js +++ b/bundled-addons/aegis/lib/prices.js @@ -111,7 +111,11 @@ const SOURCES = { const r = await fetch(`https://coin-spectrum.com/api/v1/assets/${slug}.json`, { cache: "no-store" }); if (!r.ok) return; const body = await r.json(); - const usd = Number(body?.price_usd); + // coin-spectrum wraps everything under body.asset: + // { generated_at, asset: { slug, symbol, price_usd, … } } + // Older builds read body.price_usd, which is undefined, so every + // chain silently NaN'd and the UI showed "✓ 0 coins". + const usd = Number(body?.asset?.price_usd ?? body?.price_usd); if (Number.isFinite(usd) && usd > 0) out[chain] = usd; } catch { /* one slug failing shouldn't kill the others */ } }));