Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(pump-dashboard): bound the token scan's RPC calls and keep its status on screen

nirholas079b85109c5a
diff --git a/pages/pump-dashboard.html b/pages/pump-dashboard.html
index 07503fc98..644a28d65 100644
--- a/pages/pump-dashboard.html
+++ b/pages/pump-dashboard.html
@@ -973,6 +973,7 @@
Scan
</button>
</div>
+ <div class="pd-inline-status" id="pd-scan-status" role="status" hidden></div>
<div id="pd-scanner-results" hidden>
<div class="pd-stat-grid" style="margin-bottom: 1rem">
<div class="pd-stat">
@@ -1867,6 +1868,12 @@
if (sub) sub.classList.remove('is-danger');
}
+ // Some Solana providers accept a request and then never answer it
+ // (getTokenLargestAccounts is a known offender). Without a bound, the
+ // caller's await never settles: the token scanner sat on a click with no
+ // result, no error and no way to retry. Time every call out instead.
+ const RPC_TIMEOUT_MS = 25000;
+
async function rpcCall(rpcBody, { id = 1 } = {}) {
let resp;
try {
@@ -1874,11 +1881,17 @@
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ jsonrpc: '2.0', id, ...rpcBody }),
+ signal: AbortSignal.timeout(RPC_TIMEOUT_MS),
});
} catch (e) {
+ const timedOut = e?.name === 'TimeoutError' || e?.name === 'AbortError';
console.warn('[pump-dashboard] RPC transport error:', e?.message || e);
- markRpcError('unreachable');
- throw new Error('RPC unreachable');
+ markRpcError(timedOut ? 'timed out' : 'unreachable');
+ throw new Error(
+ timedOut
+ ? 'the Solana RPC did not respond in time'
+ : 'the Solana RPC is unreachable',
+ );
}
if (!resp.ok) {
console.warn('[pump-dashboard] RPC HTTP', resp.status, 'from', state.rpcUrl);
@@ -3743,13 +3756,31 @@
// ── Token Scanner ────────────────────────────────────────────
+ // A scan is two on-chain reads that routinely take several seconds, so the
+ // button and this line carry the busy state. A toast alone was not enough:
+ // it expires, leaving a failed scan indistinguishable from one never run.
+ function setScanStatus(text, kind = 'info') {
+ const el = $('pd-scan-status');
+ if (!el) return;
+ el.textContent = text || '';
+ el.hidden = !text;
+ el.classList.toggle('is-error', kind === 'error');
+ }
+
async function scanToken() {
const mint = $('pd-scanner-mint').value.trim();
if (!mint) {
toast('Enter a token mint address', 'error');
+ setScanStatus('Enter a token mint address to scan.', 'error');
+ $('pd-scanner-mint').focus();
return;
}
$('pd-scanner-results').hidden = true;
+ const scanBtn = $('pd-scan-token');
+ const scanLabel = scanBtn.textContent;
+ scanBtn.disabled = true;
+ scanBtn.textContent = 'Scanning…';
+ setScanStatus('Reading the mint account and top holders on-chain…');
try {
const [scanData, holdersData] = await Promise.all([
rpcCall(
@@ -3770,6 +3801,10 @@
const account = scanData.result?.value;
if (!account) {
toast('Token not found on-chain', 'error');
+ setScanStatus(
+ 'No account exists at that address on mainnet. Check the mint and scan again.',
+ 'error',
+ );
return;
}
@@ -3929,12 +3964,18 @@
)
.join('');
$('pd-scanner-results').hidden = false;
+ setScanStatus('');
toast(
'Scan complete: ' + riskLevel.toLowerCase() + ' risk',
riskLevel === 'HIGH' ? 'error' : 'success',
);
} catch (e) {
- toast('Scan failed: ' + (e.message || 'Network error'), 'error');
+ const why = e.message || 'the network request failed';
+ toast('Scan failed: ' + why, 'error');
+ setScanStatus(`Scan failed: ${why}. Press Scan to try again.`, 'error');
+ } finally {
+ scanBtn.disabled = false;
+ scanBtn.textContent = scanLabel;
}
}
@@ -3960,6 +4001,27 @@
`;
}
+ // /api/pump/quote-sdk answers with { error, error_description }. Showing the
+ // raw code ("internal_error", "no_curve") told the user nothing and offered
+ // no next step, so translate the ones this page can actually hit.
+ const QUOTE_ERROR_TEXT = {
+ no_curve:
+ 'No active bonding curve for that mint. It has graduated to an AMM, or the address is not a pump.fun token.',
+ bad_mint: 'That is not a valid Solana mint address.',
+ bad_amount: 'Enter an amount greater than zero.',
+ bad_side: 'Quote side must be buy or sell.',
+ upstream_unavailable:
+ 'Every Solana RPC provider is rate limited right now. Try again in a moment.',
+ };
+
+ function quoteErrorText(status, data) {
+ const code = data?.error;
+ if (QUOTE_ERROR_TEXT[code]) return QUOTE_ERROR_TEXT[code];
+ if (status >= 500)
+ return 'The quote service could not reach Solana. Try again in a moment.';
+ return data?.error_description || data?.message || 'Quote failed.';
+ }
+
async function getBuyQuote() {
const mint = $('pd-quote-buy-mint').value.trim();
const solAmount = parseFloat($('pd-quote-buy-amount').value);
@@ -3979,7 +4041,7 @@
);
const data = await r.json();
if (!r.ok) {
- target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(data.message || data.error || 'Quote failed')}</span>`;
+ target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(quoteErrorText(r.status, data))}</span>`;
return;
}
renderQuoteResult(target, {
@@ -4012,7 +4074,7 @@
);
const data = await r.json();
if (!r.ok) {
- target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(data.message || data.error || 'Quote failed')}</span>`;
+ target.innerHTML = `<span style="color:var(--danger)">${escapeHtml(quoteErrorText(r.status, data))}</span>`;
return;
}
renderQuoteResult(target, {
diff --git a/pages/pump-live.html b/pages/pump-live.html
index c98bb3052..7d7c1c31f 100644
--- a/pages/pump-live.html
+++ b/pages/pump-live.html
@@ -10,8 +10,8 @@
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.webmanifest" />
-<title data-i18n="pump_live.meta_title">3D-Agent · PumpFun Live</title>
-<meta name="description" content="Real-time stream of new PumpFun token launches on Solana, presented by a 3D Agent." data-i18n-attr="content:pump_live.meta_description">
+<title data-i18n="pump_live.meta_title">Pump.fun Live Feed · three.ws</title>
+<meta name="description" content="Watch every pump.fun launch on Solana the moment it happens: live market caps, Oracle conviction scores, and a 3D agent that reacts to each new coin." data-i18n-attr="content:pump_live.meta_description">
<link rel="canonical" href="https://three.ws/pump-live">
<script type="importmap">
{
@@ -105,6 +105,10 @@
}
.stat {
flex: 1;
+ /* Without this the flex items refuse to shrink below their longest label,
+ so at 320px the four stats sum to 321px and the last one hangs a pixel
+ past the viewport. Labels wrap instead. */
+ min-width: 0;
padding: 10px 16px;
border-right: 1px solid var(--dark-grey);
display: flex;
diff --git a/public/pump-dashboard.css b/public/pump-dashboard.css
index a0dfc842c..67e1cb3f0 100644
--- a/public/pump-dashboard.css
+++ b/public/pump-dashboard.css
@@ -575,6 +575,22 @@ html.pump-dashboard-page body {
margin-bottom: 0.55rem;
}
+/* Persistent status line under a form that runs a slow on-chain read. */
+.pd-inline-status {
+ margin: 0.6rem 0 0;
+ padding: 0.55rem 0.75rem;
+ border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
+ border-radius: 8px;
+ font-size: 0.82rem;
+ color: var(--ink-dim);
+ background: var(--surface-1, rgba(255, 255, 255, 0.02));
+}
+
+.pd-inline-status.is-error {
+ color: var(--danger);
+ border-color: color-mix(in srgb, var(--danger) 40%, transparent);
+}
+
/* Filtered-empty notice inside the live feed: message plus a way back to All. */
#pd-filter-empty {
display: flex;