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-go): retry a transient bounty read instead of failing it on one blip

nirholasfdd0b9801236
diff --git a/api/_lib/pump-go.js b/api/_lib/pump-go.js
index 31124470d..84f54e9df 100644
--- a/api/_lib/pump-go.js
+++ b/api/_lib/pump-go.js
@@ -14,6 +14,7 @@
// without the network.
import { clampInt } from './http-params.js';
+import { fetchUpstream } from './upstream-fetch.js';
const REST_BASE = 'https://livestream-api.pump.fun';
const PROGRAM_ID = 'goGzNYTYkSEe4hUqz6dPmY5uf3CTt36AQAoujXDrKiV';
@@ -35,17 +36,19 @@ export class PumpGoError extends Error {
}
async function pumpGoGet(path) {
+ // Retried on the transient statuses only. A 404 is a real answer about this
+ // bounty and must not be retried, and neither should a 4xx: repeating either
+ // just spends the caller's budget to be told the same thing again.
let res;
try {
- res = await fetch(`${REST_BASE}${path}`, {
+ res = await fetchUpstream(`${REST_BASE}${path}`, {
headers: {
accept: 'application/json',
'user-agent': 'Mozilla/5.0 (compatible; three.ws/1.0; +https://three.ws)',
origin: 'https://pump.fun',
referer: 'https://pump.fun/',
},
- signal: AbortSignal.timeout(TIMEOUT_MS),
- });
+ }, { name: 'pumpfun:go', timeoutMs: TIMEOUT_MS, attempts: 2, okWhen: () => true });
} catch (e) {
throw new PumpGoError(`pump.fun GO unreachable: ${e.message}`, 504);
}