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.

feat: add pumpfun-buy.html for live feed widget implementation

nirholasf95c35afb450
diff --git a/pumpfun-buy.html b/pumpfun-buy.html
new file mode 100644
index 000000000..31de33e54
--- /dev/null
+++ b/pumpfun-buy.html
@@ -0,0 +1,175 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Pump.fun Live</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="description" content="Pump.fun live feed widget." />
+ <meta name="robots" content="noindex" />
+ <style>
+ * { margin: 0; padding: 0; box-sizing: border-box; }
+ body {
+ background: #0a0a0a;
+ color: #00ff41;
+ font-family: 'Courier New', monospace;
+ font-size: 13px;
+ line-height: 1.5;
+ padding: 0;
+ }
+ #root {
+ height: 100vh;
+ overflow-y: auto;
+ }
+ .entry {
+ border-bottom: 1px solid #111;
+ padding: 8px;
+ animation: fadeIn 0.3s ease;
+ }
+ @keyframes fadeIn {
+ from { opacity: 0; transform: translateY(-4px); }
+ to { opacity: 1; transform: translateY(0); }
+ }
+ .entry .name { color: #ffcc00; font-weight: bold; font-size: 15px; }
+ .entry .symbol { color: #ff9900; font-weight: bold; }
+ .entry a { color: #4a9eff; text-decoration: none; }
+ .entry a:hover { text-decoration: underline; }
+ .entry .token-row { display: flex; align-items: center; gap: 10px; }
+ .entry .token-img { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #333; object-fit: cover; background: #111; }
+ .entry .token-details { flex: 1; min-width: 0; }
+ .entry .meta-row { display: flex; gap: 12px; flex-wrap: wrap; font-size: 11px; color: #666; margin-top: 3px; }
+ .entry .mcap { color: #b366ff; font-weight: bold; }
+ body.bg-dark {
+ background: #0b0d10;
+ }
+ body.bg-light {
+ background: #f5f5f5;
+ }
+ body.bg-light .entry {
+ border-bottom-color: #eee;
+ }
+ body.bg-light .name {
+ color: #333;
+ }
+ body.bg-light .symbol {
+ color: #666;
+ }
+ body.bg-light .mcap {
+ color: #999;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module">
+ const params = new URL(location.href).searchParams;
+ const bg = params.get('bg') || 'dark';
+ if (bg === 'dark') document.body.classList.add('bg-dark');
+ if (bg === 'light') document.body.classList.add('bg-light');
+ const maxEntries = parseInt(params.get('max') || '50', 10);
+
+ const RPC_ENDPOINTS = [
+ { url: 'wss://pumpportal.fun/api/data', protocol: 'pumpportal', label: 'PumpPortal' },
+ { url: 'wss://pump-fun-websocket-production.up.railway.app/ws', protocol: 'relay', label: 'Relay Server' },
+ ];
+ let rpcIndex = 0;
+ let ws = null;
+
+ function connect() {
+ const ep = RPC_ENDPOINTS[rpcIndex % RPC_ENDPOINTS.length];
+ rpcIndex++;
+ ws = new WebSocket(ep.url);
+
+ ws.onopen = () => {
+ if (ep.protocol === 'pumpportal') {
+ ws.send(JSON.stringify({ method: 'subscribeNewToken' }));
+ }
+ };
+
+ ws.onmessage = (evt) => {
+ let msg;
+ try { msg = JSON.parse(evt.data); } catch { return; }
+
+ if (ep.protocol === 'relay') {
+ if (msg.type === 'token-launch' || msg.mint) {
+ const info = {
+ mint: msg.mint || 'unknown',
+ name: msg.name || null,
+ symbol: msg.symbol || null,
+ imageUrl: msg.imageUri || null,
+ marketCapSol: msg.marketCapSol || 0,
+ };
+ renderEntry(info);
+ }
+ return;
+ }
+
+ if (ep.protocol === 'pumpportal') {
+ if (msg && msg.mint) {
+ const vSol = msg.vSolInBondingCurve || 0;
+ const vTok = msg.vTokensInBondingCurve || 0;
+ const supply = msg.tokenTotalSupply || (vTok > 0 ? 1e15 : 0);
+ let mcap = msg.marketCapSol || 0;
+ if (!mcap && vTok > 0 && vSol > 0) {
+ mcap = (vSol / vTok) * supply / 1e9;
+ }
+ const info = {
+ mint: msg.mint,
+ name: msg.name || null,
+ symbol: msg.symbol || null,
+ marketCapSol: mcap,
+ imageUrl: null, // PumpPortal does not provide image directly
+ };
+ renderEntry(info);
+ }
+ return;
+ }
+ };
+
+ ws.onclose = () => {
+ setTimeout(connect, 1000);
+ };
+ }
+
+ function renderEntry(info) {
+ const div = document.createElement('div');
+ div.className = 'entry';
+
+ const displayName = info.name || 'Unknown';
+ const displaySymbol = info.symbol ? '$' + info.symbol : '';
+ const mcap = info.marketCapSol ? fmtMcap(info.marketCapSol) : null;
+
+ let html = `<div class="token-row">`;
+ html += `<img class="token-img" src="${info.imageUrl || ''}" alt="" style="${info.imageUrl ? '' : 'display:none'}" onerror="this.style.display='none'" />`;
+ html += `<div class="token-details">`;
+ html += `<div><span class="name">${esc(displayName)}</span> <span class="symbol">${esc(displaySymbol)}</span></div>`;
+ html += `<div class="meta-row">`;
+ if (info.mint) html += `<span><a href="https://pump.fun/coin/${info.mint}" target="_blank">View on Pump.fun</a></span>`;
+ if (mcap) html += `<span>MCap: <span class="mcap">${mcap}</span></span>`;
+ html += `</div>`;
+ html += `</div></div>`;
+
+ div.innerHTML = html;
+ const root = document.getElementById('root');
+ root.prepend(div);
+ while (root.children.length > maxEntries) {
+ root.removeChild(root.lastChild);
+ }
+ }
+
+ function fmtMcap(sol) {
+ if (!sol || sol <= 0) return null;
+ if (sol >= 1000) return (sol / 1000).toFixed(1) + 'k';
+ if (sol >= 1) return sol.toFixed(2);
+ return sol.toFixed(4);
+ }
+
+ function esc(s) {
+ const d = document.createElement('div');
+ d.textContent = s || '';
+ return d.innerHTML;
+ }
+
+ connect();
+ </script>
+ </body>
+</html>