spb/coinexplorer Public MIT
Self-hosted, zero-API-key explorer for stablecoins and major crypto.
Python 60.3%
HTML 23.6%
JavaScript 8.1%
CSS 6.8%
SQL 1%
1<!doctype html>2<!-- Author: Simon-Pierre Boucher -->3<!-- Mail: contact@spboucher.ai -->4<html lang="en">5<head>6<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">7<title>tx — coinexplorer</title>8<link rel="stylesheet" href="/assets/style.css">9</head>10<body>11<main>12 <div class="pagehead"><h1>Transaction</h1><span class="sub mono" id="hash" style="max-width:none"></span></div>13 <section class="card" id="summary"><h2>Summary</h2><div class="empty" id="state">loading…</div>14 <div class="scroll"><table id="kv" style="display:none;min-width:0"><tbody></tbody></table></div></section>15 <section class="card"><h2>Stablecoin transfers in this transaction</h2>16 <div class="scroll"><table><thead><tr><th>token</th><th class="num">amount</th><th>from</th><th>to</th></tr></thead>17 <tbody id="rows"></tbody></table></div></section>18</main>1920<script type="module">21import { $, qs, j, fmtUsd, fmtN, fmtAmt, mountNav, addrLink, chainLink, tokenLink, ago } from "/assets/app.js";22mountNav("Transfers");23const HASH = qs.get("hash") || "";24let CHAIN = qs.get("chain") || "";25$("hash").textContent = HASH;2627async function load() {28 if (!HASH) { $("state").textContent = "no hash given"; return; }29 if (!CHAIN) {30 const s = await j(`/v1/search?q=${encodeURIComponent(HASH)}`);31 if (s.chain) CHAIN = s.chain;32 else { $("state").textContent = "transaction not found in the index — supply ?chain= to query a node directly"; return; }33 }34 let t;35 try { t = await j(`/v1/${CHAIN}/tx/${encodeURIComponent(HASH)}`); }36 catch { $("state").textContent = "not found on " + CHAIN; return; }37 $("state").style.display = "none";38 const kv = $("kv");39 kv.style.display = "";40 const rows = [41 ["chain", chainLink(t.chain)],42 ["block", t.block != null ? fmtN(t.block) : "pending"],43 ["status", t.status === 1 ? "✓ success" : t.status === 0 ? "✗ reverted" : t.source === "index" ? "indexed" : "—"],44 ];45 if (t.timestamp) rows.push(["time", new Date(t.timestamp * 1000).toLocaleString() + ` (${ago(t.timestamp)} ago)`]);46 if (t.from) rows.push(["from", addrLink(t.from)]);47 if (t.to) rows.push(["to", addrLink(t.to)]);48 if (t.gas_used != null) rows.push(["gas used", fmtN(t.gas_used)]);49 kv.tBodies[0].innerHTML = rows.map(([k, v]) =>50 `<tr><td style="color:var(--muted);width:120px">${k}</td><td style="max-width:none">${v}</td></tr>`).join("");51 $("rows").innerHTML = (t.stablecoin_transfers || []).map((x) =>52 `<tr><td>${tokenLink(x.symbol)}</td><td class="num"><b>${fmtAmt(x)}</b></td>53 <td>${addrLink(x.from)}</td><td>${addrLink(x.to)}</td></tr>`).join("") ||54 `<tr><td colspan="4" class="empty">no stablecoin transfers decoded</td></tr>`;55}56load();57</script>58</body>59</html>60