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.

Refactor My Agents page and enhance agent fetching logic

nirholasb4df1b946d92
diff --git a/a-edit.html b/a-edit.html
index 6367cf0e9..52b506eca 100644
--- a/a-edit.html
+++ b/a-edit.html
@@ -245,7 +245,7 @@
</head>
<body>
<header class="ce-page-header">
- <a id="back-link" href="/discover">← Back</a>
+ <a id="back-link" href="/marketplace.html">← Back</a>
</header>
<main>
diff --git a/agent-detail.html b/agent-detail.html
index c79ea45d6..d0315cd2b 100644
--- a/agent-detail.html
+++ b/agent-detail.html
@@ -21,7 +21,7 @@
<nav class="ad-nav">
<a href="/">Home</a>
<a href="/leaderboard">Leaderboard</a>
- <a class="active" href="/agents">Agents <span class="ad-beta">BETA</span></a>
+ <a class="active" href="/marketplace.html">Agents <span class="ad-beta">BETA</span></a>
<a href="/spotlight">Apply for Spotlight</a>
<a href="/developers">Developers</a>
<a href="/about">About</a>
diff --git a/agent-detail.html.temp b/agent-detail.html.temp
new file mode 100644
index 000000000..8b9a22035
--- /dev/null
+++ b/agent-detail.html.temp
@@ -0,0 +1,186 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Agent — three.ws</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="theme-color" content="#0b0d10" />
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
+ <link
+ href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap"
+ rel="stylesheet"
+ />
+ <link rel="stylesheet" href="/src/agent-detail.css" />
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/qrious/4.0.2/qrious.min.js"></script>
+ </head>
+ <body>
+ <div class="ad-shell">
+ <aside class="ad-sidebar">
+ <div class="ad-brand">three.ws</div>
+ <nav class="ad-nav">
+ <a href="/">Home</a>
+ <a href="/leaderboard">Leaderboard</a>
+ <a class="active" href="/agents">Agents <span class="ad-beta">BETA</span></a>
+ <a href="/spotlight">Apply for Spotlight</a>
+ <a href="/developers">Developers</a>
+ <a href="/about">About</a>
+ <a href="/support">Support</a>
+ </nav>
+ <div class="ad-side-foot">
+ <a href="https://twitter.com" target="_blank" rel="noopener">Twitter</a>
+ <a href="https://discord.com" target="_blank" rel="noopener">Discord</a>
+ </div>
+ </aside>
+
+ <main class="ad-main">
+ <header class="ad-banner">
+ <span>S1 Powered by Torque · $250K rewards</span>
+ </header>
+
+ <div class="ad-topbar">
+ <input class="ad-search" placeholder="Search agents…" />
+ <div class="ad-actions">
+ <a class="ad-btn" href="/create">Create Agent</a>
+ <a class="ad-btn" href="/agents">Registry</a>
+ <a class="ad-btn ad-btn-primary" href="/login">Log In</a>
+ </div>
+ </div>
+
+ <a class="ad-back" href="/agents">← Back to Registry</a>
+
+ <section class="ad-hero">
+ <img class="ad-hero-avatar" id="ad-avatar" alt="" />
+ <div class="ad-hero-body">
+ <div class="ad-hero-title">
+ <h1 id="ad-name">Loading…</h1>
+ <span class="ad-status" id="ad-status">Active</span>
+ </div>
+ <div class="ad-hero-meta">
+ <span id="ad-id-short" class="ad-mono"></span>
+ <button class="ad-copy" data-copy-target="ad-id-short" aria-label="Copy">⧉</button>
+ <span class="ad-dot">·</span>
+ <span id="ad-asset-kind">Core Asset</span>
+ </div>
+ <p class="ad-hero-desc" id="ad-desc"></p>
+ <div class="ad-hero-trust" id="ad-trust-pills"></div>
+ </div>
+ </section>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet"></span>
+ <h2>SERVICES</h2>
+ <span class="ad-pill ad-pill-muted" id="ad-svc-count">0 configured</span>
+ </div>
+ <div class="ad-services" id="ad-services"></div>
+ </section>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet"></span>
+ <h2>AGENT HOLDINGS</h2>
+ </div>
+ <div class="ad-row">
+ <span class="ad-mono" id="ad-holdings-addr"></span>
+ <button class="ad-copy" data-copy-target="ad-holdings-addr" aria-label="Copy">⧉</button>
+ </div>
+ <div class="ad-balance"><span id="ad-holdings-sol">0</span> SOL</div>
+ <div class="flex space-x-2 mt-4 justify-start">
+ <button id="receive-btn" class="ad-btn">
+ Receive
+ </button>
+ <button id="withdraw-btn" class="ad-btn">
+ Withdraw
+ </button>
+ <button id="swap-btn" class="ad-btn">
+ Swap
+ </button>
+ </div>
+ <div id="qr-code-container" class="hidden mt-4 p-4 bg-white rounded-lg shadow-md inline-block">
+ <canvas id="qr-code"></canvas>
+ </div>
+ </section>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet ad-bullet-amber"></span>
+ <h2>AGENT TOKEN</h2>
+ </div>
+ <div id="ad-token-body" class="ad-muted">No agent token linked for this agent yet.</div>
+ </section>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet ad-bullet-green"></span>
+ <h2>CREATOR REWARDS</h2>
+ </div>
+ <div class="ad-row ad-row-split">
+ <span class="ad-muted">Lifetime rewards</span>
+ <span><b id="ad-rewards">0</b> SOL</span>
+ </div>
+ </section>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet"></span>
+ <h2>TRUST &amp; SECURITY</h2>
+ </div>
+ <div class="ad-sub">TRUST MECHANISMS</div>
+ <div class="ad-trust-pills" id="ad-trust-mechs"></div>
+ <div class="ad-sub">PAYMENT PROTOCOL</div>
+ <div class="ad-trust-pills" id="ad-payment"></div>
+ </section>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet ad-bullet-violet"></span>
+ <h2>REGISTRATIONS</h2>
+ </div>
+ <div class="ad-row ad-row-split">
+ <span class="ad-muted">Agent ID</span>
+ <span class="ad-mono" id="ad-agent-id"></span>
+ </div>
+ <div class="ad-row ad-row-split">
+ <span class="ad-muted">Registry</span>
+ <span class="ad-trust-pills" id="ad-registries"></span>
+ </div>
+ </section>
+
+ <details class="ad-card ad-collapse">
+ <summary>
+ <span class="ad-bullet ad-bullet-muted"></span>
+ <span class="ad-card-title">RAW METADATA</span>
+ </summary>
+ <pre class="ad-raw" id="ad-raw"></pre>
+ </details>
+
+ <section class="ad-card">
+ <div class="ad-card-head">
+ <span class="ad-bullet"></span>
+ <h2>ON-CHAIN DETAILS</h2>
+ </div>
+ <div id="ad-onchain"></div>
+ <div class="ad-row ad-row-split"><span class="ad-muted">Active</span><span id="ad-active">true</span></div>
+ <div class="ad-row ad-row-split"><span class="ad-muted">Services</span><span id="ad-svc-count2">0</span></div>
+ <div class="ad-row ad-row-split"><span class="ad-muted">Supported Trust</span><span class="ad-trust-pills" id="ad-supported-trust"></span></div>
+ <div class="ad-row ad-row-split"><span class="ad-muted">x402 Support</span><span id="ad-x402">No</span></div>
+ <div class="ad-sub">PROTOCOLS</div>
+ <div class="ad-protocols" id="ad-protocols"></div>
+ <div class="ad-cta-row">
+ <a class="ad-cta" id="ad-explorer" target="_blank" rel="noopener">View on Explorer ↗</a>
+ <a class="ad-cta" id="ad-trade" target="_blank" rel="noopener">Trade on Magic Eden ↗</a>
+ </div>
+ </section>
+
+ <footer class="ad-foot">
+ <span>© 2026 three.ws</span>
+ <span><a href="/terms">Terms</a> · <a href="/privacy">Privacy</a> · <a href="/content-policy">Content Policy</a></span>
+ </footer>
+ </main>
+ </div>
+
+ <script type="module" src="/src/agent-detail.js"></script>
+ </body>
+</html>
diff --git a/app.html b/app.html
index 6c72451eb..5195a29a1 100644
--- a/app.html
+++ b/app.html
@@ -151,6 +151,7 @@
</li>
</ul>
</li>
+ <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
</ul>
</nav>
id="make-widget-btn"
diff --git a/chat/src/App.svelte b/chat/src/App.svelte
index 21d5e6c95..aea6391c9 100644
--- a/chat/src/App.svelte
+++ b/chat/src/App.svelte
@@ -2933,7 +2933,4 @@
:global(.h-footer-inner) {
margin-bottom: 2rem;
}
-
- .container {
-// ... existing code ...
</style>
diff --git a/create.html b/create.html
index a57131a7b..ee377f6f9 100644
--- a/create.html
+++ b/create.html
@@ -606,19 +606,96 @@
>
</h1>
<nav class="features-nav" aria-label="Primary">
- <a href="/app">Viewer</a>
- <a href="/create" class="active">Create</a>
- <a href="/discover">Discover</a>
- <a href="/features">Features</a>
- <a href="/widgets">Widgets</a>
- <a href="/studio">Studio</a>
- <a href="/chat">Chat</a>
- <a href="/docs">Docs</a>
- <a href="/dashboard" class="nav-dashboard">Dashboard</a>
- <a href="/my-agents" id="nav-my-agents" hidden>My Agents</a>
- <a href="/dashboard" id="nav-user" hidden class="nav-user"></a>
- <a href="/login" class="nav-sign-in" id="nav-sign-in">Sign in</a>
- <button id="btn-wallet-signin" style="cursor: pointer">Sign in with wallet</button>
+ <ul class="nav-root" role="menubar">
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Build<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Build">
+ <li role="none">
+ <a href="/create" role="menuitem"
+ ><span class="nav-mi-title">Create agent</span
+ ><span class="nav-mi-sub">Avatar + brain wizard</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/app" role="menuitem"
+ ><span class="nav-mi-title">Viewer</span
+ ><span class="nav-mi-sub">Drag-and-drop GLB</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/validation" role="menuitem"
+ ><span class="nav-mi-title">glTF Validator</span
+ ><span class="nav-mi-sub">Khronos spec check</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Discover<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Discover">
+ <li role="none">
+ <a href="/discover" role="menuitem"
+ ><span class="nav-mi-title">Agents</span
+ ><span class="nav-mi-sub">Public directory</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/widgets" role="menuitem"
+ ><span class="nav-mi-title">Widgets gallery</span
+ ><span class="nav-mi-sub">Embeddable showcases</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/reputation" role="menuitem"
+ ><span class="nav-mi-title">Reputation</span
+ ><span class="nav-mi-sub">ERC-8004 registry</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Solana<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Solana">
+ <li role="none">
+ <a href="/pumpfun" role="menuitem"
+ ><span class="nav-mi-title">Pump.fun stream</span
+ ><span class="nav-mi-sub">Mint agent tokens</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/vanity-wallet" role="menuitem"
+ ><span class="nav-mi-title">Vanity wallet</span
+ ><span class="nav-mi-sub">Generate address</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item" role="none"><a href="/docs" role="menuitem">Docs</a></li>
+ </ul>
</nav>
</header>
diff --git a/examples/embed-test.html b/examples/embed-test.html
new file mode 100644
index 000000000..e44a1f161
--- /dev/null
+++ b/examples/embed-test.html
@@ -0,0 +1,78 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>three.ws Embed Test</title>
+ <style>
+ body {
+ margin: 0;
+ padding: 40px;
+ background: #111;
+ color: #fff;
+ font-family: sans-serif;
+ }
+ h1 {
+ margin-bottom: 8px;
+ }
+ p {
+ color: #aaa;
+ margin-bottom: 24px;
+ }
+ </style>
+ </head>
+ <body>
+ <h1>three.ws Web Component Test</h1>
+ <p>Testing the <code>&lt;agent-3d&gt;</code> web component embed.</p>
+
+ <script type="module" src="https://three.ws/dist-lib/agent-3d.js"></script>
+ <agent-3d
+ src="https://three.ws/api/avatars/bdef4d68-710e-4fa6-8a8d-d5c00857b85c"
+ style="width: 600px; height: 600px"
+ ></agent-3d>
+
+ <hr style="margin: 40px 0; border-color: #333" />
+
+ <h2 style="margin-bottom: 8px">KOL Smart Money Widget</h2>
+ <p>
+ Replace <code>mint</code> with a Solana token mint address to see smart-money activity.
+ Polls <code>/api/kol/trades</code> every 30 s.
+ </p>
+
+ <script type="module" src="/src/widgets/kol-trades.js"></script>
+ <three-ws-widget
+ type="kol-trades"
+ mint="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
+ limit="20"
+ refresh-ms="30000"
+ style="display:block; max-width:520px; background:#1a1a1a; border-radius:12px; padding:12px"
+ ></three-ws-widget>
+
+ <hr style="margin: 40px 0; border-color: #333" />
+
+ <h2 style="margin-bottom: 8px">Live Trades Canvas</h2>
+ <p>
+ Replace <code>mint</code> with an active pump.fun token mint to see buy/sell particles.
+ Polls <code>/api/pump-fun-mcp</code> every 6 s.
+ </p>
+ <three-ws-widget
+ type="live-trades-canvas"
+ mint="So11111111111111111111111111111111111111112"
+ bg="#0d0d14"
+ min-usd="0"
+ style="display:block; width:600px; height:400px; border-radius:12px; overflow:hidden; position:relative"
+ ></three-ws-widget>
+ <script type="module">
+ import { mountLiveTradesCanvas } from '/src/widgets/live-trades-canvas.js';
+ const host = document.querySelector('[type="live-trades-canvas"]');
+ if (host && !host.dataset.mounted) {
+ host.dataset.mounted = '1';
+ mountLiveTradesCanvas(host, {
+ mint: host.getAttribute('mint'),
+ bg: host.getAttribute('bg') || '#0d0d14',
+ minUsd: Number(host.getAttribute('min-usd') || 0),
+ });
+ }
+ </script>
+ </body>
+</html>
diff --git a/home.html b/home.html
index dc76ea767..3c565d1f3 100644
--- a/home.html
+++ b/home.html
@@ -215,6 +215,7 @@
</li>
</ul>
</li>
+ <li class="nav-item" role="none"><a href="/marketplace.html" role="menuitem">Marketplace</a></li>
<li class="nav-item" role="none"><a href="/chat" role="menuitem">Chat</a></li>
<li class="nav-item" role="none">
<a href="/features" role="menuitem">Features</a>
diff --git a/public/discover/index.html b/public/discover/index.html
index d2c6b6080..5f2878aa6 100644
--- a/public/discover/index.html
+++ b/public/discover/index.html
@@ -41,18 +41,97 @@
<h1>
<a href="/"><img src="/three.svg" alt="three.ws" class="header-logo" /></a>
</h1>
- <nav class="features-nav">
- <a href="/app">Viewer</a>
- <a href="/create">Create</a>
- <a href="/discover" class="active">Discover</a>
- <a href="/features">Features</a>
- <a href="/widgets">Widgets</a>
- <a href="/studio">Studio</a>
- <a href="/chat">Chat</a>
- <a href="/docs">Docs</a>
- <a href="/my-agents" id="nav-my-agents" hidden>My Agents</a>
- <a href="/dashboard" class="nav-dashboard">Dashboard</a>
- <a href="/login" class="nav-sign-in" id="nav-sign-in">Sign in</a>
+ <nav class="features-nav" aria-label="Primary">
+ <ul class="nav-root" role="menubar">
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Build<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Build">
+ <li role="none">
+ <a href="/create" role="menuitem"
+ ><span class="nav-mi-title">Create agent</span
+ ><span class="nav-mi-sub">Avatar + brain wizard</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/app" role="menuitem"
+ ><span class="nav-mi-title">Viewer</span
+ ><span class="nav-mi-sub">Drag-and-drop GLB</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/validation" role="menuitem"
+ ><span class="nav-mi-title">glTF Validator</span
+ ><span class="nav-mi-sub">Khronos spec check</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Discover<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Discover">
+ <li role="none">
+ <a href="/discover" role="menuitem"
+ ><span class="nav-mi-title">Agents</span
+ ><span class="nav-mi-sub">Public directory</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/widgets" role="menuitem"
+ ><span class="nav-mi-title">Widgets gallery</span
+ ><span class="nav-mi-sub">Embeddable showcases</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/reputation" role="menuitem"
+ ><span class="nav-mi-title">Reputation</span
+ ><span class="nav-mi-sub">ERC-8004 registry</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Solana<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Solana">
+ <li role="none">
+ <a href="/pumpfun" role="menuitem"
+ ><span class="nav-mi-title">Pump.fun stream</span
+ ><span class="nav-mi-sub">Mint agent tokens</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/vanity-wallet" role="menuitem"
+ ><span class="nav-mi-title">Vanity wallet</span
+ ><span class="nav-mi-sub">Generate address</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item" role="none"><a href="/docs" role="menuitem">Docs</a></li>
+ </ul>
</nav>
</header>
diff --git a/public/my-agents/index.html b/public/my-agents/index.html
index 84666446d..0d3ba9b50 100644
--- a/public/my-agents/index.html
+++ b/public/my-agents/index.html
@@ -27,8 +27,8 @@
</header>
<main class="my-agents-main" id="my-agents-main">
- <h1 class="my-agents-title">On-chain Agents</h1>
- <p class="my-agents-subtitle">Agents owned by your linked wallets</p>
+ <h1 class="my-agents-title">My Agents</h1>
+ <p class="my-agents-subtitle">Agents from your account and linked wallets</p>
<div
id="my-agents-error"
diff --git a/public/my-agents/my-agents.js b/public/my-agents/my-agents.js
index 95a2f4520..78d716462 100644
--- a/public/my-agents/my-agents.js
+++ b/public/my-agents/my-agents.js
@@ -14,6 +14,16 @@ async function fetchDiscoveredAgents() {
return data.agents || [];
}
+async function fetchNormalAgents() {
+ const res = await fetch('/api/agents', { method: 'GET', credentials: 'include' });
+ if (!res.ok) {
+ const error = await res.json().catch(() => ({}));
+ throw new Error(error.error_description || `HTTP ${res.status}`);
+ }
+ const data = await res.json();
+ return data.agents || [];
+}
+
async function importAgent({ chainId, agentId }) {
const res = await fetch('/api/erc8004/import', {
method: 'POST',
@@ -143,7 +153,7 @@ function showErrorBanner(msg, retry = true) {
/**
* Render one agent card.
- * @param {{ chainId: number, agentId: string, name: string, description: string, image: string|null, glbUrl: string|null, alreadyImported: boolean }} agent
+ * @param {{ chainId: number, agentId: string, name: string, description: string, image: string|null, glbUrl: string|null, alreadyImported?: boolean, isNormal?: boolean, onChain?: boolean }} agent
* @returns {HTMLElement}
*/
function buildCard(agent) {
@@ -154,14 +164,14 @@ function buildCard(agent) {
const thumbSrc = agent.glbUrl || agent.image;
const thumbHtml = thumbSrc
? `<img src="${escapeHtml(thumbSrc)}" alt="${escapeHtml(agent.name)} preview" loading="lazy" />`
- : `<span aria-hidden="true">🤖</span>`;
+ : `<span aria-hidden="true">${agent.isNormal ? '◎' : '🤖'}</span>`;
card.innerHTML = `
<div class="my-agents-card__thumb">${thumbHtml}</div>
<div class="my-agents-card__body">
<h2 class="my-agents-card__name" title="${escapeHtml(agent.name)}">${escapeHtml(agent.name)}</h2>
<div class="my-agents-card__row">
- <span class="my-agents-card__chain-pill" title="Chain ID ${escapeHtml(String(agent.chainId))}">${escapeHtml(chainName(agent.chainId))}</span>
+ ${agent.chainId ? `<span class="my-agents-card__chain-pill" title="Chain ID ${escapeHtml(String(agent.chainId))}">${escapeHtml(chainName(agent.chainId))}</span>` : ''}
</div>
${agent.description ? `<p class="my-agents-card__desc">${escapeHtml(agent.description)}</p>` : ''}
</div>
@@ -176,10 +186,15 @@ function buildCard(agent) {
/**
* @param {HTMLElement} wrap
- * @param {{ chainId: number, agentId: string, name: string, alreadyImported: boolean }} agent
+ * @param {{ chainId: number, agentId: string, name: string, alreadyImported?: boolean, isNormal?: boolean }} agent
* @param {string|null} [importedId]
*/
function _renderCardAction(wrap, agent, importedId = null) {
+ if (agent.isNormal) {
+ wrap.innerHTML = `<a class="my-agents-btn" href="/agent/${escapeHtml(agent.agentId)}">Open</a>`;
+ return;
+ }
+
if (agent.alreadyImported || importedId) {
const id = importedId || '';
wrap.innerHTML = `
@@ -229,23 +244,73 @@ async function loadAgents() {
showSkeletons();
try {
- const agents = await fetchDiscoveredAgents();
+ const [onChainAgents, normalAgents] = await Promise.all([
+ fetchDiscoveredAgents().catch(e => { console.error("Error fetching on-chain agents:", e); return []; }),
+ fetchNormalAgents().catch(e => { console.error("Error fetching normal agents:", e); return []; })
+ ]);
+
+ const onChainAgentsMap = new Map();
+ for (const agent of onChainAgents) {
+ onChainAgentsMap.set(`${agent.chainId}:${agent.agentId}`, agent);
+ }
+
+ const allAgents = [];
+ const processedOnChain = new Set();
+
+ // Add normal agents, and if they are on-chain, merge info
+ for (const agent of normalAgents) {
+ const onChainKey = `${agent.chain_id}:${agent.erc8004_agent_id}`;
+ const onChainData = onChainAgentsMap.get(onChainKey);
+
+ const cardData = {
+ chainId: agent.chain_id,
+ agentId: agent.id, // Internal UUID
+ name: agent.name,
+ description: agent.description,
+ image: agent.avatar_id ? `/api/avatars/${agent.avatar_id}/thumbnail` : (onChainData ? onChainData.image : null),
+ glbUrl: onChainData ? onChainData.glbUrl : null,
+ isNormal: true,
+ onChain: !!onChainData
+ };
+ allAgents.push(cardData);
+
+ if (onChainData) {
+ processedOnChain.add(onChainKey);
+ }
+ }
+
+ // Add on-chain agents that haven't been imported yet
+ for (const agent of onChainAgents) {
+ const onChainKey = `${agent.chainId}:${agent.agentId}`;
+ if (!processedOnChain.has(onChainKey)) {
+ allAgents.push({
+ ...agent, // has name, description, image, glbUrl
+ isNormal: false,
+ onChain: true
+ });
+ }
+ }
grid.innerHTML = '';
- if (agents.length === 0) {
+ if (allAgents.length === 0) {
showState(
'🔭',
- 'No on-chain agents yet',
- 'No agents found in your linked wallets yet.',
- { label: 'Browse the community directory →', href: '/discover' },
+ 'No agents yet',
+ 'No agents found. Link a wallet or create a new agent.',
+ { label: 'Create an agent', href: '/create' },
+ { label: 'Browse community agents →', href: '/discover' },
);
return;
}
- for (const agent of agents) {
+ document.querySelector('.my-agents-title').textContent = 'My Agents';
+ document.querySelector('.my-agents-subtitle').textContent = 'Agents from your account and linked wallets';
+
+ for (const agent of allAgents) {
grid.appendChild(buildCard(agent));
}
+
} catch (err) {
grid.innerHTML = '';
const msg = err.message || '';
diff --git a/public/vanity-wallet.html b/public/vanity-wallet.html
index 42cde8632..9fc4831c4 100644
--- a/public/vanity-wallet.html
+++ b/public/vanity-wallet.html
@@ -197,18 +197,97 @@
<a href="/" aria-label="three.ws home"><span class="wordmark-dot" aria-hidden="true"></span>three.ws</a>
</h1>
<nav class="features-nav" aria-label="Primary">
- <a href="/app">Viewer</a>
- <a href="/create">Create</a>
- <a href="/discover">Discover</a>
- <a href="/features">Features</a>
- <a href="/widgets">Widgets</a>
- <a href="/studio">Studio</a>
- <a href="/chat">Chat</a>
- <a href="/docs">Docs</a>
- <a href="/dashboard" class="nav-dashboard">Dashboard</a>
- <a href="/my-agents" id="nav-my-agents" hidden>My Agents</a>
- <a href="/dashboard" id="nav-user" hidden class="nav-user"></a>
- </nav>
+ <ul class="nav-root" role="menubar">
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Build<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Build">
+ <li role="none">
+ <a href="/create" role="menuitem"
+ ><span class="nav-mi-title">Create agent</span
+ ><span class="nav-mi-sub">Avatar + brain wizard</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/app" role="menuitem"
+ ><span class="nav-mi-title">Viewer</span
+ ><span class="nav-mi-sub">Drag-and-drop GLB</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/validation" role="menuitem"
+ ><span class="nav-mi-title">glTF Validator</span
+ ><span class="nav-mi-sub">Khronos spec check</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Discover<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Discover">
+ <li role="none">
+ <a href="/discover" role="menuitem"
+ ><span class="nav-mi-title">Agents</span
+ ><span class="nav-mi-sub">Public directory</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/widgets" role="menuitem"
+ ><span class="nav-mi-title">Widgets gallery</span
+ ><span class="nav-mi-sub">Embeddable showcases</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/reputation" role="menuitem"
+ ><span class="nav-mi-title">Reputation</span
+ ><span class="nav-mi-sub">ERC-8004 registry</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item nav-has-menu" role="none">
+ <button
+ type="button"
+ class="nav-trigger"
+ aria-haspopup="true"
+ aria-expanded="false"
+ role="menuitem"
+ >
+ Solana<span class="nav-caret" aria-hidden="true">▾</span>
+ </button>
+ <ul class="nav-menu" role="menu" aria-label="Solana">
+ <li role="none">
+ <a href="/pumpfun" role="menuitem"
+ ><span class="nav-mi-title">Pump.fun stream</span
+ ><span class="nav-mi-sub">Mint agent tokens</span></a
+ >
+ </li>
+ <li role="none">
+ <a href="/vanity-wallet" role="menuitem"
+ ><span class="nav-mi-title">Vanity wallet</span
+ ><span class="nav-mi-sub">Generate address</span></a
+ >
+ </li>
+ </ul>
+ </li>
+ <li class="nav-item" role="none"><a href="/docs" role="menuitem">Docs</a></li>
+ </ul>
+ </nav>
</header>
<main id="main-content">
diff --git a/pumpfun-buy.html b/pumpfun-buy.html
index 31de33e54..a290d9fba 100644
--- a/pumpfun-buy.html
+++ b/pumpfun-buy.html
@@ -2,174 +2,64 @@
<html lang="en">
<head>
<meta charset="utf-8" />
- <title>Pump.fun Live</title>
+ <title>Pump.fun Buy</title>
+ <meta name="description" content="Pump.fun buy token widget." />
<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; }
+ * { 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 {
+ padding: 12px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
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;
+ .container {
+ border: 1px solid #222;
+ padding: 20px;
+ text-align: center;
}
- body.bg-light .symbol {
- color: #666;
+ #token-info {
+ margin-bottom: 20px;
}
- body.bg-light .mcap {
- color: #999;
+ #buy-button {
+ background: #00ff41;
+ color: #0a0a0a;
+ border: none;
+ padding: 10px 20px;
+ cursor: pointer;
+ font-weight: bold;
}
</style>
</head>
<body>
- <div id="root"></div>
+ <div class="container">
+ <div id="token-info">Loading...</div>
+ <button id="buy-button">Buy on Pump.fun</button>
+ </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;
- }
+ const params = new URL(location.href).searchParams;
+ const mint = params.get('mint');
- 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;
- }
+ if (!mint) {
+ document.getElementById('token-info').innerText = 'No mint address provided.';
+ document.getElementById('buy-button').style.display = 'none';
+ } else {
+ // In a real application, you would fetch token info using the mint address.
+ // For this example, we'll just display the mint address.
+ document.getElementById('token-info').innerText = `Token: ${mint.slice(0, 12)}...`;
+ document.getElementById('buy-button').onclick = () => {
+ window.open(`https://pump.fun/coin/${mint}`, '_blank');
};
-
- 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>
diff --git a/pumpfun-counter.html b/pumpfun-counter.html
new file mode 100644
index 000000000..d3494c35c
--- /dev/null
+++ b/pumpfun-counter.html
@@ -0,0 +1,79 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Pump.fun Counter</title>
+ <meta name="description" content="Pump.fun new token counter widget." />
+ <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: 24px;
+ font-weight: bold;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ height: 100vh;
+ text-align: center;
+ }
+ </style>
+ </head>
+ <body>
+ <div id="counter">0</div>
+ <script type="module">
+ let count = 0;
+ const counterElement = document.getElementById('counter');
+
+ 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) {
+ count++;
+ counterElement.innerText = count;
+ }
+ return;
+ }
+
+ if (ep.protocol === 'pumpportal') {
+ if (msg && msg.mint) {
+ count++;
+ counterElement.innerText = count;
+ }
+ return;
+ }
+ };
+
+ ws.onclose = () => {
+ setTimeout(connect, 1000);
+ };
+ }
+
+ connect();
+ </script>
+ </body>
+</html>
diff --git a/pumpfun-search.html b/pumpfun-search.html
new file mode 100644
index 000000000..3d5b0c875
--- /dev/null
+++ b/pumpfun-search.html
@@ -0,0 +1,122 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Pump.fun Search</title>
+ <meta name="description" content="Pump.fun token search widget." />
+ <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: 8px;
+ }
+ #search-input {
+ width: 100%;
+ background: #1a1a1a;
+ border: 1px solid #333;
+ color: #ccc;
+ padding: 6px 10px;
+ font-family: inherit;
+ font-size: 12px;
+ border-radius: 3px;
+ margin-bottom: 8px;
+ }
+ #results {
+ height: calc(100vh - 40px);
+ overflow-y: auto;
+ }
+ .entry {
+ border-bottom: 1px solid #111;
+ padding: 8px;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ }
+ .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-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; }
+ </style>
+ </head>
+ <body>
+ <input type="text" id="search-input" placeholder="Search tokens...">
+ <div id="results"></div>
+ <script type="module">
+ const SEARCH_API = '/api/pump/search?q=';
+ const searchInput = document.getElementById('search-input');
+ const resultsContainer = document.getElementById('results');
+ let debounceTimer;
+
+ searchInput.addEventListener('input', () => {
+ clearTimeout(debounceTimer);
+ debounceTimer = setTimeout(() => {
+ const query = searchInput.value.trim();
+ if (query) {
+ fetchSearch(query);
+ } else {
+ resultsContainer.innerHTML = '';
+ }
+ }, 300);
+ });
+
+ async function fetchSearch(query) {
+ try {
+ const response = await fetch(SEARCH_API + encodeURIComponent(query));
+ const tokens = await response.json();
+ renderTokens(tokens);
+ } catch (error) {
+ resultsContainer.innerText = 'Failed to load search results.';
+ console.error(error);
+ }
+ }
+
+ function renderTokens(tokens) {
+ resultsContainer.innerHTML = '';
+ tokens.forEach(token => {
+ const div = document.createElement('div');
+ div.className = 'entry';
+
+ const displayName = token.name || 'Unknown';
+ const displaySymbol = token.symbol ? '$' + token.symbol : '';
+ const mcap = token.market_cap ? fmtMcap(token.market_cap) : null;
+
+ let html = `<img class="token-img" src="${token.image_uri || ''}" alt="" style="${token.image_uri ? '' : '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 (token.mint) html += `<span><a href="https://pump.fun/coin/${token.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.innerHTML = html;
+ resultsContainer.appendChild(div);
+ });
+ }
+
+ function fmtMcap(mcap) {
+ if (!mcap || mcap <= 0) return null;
+ if (mcap >= 1000000) return (mcap / 1000000).toFixed(1) + 'M';
+ if (mcap >= 1000) return (mcap / 1000).toFixed(1) + 'K';
+ return mcap.toFixed(2);
+ }
+
+ function esc(s) {
+ const d = document.createElement('div');
+ d.textContent = s || '';
+ return d.innerHTML;
+ }
+ </script>
+ </body>
+</html>
diff --git a/pumpfun-trending.html b/pumpfun-trending.html
new file mode 100644
index 000000000..8b91d176e
--- /dev/null
+++ b/pumpfun-trending.html
@@ -0,0 +1,106 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Pump.fun Trending</title>
+ <meta name="description" content="Pump.fun trending tokens widget." />
+ <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;
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ }
+ .entry .rank {
+ font-size: 18px;
+ font-weight: bold;
+ color: #666;
+ width: 30px;
+ text-align: center;
+ }
+ .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-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; }
+ </style>
+ </head>
+ <body>
+ <div id="root"></div>
+ <script type="module">
+ const TRENDING_API = '/api/pump/trending';
+ const root = document.getElementById('root');
+
+ async function fetchTrending() {
+ try {
+ const response = await fetch(TRENDING_API);
+ const tokens = await response.json();
+ renderTokens(tokens);
+ } catch (error) {
+ root.innerText = 'Failed to load trending tokens.';
+ console.error(error);
+ }
+ }
+
+ function renderTokens(tokens) {
+ root.innerHTML = '';
+ tokens.forEach((token, index) => {
+ const div = document.createElement('div');
+ div.className = 'entry';
+
+ const displayName = token.name || 'Unknown';
+ const displaySymbol = token.symbol ? '$' + token.symbol : '';
+ const mcap = token.market_cap ? fmtMcap(token.market_cap) : null;
+
+ let html = `<div class="rank">#${index + 1}</div>`;
+ html += `<img class="token-img" src="${token.image_uri || ''}" alt="" style="${token.image_uri ? '' : '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 (token.mint) html += `<span><a href="https://pump.fun/coin/${token.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.innerHTML = html;
+ root.appendChild(div);
+ });
+ }
+
+ function fmtMcap(mcap) {
+ if (!mcap || mcap <= 0) return null;
+ if (mcap >= 1000000) return (mcap / 1000000).toFixed(1) + 'M';
+ if (mcap >= 1000) return (mcap / 1000).toFixed(1) + 'K';
+ return mcap.toFixed(2);
+ }
+
+ function esc(s) {
+ const d = document.createElement('div');
+ d.textContent = s || '';
+ return d.innerHTML;
+ }
+
+ fetchTrending();
+ </script>
+ </body>
+</html>
diff --git a/widgets.html b/widgets.html
index df436a5d6..0d7218bbe 100644
--- a/widgets.html
+++ b/widgets.html
@@ -36,6 +36,42 @@
</header>
<div class="market-body">
<div class="market-grid" id="widget-grid">
+ <div class="market-item">
+ <div class="market-item-thumb">
+ <iframe src="/pumpfun-search.html" width="100%" height="200px" style="border:none;"></iframe>
+ </div>
+ <div class="market-item-meta">
+ <h3>Pump.fun Search</h3>
+ <p>Search for tokens on Pump.fun.</p>
+ </div>
+ </div>
+ <div class="market-item">
+ <div class="market-item-thumb">
+ <iframe src="/pumpfun-trending.html" width="100%" height="200px" style="border:none;"></iframe>
+ </div>
+ <div class="market-item-meta">
+ <h3>Pump.fun Trending</h3>
+ <p>Trending tokens on Pump.fun.</p>
+ </div>
+ </div>
+ <div class="market-item">
+ <div class="market-item-thumb">
+ <iframe src="/pumpfun-counter.html" width="100%" height="200px" style="border:none;"></iframe>
+ </div>
+ <div class="market-item-meta">
+ <h3>Pump.fun Token Counter</h3>
+ <p>A live counter of new tokens on Pump.fun.</p>
+ </div>
+ </div>
+ <div class="market-item">
+ <div class="market-item-thumb">
+ <iframe src="/pumpfun-buy.html?mint=CAKE" width="100%" height="200px" style="border:none;"></iframe>
+ </div>
+ <div class="market-item-meta">
+ <h3>Pump.fun Buy Button</h3>
+ <p>A button to buy a specific token on Pump.fun.</p>
+ </div>
+ </div>
<div class="market-item">
<div class="market-item-thumb">
<iframe src="/pumpfun-widget.html?bg=dark" width="100%" height="200px" style="border:none;"></iframe>