chore(aegis): 0.8.5 — Coin-Spectrum price parser reads body.asset.price_usd
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).
This commit is contained in:
parent
e03c728116
commit
f3fb31e651
2 changed files with 6 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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 */ }
|
||||
}));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue