feat(portal): wire Solace portal (all 7 pages) to live Chain-138 RPC + SolaceScan Explorer #2

Merged
nsatoshi merged 6 commits from devin/1776532671-solace-bank-portal into main 2026-04-22 17:15:29 +00:00
Showing only changes of commit 23638844e4 - Show all commits

View File

@@ -25,7 +25,15 @@ export interface ExplorerStats {
}
export async function getExplorerStats(): Promise<ExplorerStats> {
return httpJson<ExplorerStats>(api('/stats'));
const raw = await httpJson<ExplorerStats>(api('/stats'));
// Blockscout returns `average_block_time` in milliseconds; normalize to seconds
// so callers can display `${value.toFixed(1)}s` directly. Chain-138 block time
// is ~4s, so a raw value > 60 is a reliable signal that it is still in ms.
const average_block_time =
typeof raw.average_block_time === 'number' && raw.average_block_time > 60
? raw.average_block_time / 1000
: raw.average_block_time;
return { ...raw, average_block_time };
}
export interface ExplorerBlock {