Skip to content

Commit fe88a35

Browse files
committed
fix(scan): show validator "Registered" timestamp on detail page
Operator noticed the validators page has no "how long has this validator been online" indicator. The chain's legacy /validators endpoint exposes `registered_at` (unix seconds) but the merge in fetchValidators only pulled name + blocks_produced from it. Now carries `registered_at` through to the merged row and renders a "Registered" InfoRow on the detail page under Status. List page stays clean — detail-page surface is the standard explorer pattern (Etherscan's "Created" / Solana Beach's "Started" both live on the detail page, not the list). Field already existed on ValidatorData; no chain-side change needed.
1 parent 49f813c commit fe88a35

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

apps/scan/app/[locale]/validators/[address]/page.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ export default function ValidatorDetailPage({ params }: { params: Promise<{ addr
186186
<InfoRow label="Name" value={validator.name ?? "-"} />
187187
<InfoRow label="Address" value={<Address address={validator.address} truncate={false} />} />
188188
<InfoRow label="Status" value={<span className={`inline-flex items-center gap-1.5 text-sm ${st.color}`}>{st.icon}{st.text}</span>} />
189+
{validator.registered_at !== undefined && validator.registered_at > 0 && (
190+
<InfoRow label="Registered" value={<Timestamp timestamp={validator.registered_at} />} />
191+
)}
189192
{validator.stake !== undefined && (
190193
<InfoRow label="Stake" value={<span className="font-mono">{formatNumber(validator.stake)} SRX</span>} />
191194
)}

apps/scan/lib/api.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ export async function fetchValidators(network: NetworkId) {
553553
return {
554554
...v,
555555
name: v.name ?? legacy?.name ?? "",
556+
// `registered_at` (unix seconds) is on /validators but not /staking/validators.
557+
// Carry it across so the detail page can show "online since <date>".
558+
registered_at: v.registered_at ?? legacy?.registered_at,
556559
// Prefer the larger of the two block counters. /staking/validators
557560
// tracks blocks_signed which can reset on chain restart; legacy
558561
// /validators carries the cumulative blocks_produced. Take whichever

0 commit comments

Comments
 (0)