diff --git a/explorer/src/components/StatsCard.tsx b/explorer/src/components/StatsCard.tsx index 09ebddaa02..c404531249 100644 --- a/explorer/src/components/StatsCard.tsx +++ b/explorer/src/components/StatsCard.tsx @@ -62,12 +62,16 @@ function StatsCardBody() { } const currentBlock = rootSlot.toLocaleString("en-US"); - const { avgBlockTime_1min, epochInfo } = dashboardInfo; + const { avgBlockTime_1h, avgBlockTime_1min, epochInfo } = dashboardInfo; + const hourlyBlockTime = Math.round(1000 * avgBlockTime_1h); const averageBlockTime = Math.round(1000 * avgBlockTime_1min) + "ms"; const { slotIndex, slotsInEpoch } = epochInfo; const currentEpoch = epochInfo.epoch.toString(); const epochProgress = ((100 * slotIndex) / slotsInEpoch).toFixed(1) + "%"; - const epochTimeRemaining = slotsToHumanString(slotsInEpoch - slotIndex); + const epochTimeRemaining = slotsToHumanString( + slotsInEpoch - slotIndex, + hourlyBlockTime + ); const averageTps = Math.round(performanceInfo.avgTPS); const transactionCount = ; diff --git a/explorer/src/utils/index.tsx b/explorer/src/utils/index.tsx index 3e88917821..e7fb806bfb 100644 --- a/explorer/src/utils/index.tsx +++ b/explorer/src/utils/index.tsx @@ -52,6 +52,9 @@ HUMANIZER.addLanguage("short", { decimal: ".", }); -export function slotsToHumanString(slots: number): string { - return HUMANIZER.humanize(slots * MS_PER_SLOT); +export function slotsToHumanString( + slots: number, + slotTime = MS_PER_SLOT +): string { + return HUMANIZER.humanize(slots * slotTime); }