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(charts): offer DEXTools and every chart terminal on the Oracle and Pump Dashboard charts
ni3a154e13068df1
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex b1fa782ca..dd774163f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -6,7 +6,9 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr## 2026-09-21+- **Paying at the Club door no longer fails when our own traffic has been busy**: Some visitors paying the Club cover approved the payment in their wallet and then saw it fail at the last step with an internal error. The cause was on our side. We cover the small Solana network fee on your payment, and a safety limit that spreads our own automated payments across the day was also being applied to customers, so once our background traffic had used the morning's share, a real payment was turned away. Customers are now exempt from that limit: if you are paying, the payment goes through, and our own traffic waits instead. Nothing was charged on a failed attempt. Separately, when a wallet refuses to open its approval window, the payment window now says plainly that nothing was signed or charged and what to try next, instead of repeating the wallet's own wording. (`/club`) `[fix]`- **Phantom users no longer have to switch off transaction protection to pay**: Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee. (`/club`) `[fix]`+- **Pick DEXTools as your chart on every coin chart**: The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them. (`/docs/coin-pages`) `[feature, improvement]`- **Three SDKs now report the version you actually installed**: The walk, tour and assistant SDKs each export a VERSION constant, and a release earlier this month bumped all three packages without updating it. Code that read the constant got the previous release's number: 0.3.0 from walk 0.3.1, 0.5.1 from tour 0.5.2, 1.0.0 from assistant 1.0.1. The constants now match the packages, and the tour builder's copy-paste embed snippet points at tour 0.5.2. Only the tour SDK had a test comparing the two, which is how this was found; the other two were caught by checking every package from that release for the same mistake. Copies already installed from npm keep the old number until the next release of each package. (`/tour-builder`) `[sdk, fix]`## 2026-09-20diff --git a/STRUCTURE.md b/STRUCTURE.mdindex 0e84bbe55..be0cd5f87 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -260,7 +260,7 @@ bottom.| Social recovery & inheritance (guardian console) | page [pages/guardian.html](pages/guardian.html) `-> /guardian` + client [src/guardian.js](src/guardian.js), inbox [api/agents/recovery-inbox.js](api/agents/recovery-inbox.js) `-> GET /api/agents/recovery-inbox`, per-agent actions [api/agents/recovery.js](api/agents/recovery.js) `-> /api/agents/:id/recovery/...`, rules [api/_lib/agent-recovery.js](api/_lib/agent-recovery.js), owner-side tab [src/agent-wallet-hub/tabs/recovery.js](src/agent-wallet-hub/tabs/recovery.js), schema [api/_lib/migrations/20260623100000_social_recovery.sql](api/_lib/migrations/20260623100000_social_recovery.sql) | Live | The other side of a locked-out or departed owner. The owner names guardians, an approval threshold and a beneficiary from their agent's wallet hub; the guardians and beneficiaries act from `/guardian`, which lists every agent they are trusted to protect with the open recovery or inheritance process, the reason the requester gave, who has already voted, the safety-window and expiry countdowns, and their own approve / decline / confirm / complete actions. A key is never decrypted or exported: completing a process re-points ownership only. The requester cannot approve their own takeover, an open request freezes autonomous spend, threshold approvals start a 48h time-lock, and the real owner's return cancels the whole thing. Inheritance is a dead-man's switch armed from real owner activity plus a grace window. Docs: [docs/guardian.md](docs/guardian.md), [docs/custody.md](docs/custody.md). Tests: [tests/agent-recovery.test.js](tests/agent-recovery.test.js), [tests/api-agents-recovery-handler.test.js](tests/api-agents-recovery-handler.test.js) || Master wallet (per-user custodial hub) | page [pages/wallet.html](pages/wallet.html) `→ /wallet` + controller [src/master-wallet.js](src/master-wallet.js), client [src/wallet-api.js](src/wallet-api.js), styles [public/master-wallet.css](public/master-wallet.css); API [api/user/wallet/index.js](api/user/wallet/index.js) (create + balances), [send.js](api/user/wallet/send.js), [fund-agent.js](api/user/wallet/fund-agent.js), [history.js](api/user/wallet/history.js); schema [master_wallets](api/_lib/migrations/20260730040000_master_wallets.sql) | In-repo | One custodial Solana + EVM keypair per USER account (distinct from per-agent wallets): hold SOL/USDC across Solana and Base, top up any agent you own, send to any Solana address, and read history straight from chain. Session-cookie auth only, so no API key or agent can ever spend it; writes are CSRF-guarded and capped at 5 outbound transfers per user per day. The page prices every send through the server's `simulate` path first and requires an explicit confirm showing recipient, amount, asset and network before anything is signed. NOT [src/wallet.js](src/wallet.js), which connects an external Phantom/Seed-Vault wallet. Docs: [docs/user-wallet.md](docs/user-wallet.md). Tests: [tests/master-wallet-page.test.js](tests/master-wallet-page.test.js) || Real-funds agreements (signature gate) | dialog [public/risk-ack.js](public/risk-ack.js), app wrapper [src/shared/risk-ack.js](src/shared/risk-ack.js), server enforcement [api/_lib/real-funds-agreement.js](api/_lib/real-funds-agreement.js), sign/status endpoint [api/legal/risk-ack.js](api/legal/risk-ack.js), review page [public/legal/agreements.html](public/legal/agreements.html) `→ /legal/agreements`, documents [public/legal/tos.html](public/legal/tos.html), [public/legal/risk.html](public/legal/risk.html), [public/legal/agent-wallet.html](public/legal/agent-wallet.html) `→ /legal/agent-wallet`, coverage guard [tests/real-funds-agreement-coverage.test.js](tests/real-funds-agreement-coverage.test.js) | In-repo | Before any real-funds action (deposit address reveal, tip, trade, snipe, withdraw, send, swap, launch, x402, onramp, autopilot arm) a person signs the Terms of Service, Risk Disclosure, and Agent Wallet Agreement: one checkbox per document, eligibility and no-liability attestations, and a typed-name e-signature. Signatures land append-only in `legal_signatures` with document versions and text fingerprints. Every custodial money endpoint calls `requireRealFundsAgreement()`, which answers `403 risk_ack_required` for unsigned accounts (session and API key alike); devnet exempt. See [docs/risk-acknowledgment.md](docs/risk-acknowledgment.md) |-| Global markets + coin detail pages | [pages/coins.html](pages/coins.html) + [src/coins-index.js](src/coins-index.js) `→ /coins`, [pages/coin.html](pages/coin.html) + [src/coin-page.js](src/coin-page.js) `→ /coin/:id`, backend [api/coin/](api/coin) (detail, tickers, ohlc, pool, markets, news, global over [api/_lib/coingecko.js](api/_lib/coingecko.js)) | In-repo | CoinGecko-style markets index (global stats bar, sortable top-coins table, search, sparklines) + a rich detail page per coin: interactive chart with a source switcher (native CoinGecko line chart, TradingView advanced candlesticks, or the DexScreener / GeckoTerminal on-chain terminal — each shown only when it can chart the coin; GeckoTerminal's pool resolved via [api/coin/pool.js](api/coin/pool.js)), 1h→1y price-performance matrix, market-stats grid, circulating/max supply bar with Mcap/FDV ratio, ATH/ATL with drawdown & recovery multiple, community sentiment vote split, community + developer (GitHub) activity grids, a paginated exchange-listings table (`api/coin/tickers`, ±2% depth + trust) linking into exchange detail, related news, and full link pills (site/social/whitepaper/forum/chat/explorers). Design adopted from cryptocurrency.cv; accepts CoinGecko slugs or Solana mints. Docs: [docs/coin-pages.md](docs/coin-pages.md) |+| Global markets + coin detail pages | [pages/coins.html](pages/coins.html) + [src/coins-index.js](src/coins-index.js) `→ /coins`, [pages/coin.html](pages/coin.html) + [src/coin-page.js](src/coin-page.js) `→ /coin/:id`, backend [api/coin/](api/coin) (detail, tickers, ohlc, pool, markets, news, global over [api/_lib/coingecko.js](api/_lib/coingecko.js)) | In-repo | CoinGecko-style markets index (global stats bar, sortable top-coins table, search, sparklines) + a rich detail page per coin: interactive chart with a source switcher (native CoinGecko line chart, TradingView advanced candlesticks, or the DexScreener / GeckoTerminal on-chain terminal, each shown only when it can chart the coin; GeckoTerminal's pool resolved via [api/coin/pool.js](api/coin/pool.js); the same provider list, DEXTools included, is one tab away on every other coin chart through the compact [src/shared/chart-switcher.js](src/shared/chart-switcher.js), which `/trades`, Mission Control, `/oracle/coin/<mint>` and the `/pump-dashboard` market chart mount, the buildless Oracle page from the stable `/chart-switcher.js` bundle; tests [tests/chart-switcher.dom.test.js](tests/chart-switcher.dom.test.js)), 1h→1y price-performance matrix, market-stats grid, circulating/max supply bar with Mcap/FDV ratio, ATH/ATL with drawdown & recovery multiple, community sentiment vote split, community + developer (GitHub) activity grids, a paginated exchange-listings table (`api/coin/tickers`, ±2% depth + trust) linking into exchange detail, related news, and full link pills (site/social/whitepaper/forum/chat/explorers). Design adopted from cryptocurrency.cv; accepts CoinGecko slugs or Solana mints. Docs: [docs/coin-pages.md](docs/coin-pages.md) || Global Intel Globe (`/globe`) | Page [pages/globe.html](pages/globe.html) `-> /globe`, renderer [src/globe-intel.js](src/globe-intel.js), pure logic [src/globe-intel-core.js](src/globe-intel-core.js), styles [src/globe-intel.css](src/globe-intel.css); API [api/globe/intel.js](api/globe/intel.js) over [api/_lib/globe-sources.js](api/_lib/globe-sources.js) and [api/_lib/globe-centroids.js](api/_lib/globe-centroids.js); ingest [api/cron/globe-ingest.js](api/cron/globe-ingest.js) -> `globe_events`; reference set [data/globe-reference.json](data/globe-reference.json), geometry baked by [scripts/build-globe-geometry.mjs](scripts/build-globe-geometry.mjs) into [public/data/globe-land.json](public/data/globe-land.json) + [data/country-centroids.json](data/country-centroids.json) | Live | **A 3D globe of what is happening on Earth right now.** Eleven layers on one sphere: armed conflict, force posture and sanctions classified out of the GDELT 2.0 event stream by CAMEO code, attention hotspots computed from them, natural events (USGS, NASA EONET, GDACS), severe weather (GDACS), national internet outages (Georgia Tech IODA), economic stress (World Bank), and the reference geography that gives the live layers meaning: overseas military bases, nuclear sites, and maritime chokepoints that score themselves against the live feed rather than sitting still. Every upstream is keyless, so the page works on a fresh clone. GDELT publishes one file every 15 minutes and no queryable history (its GEO 2.0 API 404s for every query), so the 24h/7d/30d control is only honest because the cron keeps the window in Postgres; each layer reports the span it actually covered and the panel prints "Covers 15h so far" rather than implying a week. A dead upstream renders as a named layer with its reason, never as an empty globe. Camera, zoom, projection, range and layer selection all live in the URL, so any view is a shareable link. Globe and flat map are the same geometry lerped between two projections, written into `position` rather than a vertex shader so every marker stays pickable in both. Docs: [docs/globe.md](docs/globe.md). Tests: [tests/globe-intel-core.test.js](tests/globe-intel-core.test.js), [tests/globe-sources.test.js](tests/globe-sources.test.js) || Token in 3D (`/coin3d`, embeddable) | [pages/coin3d.html](pages/coin3d.html) + [src/coin3d/main.js](src/coin3d/main.js) `→ /coin3d`; pair bridge [api/coin/pair.js](api/coin/pair.js) `→ /api/coin/pair` over `tokenForPool()` in [api/_lib/market/ohlcv.js](api/_lib/market/ohlcv.js) | In-repo | Any Solana token as a live 3D scene: logo medallion, holder galaxy sized by balance, graduation ring, and a tape of real swaps, all from on-chain and live market data, degrading to a data view where WebGL is unavailable. Addressable two ways: `?mint=` (what three.ws keys tokens by) or `?pair=` (what every DEX terminal keys a market by), resolved through `/api/coin/pair`, the inverse of [api/coin/pool.js](api/coin/pool.js). `?embed=1` plus `frame-ancestors *` on the route make it framable on any site, with one attribution link as its only added chrome. Tests: [tests/api/coin-pair.test.js](tests/api/coin-pair.test.js) (route contract), [tests/api/coin-pair-resolver.test.js](tests/api/coin-pair-resolver.test.js) (the resolver and its fallback). Docs: [docs/coin3d-embed.md](docs/coin3d-embed.md) || Market tools (heatmap, sentiment, gas, compare) | [pages/heatmap.html](pages/heatmap.html) + [src/heatmap.js](src/heatmap.js) `→ /heatmap`, [pages/fear-greed.html](pages/fear-greed.html) + [src/fear-greed.js](src/fear-greed.js) `→ /fear-greed`, [pages/gas.html](pages/gas.html) + [src/gas.js](src/gas.js) `→ /gas`, [pages/compare.html](pages/compare.html) + [src/compare.js](src/compare.js) `→ /compare`; backend [api/coin/fear-greed.js](api/coin/fear-greed.js), [api/coin/gas.js](api/coin/gas.js) | In-repo | Four tools extending Markets, same design system: treemap heatmap (market-cap-sized tiles), Fear & Greed gauge + history, live Ethereum gas tracker (keyless `eth_feeHistory`), and up-to-4-coin compare (overlay perf + stats). All real key-free data; cross-linked from the markets table. Docs: [docs/coin-pages.md](docs/coin-pages.md) |diff --git a/data/changelog.json b/data/changelog.jsonindex 9b4184b60..6d7c3f4c6 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -20,6 +20,16 @@],"link": "/club"},+ {+ "date": "2026-09-21",+ "title": "Pick DEXTools as your chart on every coin chart",+ "summary": "The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them.",+ "tags": [+ "feature",+ "improvement"+ ],+ "link": "/docs/coin-pages"+ },{"date": "2026-09-20","title": "Repeat visits stop downloading the app's code twice",diff --git a/docs/coin-pages.md b/docs/coin-pages.mdindex fd496a70b..8bb80cb93 100644--- a/docs/coin-pages.md+++ b/docs/coin-pages.md@@ -65,11 +65,19 @@ Grotesk display face).`tws_coin_chart_source`), and the embeds follow the site's light/dark theme.Every embed URL shape lives once in[`src/shared/chart-embeds.js`](../src/shared/chart-embeds.js), so this page,- the launch coin page `/launches/<mint>`, the `/trades` deep-dive and Mission- Control (the last two through the compact switcher in+ the launch coin page `/launches/<mint>`, the `/trades` deep-dive, Mission+ Control, the Oracle coin page `/oracle/coin/<mint>` and the `/pump-dashboard`+ market chart (the last four through the compact switcher in[`src/shared/chart-switcher.js`](../src/shared/chart-switcher.js)) buildidentical embeds and a provider changing its format is a one-file fix. Adding- a provider there adds its tab on all four surfaces. Providers that refuse cross-origin+ a provider there adds its tab on all six surfaces. A surface that already+ draws a chart of its own keeps it: it hands the switcher its views through+ `nativeViews` (the Oracle page's Line and Agent trades views, the dashboard's+ canvas chart) and the providers line up behind them, styled with the host's+ own segmented-control classes. The Oracle page is buildless, so it loads the+ switcher from the stable `/chart-switcher.js` URL the build publishes. The+ `$THREE` page at `/three` is the one surface with no switcher, because its+ chart is already the DEXTools widget. Providers that refuse cross-originframing or need a key are left out rather than offered as a tab that can onlyfail.diff --git a/marketing/dextools/README.md b/marketing/dextools/README.mdnew file mode 100644index 000000000..54dc284af--- /dev/null+++ b/marketing/dextools/README.md@@ -0,0 +1,57 @@+# DEXTools charts on three.ws++Announcement graphics for DEXTools charts being a selectable source on every+coin chart on three.ws.++| File | Size | Use it for |+| --- | --- | --- |+| [three-ws-dextools-charts-16x9.png](three-ws-dextools-charts-16x9.png) | 3200x1800 (16:9) | Timeline posts, blog headers, link previews |+| [three-ws-dextools-charts-1x1.png](three-ws-dextools-charts-1x1.png) | 3200x3200 (1:1) | Anywhere the crop is square: profile posts, Telegram, chat previews |++Both render from one layout, [partnership-card.html](partnership-card.html).++## Regenerating++```bash+npm run render:dextools-card+```++Edit `partnership-card.html`, run that, commit the PNGs. It is the same renderer+as the [pump.fun verified card](../pumpfun-verified/README.md)+(`scripts/render-pumpfun-verified.mjs --set=dextools`): the page is served over+HTTP and the run fails loudly if any asset 404s, so a card never ships in a+fallback font. Pass `--scale=3` for a 3x render or `--out=<dir>` to write+elsewhere.++## What is on the card++- **three.ws lockup**: `public/brand/three-ws-lockup-on-dark.png`, the standard+ on-dark lockup from the [brand kit](../brand/README.md).+- **DEXTools mark**: `public/marks/dextools-alpha.png`. It is DEXTools' own+ hexagon mark, taken from the 680px original CoinGecko serves for the project,+ with its white plate keyed out to alpha so it sits on black. The anti-aliased+ edge was un-mixed against the mark's own colour, so there is no pale halo. The+ mark's shape, proportions and gradient are untouched. The wordmark beside it+ is set in Space Grotesk 700 to match the weight of the three.ws lockup, the+ same call the pump.fun card makes, and is not an imitation of DEXTools' own+ lettering.+- **The pill**: the one-line claim, "Every coin on three.ws. Real-time charts."+- **Footer**: "DEXTools Charts, now live on three.ws" and "Powered by+ @DEXToolsApp".++Palette: `#0a0a0a` ground, `#22c3e6` accent (sampled from the DEXTools mark, the+way every house partner card takes its accent from the partner), `#1c1c1c` frame.+Type: Space Grotesk (wordmark), JetBrains Mono (eyebrow, pill, footer), all from+`public/fonts/`.++## Copy rules++The card says **charts, now live** and **powered by**. It does not say partner+or partnership: what is true today is that three.ws embeds DEXTools' published+chart widget as a selectable source on its coin charts, which is an integration+we shipped, not an agreement DEXTools signed. If the+[proposal](../../docs/partners/dextools-proposal.md) lands and DEXTools agrees to+co-announce, the eyebrow is the line to change.++The claim in the pill is checkable. The chart surfaces and the shared provider+list behind them are documented in [coin pages](../../docs/coin-pages.md).diff --git a/marketing/dextools/partnership-card.html b/marketing/dextools/partnership-card.htmlnew file mode 100644index 000000000..76d807ec9--- /dev/null+++ b/marketing/dextools/partnership-card.html@@ -0,0 +1,88 @@+<!doctype html>+<meta charset="utf-8">+<title>three.ws x DEXTools charts card</title>+<!--+ Source for the "DEXTools charts, now live on three.ws" graphics.++ Renders two sizes from one layout: 1600x900 by default, 1600x1600 with the+ "#square" hash. Every asset is a repo file referenced relatively, so a fresh+ clone re-renders the exact PNGs in marketing/dextools/ with:++ npm run render:dextools-card++ See README.md in this directory for the palette and the copy rules.+-->+<style>+@font-face { font-family: Inter; src: url('../../public/fonts/inter-latin.woff2') format('woff2'); font-weight: 100 900; font-display: block; }+@font-face { font-family: 'Space Grotesk'; src: url('../../public/fonts/space-grotesk-latin.woff2') format('woff2'); font-weight: 300 700; font-display: block; }+@font-face { font-family: 'JetBrains Mono'; src: url('../../public/fonts/jetbrains-mono-latin.woff2') format('woff2'); font-weight: 100 800; font-display: block; }++* { box-sizing: border-box; margin: 0; padding: 0; }+html, body { width: 1600px; height: 900px; background: #0a0a0a; }+body.square, body.square html { height: 1600px; }+body.square .card { height: 1600px; }++.card { position: relative; width: 1600px; height: 900px; background: #0a0a0a;+ display: flex; flex-direction: column; align-items: center; justify-content: center; }+.frame { position: absolute; inset: 26px; border: 1px solid #1c1c1c; border-radius: 4px; }++.eyebrow { font-family: 'JetBrains Mono', monospace; font-size: 19px; font-weight: 500;+ letter-spacing: .42em; color: #22c3e6; margin-bottom: 96px; }+.eyebrow span { color: #12667a; margin-right: 12px; }++.lockup { display: flex; align-items: center; gap: 56px; }+.brand { display: flex; align-items: center; gap: 28px; }+.threews img { height: 92px; display: block; }+.dext img { height: 112px; display: block; }+/* Set in Space Grotesk 700 to match the weight of the three.ws lockup, the same+ call the pump.fun card makes, not an imitation of DEXTools' own lettering. */+.dext .word { font-family: 'Space Grotesk', Inter, sans-serif; font-size: 62px; font-weight: 700;+ color: #fff; letter-spacing: -.02em; }+.rule { width: 1px; height: 118px;+ background: linear-gradient(180deg, transparent, #2a2a2a 22%, #2a2a2a 78%, transparent); }++/* The one-line claim, in a terminal-style pill: three status dots and a caret. */+.pill { margin-top: 92px; display: flex; align-items: center; gap: 18px;+ padding: 15px 28px 15px 24px; border: 1px solid #1f2a2e; border-radius: 10px;+ background: #0d1113; font-family: 'JetBrains Mono', monospace; font-size: 20px;+ font-weight: 500; letter-spacing: .02em; color: #d7dde0; }+.dots { display: flex; gap: 7px; }+.dots i { width: 7px; height: 7px; border-radius: 50%; background: #1d3a42; display: block; }+.dots i:first-child { background: #22c3e6; }+.caret { width: 2px; height: 22px; background: #22c3e6; margin-left: 2px; }++.foot { position: absolute; left: 78px; right: 78px; bottom: 58px; display: flex;+ justify-content: space-between; align-items: flex-end;+ font-family: 'JetBrains Mono', monospace; font-size: 18px; letter-spacing: .06em; color: #5a5a5a;+ line-height: 1.55; }+.foot .l b { display: block; font-weight: 500; color: #9a9a9a; }+.foot em { font-style: normal; color: #22c3e6; }+</style>+<div class="card">+ <div class="frame"></div>++ <div class="eyebrow"><span>//</span>DEXTOOLS CHARTS · NOW LIVE</div>++ <div class="lockup">+ <div class="brand threews"><img src="../../public/brand/three-ws-lockup-on-dark.png" alt="three.ws"></div>+ <div class="rule"></div>+ <div class="brand dext">+ <img src="../../public/marks/dextools-alpha.png" alt="DEXTools">+ <div class="word">DEXTools</div>+ </div>+ </div>++ <div class="pill">+ <div class="dots"><i></i><i></i><i></i></div>+ <div>Every coin on three.ws. Real-time charts.</div>+ <div class="caret"></div>+ </div>++ <div class="foot">+ <div class="l"><b>DEXTools Charts</b>Now live on <em>three.ws</em></div>+ <div>Powered by <em>@DEXToolsApp</em></div>+ </div>+</div>+<script>+ if (location.hash === '#square') document.body.classList.add('square');+</script>diff --git a/marketing/dextools/three-ws-dextools-charts-16x9.png b/marketing/dextools/three-ws-dextools-charts-16x9.pngnew file mode 100644index 000000000..b2d08136dBinary files /dev/null and b/marketing/dextools/three-ws-dextools-charts-16x9.png differdiff --git a/marketing/dextools/three-ws-dextools-charts-1x1.png b/marketing/dextools/three-ws-dextools-charts-1x1.pngnew file mode 100644index 000000000..01cea5753Binary files /dev/null and b/marketing/dextools/three-ws-dextools-charts-1x1.png differdiff --git a/pages/pump-dashboard.html b/pages/pump-dashboard.htmlindex 644a28d65..df30b49f8 100644--- a/pages/pump-dashboard.html+++ b/pages/pump-dashboard.html@@ -588,7 +588,8 @@color: var(--ink-dim);"></div>- <div style="position: relative">+ <div id="pd-chart-switch"></div>+ <div id="pd-chart-native" style="position: relative"><canvasid="pd-market-chart"style="width: 100%; height: 300px; display: block"@@ -1669,6 +1670,7 @@getConnectedWalletAddress,} from '/src/wallet.js';import { emptyStateHTML } from '/src/shared/state-kit.js';+ import { mountSwitchableChart } from '/src/shared/chart-switcher.js';// Some embedded webviews — notably the in-app browsers X/Twitter// and a few Android wrappers ship — expose `window.localStorage`@@ -4591,6 +4593,32 @@}}+ // Chart source bar: this desk's own candle chart, or any terminal the rest+ // of three.ws offers (DexScreener, Birdeye, GMGN, DEXTools, GeckoTerminal).+ // The native canvas stays in the DOM and is only hidden while a provider+ // is showing, because the fetch, overlay and hover code all address it by+ // id; its ResizeObserver redraws it the moment it is shown again.+ let chartSources = null;+ function mountChartSources(mint) {+ chartSources?.destroy();+ const nativeBlock = $('pd-chart-native');+ chartSources = mountSwitchableChart({+ host: $('pd-chart-switch'),+ mint,+ nativeViews: [+ {+ id: 'threews',+ label: 'three.ws',+ mount: () => {+ nativeBlock.hidden = false;+ return { destroy: () => (nativeBlock.hidden = true) };+ },+ },+ ],+ classes: { tabs: 'pd-chart-sources', tab: 'pd-btn pd-btn-sm', active: 'is-primary' },+ });+ }+async function fetchChartData(mint, symbol) {chart.mint = mint;chart.symbol = symbol;@@ -5068,9 +5096,10 @@if (chart.mint) fetchChartData(chart.mint, chart.symbol);else loadTrendingTokens();});- document.addEventListener('chart:tokenChange', (e) =>- fetchChartData(e.detail.mint, e.detail.symbol),- );+ document.addEventListener('chart:tokenChange', (e) => {+ fetchChartData(e.detail.mint, e.detail.symbol);+ mountChartSources(e.detail.mint);+ });const marketCanvas = $('pd-market-chart');marketCanvas.addEventListener('mousemove', onChartMove);marketCanvas.addEventListener('mouseleave', () => {diff --git a/public/changelog-recent.json b/public/changelog-recent.jsonindex b92f4e559..40533fcfc 100644--- a/public/changelog-recent.json+++ b/public/changelog-recent.json@@ -1,14 +1,24 @@{- "generated_at": "2026-09-21T02:53:24.112Z",+ "generated_at": "2026-09-21T05:41:11.543Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},- "total": 3739,+ "total": 3741,"complete": false,"full_feed": "/changelog.json","entries": [+ {+ "date": "2026-09-21",+ "type": "update",+ "title": "Paying at the Club door no longer fails when our own traffic has been busy",+ "summary": "Some visitors paying the Club cover approved the payment in their wallet and then saw it fail at the last step with an internal error. The cause was on our side. We cover the small Solana network fee on your payment, and a safety limit that spreads our own automated payments across the day was also being applied to customers, so once our background traffic had used the morning's share, a real payment was turned away. Customers are now exempt from that limit: if you are paying, the payment goes through, and our own traffic waits instead. Nothing was charged on a failed attempt. Separately, when a wallet refuses to open its approval window, the payment window now says plainly that nothing was signed or charged and what to try next, instead of repeating the wallet's own wording.",+ "link": "/club",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-21","type": "update",@@ -19,6 +29,17 @@"fix"]},+ {+ "date": "2026-09-21",+ "type": "update",+ "title": "Pick DEXTools as your chart on every coin chart",+ "summary": "The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them.",+ "link": "/docs/coin-pages",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-09-21","type": "update",@@ -1595,28 +1616,6 @@"fix","improvement"]- },- {- "date": "2026-09-09",- "type": "update",- "title": "The retired Flappin UFO page is readable in light mode, and its two bottom-corner controls stopped sitting on top of each other",- "summary": "A full audit of /play/ufo, the page that stands where the retired Flappin UFO arcade demo used to be. In light mode its headline was painted in a violet-to-cyan gradient that all but vanished against the white card, the Retired badge and the Still live label were too pale to read, and the keyboard focus ring was that same near-invisible cyan, so tabbing through the page showed you nothing. All four now clear the contrast bar in both themes. The three links to the experiences that are still live were 37 pixels tall and the three.ws logo link was 21, both under the 44 pixels a thumb needs; every link on the page now clears it. The language picker and the Ctrl+K search hint were both pinned to the bottom right corner and overlapped each other, because this page carries its own compact header instead of the site nav that normally arranges that corner; they now stack. Two fixes from this audit land site-wide: the search hint was drawing dark text on its dark default pill on every light-themed page that does not define the site's surface colors, and neither floating control could be reached by screen reader landmark navigation. The page copy also lost the long dash the house style bans, in English and in all 84 translations.",- "link": "/play/ufo",- "tags": [- "fix",- "improvement"- ]- },- {- "date": "2026-09-09",- "type": "update",- "title": "The sitemap filter matches words in any order, opens the first hit on Enter, and stops leaving an empty bar behind",- "summary": "A full audit of /sitemap, the human-readable index of all 924 pages on three.ws. Filtering used to test your whole query as one run of characters, so \"avatar studio\" found the Avatar Studio but \"studio avatar\" found nothing; every word is now matched independently and either order returns the same 23 pages. Typing a query that matched nothing left the section jump-list on screen as an empty bordered bar hovering above the no-results panel; it now steps aside with the sections it points at. Pressing Enter in the filter box did nothing at all, which is the one key anybody tries after typing a page name; it now opens the first match, and the hint at the right of the box switches from the / shortcut to a return arrow to say so. Under the surface: the address bar is updated once you stop typing rather than on every keystroke, which is what Safari's limit on that call actually allows, and each row's visibility is only rewritten when it changes rather than 924 times per key. A query of nothing but spaces is no longer treated as a search.",- "link": "/sitemap",- "tags": [- "improvement",- "fix"- ]}]}diff --git a/public/changelog.json b/public/changelog.jsonindex 7dbf8b2bf..7e6a8c2f6 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,11 +1,21 @@{- "generated_at": "2026-09-21T02:53:24.058Z",+ "generated_at": "2026-09-21T05:41:11.310Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws","url": "https://three.ws"},"entries": [+ {+ "date": "2026-09-21",+ "type": "update",+ "title": "Paying at the Club door no longer fails when our own traffic has been busy",+ "summary": "Some visitors paying the Club cover approved the payment in their wallet and then saw it fail at the last step with an internal error. The cause was on our side. We cover the small Solana network fee on your payment, and a safety limit that spreads our own automated payments across the day was also being applied to customers, so once our background traffic had used the morning's share, a real payment was turned away. Customers are now exempt from that limit: if you are paying, the payment goes through, and our own traffic waits instead. Nothing was charged on a failed attempt. Separately, when a wallet refuses to open its approval window, the payment window now says plainly that nothing was signed or charged and what to try next, instead of repeating the wallet's own wording.",+ "link": "/club",+ "tags": [+ "fix"+ ]+ },{"date": "2026-09-21","type": "update",@@ -16,6 +26,17 @@"fix"]},+ {+ "date": "2026-09-21",+ "type": "update",+ "title": "Pick DEXTools as your chart on every coin chart",+ "summary": "The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them.",+ "link": "/docs/coin-pages",+ "tags": [+ "feature",+ "improvement"+ ]+ },{"date": "2026-09-21","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 99e1c6081..4822c2f68 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -6,6 +6,14 @@<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/><description>What's new on three.ws: features, improvements, and releases, newest first.</description><language>en</language>+ <item>+ <title>Paying at the Club door no longer fails when our own traffic has been busy</title>+ <link>https://three.ws/club</link>+ <guid isPermaLink="false">2026-09-21:Paying at the Club door no longer fails when our own traffic has been busy</guid>+ <pubDate>Mon, 21 Sep 2026 12:00:00 GMT</pubDate>+ <category>fix</category>+ <description>Some visitors paying the Club cover approved the payment in their wallet and then saw it fail at the last step with an internal error. The cause was on our side. We cover the small Solana network fee on your payment, and a safety limit that spreads our own automated payments across the day was also being applied to customers, so once our background traffic had used the morning's share, a real payment was turned away. Customers are now exempt from that limit: if you are paying, the payment goes through, and our own traffic waits instead. Nothing was charged on a failed attempt. Separately, when a wallet refuses to open its approval window, the payment window now says plainly that nothing was signed or charged and what to try next, instead of repeating the wallet's own wording.</description>+ </item><item><title>Phantom users no longer have to switch off transaction protection to pay</title><link>https://three.ws/club</link>@@ -14,6 +22,14 @@<category>fix</category><description>Phantom adds a small safety check to every transaction before you sign it, and it does this by default. Our payment rail treated that check as tampering and refused the payment, and the payment window told you to turn the protection off in your wallet settings. That was the wrong answer: the check moves no money and is there to protect you. Payments that carry it now go through, at the Club door and everywhere else you pay with a Solana wallet. We still refuse a payment if a wallet changes the amount, the recipient, or who covers the network fee.</description></item>+ <item>+ <title>Pick DEXTools as your chart on every coin chart</title>+ <link>https://three.ws/docs/coin-pages</link>+ <guid isPermaLink="false">2026-09-21:Pick DEXTools as your chart on every coin chart</guid>+ <pubDate>Mon, 21 Sep 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The chart-source switcher now covers every coin chart on three.ws. The Oracle coin page and the Pump Dashboard market chart join the coin pages, launch pages, the trade deep-dive and Mission Control, so wherever a coin is charted you can switch between the three.ws chart, DexScreener, Birdeye, GMGN, DEXTools and GeckoTerminal. Your pick is remembered and follows you from one coin surface to the next. The Oracle page keeps its Line and Agent trades views, and the dashboard keeps its own candle chart; the terminals simply line up beside them.</description>+ </item><item><title>Three SDKs now report the version you actually installed</title><link>https://three.ws/tour-builder</link>diff --git a/public/features.json b/public/features.jsonindex e0a9a2228..aab79f6f7 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-09-21T02:53:24.031Z",+ "generated_at": "2026-09-21T05:41:11.217Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/public/marks/dextools-alpha.png b/public/marks/dextools-alpha.pngnew file mode 100644index 000000000..620567eb3Binary files /dev/null and b/public/marks/dextools-alpha.png differdiff --git a/public/oracle-coin.css b/public/oracle-coin.cssindex 3b46b53b7..e8fefec97 100644--- a/public/oracle-coin.css+++ b/public/oracle-coin.css@@ -65,6 +65,8 @@ html:not([data-theme='light']) {direction: rtl; /* keep the distinctive base58 tail (…pump) visible when clipped */}@media (min-width: 900px) { .oc-mint-addr { max-width: 28rem; direction: ltr; } }+/* At 320px the address, its Copy button and the chip padding outgrow the gutter by a few px. */+@media (max-width: 360px) { .oc-mint-addr { max-width: 12rem; } }.oc-actions { margin-top: 1rem; }.cv-pills button.cv-pill { appearance: none; background: transparent; cursor: pointer; font: inherit; }.cv-pills button.cv-pill[aria-pressed='true'] { color: var(--cv-accent); border-color: var(--cv-accent); }@@ -74,6 +76,8 @@ html:not([data-theme='light']) {background: var(--cv-surface); border: 1px solid var(--cv-border);border-radius: var(--cv-radius-lg); box-shadow: var(--cv-shadow-card);padding: 1.25rem; width: 15.5rem; max-width: 100%; flex-shrink: 0;+ /* Without this, width: 100% plus the padding overflows the viewport on phones. */+ box-sizing: border-box;}@media (max-width: 899px) { .oc-conv-card { width: 100%; } }@@ -377,9 +381,17 @@ html:not([data-theme='light']) {border: 1px solid var(--cv-border); border-radius: var(--cv-radius-md);overflow: hidden; background: var(--cv-surface-2); min-height: 300px; position: relative;}-.oc-chart-frame { width: 100%; height: 440px; border: 0; display: block; opacity: 0; transition: opacity var(--duration-base); }-@media (min-width: 768px) { .oc-chart-frame { height: 520px; } }-.oc-chart-canvas.ready .oc-chart-frame { opacity: 1; }+/* The shared chart-source switcher (/chart-switcher.js) mounts inside .oc-chart-host:+ its tab bar takes the .oc-seg control above, the page's own Line and Agent trades+ views render into an .oc-chart-canvas slot, and a provider terminal gets this frame. */+.oc-chart-host { min-width: 0; color: var(--cv-text-2); }+.oc-chart-host .cs-frame-wrap {+ border: 1px solid var(--cv-border); border-radius: var(--cv-radius-md);+ background: var(--cv-surface-2); min-height: 440px;+}+@media (min-width: 768px) { .oc-chart-host .cs-frame-wrap { min-height: 520px; } }+.oc-chart-host .cs-open { color: var(--cv-text-3); }+.oc-chart-host .cs-open:hover, .oc-chart-host .cs-open:focus-visible { color: var(--cv-text); }.oc-chart-skel {position: absolute; inset: 0;background: linear-gradient(100deg, var(--cv-surface-2) 30%, var(--cv-surface-3) 50%, var(--cv-surface-2) 70%);@@ -404,9 +416,6 @@ html:not([data-theme='light']) {.oc-chart-legend .oc-lg.buy { background: var(--cv-green); margin-left: 4px; }.oc-chart-legend .oc-lg.sell { background: var(--cv-red); margin-left: 12px; }.oc-chart-legend .oc-lg-ct { margin-left: auto; color: var(--cv-text-2); text-transform: none; letter-spacing: 0; }-.oc-chart-credit { margin: 0.625rem 0 0; font-size: 0.6875rem; }-.oc-chart-credit a { color: var(--cv-text-3); text-decoration: none; }-.oc-chart-credit a:hover, .oc-chart-credit a:focus-visible { color: var(--cv-text-2); text-decoration: underline; }@media (prefers-reduced-motion: reduce) { .oc-chart-skel { animation: none; } .oc-chart-svg .oc-mk circle { transition: none; } }/* ── Agent transactions ──────────────────────────────────────────────────── */diff --git a/public/oracle-coin.js b/public/oracle-coin.jsindex 95d15c7bf..dbf191feb 100644--- a/public/oracle-coin.js+++ b/public/oracle-coin.js@@ -627,12 +627,6 @@// mint, shared by the chart-marker overlay and the "Agent transactions" list.let AGENT_TRADES = [];- function dexEmbedUrl(mint) {- const theme = document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark';- const p = new URLSearchParams({ embed: '1', loadChartSettings: '0', theme, chartTheme: theme, chartType: 'usd', interval: '15', info: '0' });- return `https://dexscreener.com/solana/${encodeURIComponent(mint)}?${p}`;- }-// Every three.ws agent transaction in one coin, newest first. Normalised for// both the marker overlay (needs tSec + side) and the list (needs labels). Never// throws: a failure just yields an empty overlay and an empty list.@@ -763,55 +757,60 @@canvas.innerHTML = `<div class="oc-chart-readout"><span class="oc-chart-price">${fmtPrice(last)}</span><span class="mkt-${chg.cls}">${chg.txt} · ${label}</span></div>${areaChartSvg(pts, markers)}${legend}`;}- function mountChart(container, mint) {- let stored = null; try { stored = localStorage.getItem(CHART_KEY); } catch {}+ // The chart view ids the page used before the shared switcher took over, mapped+ // onto its ids, so a returning viewer's last choice here still opens.+ const LEGACY_VIEW = { candles: 'dexscreener', line: 'line', trades: 'trades' };++ async function mountChart(container, mint) {const hasTrades = AGENT_TRADES.length > 0;const preCurve = BOOT.pump && !BOOT.pump.complete; // no DEX pair yet → native by default// When agents have traded this coin, lead with the annotated view so their- // moves are on the chart the instant the page opens; otherwise honour the last- // choice, then default to candles (or native pre-DEX).- let view = stored || (hasTrades ? 'trades' : preCurve ? 'line' : 'candles');- if (view === 'trades' && !hasTrades) view = preCurve ? 'line' : 'candles';- const tradesBtn = hasTrades ? `<button type="button" class="oc-seg-btn${view === 'trades' ? ' on' : ''}" data-view="trades">Agent trades</button>` : '';+ // moves are on the chart the instant the page opens; otherwise the viewer's+ // last choice on this page, then a candle terminal (or native pre-DEX).+ let legacy = null; try { legacy = LEGACY_VIEW[localStorage.getItem(CHART_KEY)] || null; } catch {}+ if (legacy === 'trades' && !hasTrades) legacy = null;+ const defaultView = hasTrades ? 'trades' : legacy || (preCurve ? 'line' : 'dexscreener');+container.innerHTML = `<div class="oc-chart-controls"><span class="oc-chart-title">Price chart <span class="oc-h2-note">live</span></span>- <div class="oc-seg" role="group" aria-label="Chart view">- <button type="button" class="oc-seg-btn${view === 'candles' ? ' on' : ''}" data-view="candles">Candles</button>- <button type="button" class="oc-seg-btn${view === 'line' ? ' on' : ''}" data-view="line">Line</button>- ${tradesBtn}- </div>- <a class="dr-act" href="https://dexscreener.com/solana/${encodeURIComponent(mint)}" target="_blank" rel="noopener">DexScreener ↗</a></div>- <div class="oc-chart-canvas" id="ocChartCanvas"></div>- <p class="oc-chart-credit"><a href="https://dexscreener.com/solana/${encodeURIComponent(mint)}" target="_blank" rel="noopener nofollow noreferrer">Candles chart by DexScreener · TradingView ↗</a></p>`;+ <div class="oc-chart-host" id="ocChartCanvas"></div>`;const canvas = container.querySelector('#ocChartCanvas');- let watchdog = 0;- function renderCandles() {- canvas.classList.remove('ready');- canvas.innerHTML = '<div class="oc-chart-skel"></div>';- const frame = document.createElement('iframe');- frame.className = 'oc-chart-frame';- frame.title = 'DexScreener live chart';- frame.loading = 'lazy';- frame.src = dexEmbedUrl(mint);- frame.addEventListener('load', () => { clearTimeout(watchdog); canvas.classList.add('ready'); });- canvas.replaceChildren(frame);- // Embed blocked / offline → fall back to the native line chart.- watchdog = setTimeout(() => { if (!canvas.classList.contains('ready')) loadNativeChart(canvas, mint); }, 9000);- }- function render(v) {- clearTimeout(watchdog);- if (v === 'candles') renderCandles();- else if (v === 'trades') loadNativeChart(canvas, mint, { markers: AGENT_TRADES });- else loadNativeChart(canvas, mint);- }- function apply(v) {- try { localStorage.setItem(CHART_KEY, v); } catch {}- container.querySelectorAll('.oc-seg-btn').forEach((b) => b.classList.toggle('on', b.dataset.view === v));- render(v);++ // The page's own views. Each gets a fresh slot from the switcher, and the+ // native chart paints its own skeleton, empty and error states into it.+ const native = (id, label, opts) => ({+ id,+ label,+ mount: ({ host }) => {+ host.className = 'oc-chart-canvas oc-chart-native';+ loadNativeChart(host, mint, opts);+ },+ });+ const nativeViews = [+ native('line', 'Line'),+ ...(hasTrades ? [native('trades', 'Agent trades', { markers: AGENT_TRADES })] : []),+ ];++ // Every chart terminal the rest of three.ws offers (DexScreener, Birdeye,+ // GMGN, DEXTools, GeckoTerminal) from the one shared provider list. This+ // page is buildless, so the switcher comes from its stable URL, which+ // publishes on window (a stable-named build entry re-exports nothing).+ try {+ await import('/chart-switcher.js');+ window.threeChartSwitcher.mountSwitchableChart({+ host: canvas,+ mint,+ nativeViews,+ defaultView,+ classes: { tabs: 'oc-seg', tab: 'oc-seg-btn', active: 'on' },+ });+ } catch {+ // The switcher bundle did not load (offline, blocked). The native chart+ // needs nothing but our own API, so the page still has a chart.+ canvas.className = 'oc-chart-canvas';+ loadNativeChart(canvas, mint, hasTrades ? { markers: AGENT_TRADES } : {});}- container.querySelectorAll('.oc-seg-btn').forEach((b) => b.addEventListener('click', () => apply(b.dataset.view)));- render(view);}// ── agent transactions list ─────────────────────────────────────────────────diff --git a/public/pump-dashboard.css b/public/pump-dashboard.cssindex 67e1cb3f0..2b5d6e9ae 100644--- a/public/pump-dashboard.css+++ b/public/pump-dashboard.css@@ -751,6 +751,22 @@ html.pump-dashboard-page body {font-size: 0.74rem;}+/* Market chart source bar: the shared chart switcher, dressed in this desk's buttons. */+.pd-chart-sources {+ display: flex;+ flex-wrap: wrap;+ gap: 0.35rem;+}+.pd-chart-sources .pd-btn[aria-selected='true'] {+ cursor: default;+}+#pd-chart-switch .cs-root {+ margin-bottom: 0.6rem;+}+#pd-chart-switch .cs-native:empty {+ display: none;+}+.pd-btn svg {width: 12px;height: 12px;diff --git a/scripts/check-dist.mjs b/scripts/check-dist.mjsindex 393a61bd0..4d1420b14 100644--- a/scripts/check-dist.mjs+++ b/scripts/check-dist.mjs@@ -13,6 +13,10 @@ const required = [// copy-timeline-data hook). It was missing from every production build// until 2026-09-01, which left the page on its error state.'dist/data/timeline.json',+ // The chart-source switcher at its stable URL. /oracle/coin/<mint> is+ // buildless and imports it by this exact name; without it the page falls+ // back to its native line chart and quietly loses every chart terminal.+ 'dist/chart-switcher.js',];diff --git a/scripts/render-pumpfun-verified.mjs b/scripts/render-pumpfun-verified.mjsindex 7c9e9a1c1..5ec30bf98 100644--- a/scripts/render-pumpfun-verified.mjs+++ b/scripts/render-pumpfun-verified.mjs@@ -16,6 +16,7 @@** Usage:* node scripts/render-pumpfun-verified.mjs+ * node scripts/render-pumpfun-verified.mjs --set=dextools* node scripts/render-pumpfun-verified.mjs --scale=3 --out=/tmp/cards*/import { createServer } from 'node:http';@@ -34,12 +35,25 @@ const args = Object.fromEntries(process.argv.slice(2).map((a) => {return m ? [m[1], m[2] ?? true] : [a, true];}));const SCALE = Number(args.scale) || 2;-const OUT_DIR = args.out ? resolve(String(args.out)) : join(ROOT, 'marketing', 'pumpfun-verified');-const CARD_PAGE = '/marketing/pumpfun-verified/partnership-card.html';++// Every house partner card is one partnership-card.html in its own marketing/+// directory, rendered at the same two crops. `--set=<name>` picks which; the+// default stays the card this script was written for.+const SETS = {+ 'pumpfun-verified': { dir: 'pumpfun-verified', stem: 'three-ws-pumpfun-verified' },+ dextools: { dir: 'dextools', stem: 'three-ws-dextools-charts' },+};+const SET = SETS[args.set || 'pumpfun-verified'];+if (!SET) {+ console.error(`Unknown --set=${args.set}. Known sets: ${Object.keys(SETS).join(', ')}`);+ process.exit(1);+}+const OUT_DIR = args.out ? resolve(String(args.out)) : join(ROOT, 'marketing', SET.dir);+const CARD_PAGE = `/marketing/${SET.dir}/partnership-card.html`;const CARDS = [- { hash: '', width: 1600, height: 900, file: 'three-ws-pumpfun-verified-16x9.png' },- { hash: '#square', width: 1600, height: 1600, file: 'three-ws-pumpfun-verified-1x1.png' },+ { hash: '', width: 1600, height: 900, file: `${SET.stem}-16x9.png` },+ { hash: '#square', width: 1600, height: 1600, file: `${SET.stem}-1x1.png` },];const MIME = {diff --git a/src/shared/chart-switcher-global.js b/src/shared/chart-switcher-global.jsnew file mode 100644index 000000000..bc08a1f71--- /dev/null+++ b/src/shared/chart-switcher-global.js@@ -0,0 +1,16 @@+// The chart-source switcher for buildless pages, published at /chart-switcher.js.+//+// A stable-named build entry is emitted as a facade that imports its hashed+// chunk for side effects and re-exports nothing, so a page served from public/+// cannot `import { mountSwitchableChart }` from it. Like /herald.js, it+// publishes on `window` instead: the page loads this script with a dynamic+// import, then calls `mountSwitchableChart` off `window.threeChartSwitcher`+// (see mountChart in public/oracle-coin.js for the call site).+//+// Bundled pages import src/shared/chart-switcher.js directly and never load this.++import { mountSwitchableChart } from './chart-switcher.js';++if (typeof window !== 'undefined' && !window.threeChartSwitcher) {+ window.threeChartSwitcher = { mountSwitchableChart };+}diff --git a/src/shared/chart-switcher.js b/src/shared/chart-switcher.jsindex 08b431b3f..2248e9d47 100644--- a/src/shared/chart-switcher.js+++ b/src/shared/chart-switcher.js@@ -10,16 +10,34 @@//// The tab bar reuses the `.mc-chart-ivs` / `.mc-chart-iv` segmented-control// classes both host pages already style for the interval switcher, so it matches-// each page's design system without a second set of theme rules.+// each page's design system without a second set of theme rules. A host with a+// segmented control of its own passes its class names through `classes`.+//+// A host that already draws a chart keeps it: `nativeViews` replaces the built-in+// candle view with the host's own, and the providers line up beside them. That is+// how /oracle/coin/<mint> keeps its agent-trade overlay and /pump-dashboard its+// canvas chart while gaining every provider. Buildless pages get it through+// chart-switcher-global.js, published at the stable /chart-switcher.js URL.-import { mountPriceChart } from '../mission-control/chart.js';import { chartEmbedsFor, chartEmbedUrls, resolveChartPool } from './chart-embeds.js';import { watchEmbed, embedFallbackNode, DEFAULT_EMBED_TIMEOUT_MS } from './embed-guard.js';// Shared with /launches/<mint>, which uses the same view ids: the chart a trader// picks is a viewing preference, so it follows them across coin surfaces.const VIEW_KEY = 'ld_chart_view';-const CANDLES = { id: 'tradingview', label: 'TradingView', kind: 'candles' };++// The built-in native view: the platform's live candle chart. Imported on first+// use so a host that brings its own native views never downloads the engine.+const CANDLES = {+ id: 'tradingview',+ label: 'TradingView',+ mount: async ({ host, mint }) => {+ const { mountPriceChart } = await import('../mission-control/chart.js');+ return mountPriceChart({ host, mint });+ },+};++const DEFAULT_CLASSES = { tabs: 'mc-chart-ivs', tab: 'mc-chart-iv', active: '' };const STYLE_ID = 'chart-switcher-style';const CSS = `@@ -37,7 +55,7 @@ const CSS = `.cs-state { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; text-align: center; font-size: .8125rem; opacity: .85; }.cs-state p { margin: 0; max-width: 46ch; }.cs-state a { color: inherit; font-weight: 600; }-.cs-state .mc-chart-iv { border: 1px solid color-mix(in srgb, currentColor 22%, transparent); padding: 5px 12px; }+.cs-state button { border: 1px solid color-mix(in srgb, currentColor 22%, transparent); padding: 5px 12px; }.cs-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }@keyframes cs-shimmer { to { background-position: -200% 0, 0 0; } }@media (prefers-reduced-motion: reduce) { .cs-skel { animation: none; } .cs-frame { transition: none; } }@@ -62,14 +80,14 @@ function node(tag, props = {}, children = []) {return n;}-function readView(views) {+function readView(views, fallback) {try {const v = localStorage.getItem(VIEW_KEY);if (views.some((view) => view.id === v)) return v;} catch {// Storage blocked: fall through to the default.}- return CANDLES.id;+ return views.some((view) => view.id === fallback) ? fallback : views[0].id;}function currentTheme() {@@ -83,25 +101,45 @@ function currentTheme() {* @param {string} [opts.chain] A CHART_CHAINS id. Solana is the home chain.* @param {'mainnet'|'devnet'} [opts.network] The providers index mainnet only,* so on devnet the candle chart stands alone and no source bar is drawn.- * @returns {{ destroy(): void }}+ * @param {Array<{ id: string, label: string, mount: (ctx: { host: HTMLElement, mint: string }) => ({ destroy?(): void } | void | Promise<{ destroy?(): void } | void>) }>} [opts.nativeViews]+ * The host's own chart views, shown ahead of the providers. Defaults to the+ * platform candle chart.+ * @param {string} [opts.defaultView] View to open on when the viewer has no+ * stored preference that applies here. Defaults to the first view.+ * @param {{ tabs?: string, tab?: string, active?: string }} [opts.classes]+ * The host's segmented-control class names. `active` is toggled on the selected+ * tab for hosts whose styles key off a class instead of `aria-selected`.+ * @returns {{ destroy(): void, select(id: string): void }}*/-export function mountSwitchableChart({ host, mint, chain = 'solana', network = 'mainnet' }) {+export function mountSwitchableChart({+ host,+ mint,+ chain = 'solana',+ network = 'mainnet',+ nativeViews = [CANDLES],+ defaultView,+ classes,+}) {ensureStyle();+ const cls = { ...DEFAULT_CLASSES, ...classes };const providers = network === 'mainnet' ? chartEmbedsFor(chain) : [];- const views = [CANDLES, ...providers.map((p) => ({ id: p.id, label: p.label, kind: 'embed', provider: p }))];+ const views = [+ ...nativeViews.map((v) => ({ ...v, kind: 'native' })),+ ...providers.map((p) => ({ id: p.id, label: p.label, kind: 'embed', provider: p })),+ ];const pools = {}; // provider id → { pool, indexed }- let active = readView(views);+ let active = readView(views, defaultView);let teardown = null;let seq = 0;let destroyed = false;- const tabs = node('div', { class: 'mc-chart-ivs cs-tabs', role: 'tablist', 'aria-label': 'Chart source' });+ const tabs = node('div', { class: `${cls.tabs} cs-tabs`, role: 'tablist', 'aria-label': 'Chart source' });const openSlot = node('span', { class: 'cs-open-slot' });const viewHost = node('div', { class: 'cs-view' });const buttons = views.map((view) =>node('button', {type: 'button',- class: 'mc-chart-iv',+ class: cls.tab,role: 'tab','data-view': view.id,text: view.label,@@ -154,17 +192,32 @@ export function mountSwitchableChart({ host, mint, chain = 'solana', network = 'for (const b of buttons) {const on = b.dataset.view === active;b.setAttribute('aria-selected', String(on));+ if (cls.active) b.classList.toggle(cls.active, on);b.tabIndex = on ? 0 : -1;}- const view = views.find((v) => v.id === active) || CANDLES;- if (view.kind === 'candles') {- const chart = mountPriceChart({ host: viewHost, mint });- teardown = () => chart.destroy();+ const view = views.find((v) => v.id === active) || views[0];+ if (view.kind === 'native') {+ renderNative(view, seq);return;}renderEmbed(view.provider, seq);}+ async function renderNative(view, mySeq) {+ const slot = node('div', { class: 'cs-native' });+ viewHost.replaceChildren(slot);+ // Set before the await: a switch away mid-mount must still find something+ // to tear down, and the late-arriving chart is destroyed on arrival.+ let mounted = null;+ let gone = false;+ teardown = () => {+ gone = true;+ mounted?.destroy?.();+ };+ mounted = (await view.mount({ host: slot, mint })) || null;+ if (gone || mySeq !== seq) mounted?.destroy?.();+ }+function statePanel(wrap, lines, actions) {wrap.replaceChildren(node('div', { class: 'cs-state', role: 'status' }, [@@ -174,7 +227,7 @@ export function mountSwitchableChart({ host, mint, chain = 'solana', network = ');}- const actionBtn = (text, onclick) => node('button', { type: 'button', class: 'mc-chart-iv', text, onclick });+ const actionBtn = (text, onclick) => node('button', { type: 'button', class: cls.tab, text, onclick });async function renderEmbed(provider, mySeq) {// Taller than the candle chart's box on purpose: a provider's embed carries@@ -228,7 +281,7 @@ export function mountSwitchableChart({ host, mint, chain = 'solana', network = 'label: `Open in ${provider.label}`,onRetry: render,className: 'cs-state',- buttonClassName: 'mc-chart-iv',+ buttonClassName: cls.tab,}),);};@@ -252,13 +305,14 @@ export function mountSwitchableChart({ host, mint, chain = 'solana', network = '// The iframe providers bake the theme in at load, so a live theme switch// reloads whichever embed is showing. The candle view is left to chart.js.const themeObserver = new MutationObserver(() => {- if (active !== CANDLES.id) render();+ if (views.find((v) => v.id === active)?.kind === 'embed') render();});themeObserver.observe(document.documentElement, { attributes: true, attributeFilter: ['data-theme'] });render();return {+ select: (id) => views.some((v) => v.id === id) && select(id, { persist: true }),destroy() {destroyed = true;themeObserver.disconnect();diff --git a/tests/chart-switcher.dom.test.js b/tests/chart-switcher.dom.test.jsnew file mode 100644index 000000000..88df320c3--- /dev/null+++ b/tests/chart-switcher.dom.test.js@@ -0,0 +1,129 @@+// @vitest-environment jsdom+//+// The chart-source switcher, as the surfaces that bring their own chart use it.+//+// /oracle/coin/<mint> and /pump-dashboard each already drew a chart when the+// switcher arrived, so they hand it their own views through `nativeViews` and+// their own segmented-control class names through `classes`. What is pinned:+//+// 1. Every provider in the shared list, DEXTools included, lines up behind the+// host's views. A surface that adopts the switcher cannot quietly offer a+// shorter list than the rest of three.ws.+// 2. The platform candle engine is never imported for a host that brought its+// own native views. It is the heaviest thing in the module graph.+// 3. A host's native view is torn down when the viewer switches away, and a+// pool-keyed provider (DEXTools) resolves its pair before it mounts a frame.++import { describe, it, expect, beforeEach, vi } from 'vitest';++const mountPriceChart = vi.fn(() => ({ destroy: vi.fn() }));+vi.mock('../src/mission-control/chart.js', () => ({ mountPriceChart }));++const { mountSwitchableChart } = await import('../src/shared/chart-switcher.js');++// $THREE and the three / SOL pool DEXTools tracks it under.+const MINT = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';+const PAIR = 'CnK82s8exdsK9nwqQ55kd9wcxoA22NwTchZJCBdu8LDa';++const tabs = (host) => [...host.querySelectorAll('[role=tab]')];+const tick = () => new Promise((r) => setTimeout(r, 0));++describe('mountSwitchableChart with host-native views', () => {+ let host;+ beforeEach(() => {+ document.body.innerHTML = '<div id="h"></div>';+ host = document.getElementById('h');+ localStorage.clear();+ mountPriceChart.mockClear();+ globalThis.fetch = vi.fn(async () => new Response(JSON.stringify({ pool: PAIR }), { status: 200 }));+ });++ it('offers every shared provider, DEXTools included, behind the host views', async () => {+ mountSwitchableChart({+ host,+ mint: MINT,+ nativeViews: [{ id: 'line', label: 'Line', mount: () => {} }],+ });+ await tick();+ expect(tabs(host).map((t) => t.dataset.view)).toEqual([+ 'line',+ 'dexscreener',+ 'birdeye',+ 'gmgn',+ 'dextools',+ 'geckoterminal',+ ]);+ });++ it('never loads the platform candle engine for a host that brought its own view', async () => {+ mountSwitchableChart({ host, mint: MINT, nativeViews: [{ id: 'line', label: 'Line', mount: () => {} }] });+ await tick();+ expect(mountPriceChart).not.toHaveBeenCalled();+ });++ it('still opens on the platform candle chart when no native views are given', async () => {+ mountSwitchableChart({ host, mint: MINT });+ await tick();+ expect(tabs(host)[0].dataset.view).toBe('tradingview');+ expect(mountPriceChart).toHaveBeenCalledTimes(1);+ });++ it('uses the host segmented-control classes and marks the active tab', async () => {+ mountSwitchableChart({+ host,+ mint: MINT,+ nativeViews: [{ id: 'line', label: 'Line', mount: () => {} }],+ classes: { tabs: 'oc-seg', tab: 'oc-seg-btn', active: 'on' },+ });+ await tick();+ expect(host.querySelector('[role=tablist]').classList.contains('oc-seg')).toBe(true);+ const [first, second] = tabs(host);+ expect(first.className).toBe('oc-seg-btn on');+ expect(second.classList.contains('on')).toBe(false);+ });++ it('opens on defaultView, and lets a stored preference win over it', async () => {+ const views = [+ { id: 'line', label: 'Line', mount: () => {} },+ { id: 'trades', label: 'Agent trades', mount: () => {} },+ ];+ mountSwitchableChart({ host, mint: MINT, nativeViews: views, defaultView: 'trades' });+ await tick();+ expect(host.querySelector('[aria-selected=true]').dataset.view).toBe('trades');++ localStorage.setItem('ld_chart_view', 'line');+ mountSwitchableChart({ host, mint: MINT, nativeViews: views, defaultView: 'trades' });+ await tick();+ expect(host.querySelector('[aria-selected=true]').dataset.view).toBe('line');+ });++ it('tears the host view down on switching to DEXTools, and frames the resolved pair', async () => {+ const destroy = vi.fn();+ mountSwitchableChart({+ host,+ mint: MINT,+ nativeViews: [{ id: 'threews', label: 'three.ws', mount: () => ({ destroy }) }],+ });+ await tick();+ host.querySelector('[data-view=dextools]').click();+ await tick();+ await tick();++ expect(destroy).toHaveBeenCalledTimes(1);+ expect(globalThis.fetch.mock.calls[0][0]).toContain(`/api/coin/pool?address=${MINT}`);+ const frame = host.querySelector('iframe.cs-frame');+ expect(frame.src).toContain(`dextools.io/widget-chart/en/solana/pe-light/${PAIR}`);+ expect(host.querySelector('.cs-open').href).toContain(`/app/solana/pair-explorer/${PAIR}`);+ expect(localStorage.getItem('ld_chart_view')).toBe('dextools');+ });+});++// A stable-named build entry re-exports nothing (the build emits a facade that+// imports its hashed chunk for side effects), so the buildless Oracle coin page+// cannot import a named export from /chart-switcher.js. It reads this global.+describe('the /chart-switcher.js entry for buildless pages', () => {+ it('publishes the switcher on window', async () => {+ await import('../src/shared/chart-switcher-global.js');+ expect(window.threeChartSwitcher.mountSwitchableChart).toBe(mountSwitchableChart);+ });+});diff --git a/vite.config.js b/vite.config.jsindex 2adcaafa3..3292072b0 100644--- a/vite.config.js+++ b/vite.config.js@@ -620,6 +620,7 @@ const appConfig = {chunk.name === 'herald' ||chunk.name === 'nav-tier-badge' ||chunk.name === 'agent-bus' ||+ chunk.name === 'chart-switcher' ||chunk.name === 'i18n'? `${chunk.name}.js`: 'assets/[name]-[hash].js',@@ -628,6 +629,10 @@ const appConfig = {'footer-bot': resolve(__dirname, 'src/footer-bot.js'),'walk-companion': resolve(__dirname, 'src/walk-companion.js'),'agent-bus': resolve(__dirname, 'src/agents/agent-bus.js'),+ // The chart-source switcher at a stable URL, so buildless pages+ // (/oracle/coin/<mint> is served from public/) offer the same+ // providers as the bundled coin surfaces from the one provider list.+ 'chart-switcher': resolve(__dirname, 'src/shared/chart-switcher-global.js'),'walk-playground': resolve(__dirname, 'src/walk-playground.js'),'feature-tour': resolve(__dirname, 'src/feature-tour.js'),notifications: resolve(__dirname, 'src/notifications.js'),@@ -2572,6 +2577,12 @@ const appConfig = {req.url = '/src/agents/agent-bus.js';return next();}+ // /chart-switcher.js: the chart-source switcher, served from src in+ // dev at the stable, unhashed name it ships under in production.+ if (path === '/chart-switcher.js') {+ req.url = '/src/shared/chart-switcher-global.js';+ return next();+ }// /walk-playground.js — stable URL so any page (not just the nav// companion) can launch the full-page walk playground on demand.if (path === '/walk-playground.js') {