feat(explorer): dynamic feeds, wallet SSR alignment, and detail pagination
Align wallet SSR with report token-list, dedupe featured v1 tokens, refresh home and wallet snapshots on a 60s cadence, and drive vanilla SPA chain add/watch from API metadata. Add shared pagination/tabs for address, token, and transaction pages, extend token aggregation helpers, and harden stats API with tests and health checks. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -201,6 +201,31 @@ for url in external_roots:
|
||||
except Exception as exc:
|
||||
print(f"ERR {url} [{exc}]")
|
||||
|
||||
print("\n== Native ETH USD (token-aggregation WETH proxy) ==")
|
||||
weth = "0xc02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
|
||||
try:
|
||||
cg = session.get(
|
||||
"https://api.coingecko.com/api/v3/simple/price",
|
||||
params={"ids": "ethereum", "vs_currencies": "usd"},
|
||||
timeout=15,
|
||||
).json()
|
||||
cg_usd = float(cg["ethereum"]["usd"])
|
||||
ta = session.get(
|
||||
f"{base}/token-aggregation/api/v1/tokens/{weth}",
|
||||
params={"chainId": 138},
|
||||
timeout=20,
|
||||
).json()
|
||||
ta_usd = float(ta["token"]["market"]["priceUsd"])
|
||||
delta_pct = abs(ta_usd - cg_usd) / cg_usd * 100.0
|
||||
layer = ta.get("token", {}).get("pricing", {}).get("sourceLayer", "")
|
||||
print(f" coingecko=${cg_usd:.2f} explorer=${ta_usd:.2f} delta={delta_pct:.2f}% layer={layer}")
|
||||
if abs(ta_usd - 2490.0) < 0.01:
|
||||
mark_failure(" ETH price still at stale repo snapshot $2490")
|
||||
if delta_pct > 5.0:
|
||||
mark_failure(f" ETH price drift {delta_pct:.2f}% exceeds 5% vs CoinGecko")
|
||||
except Exception as exc:
|
||||
mark_failure(f" native ETH price check failed: {exc}")
|
||||
|
||||
if failed:
|
||||
sys.exit(1)
|
||||
PY
|
||||
|
||||
Reference in New Issue
Block a user