diff --git a/frontend/public/explorer-spa.js b/frontend/public/explorer-spa.js index 220f48d..f85fa2c 100644 --- a/frontend/public/explorer-spa.js +++ b/frontend/public/explorer-spa.js @@ -3670,29 +3670,147 @@ if ((window.location.pathname || '').replace(/^\//, '').split('/')[0] !== 'more') updatePath('/more'); var container = document.getElementById('moreContent'); if (!container) return; - var cards = [ - { href: '/bridge', icon: 'fa-bridge', title: 'Bridge', desc: 'Inspect CCIP routes, bridge endpoints, and cross-chain references.', action: 'showBridgeMonitoring();' }, - { href: '/weth', icon: 'fa-coins', title: 'WETH', desc: 'Wrap and unwrap WETH9 / WETH10 and review utility contract details.', action: 'showWETHUtilities();' }, - { href: '/liquidity', icon: 'fa-wave-square', title: 'Liquidity', desc: 'Open the public liquidity map, route matrix endpoints, partner payload templates, and fallback execution access.', action: 'showLiquidityAccess();' }, - { href: '/tokens', icon: 'fa-tag', title: 'Tokens', desc: 'Browse the indexed token list and jump into token detail pages.', action: 'showTokensList();' }, - { href: '/addresses', icon: 'fa-address-book', title: 'Addresses', desc: 'Review indexed addresses, labels, contract status, and recent activity.', action: 'showAddresses();' }, - { href: '/watchlist', icon: 'fa-star', title: 'Watchlist', desc: 'Track saved addresses and revisit them quickly.', action: 'showWatchlist();' }, - { href: '/pools', icon: 'fa-water', title: 'Pools', desc: 'Review the liquidity snapshot and config caps for public pools and reserve links.', action: 'openPoolsView();' }, - { href: '/analytics', icon: 'fa-chart-line', title: 'Analytics', desc: 'Open the Track 3 analytics hub for network and bridge insight.', action: 'showAnalytics();' }, - { href: '/operator', icon: 'fa-cog', title: 'Operator', desc: 'Open the Track 4 operator panel for deployment and maintenance tools.', action: 'showOperator();' } + var groups = [ + { + key: 'tools', + title: 'Tools', + items: [ + { title: 'Input Data Decoder', icon: 'fa-file-code', status: 'Live', badgeClass: 'badge-info', desc: 'Open transaction detail pages to decode calldata, logs, and contract interactions already exposed by the explorer.', action: 'showTransactionsList();', href: '/transactions' }, + { title: 'Unit Converter', icon: 'fa-scale-balanced', status: 'Live', badgeClass: 'badge-success', desc: 'Convert wei, gwei, ether, and common Chain 138 stablecoin units with a quick in-page helper.', action: 'showUnitConverterModal();', href: '/more' }, + { title: 'CSV Export', icon: 'fa-file-csv', status: 'Live', badgeClass: 'badge-success', desc: 'Export pool state and route inventory snapshots for operator review and downstream ingestion.', action: 'showPools(); updatePath(\'/pools\'); setTimeout(function(){ if (typeof exportPoolsCSV === \"function\") exportPoolsCSV(); }, 200);', href: '/pools' }, + { title: 'Account Balance Checker', icon: 'fa-wallet', status: 'Live', badgeClass: 'badge-success', desc: 'Jump into indexed addresses to inspect balances, token inventory, internal transfers, and recent activity.', action: 'showAddresses();', href: '/addresses' } + ] + }, + { + key: 'explore', + title: 'Explore', + items: [ + { title: 'Gas Tracker', icon: 'fa-gas-pump', status: 'Live', badgeClass: 'badge-success', desc: 'Review live gas, block time, TPS, and chain health from the analytics and home dashboards.', action: 'showAnalytics();', href: '/analytics' }, + { title: 'DEX Tracker', icon: 'fa-chart-line', status: 'Live', badgeClass: 'badge-success', desc: 'Open liquidity discovery, PMM pool status, live route trees, and partner payload access points.', action: 'showLiquidityAccess();', href: '/liquidity' }, + { title: 'Node Tracker', icon: 'fa-server', status: 'Live', badgeClass: 'badge-success', desc: 'Inspect bridge and operator infrastructure surfaces already exposed in the Bridge and Operator panels.', action: 'showOperator();', href: '/operator' }, + { title: 'Label Cloud', icon: 'fa-tags', status: 'Live', badgeClass: 'badge-success', desc: 'Browse labeled addresses, contracts, and address activity through the explorer address index.', action: 'showAddresses();', href: '/addresses' }, + { title: 'Domain Name Lookup', icon: 'fa-magnifying-glass', status: 'Live', badgeClass: 'badge-success', desc: 'Use the smart search launcher to resolve ENS-style names, domains, addresses, hashes, and token symbols.', action: 'openSmartSearchModal(\'\');', href: '/more' } + ] + }, + { + key: 'services', + title: 'Services', + items: [ + { title: 'Token Approvals', icon: 'fa-shield-halved', status: 'External', badgeClass: 'badge-warning', desc: 'Jump to revoke.cash for wallet approval review. Address detail pages also expose approval shortcuts directly.', action: 'openExternalMoreLink(\'https://revoke.cash/\');', href: '#' }, + { title: 'Verified Signature', icon: 'fa-signature', status: 'Live', badgeClass: 'badge-success', desc: 'Use wallet sign-in and verified address flows already built into the explorer authentication surfaces.', action: 'showWalletModal();', href: '/more' }, + { title: 'Input Data Messages', icon: 'fa-message', status: 'Live', badgeClass: 'badge-info', desc: 'Transaction detail pages already surface decoded input data, event logs, and contract interaction context.', action: 'showTransactionsList();', href: '/transactions' }, + { title: 'Advanced Filter', icon: 'fa-filter', status: 'Live', badgeClass: 'badge-success', desc: 'Block, transaction, address, token, pool, bridge, and watchlist screens all support focused page-level filtering.', action: 'showTransactionsList();', href: '/transactions' }, + { title: 'Blockscan Chat', icon: 'fa-comments', status: 'Soon', badgeClass: 'badge-muted', desc: 'Messaging and collaborative address discussion are not exposed yet in SolaceScanScout.', disabled: true, href: '/more' } + ] + } ]; - var html = '
'; - cards.forEach(function(card) { - html += ''; - html += '
' + escapeHtml(card.title) + '
'; - html += '
' + escapeHtml(card.desc) + '
'; - html += '
'; + + var html = '
'; + html += '
'; + html += '
Tools & Services
'; + html += '
Discover more of SolaceScanScout's explorer tools in one place, grouped the way users expect from Etherscan-style explorers.
'; + html += '
'; + html += '
Now live
Route matrix, ingestion APIs, smart search, pool exports, and live Mainnet stable bridge discovery.
'; + html += '
Good entry points
'; + html += ''; + html += ''; + html += ''; + html += '
'; + html += '
'; + + groups.forEach(function(group) { + html += '
'; + html += '
' + escapeHtml(group.title) + '
'; + html += '
'; + group.items.forEach(function(item) { + var disabled = !!item.disabled; + var disabledTitle = String(item.title) + ' is not exposed in the explorer yet.'; + var onclick = disabled + ? ('event.preventDefault(); showToast(' + JSON.stringify(disabledTitle) + ', "info");') + : (item.href === '#' + ? ('event.preventDefault(); ' + item.action + ' closeNavMenu();') + : ('event.preventDefault(); ' + item.action + ' updatePath(' + JSON.stringify(item.href) + '); closeNavMenu();')); + var href = disabled ? '/more' : item.href; + html += ''; + html += '
'; + html += '
'; + html += ''; + html += '' + escapeHtml(item.title) + ''; + html += '
'; + html += '' + escapeHtml(item.status) + ''; + html += '
'; + html += '
' + escapeHtml(item.desc) + '
'; + html += '
'; + }); + html += '
'; }); html += '
'; container.innerHTML = html; } window._showMore = renderMoreView; + window.showUnitConverterModal = function() { + var existing = document.getElementById('unitConverterModal'); + if (existing) existing.remove(); + var modal = document.createElement('div'); + modal.id = 'unitConverterModal'; + modal.style.cssText = 'position:fixed; inset:0; background:rgba(8,15,32,0.68); backdrop-filter:blur(8px); z-index:12000; display:flex; align-items:center; justify-content:center; padding:1rem;'; + modal.innerHTML = '' + + '
' + + '
' + + '
Unit Converter
Wei, gwei, ether, and 6-decimal stablecoin units for Chain 138.
' + + '' + + '
' + + '
' + + '' + + '' + + '
' + + '
' + + '
'; + document.body.appendChild(modal); + + function renderUnitConverterResults() { + var amountEl = document.getElementById('unitConverterAmount'); + var unitEl = document.getElementById('unitConverterUnit'); + var resultsEl = document.getElementById('unitConverterResults'); + if (!amountEl || !unitEl || !resultsEl) return; + var amount = Number(amountEl.value || '0'); + var unit = unitEl.value; + if (!isFinite(amount) || amount < 0) { + resultsEl.innerHTML = '
Enter a non-negative amount to convert.
'; + return; + } + var wei = 0; + if (unit === 'ether') wei = amount * 1e18; + else if (unit === 'gwei') wei = amount * 1e9; + else if (unit === 'wei') wei = amount; + else if (unit === 'stable') wei = amount * 1e6; + var etherValue = unit === 'stable' ? 'N/A' : (wei / 1e18).toLocaleString(undefined, { maximumFractionDigits: 18 }); + var gweiValue = unit === 'stable' ? 'N/A' : (wei / 1e9).toLocaleString(undefined, { maximumFractionDigits: 9 }); + var stableValue = (unit === 'stable' ? amount : wei / 1e6).toLocaleString(undefined, { maximumFractionDigits: 6 }); + resultsEl.innerHTML = + '
Wei: ' + escapeHtml(Math.round(wei).toString()) + '
' + + '
Gwei: ' + escapeHtml(gweiValue) + '
' + + '
Ether / WETH: ' + escapeHtml(etherValue) + '
' + + '
6-decimal stable amount: ' + escapeHtml(stableValue) + '
'; + } + + var closeBtn = document.getElementById('unitConverterCloseBtn'); + if (closeBtn) closeBtn.addEventListener('click', function() { modal.remove(); }); + modal.addEventListener('click', function(event) { + if (event.target === modal) modal.remove(); + }); + var amountEl = document.getElementById('unitConverterAmount'); + var unitEl = document.getElementById('unitConverterUnit'); + if (amountEl) amountEl.addEventListener('input', renderUnitConverterResults); + if (unitEl) unitEl.addEventListener('change', renderUnitConverterResults); + renderUnitConverterResults(); + }; + + window.openExternalMoreLink = function(url) { + window.open(url, '_blank', 'noopener,noreferrer'); + }; + async function refreshBridgeData() { const container = document.getElementById('bridgeContent'); if (!container) return;