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.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(smart-money): put the fork action on the smart-money cards
nirholas3f3d0eda0ce9
diff --git a/pages/smart-money.html b/pages/smart-money.htmlindex f745e74fd..3ba313a4b 100644--- a/pages/smart-money.html+++ b/pages/smart-money.html@@ -3,6 +3,7 @@<head><script>/* three.ws theme boot — no-flash; runtime in /theme-switcher.js */(function(){try{var m=localStorage.getItem('twx_theme');var l=m==='auto'?(window.matchMedia&&window.matchMedia('(prefers-color-scheme: light)').matches):m==='light';document.documentElement.setAttribute('data-theme',l?'light':'dark');}catch(e){document.documentElement.setAttribute('data-theme','dark');}})();</script><meta charset="utf-8" />+ <script src="/referral-capture.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover" /><title data-i18n="smart_money.meta_title">Smart Money Radar — follow the wallets that actually win on pump.fun · three.ws</title><meta name="description" content="A live, first-party reputation graph of every pump.fun wallet. We cross each coin's buyers with which coins actually graduated, so you can see exactly which wallets keep picking winners — and what they're buying right now." data-i18n-attr="content:smart_money.meta_description"/>@@ -108,6 +109,21 @@.sm-watch:hover { color: var(--ink); }.sm-watch:focus-visible { outline: 2px solid #7c83ff; outline-offset: 1px; }@media (hover: none) { .sm-watch { opacity: 1; } }+ /* Fork: the card's one live action. Opens the real pump.fun trade panel for+ this coin (src/fork-trade.js); the visitor's own wallet signs it. The+ card reserves a strip for it rather than floating it over the score+ badge, and it stays visible: this is the page's call to action, not a+ hover easter egg. */+ .sm-coin-wrap .coin { padding-bottom: 55px; }+ .sm-fork { position: absolute; left: 15px; right: 15px; bottom: 13px; z-index: 2; height: 32px;+ display: inline-flex; align-items: center; justify-content: center; gap: 6px;+ border-radius: 9px; border: 1px solid rgba(124,131,255,.45); background: rgba(124,131,255,.14);+ color: var(--ink); font: 700 12px/1 var(--mono, ui-monospace, monospace); letter-spacing: .06em;+ cursor: pointer; transition: background .15s, border-color .15s, transform .15s; }+ .sm-fork:hover { background: rgba(124,131,255,.3); border-color: #7c83ff; }+ .sm-fork:active { transform: translateY(1px); }+ .sm-fork:focus-visible { outline: 2px solid #7c83ff; outline-offset: 2px; }+ @media (prefers-reduced-motion: reduce) { .sm-fork { transition: none; } .sm-fork:active { transform: none; } }.coin { text-align: left; width: 100%; background: var(--panel); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);border: 1px solid var(--line); border-radius: var(--r); padding: 15px; box-shadow: var(--shadow);display: flex; flex-direction: column; gap: 13px; transition: transform .14s, border-color .18s; }@@ -240,6 +256,7 @@.state { padding: 56px 22px; text-align: center; color: var(--muted); }.state b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 8px; }.state .btn { margin-top: 16px; }+ .dr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);background: var(--panel); font-weight: 600; font-size: 13px; transition: transform .12s, border-color .2s; }.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--cyan) 50%, var(--line)); }@@ -404,6 +421,8 @@</div><script type="module">+ import { initFork, forkButton } from '/src/fork-trade.js';+const API = '/api/pump/smart-money';const $ = (id) => document.getElementById(id);const fmtSol = (n) => (n == null ? '0' : (n >= 100 ? Math.round(n) : n.toFixed(n >= 10 ? 1 : 2)));@@ -550,6 +569,13 @@wrap.className = 'sm-coin-wrap';wrap.appendChild(btn);+ // The page's whole claim is "proven wallets are in this coin". Fork is the+ // one place that claim becomes an action: it opens the real trade panel+ // for this mint, and the visitor's own wallet signs it.+ const fk = document.createElement('div');+ fk.innerHTML = forkButton({ mint: c.mint, symbol: c.symbol, name: c.name }, { label: 'Fork this trade', className: 'sm-fork' });+ if (fk.firstElementChild) wrap.appendChild(fk.firstElementChild);+if (watchOffer) {const watched = isWatched(c.mint);const wb = document.createElement('button');@@ -895,7 +921,11 @@<div class="dr-sec">Notable wallets buying</div>${rows}<div id="sm-oracle-slot" class="sm-oracle-slot"><div class="skel" style="height:80px;margin-top:16px"></div></div>- <a class="btn primary" style="margin-top:18px" href="https://pump.fun/${esc(coin.mint)}" target="_blank" rel="noopener">Open on pump.fun →</a>`;+ <div class="dr-actions">+ ${forkButton({ mint: coin.mint, symbol: coin.symbol, name: coin.name }, { label: 'Fork this trade', className: 'btn primary' })}+ ${forkButton({ mint: coin.mint, symbol: coin.symbol, name: coin.name }, { label: 'Share ↗', className: 'btn', share: true })}+ <a class="btn" href="https://pump.fun/${esc(coin.mint)}" target="_blank" rel="noopener">pump.fun →</a>+ </div>`;$('drBody').querySelectorAll('.nwallet[data-wallet]').forEach((el) => {const go = () => openWallet(el.dataset.wallet);@@ -1106,6 +1136,7 @@$('staleRetry').addEventListener('click', manualRetry);// boot+ initFork();renderWalletHead();updateWatchCount();$('feedGrid').innerHTML = Array.from({ length: 6 }, () => '<div class="skel"></div>').join('');diff --git a/src/fork-trade.js b/src/fork-trade.jsindex 2913cf15f..9c8bb60bb 100644--- a/src/fork-trade.js+++ b/src/fork-trade.js@@ -112,7 +112,9 @@ export async function openFork(trade) {const { openBuyModal } = await import('./game/coin-buy.js');openBuyModal({ mint: trade.mint, symbol: trade.symbol, name: trade.name, image: trade.image },- { mode: 'buy', amount: clampForkSize(trade.size) ?? undefined },+ // elevate: a fork always opens on a page carrying the site nav, which+ // stacks above the modal's default /play layer.+ { mode: 'buy', amount: clampForkSize(trade.size) ?? undefined, elevate: true },);return true;} catch {diff --git a/src/game/coin-buy.css b/src/game/coin-buy.cssindex 102084ec4..eeeccfd80 100644--- a/src/game/coin-buy.css+++ b/src/game/coin-buy.css@@ -33,6 +33,12 @@opacity: 0; transition: opacity 0.18s ease;}.cc-buy-overlay.cc-on { opacity: 1; }+/* Opened from a page that carries the site nav (a forked trade: /trades,+ /radar, /smart-money) rather than from inside a /play world. The nav is+ sticky at z-index 100 and its menus at 200, so the default 80 would slide+ the modal's own header, and its close button, under the header bar. Kept as+ an opt-in modifier so the /play HUD's stacking is untouched. */+.cc-buy-overlay.cc-buy-elevated { z-index: 9000; }.cc-buy-card {width: 100%; max-width: 380px;background: var(--cc-panel-solid); border: 1px solid var(--cc-edge);diff --git a/src/game/coin-buy.js b/src/game/coin-buy.jsindex b52f209ba..3b7e1f311 100644--- a/src/game/coin-buy.js+++ b/src/game/coin-buy.js@@ -117,8 +117,9 @@ function friendlyTradeError(err, mode = 'buy') {* so a forked trade never leaves the user staring at the previous coin's panel.* Opens in Buy mode; the user can switch to Sell inside the modal.* @param {{mint:string, name?:string, symbol?:string, image?:string}} coin- * @param {{mode?: 'buy'|'sell', amount?: number}} [opts] `amount` pre-fills the- * buy input (SOL), which is how a forked trade carries its size across.+ * @param {{mode?: 'buy'|'sell', amount?: number, elevate?: boolean}} [opts]+ * `amount` pre-fills the buy input (SOL), which is how a forked trade carries+ * its size across; `elevate` lifts the modal above a page's sticky site nav.*/export function openBuyModal(coin, opts = {}) {if (!coin?.mint) return;@@ -148,6 +149,9 @@ class TradeModal {// means nothing against a USDC curve.const preset = Number(opts.amount);if (mode === 'buy' && Number.isFinite(preset) && preset > 0) this.amount = preset;+ // Pages with the site nav stack their chrome above this modal's default+ // layer; they opt into a higher one. See .cc-buy-elevated.+ this.elevate = !!opts.elevate;this._sellMax = false;this.slippageBps = DEFAULT_SLIPPAGE_BPS;this.busy = false;@@ -274,7 +278,7 @@ class TradeModal {pumpLink,]);- this.overlay = el('div', { class: 'cc-buy-overlay', onpointerdown: (e) => { if (e.target === this.overlay) this.close(); } }, [this.card]);+ this.overlay = el('div', { class: `cc-buy-overlay${this.elevate ? ' cc-buy-elevated' : ''}`, onpointerdown: (e) => { if (e.target === this.overlay) this.close(); } }, [this.card]);// Keep the game from swallowing typing/keys while the modal is up.this.card.addEventListener('keydown', (e) => {if (e.key === 'Escape') this.close();