(function () { const meta = document.querySelector('meta[name="reserve-api-base"]'); const apiBase = (meta && meta.content) || '/api/v1'; const institutional = document.body.dataset.institutional === '1'; const els = { status: document.getElementById('load-status'), refreshed: document.getElementById('refreshed-at'), quorum: document.getElementById('quorum-summary'), metrics: document.getElementById('metrics-grid'), proof: document.getElementById('proof-points'), gate: document.getElementById('gate-kv'), triple: document.getElementById('triple-kv'), raw: document.getElementById('raw-json'), rawSection: document.getElementById('raw-section'), }; function fmtUsd(n) { if (n == null || Number.isNaN(n)) return '—'; if (n >= 1e12) return `$${(n / 1e12).toFixed(3)}T`; if (n >= 1e9) return `$${(n / 1e9).toFixed(2)}B`; if (n >= 1e6) return `$${(n / 1e6).toFixed(2)}M`; return `$${n.toLocaleString(undefined, { maximumFractionDigits: 2 })}`; } function fmtBps(bps) { if (bps == null) return '—'; const pct = Number(bps) / 100; return `${pct.toFixed(2)}% (${bps} bps)`; } function badge(status) { const s = status || 'skip'; return `${s}`; } function kv(rows) { return rows .map(([k, v]) => `
No proof points in response.
'; const g = data.onChainGate || {}; els.gate.innerHTML = kv([ ['Gate address', g.address ? `${g.address}` : '—'],
['RPC reachable', g.rpcReachable ? 'yes' : 'no'],
['Coverage (on-chain)', g.coverageRatioBps != null ? fmtBps(g.coverageRatioBps) : '—'],
['M1/M00 util', g.m1ToM00Utilization != null ? String(g.m1ToM00Utilization) : '—'],
['Issuance paused', g.issuancePaused == null ? '—' : String(g.issuancePaused)],
]);
const t = data.tripleState || {};
els.triple.innerHTML = kv([
['Aligned', t.aligned == null ? '—' : String(t.aligned)],
['Breaks', t.breaksCount != null ? String(t.breaksCount) : '—'],
['As of', t.generatedAt || '—'],
]);
els.raw.textContent = JSON.stringify(data, null, 2);
} catch (e) {
els.status.className = 'status-bar fail';
els.status.textContent = `Error: ${e.message || e}`;
}
}
document.getElementById('btn-refresh')?.addEventListener('click', () => load(true));
document.getElementById('btn-toggle-raw')?.addEventListener('click', () => {
els.rawSection?.classList.toggle('hidden');
});
if (institutional) {
setInterval(() => load(false), 30000);
}
load(false);
})();