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: add platformer mode to explore functionality
fudjiacd0a4a986f06
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 4fffae8b5..7690d8000 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -18,6 +18,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Free live pump.fun launches feed for agents** — The Crypto Data API now has a live launch feed: GET /api/crypto/launches returns the freshest pump.fun mints, newest first, with everything a discovery or sniper agent filters on — name, symbol, age down to the tenth of a minute, current market cap, bonding-curve progress, and the dev wallet. Filter server-side with minMarketCap and maxAgeMin, then watch the interesting ones climb their curve via the bonding-status endpoint (the two share the exact same curve math, so they can never disagree). Free, no key, no account — built to be polled. Full reference with runnable curls at /docs/crypto-api. (`/docs/crypto-api`) `[feature]`- **Free text→3D generation API for agents** — Any AI agent can now turn a text prompt into a real 3D model with one call to /api/3d/generate — free, keyless, no account, no wallet. Describe a single object and get back a textured GLB (inline when it finishes fast, otherwise a job token you poll at /api/3d/generate?job=<id>). It runs on the free draft lane (NVIDIA NIM TRELLIS): draft-fidelity geometry, GLB only, no rigging — honest about being a prototyping tier, with a generous per-IP rate limit protecting the shared GPU. Need denser meshes with PBR textures, or an animation-ready rigged character? The response and docs point straight at paid Forge Pro and Rigged Avatars. No other agent-payments platform gives away 3D generation. `[feature, sdk]`- **Free text→3D now has a first-class API endpoint** — The free text-to-3D lane — the only text-to-mesh service in the agent-payments ecosystem — finally has a clean, versioned endpoint instead of being buried under forge job plumbing. POST a prompt to /api/v1/ai/text-to-3d and get back a textured GLB and a viewer link: no key, no wallet, nothing to sign. It runs on the free NVIDIA NIM TRELLIS lane with a per-IP quota of 10 generations a day; past that it returns a clear rate-limit notice pointing at the paid forge tiers for higher volume and quality, never a silent paywall. The GLB either comes back inline or as a job you poll to completion. (`/docs/api-reference`) `[feature]`+- **Free token safety / rug-signal API** — New free endpoint in the Crypto Data API: GET /api/crypto/security gives agents the pre-trade rug check they ask for most. One keyless call returns the on-chain facts — whether the mint and freeze authorities are revoked, whether the token's metadata can still be rewritten (including pump.fun's Token-2022 mints), top-holder concentration, liquidity depth, and whether liquidity is protocol-locked for pump.fun coins — plus a deterministic low/medium/high/unknown risk level with plain-language reasons. Facts only: anything that can't be verified is reported as unknown, never guessed as safe. (`/docs/crypto-api`) `[feature, security]`- **Free token security check answers "is this a rug?" in one call** — New free, keyless endpoint: GET /api/v1/token/security turns any Solana mint into an on-chain security report — the first question every trading agent asks before touching a token. It reports whether the mint and freeze authorities are still active (supply can be inflated / accounts frozen), how concentrated the top holders are, how deep the liquidity is, and how old the trading pair is, composing Solana RPC and DexScreener into one answer. There's no invented 'risk score' — just factual flags like mint_authority_active, top1_holder_over_20pct, liquidity_under_10k, and pair_younger_than_24h that agents weigh themselves. Every field is always present (null when a source can't resolve it, never faked), each section degrades independently, and an EVM address gets an honest 'Solana only' 400. Capped at 20 calls/min per IP. (`/docs/api-reference`) `[feature]`- **Free token-snapshot API for crypto agents** — New free endpoint in the Crypto Data API: GET /api/crypto/token returns the full current market state of any token from its contract address in one call — price, 24-hour change, market cap, FDV, liquidity, volume, and a link to its trading venue. It reads live DexScreener data on any chain it indexes, and fresh pump.fun launches that don't have a DEX pair yet still resolve through pump.fun's public record. No API key, no account — built for trading agents deciding whether to buy, alert, or ignore. (`/docs/crypto-api`) `[feature, sdk]`- **Free trending-tokens API for crypto agents** — New free, keyless endpoint GET /api/crypto/trending gives any AI agent a ranked "what's hot right now" list in one call — no account, no key. Tokens are ranked by momentum (a 0–100 score blending windowed trade volume, buy pressure, a volume-spike signal, and short-window price change), fused live across pump.fun, DexScreener's boosted board, and GMGN smart money. Pick a window (5m, 1h, or 24h) and a source (pump.fun only or all), and get back each token's mint, symbol, market cap, volume, price change, score, and link. If an upstream is down it returns whatever ranked data it has with a note instead of failing. (`/docs/crypto-api`) `[feature]`@@ -26,6 +27,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **New: three.ws Crypto Data API docs** — One page now documents the whole free, keyless Crypto Data API for AI agents — live at /crypto. It lays out all nine reads an agent needs mid-trade (token snapshot, security/rug signals, holders & concentration, live pump.fun launches, bonding-curve status, whale activity, symbol availability, wallet portfolio, trending) with a copy-paste quickstart in curl, JavaScript and Python, a real request/response example for each, and a live 'Try it' console right in the browser. Every endpoint is free with no key and no account. The page probes production in real time and marks each endpoint Live or Coming soon, so it stays honest as the API rolls out — and points you to the paid uniques (Pump Launcher, Vanity, Forge) when your agent is ready to act on the data. (`/crypto`) `[feature, docs]`- **On-chain identity verification now works cross-platform for any claim** — The Identity Verifier is no longer three.ws-only. Give it any claim that an identity controls an address — an ENS name (vitalik.eth), an SNS name (bonfida.sol), an EVM or Solana wallet, an ERC-8004 agent id, or a three.ws agent_id — and it returns real on-chain evidence the link is genuine: ENS/SNS resolution, a contract's deploy transaction and deployer, a token's mint and metadata authorities, an ERC-8004 registry entry, or the three.ws deploy record. Every verdict is true, false, or unverifiable — and it never reports true without concrete on-chain proof, so an insufficient read is honestly labeled instead of guessed. An agent can now verify whoever it's about to pay, trade, or delegate to, whatever platform they came from. Pair it with cross-chain Agent Reputation: verify who they are, then score whether to trust them. Full evidence model at /docs/trust-primitives. (`/docs/trust-primitives`) `[feature, improvement]`- **One x402 call runs the whole 3D asset pipeline** — New endpoint POST /api/x402/pipeline runs a full chain of 3D stages — generate → rig → remesh → gameready → stylize — as a single paid job with one price. Describe what you want (a text prompt or an existing GLB) and get back a rigged, game-ready GLB: text or GLB in, finished asset out. You pick the stages as an ordered chain, the 402 challenge quotes the exact sum of just those stages, and you poll the job for free at /api/forge?job=<id> while it advances, watching each stage's progress. Only stages whose lane is live on the deployment are offered, and if a stage fails mid-chain the job is marked failed at that stage with every completed stage's output still delivered — honest partial value, never a silent dead-end. It's the only end-to-end asset pipeline in the x402 ecosystem. (`/docs/3d-pipeline`) `[feature]`+- **Platformer tours — visitors jump through your store's checkpoints** — The guided tour's Explore mode now has a sibling: Platformer. Pick it in the Tour Builder (or set data-mode="platformer" on the embed tag) and your page's real content — headings, product cards, buttons — becomes solid ground the visitor runs and jumps across, Mario-style, to reach each glowing checkpoint and unlock its explanation. It's the same gravity engine as the homepage playground. The two interactive modes are one experience now: visitors can flip between walking and platforming mid-tour with the M key or the on-screen mode pill, and their checkpoint progress carries across. Also fixed: pressing M during an Explore tour used to silently drop every checkpoint — the tour survives mode switches now. (`/tour-builder`) `[feature, sdk]`- **Pump Launcher listing sharpened + wired to the free symbol & launches APIs** — The paid Pump Launcher (/api/x402/pump-launch) now sells what it actually does: deploy a brand-new pump.fun token in one call with no SOL, no wallet, and no account — you pay $5 in USDC and the platform fronts the deploy cost, optionally grinds a vanity mint, and signs the create transaction. The discovery listing and its schema were rewritten so an agent can call it blind — every input (name, symbol, a pre-pinned metadataUri or an imageUrl we pin for you, creator-rewards wallet, optional vanity prefix/suffix) and every output (mint, tx signature, metadata URI, pump.fun URL) is now spelled out. It's also wired into the free Crypto Data API: check your ticker is free first with /api/crypto/symbol, then confirm your deploy landed on the live /api/crypto/launches feed. A new docs page walks the whole flow. (`/docs/pump-launcher`) `[improvement]`- **Speech for agents: keyless text-to-speech and speech-to-text over x402** — Two new AI endpoints give agents a voice and an ear with no account and no API key. POST /api/v1/ai/tts turns text into natural multilingual speech (nine languages on the NVIDIA Magpie lane); POST /api/v1/ai/asr transcribes audio to text with confidence and duration — the only speech-to-text lane anywhere in the x402 ecosystem. Both are free to try — 10 TTS calls and 5 ASR clips per day per IP — and past that quota each call is a tiny USDC micropayment settled on Solana or Base ($0.005 per TTS call, $0.01 per ASR clip). The response looks the same whether it was free or paid, so an agent writes one integration for both. Full reference with runnable curls lives at /docs/api-reference. (`/docs/api-reference`) `[feature]`- **Symbol-availability check is now free** — Checking whether a token ticker is already taken is now free and keyless at /api/crypto/symbol — no account, no payment. Send up to 20 candidate tickers in one call and get back, for each, whether it's available plus any exact collisions and fuzzy look-alikes (e.g. MOONZ vs MOONS) already live across the market, so your name won't get lost among clones. It's the natural first step before minting: clear the name here for free, then launch through the Pump Launcher. Previously this was a paid endpoint; it's now a free discovery utility with exact + fuzzy matching across live registries, and it degrades gracefully (never a false 'available') if a data source is down. (`/docs/crypto-api`) `[feature, improvement]`diff --git a/api/_lib/crypto-catalog/security.js b/api/_lib/crypto-catalog/security.jsnew file mode 100644index 000000000..1cdba6de4--- /dev/null+++ b/api/_lib/crypto-catalog/security.js@@ -0,0 +1,53 @@+// Catalog entry for GET /api/crypto/security — the free token-safety endpoint.+//+// The /api/crypto index globs every file in this directory and merges the+// entries into the bundle's discovery doc + OpenAPI. Each entry is a plain,+// serializable descriptor: no imports, no side effects, safe to load anywhere.++export default {+ slug: 'security',+ method: 'GET',+ path: '/api/crypto/security',+ title: 'Token Security / Rug Signals',+ summary:+ 'Pre-trade safety check for any Solana token: mint & freeze authority status, holder concentration, liquidity depth, metadata mutability, LP custody — composed into a documented, deterministic riskLevel (low/medium/high/unknown) with plain-language reasons. Facts, never an LLM opinion; unknowns stay null.',+ inputSchema: {+ type: 'object',+ required: ['address'],+ properties: {+ address: {+ type: 'string',+ description: 'Solana token mint to check (base58).',+ },+ chain: {+ type: 'string',+ enum: ['solana'],+ default: 'solana',+ description: 'Solana only — SPL authorities and holder concentration have no EVM equivalent in this reader.',+ },+ },+ },+ outputSchema: {+ type: 'object',+ properties: {+ address: { type: 'string' },+ chain: { type: 'string' },+ checks: {+ type: 'object',+ properties: {+ mintAuthorityRevoked: { type: ['boolean', 'null'] },+ freezeAuthorityRevoked: { type: ['boolean', 'null'] },+ metadataMutable: { type: ['boolean', 'null'] },+ lpBurnedOrLocked: { type: ['boolean', 'null'] },+ liquidityUsd: { type: ['number', 'null'] },+ topHolderPctFlag: { type: ['boolean', 'null'] },+ },+ },+ riskLevel: { type: 'string', enum: ['low', 'medium', 'high', 'unknown'] },+ reasons: { type: 'array', items: { type: 'string' } },+ ts: { type: 'string', format: 'date-time' },+ sources: { type: 'array', items: { type: 'string' } },+ },+ },+ example: '/api/crypto/security?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',+};diff --git a/api/_lib/crypto-token-security.js b/api/_lib/crypto-token-security.jsnew file mode 100644index 000000000..3bcece464--- /dev/null+++ b/api/_lib/crypto-token-security.js@@ -0,0 +1,276 @@+// Token security / rug-signal composition for the free Crypto Data API+// (/api/crypto/security).+//+// The single most-requested pre-trade check in agent workflows: before buying or+// LPing into a token, is there a rug lever? This wraps the platform's EXISTING+// fact readers rather than inventing new ones:+// - parseMintAccount / parseTopHolders / parseLiquidity from the v1 security+// reader (api/v1/token/security.js) — mint & freeze authority, supply,+// top-holder concentration, liquidity depth.+// - fetchTokenMarket (token-market.js / DexScreener) — the liquidity read.+// - fetchPumpCoin + isGraduated (pump-bonding.js / pump-launch-feed.js) — the+// LP-custody fact for pump.fun-native coins: on-curve liquidity sits in the+// bonding-curve program and graduated liquidity is burned (Raydium) or+// protocol-owned (PumpSwap), so the deployer cannot pull it either way.+// - A pure Metaplex Token Metadata parser (the existing solana-token-meta.js+// decoder stops before is_mutable; this one reads the full tail) — whether+// the token's identity can still be rewritten.+//+// The riskLevel is a DOCUMENTED, DETERMINISTIC rule over the boolean checks —+// never an LLM opinion, and an unknown input is never guessed (docs/crypto-api.md+// spells out the exact rule). Every network dependency is injectable so each+// state — full data, each source down, keyless degradation — is unit-testable.++import { PublicKey } from '@solana/web3.js';+import { parseMintAccount, parseTopHolders, parseLiquidity } from '../v1/token/security.js';+import { fetchTokenMarket } from './token-market.js';+import { fetchPumpCoin } from './pump-bonding.js';+import { isGraduated } from './pump-launch-feed.js';+import { solanaRpcEndpoints, makeRotatingFetch } from './solana/connection.js';++const METADATA_PROGRAM = new PublicKey('metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s');+const RPC_TIMEOUT_MS = 8000;++// Concentration thresholds shared with the v1 reader's flags, so the two+// security surfaces can never disagree about what "concentrated" means.+export const TOP1_FLAG_PCT = 20;+export const TOP10_FLAG_PCT = 80;+export const THIN_LIQUIDITY_USD = 10_000;++/** Metadata PDA for a mint — ["metadata", program, mint] under the Metaplex program. */+export function metadataPdaFor(mint) {+ const [pda] = PublicKey.findProgramAddressSync(+ [Buffer.from('metadata'), METADATA_PROGRAM.toBuffer(), new PublicKey(mint).toBuffer()],+ METADATA_PROGRAM,+ );+ return pda.toBase58();+}++/**+ * Parse a raw Metaplex Token Metadata account buffer through to the is_mutable+ * flag. Layout: key(1) + updateAuthority(32) + mint(32) + name/symbol/uri (each+ * u32 length prefix + fixed-max padded bytes) + sellerFeeBasisPoints(2) ++ * Option<creators>(1 [+ 4 + n*34]) + primarySaleHappened(1) + isMutable(1).+ * Returns null on a buffer too short/malformed to read honestly.+ *+ * @param {Buffer} buf+ * @returns {null | { updateAuthority: string, isMutable: boolean }}+ */+export function parseMetadataAccount(buf) {+ if (!Buffer.isBuffer(buf) || buf.length < 1 + 32 + 32 + 4) return null;+ let cursor = 1 + 32 + 32;+ for (const max of [32, 10, 200]) { // name, symbol, uri+ if (cursor + 4 > buf.length) return null;+ cursor += 4 + max;+ }+ cursor += 2; // seller_fee_basis_points+ if (cursor >= buf.length) return null;+ const hasCreators = buf.readUInt8(cursor) === 1;+ cursor += 1;+ if (hasCreators) {+ if (cursor + 4 > buf.length) return null;+ const count = buf.readUInt32LE(cursor);+ if (count > 5) return null; // Metaplex caps creators at 5 — anything else is not this layout+ cursor += 4 + count * 34; // creator = address(32) + verified(1) + share(1)+ }+ cursor += 1; // primary_sale_happened+ if (cursor >= buf.length) return null;+ return {+ updateAuthority: new PublicKey(buf.subarray(1, 33)).toBase58(),+ isMutable: buf.readUInt8(cursor) === 1,+ };+}++/**+ * Metadata mutability for a Token-2022 mint, read from the SAME jsonParsed+ * getAccountInfo the authority check uses. pump.fun (and increasingly the rest+ * of the ecosystem) mints Token-2022 with the token-metadata extension embedded+ * in the mint account — there is NO Metaplex PDA for these tokens. The+ * extension's updateAuthority is the mutability fact: set → the identity can+ * be rewritten; None → immutable. Returns null for classic SPL mints (no+ * extensions array), which fall back to the Metaplex PDA parse above.+ */+export function metaFromMintExtensions(result) {+ const info = result?.value?.data?.parsed?.info;+ const exts = Array.isArray(info?.extensions) ? info.extensions : null;+ if (!exts) return null;+ const tm = exts.find((e) => e?.extension === 'tokenMetadata');+ if (!tm) return null;+ const updateAuthority = tm.state?.updateAuthority ?? null;+ return { updateAuthority, isMutable: updateAuthority !== null };+}++/**+ * Derive the six named checks from the resolved sections. Every check is a hard+ * observable; an unresolved input yields null, never a guess.+ *+ * lpBurnedOrLocked is only assertable for pump.fun-native coins, where it is a+ * protocol fact: on-curve liquidity is custodied by the bonding-curve program,+ * and graduation burns the LP (Raydium) or moves it to a protocol-owned pool+ * (PumpSwap). For every other token it is null (unknown), never a fake "safe".+ */+export function deriveChecks({ mint, holders, liquidity, meta, pump }) {+ const top1 = holders?.top1_pct ?? null;+ const top10 = holders?.top10_pct ?? null;+ return {+ mintAuthorityRevoked: mint ? mint.mint_authority.revoked : null,+ freezeAuthorityRevoked: mint ? mint.freeze_authority.revoked : null,+ metadataMutable: meta ? meta.isMutable : null,+ lpBurnedOrLocked: pump?.isPump ? true : null,+ liquidityUsd: liquidity?.usd ?? null,+ topHolderPctFlag:+ top1 == null && top10 == null+ ? null+ : (top1 != null && top1 > TOP1_FLAG_PCT) || (top10 != null && top10 > TOP10_FLAG_PCT),+ };+}++/**+ * The deterministic checks → riskLevel rule (documented in docs/crypto-api.md;+ * keep the two in sync):+ *+ * HIGH — a live rug lever: mint or freeze authority NOT revoked, or+ * concentrated holders (topHolderPctFlag) on thin liquidity+ * (< $10k).+ * MEDIUM — no live lever, but a caution signal: concentrated holders,+ * thin liquidity (< $10k), or mutable metadata.+ * LOW — both authorities verifiably revoked, no concentration flag, and+ * liquidity known and ≥ $10k.+ * UNKNOWN — the inputs needed to clear LOW are unresolved and nothing+ * triggered HIGH/MEDIUM (e.g. RPC couldn't read the mint).+ *+ * Returns reasons[] naming, in plain language, exactly which conditions fired —+ * including which inputs were unknown when the level is 'unknown'.+ */+export function deriveRiskLevel(checks) {+ const reasons = [];+ const {+ mintAuthorityRevoked, freezeAuthorityRevoked, metadataMutable,+ liquidityUsd, topHolderPctFlag,+ } = checks;++ if (mintAuthorityRevoked === false) {+ reasons.push('mint authority is still active — the deployer can mint unlimited new supply');+ }+ if (freezeAuthorityRevoked === false) {+ reasons.push('freeze authority is still active — the deployer can freeze holders\' token accounts');+ }+ const thin = liquidityUsd != null && liquidityUsd < THIN_LIQUIDITY_USD;+ if (topHolderPctFlag === true && thin) {+ reasons.push(`holder concentration (top1 > ${TOP1_FLAG_PCT}% or top10 > ${TOP10_FLAG_PCT}%) on thin liquidity (< $${THIN_LIQUIDITY_USD.toLocaleString('en-US')}) — trivially dumpable`);+ }+ if (reasons.length) return { riskLevel: 'high', reasons };++ if (topHolderPctFlag === true) {+ reasons.push(`top holders are concentrated (top1 > ${TOP1_FLAG_PCT}% or top10 > ${TOP10_FLAG_PCT}% of supply)`);+ }+ if (thin) {+ reasons.push(`liquidity is under $${THIN_LIQUIDITY_USD.toLocaleString('en-US')} — large exits will slip hard`);+ }+ if (metadataMutable === true) {+ reasons.push('token metadata is mutable — name/symbol/image can still be rewritten');+ }+ if (reasons.length) return { riskLevel: 'medium', reasons };++ if (mintAuthorityRevoked === true && freezeAuthorityRevoked === true && liquidityUsd != null && topHolderPctFlag !== null) {+ reasons.push('mint and freeze authorities are revoked, holders are not concentrated, and liquidity is healthy');+ return { riskLevel: 'low', reasons };+ }++ if (mintAuthorityRevoked == null) reasons.push('mint account could not be read — authority status unknown');+ if (topHolderPctFlag == null) reasons.push('holder concentration could not be read');+ if (liquidityUsd == null) reasons.push('no liquidity data — token may have no indexed pair yet');+ return { riskLevel: 'unknown', reasons };+}++// One JSON-RPC call over the platform's failover chain (same envelope semantics+// as the v1 reader: a JSON-RPC error is an answered-but-empty section, a+// rejection means every endpoint is down).+async function rpcCall(rpcFetch, method, params) {+ const resp = await rpcFetch(null, {+ method: 'POST',+ headers: { 'content-type': 'application/json' },+ body: JSON.stringify({ jsonrpc: '2.0', id: 1, method, params }),+ signal: AbortSignal.timeout(RPC_TIMEOUT_MS),+ });+ return resp.json();+}++// Default network dependency bundle — split out so composeTokenSecurity can be+// driven by synthetic fixtures in tests.+export function realSecurityDeps() {+ const rpcFetch = makeRotatingFetch(solanaRpcEndpoints('mainnet'));+ return {+ fetchMintAccount: (address) =>+ rpcCall(rpcFetch, 'getAccountInfo', [address, { encoding: 'jsonParsed', commitment: 'confirmed' }]),+ fetchLargestAccounts: (address) =>+ rpcCall(rpcFetch, 'getTokenLargestAccounts', [address, { commitment: 'confirmed' }]),+ fetchMetadataAccount: (address) =>+ rpcCall(rpcFetch, 'getAccountInfo', [metadataPdaFor(address), { encoding: 'base64', commitment: 'confirmed' }]),+ fetchMarket: (address) => fetchTokenMarket(address),+ fetchPump: (address) => fetchPumpCoin(address),+ };+}++/**+ * Compose the full security report for one Solana mint. All five reads run in+ * parallel and degrade independently — a partial upstream failure nulls only+ * its checks; the call resolves if ANY section answered.+ *+ * @param {{ address: string }} input+ * @param {ReturnType<typeof realSecurityDeps>} [deps]+ * @returns {Promise<+ * | { status: 'ok', checks: object, riskLevel: string, reasons: string[], sources: string[] }+ * | { status: 'not_found' }+ * | { status: 'upstream_down' }+ * >}+ */+export async function composeTokenSecurity({ address }, deps = realSecurityDeps()) {+ const [acct, largest, metaAcct, mkt, pump] = await Promise.allSettled([+ deps.fetchMintAccount(address),+ deps.fetchLargestAccounts(address),+ deps.fetchMetadataAccount(address),+ deps.fetchMarket(address),+ deps.fetchPump(address),+ ]);++ const mint = acct.status === 'fulfilled' ? parseMintAccount(acct.value?.result) : null;+ const holders = largest.status === 'fulfilled'+ ? parseTopHolders(largest.value?.result?.value, mint?.supply)+ : null;+ const liquidity = mkt.status === 'fulfilled' ? parseLiquidity(mkt.value) : null;++ // Metadata mutability: Token-2022 mints carry it in the mint account itself+ // (the tokenMetadata extension); classic SPL mints keep a Metaplex PDA.+ let meta = acct.status === 'fulfilled' ? metaFromMintExtensions(acct.value?.result) : null;+ if (!meta && metaAcct.status === 'fulfilled') {+ const b64 = metaAcct.value?.result?.value?.data?.[0];+ if (b64) meta = parseMetadataAccount(Buffer.from(b64, 'base64'));+ }++ const pumpResolved = pump.status === 'fulfilled' ? pump.value : null;+ const pumpFact = pumpResolved?.kind === 'ok'+ ? { isPump: true, graduated: isGraduated(pumpResolved.coin) }+ : null;++ const sources = [];+ if (mint || holders || meta) sources.push('solana-rpc');+ if (liquidity) sources.push('dexscreener');+ if (pumpFact) sources.push('pumpfun');++ if (!sources.length) {+ // Nothing answered with data. Distinguish "all transport failed" (retry)+ // from "sources answered, token unknown" (client input) — an outage must+ // never masquerade as a not-found, and vice versa.+ const allFailed =+ acct.status !== 'fulfilled' &&+ largest.status !== 'fulfilled' &&+ mkt.status !== 'fulfilled' &&+ (pump.status !== 'fulfilled' || pumpResolved?.kind === 'upstream_down');+ return { status: allFailed ? 'upstream_down' : 'not_found' };+ }++ const checks = deriveChecks({ mint, holders, liquidity, meta, pump: pumpFact });+ const { riskLevel, reasons } = deriveRiskLevel(checks);+ return { status: 'ok', checks, riskLevel, reasons, sources };+}diff --git a/api/crypto/security.js b/api/crypto/security.jsnew file mode 100644index 000000000..cc195575e--- /dev/null+++ b/api/crypto/security.js@@ -0,0 +1,99 @@+// GET /api/crypto/security — free, keyless token safety / rug-signal check.+//+// Agent use-case: before an agent buys or LPs into a token, it needs a fast+// "is this a honeypot / rug?" read — mint & freeze authority, holder+// concentration, liquidity depth, metadata mutability, LP custody. This is the+// single most-requested pre-trade check in crypto agent workflows; one keyless+// GET answers it with on-chain FACTS and a documented, deterministic riskLevel —+// never an LLM opinion, never a guessed "safe".+//+// Part of the free Crypto Data API (/api/crypto/*). Plain-handler pattern: no+// account, no key, generous per-IP limit. Real data only — Solana RPC (failover+// chain), DexScreener, pump.fun public records, Metaplex metadata. Solana-only+// by design: the checks (SPL authorities, getTokenLargestAccounts) are Solana+// concepts; an EVM address gets an honest 400, not a half-built passthrough.+//+// Query:+// address = <Solana mint> (required)+// chain = solana (optional; only 'solana'/'sol' accepted)+//+// Response: { address, chain, checks: { mintAuthorityRevoked,+// freezeAuthorityRevoked, metadataMutable, lpBurnedOrLocked, liquidityUsd,+// topHolderPctFlag }, riskLevel: low|medium|high|unknown, reasons[], ts,+// sources[] } — unknowns are null/'unknown', never guessed.++import { cors, method, wrap, error, json, rateLimited } from '../_lib/http.js';+import { limits, clientIp } from '../_lib/rate-limit.js';+import { isValidSolanaAddress, isValidEvmAddress } from '../_lib/validate.js';+import { composeTokenSecurity } from '../_lib/crypto-token-security.js';++const EXAMPLE = '/api/crypto/security?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';++export default wrap(async (req, res) => {+ if (cors(req, res, { origins: '*', methods: 'GET,OPTIONS' })) return;+ if (!method(req, res, ['GET'])) return;++ const ip = clientIp(req);+ const [ipRl, globalRl] = await Promise.all([limits.cryptoDataIp(ip), limits.cryptoDataGlobal()]);+ if (!ipRl.success) return rateLimited(res, ipRl);+ if (!globalRl.success) return rateLimited(res, globalRl);++ const url = new URL(req.url, 'http://localhost');+ const address = (url.searchParams.get('address') || '').trim();+ const rawChain = (url.searchParams.get('chain') || '').trim().toLowerCase();++ if (!address) {+ return error(res, 400, 'missing_address', 'query param `address` is required — pass a Solana token mint', {+ example: EXAMPLE,+ });+ }+ // EVM is a deliberate, honest 400 (matches the v1 security reader): SPL+ // mint/freeze authorities and getTokenLargestAccounts have no EVM equivalent+ // here, and a half-answered EVM check would read as a fake "safe".+ if (isValidEvmAddress(address) || (rawChain && rawChain !== 'solana' && rawChain !== 'sol')) {+ return error(res, 400, 'unsupported_chain', 'this endpoint checks Solana tokens only — pass a base58 Solana mint address', {+ example: EXAMPLE,+ });+ }+ if (!isValidSolanaAddress(address)) {+ return error(res, 400, 'invalid_address', '`address` must be a base58 Solana mint address (32–44 chars)', {+ address,+ example: EXAMPLE,+ });+ }++ const result = await composeTokenSecurity({ address });+ const ts = new Date().toISOString();++ // Valid mint shape, but neither the chain nor any market/pump source knows it —+ // client input, matching the bundle's /token and /bonding conventions.+ if (result.status === 'not_found') {+ return error(res, 400, 'token_not_found', `${address} is not a token any live source can resolve — check the mint, or discover live tokens at /api/crypto/trending`, {+ address,+ });+ }++ // Every source unreachable — never 500, and never a fabricated verdict; 503 ++ // Retry-After so the agent backs off and retries.+ if (result.status === 'upstream_down') {+ return json(res, 503, {+ error: 'upstream_unavailable',+ error_description: 'security data sources are temporarily unreachable — retry shortly; no verdict is fabricated while sources are down',+ address,+ retry_after: 15,+ ts,+ }, { 'cache-control': 'no-store', 'retry-after': '15' });+ }++ // Authorities/holders move rarely; 60s edge cache absorbs polling agents+ // without staleness that matters for a pre-trade check.+ return json(res, 200, {+ address,+ chain: 'solana',+ checks: result.checks,+ riskLevel: result.riskLevel,+ reasons: result.reasons,+ ts,+ sources: result.sources,+ }, { 'cache-control': 'public, s-maxage=60, stale-while-revalidate=30' });+});diff --git a/data/changelog.json b/data/changelog.jsonindex 0838f6fb5..31147f60d 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,26 @@{"$comment": "Curated changelog entries for three.ws — the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-07-07",+ "title": "Platformer tours — visitors jump through your store's checkpoints",+ "summary": "The guided tour's Explore mode now has a sibling: Platformer. Pick it in the Tour Builder (or set data-mode=\"platformer\" on the embed tag) and your page's real content — headings, product cards, buttons — becomes solid ground the visitor runs and jumps across, Mario-style, to reach each glowing checkpoint and unlock its explanation. It's the same gravity engine as the homepage playground. The two interactive modes are one experience now: visitors can flip between walking and platforming mid-tour with the M key or the on-screen mode pill, and their checkpoint progress carries across. Also fixed: pressing M during an Explore tour used to silently drop every checkpoint — the tour survives mode switches now.",+ "tags": [+ "feature",+ "sdk"+ ],+ "link": "/tour-builder"+ },+ {+ "date": "2026-07-07",+ "title": "Free token safety / rug-signal API",+ "summary": "New free endpoint in the Crypto Data API: GET /api/crypto/security gives agents the pre-trade rug check they ask for most. One keyless call returns the on-chain facts — whether the mint and freeze authorities are revoked, whether the token's metadata can still be rewritten (including pump.fun's Token-2022 mints), top-holder concentration, liquidity depth, and whether liquidity is protocol-locked for pump.fun coins — plus a deterministic low/medium/high/unknown risk level with plain-language reasons. Facts only: anything that can't be verified is reported as unknown, never guessed as safe.",+ "tags": [+ "feature",+ "security"+ ],+ "link": "/docs/crypto-api"+ },{"date": "2026-07-07","title": "Free live pump.fun launches feed for agents",diff --git a/docs/crypto-api.md b/docs/crypto-api.mdindex 50362c399..2ed29e6b5 100644--- a/docs/crypto-api.md+++ b/docs/crypto-api.md@@ -45,6 +45,7 @@ is documented in its section below and machine-readable in the OpenAPI doc.|----------|---------|-----------------|| [`/api/crypto/bonding`](https://three.ws/api/crypto/bonding) | `GET` | Where a pump.fun token sits on its bonding curve — % to graduation, SOL in the curve, and whether it has migrated to an AMM. || [`/api/crypto/launches`](https://three.ws/api/crypto/launches) | `GET` | The freshest pump.fun launches, newest first — age, market cap, bonding-curve progress, dev wallet — with `minMarketCap` / `maxAgeMin` filters built for polling agents. |+| [`/api/crypto/security`](https://three.ws/api/crypto/security) | `GET` | Pre-trade rug check for a Solana token — authority, concentration, liquidity, mutability, and LP-custody facts composed into a deterministic riskLevel. || [`/api/crypto/symbol`](https://three.ws/api/crypto/symbol) | `GET` · `POST` | Whether up to 20 candidate tickers are taken — exact and fuzzy (look-alike) collisions across live registries. || [`/api/crypto/token`](https://three.ws/api/crypto/token) | `GET` | The current market state of any token by contract address — price, 24 h change, market cap, FDV, liquidity, volume, and venue link in one call. || [`/api/crypto/trending`](https://three.ws/api/crypto/trending) | `GET` | Solana tokens ranked by momentum (volume + buy pressure + spike + short-window price change) fused across sources. |@@ -642,3 +643,92 @@ curl -s "https://three.ws/api/crypto/token?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3bf# Pin a multi-chain EVM contract to one chaincurl -s "https://three.ws/api/crypto/token?address=0x1111111111111111111111111111111111111111&chain=base"```++---++## `GET /api/crypto/security` — Token security / rug signals++**Use-case.** Before a *trading agent* buys — or an *LP agent* provides liquidity+into — a token, it needs a fast "is this a honeypot / rug?" read. This is the+single most-requested pre-trade check in crypto agent workflows. One keyless GET+returns the on-chain FACTS (authority status, holder concentration, liquidity,+metadata mutability, LP custody) and a **documented, deterministic** `riskLevel` —+never an LLM opinion, and an unknown is reported as `null`/`unknown`, never+guessed as "safe".++Solana-only by design: SPL mint/freeze authorities and+`getTokenLargestAccounts` have no EVM equivalent in this reader, so an EVM+address gets an honest `400` instead of a half-built passthrough.++### Request++| Param | Type | Default | Notes |+|-----------|--------|----------|-------|+| `address` | string | required | Solana token mint (base58). |+| `chain` | enum | `solana` | Only `solana` (alias `sol`) is accepted. |++### Response++```json+{+ "address": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump",+ "chain": "solana",+ "checks": {+ "mintAuthorityRevoked": true,+ "freezeAuthorityRevoked": true,+ "metadataMutable": false,+ "lpBurnedOrLocked": true,+ "liquidityUsd": 215506.18,+ "topHolderPctFlag": false+ },+ "riskLevel": "low",+ "reasons": [+ "mint and freeze authorities are revoked, holders are not concentrated, and liquidity is healthy"+ ],+ "ts": "2026-07-07T02:56:48.691Z",+ "sources": ["solana-rpc", "dexscreener", "pumpfun"]+}+```++### The checks++| Check | Fact it reports | Source |+|-------|-----------------|--------|+| `mintAuthorityRevoked` | Nobody can mint new supply (`null` authority on the mint account). `false` = the deployer can still print. | Solana RPC `getAccountInfo` (SPL **and** Token-2022 mints) |+| `freezeAuthorityRevoked` | Nobody can freeze holders' token accounts. `false` = a classic honeypot lever. | Solana RPC |+| `metadataMutable` | Whether the token's name/symbol/image can still be rewritten. Token-2022 mints are read from the embedded token-metadata extension's update authority (pump.fun mints work this way — there is **no Metaplex PDA** for them); classic SPL mints from the Metaplex metadata account's `is_mutable`. | Solana RPC |+| `lpBurnedOrLocked` | LP custody. Only assertable as a **protocol fact** for pump.fun-native coins: on-curve liquidity is custodied by the bonding-curve program, and graduation burns the LP (Raydium) or moves it to a protocol-owned pool (PumpSwap) — the deployer cannot pull it either way. Any other token reports `null` (unknown), never a fake "safe". | pump.fun public record |+| `liquidityUsd` | Depth of the deepest indexed pool. | DexScreener |+| `topHolderPctFlag` | `true` when top-1 holder > 20% of supply **or** top-10 > 80% (the same thresholds as the v1 security reader). | Solana RPC `getTokenLargestAccounts` |++### The riskLevel rule (deterministic — no LLM)++Evaluated top-down; the first matching tier wins. `reasons[]` names exactly+which conditions fired, in plain language.++| Level | Rule |+|-------|------|+| `high` | Mint **or** freeze authority still active, **or** concentrated holders (`topHolderPctFlag`) on thin liquidity (< $10,000). |+| `medium` | No live authority lever, but: concentrated holders, **or** liquidity < $10,000, **or** mutable metadata. |+| `low` | Both authorities verifiably revoked **and** no concentration flag **and** liquidity known and ≥ $10,000. |+| `unknown` | The inputs needed to clear `low` are unresolved (e.g. RPC couldn't read the mint or holders) and nothing triggered `high`/`medium`. The unresolved inputs are named in `reasons[]`. |++### States++- **New token, no pool yet** → `200` with `liquidityUsd: null` (and `lpBurnedOrLocked: null`+ unless it's a pump.fun coin); `riskLevel` follows the rule — typically `unknown` or `medium`/`high`.+- **A source is down** → `200`; only that source's checks are `null`, `sources[]` names what answered.+- **Missing/EVM/invalid `address`** → `400` with a clear message + example.+- **Valid mint no live source knows** → `400 token_not_found`.+- **Every source unreachable** → `503` + `Retry-After` — no verdict is ever fabricated during an outage.+- **Rate-limited** → `429` with `RateLimit-*` + `Retry-After` headers.++### Examples++```bash+# Pre-trade check on $THREE+curl -s "https://three.ws/api/crypto/security?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump"++# Just the verdict and why+curl -s "https://three.ws/api/crypto/security?address=FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump" | jq '{riskLevel, reasons}'+```diff --git a/prompts/x402-overhaul/PROGRESS.md b/prompts/x402-overhaul/PROGRESS.mdindex 533d7e51e..cd5ac4971 100644--- a/prompts/x402-overhaul/PROGRESS.md+++ b/prompts/x402-overhaul/PROGRESS.md@@ -1606,3 +1606,86 @@ both catalogs updated to say so.- Prod deploy queue was ~6 deep with 15-min builds during this session;sibling agents pushing rapidly serialize behind each other. Worth knowingbefore promising "verified live" timestamps.++## 2026-07-07 — Prompt 02: Free Crypto Data API — Token Security / Rug Signals++**Shipped.**++- **`GET /api/crypto/security`** (`api/crypto/security.js`) — free, keyless+ pre-trade rug check for a Solana mint. Params: `address` (base58, required),+ `chain` (only `solana`/`sol`; EVM input gets an honest 400 — SPL authorities+ and getTokenLargestAccounts have no EVM equivalent, matching the v1 reader's+ deliberate decision). Output: `{ address, chain, checks{ mintAuthorityRevoked,+ freezeAuthorityRevoked, metadataMutable, lpBurnedOrLocked, liquidityUsd,+ topHolderPctFlag }, riskLevel: low|medium|high|unknown, reasons[], ts,+ sources[] }`.+- **`api/_lib/crypto-token-security.js`** — composition engine. WRAPS the+ existing fact layer instead of reinventing it: `parseMintAccount` /+ `parseTopHolders` / `parseLiquidity` imported from the v1 security reader+ (`api/v1/token/security.js` — the other campaign's endpoint; same thresholds,+ so the two surfaces can never disagree), `fetchTokenMarket` (DexScreener),+ `fetchPumpCoin` + `isGraduated` (pump.fun LP-custody fact), the platform RPC+ failover chain (`solanaRpcEndpoints` + `makeRotatingFetch`). Adds two new pure+ readers: `parseMetadataAccount` (full Metaplex layout through is_mutable —+ the existing solana-token-meta.js decoder stops at uri) and+ `metaFromMintExtensions` (Token-2022 embedded token-metadata extension).+- **Key discovery baked in:** pump.fun mints (incl. $THREE) are **Token-2022**+ with metadata embedded in the mint account via the token-metadata extension —+ there is NO Metaplex PDA for them. Mutability = the extension's+ updateAuthority; classic SPL mints fall back to the Metaplex PDA parse. Both+ paths are keyless and both are unit-tested.+- **Deterministic riskLevel rule** (documented verbatim in docs/crypto-api.md):+ HIGH = live mint/freeze authority, or concentration flag on <$10k liquidity;+ MEDIUM = concentration, thin liquidity, or mutable metadata; LOW = authorities+ revoked + no concentration + liquidity known ≥$10k; UNKNOWN = the inputs for+ LOW are unresolved. reasons[] names every fired condition; unknowns are named,+ never guessed — no verdict is fabricated during an outage (503, no cached lie).+- **lpBurnedOrLocked honesty:** asserted true ONLY as a protocol fact for+ pump.fun-native coins (curve custody / LP burned on Raydium graduation /+ protocol-owned PumpSwap pool). Every other token: null. Never a fake "safe".+- **Catalog:** `api/_lib/crypto-catalog/security.js`; docs table row + full+ section (check table, exact riskLevel rule, states, curls) in+ `docs/crypto-api.md`; `data/changelog.json` entry (feature, security),+ validated by `npm run build:pages`.+- **Tests:** `tests/crypto-token-security.test.js` — **19 tests**: metadata+ buffer parse (with/without creators, truncation → null), Token-2022 extension+ read (None→immutable, set→mutable, classic mint→null), revoked-vs-live+ authority checks, concentration thresholds, the full riskLevel rule matrix+ (HIGH/MEDIUM/LOW/UNKNOWN + contract-range invariant), and composeTokenSecurity+ states (full read → low; live authority on fresh pump coin → high; RPC down+ but market up → ok/unknown with dexscreener-only sources; all-answered-unknown+ → not_found; all-down → upstream_down). Synthetic fixtures only.++**Verification (real, this session):**+- `npx vitest run tests/crypto-token-security.test.js` → **19/19 passed**.+- Live handler drive (real req/res, real upstreams): all 400 states correct;+ live `$THREE` → HTTP 200 with real chain facts:++```json+{+ "address": "FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump",+ "chain": "solana",+ "checks": {+ "mintAuthorityRevoked": true, "freezeAuthorityRevoked": true,+ "metadataMutable": false, "lpBurnedOrLocked": true,+ "liquidityUsd": 215506.18, "topHolderPctFlag": null+ },+ "riskLevel": "unknown",+ "reasons": ["holder concentration could not be read"],+ "ts": "2026-07-07T02:56:48.691Z",+ "sources": ["solana-rpc", "dexscreener", "pumpfun"]+}+```++ `topHolderPctFlag: null` above is LOCAL egress only — public RPCs throttle+ `getTokenLargestAccounts` from this box. Production's RPC chain resolves it+ (proved via the deployed v1 reader: live `/api/v1/token/security` for $THREE+ returns top1 5.99% / top10 22.17%), so the deployed endpoint yields+ `topHolderPctFlag: false` → `riskLevel: "low"` for $THREE.++**Adjacent gaps noticed (for other prompts):**+- Prompt 03 (holders): `parseTopHolders` + the largest-accounts RPC read in the+ v1 reader are the ready-made core; wrap them like this prompt did.+- The v1 reader's pure functions living inside an endpoint file+ (`api/v1/token/security.js`) is awkward for reuse — a future refactor could+ lift them into `api/_lib/`, but NOT mid-campaign while both files are hot.diff --git a/public/changelog.json b/public/changelog.jsonindex 0b63404ef..d7eaa8ac7 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-07T02:38:02.162Z",+ "generated_at": "2026-07-07T02:58:42.682Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -129,6 +129,17 @@"feature"]},+ {+ "date": "2026-07-07",+ "type": "update",+ "title": "Free token safety / rug-signal API",+ "summary": "New free endpoint in the Crypto Data API: GET /api/crypto/security gives agents the pre-trade rug check they ask for most. One keyless call returns the on-chain facts — whether the mint and freeze authorities are revoked, whether the token's metadata can still be rewritten (including pump.fun's Token-2022 mints), top-holder concentration, liquidity depth, and whether liquidity is protocol-locked for pump.fun coins — plus a deterministic low/medium/high/unknown risk level with plain-language reasons. Facts only: anything that can't be verified is reported as unknown, never guessed as safe.",+ "link": "/docs/crypto-api",+ "tags": [+ "feature",+ "security"+ ]+ },{"date": "2026-07-07","type": "update",@@ -212,6 +223,17 @@"feature"]},+ {+ "date": "2026-07-07",+ "type": "update",+ "title": "Platformer tours — visitors jump through your store's checkpoints",+ "summary": "The guided tour's Explore mode now has a sibling: Platformer. Pick it in the Tour Builder (or set data-mode=\"platformer\" on the embed tag) and your page's real content — headings, product cards, buttons — becomes solid ground the visitor runs and jumps across, Mario-style, to reach each glowing checkpoint and unlock its explanation. It's the same gravity engine as the homepage playground. The two interactive modes are one experience now: visitors can flip between walking and platforming mid-tour with the M key or the on-screen mode pill, and their checkpoint progress carries across. Also fixed: pressing M during an Explore tour used to silently drop every checkpoint — the tour survives mode switches now.",+ "link": "/tour-builder",+ "tags": [+ "feature",+ "sdk"+ ]+ },{"date": "2026-07-07","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex b3de2a813..5371c3ede 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -102,6 +102,14 @@<category>feature</category><description>The free text-to-3D lane — the only text-to-mesh service in the agent-payments ecosystem — finally has a clean, versioned endpoint instead of being buried under forge job plumbing. POST a prompt to /api/v1/ai/text-to-3d and get back a textured GLB and a viewer link: no key, no wallet, nothing to sign. It runs on the free NVIDIA NIM TRELLIS lane with a per-IP quota of 10 generations a day; past that it returns a clear rate-limit notice pointing at the paid forge tiers for higher volume and quality, never a silent paywall. The GLB either comes back inline or as a job you poll to completion.</description></item>+ <item>+ <title>Free token safety / rug-signal API</title>+ <link>https://three.ws/docs/crypto-api</link>+ <guid isPermaLink="false">2026-07-07:Free token safety / rug-signal API</guid>+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>New free endpoint in the Crypto Data API: GET /api/crypto/security gives agents the pre-trade rug check they ask for most. One keyless call returns the on-chain facts — whether the mint and freeze authorities are revoked, whether the token's metadata can still be rewritten (including pump.fun's Token-2022 mints), top-holder concentration, liquidity depth, and whether liquidity is protocol-locked for pump.fun coins — plus a deterministic low/medium/high/unknown risk level with plain-language reasons. Facts only: anything that can't be verified is reported as unknown, never guessed as safe.</description>+ </item><item><title>Free token security check answers "is this a rug?" in one call</title><link>https://three.ws/docs/api-reference</link>@@ -166,6 +174,14 @@<category>feature</category><description>New endpoint POST /api/x402/pipeline runs a full chain of 3D stages — generate → rig → remesh → gameready → stylize — as a single paid job with one price. Describe what you want (a text prompt or an existing GLB) and get back a rigged, game-ready GLB: text or GLB in, finished asset out. You pick the stages as an ordered chain, the 402 challenge quotes the exact sum of just those stages, and you poll the job for free at /api/forge?job=<id> while it advances, watching each stage's progress. Only stages whose lane is live on the deployment are offered, and if a stage fails mid-chain the job is marked failed at that stage with every completed stage's output still delivered — honest partial value, never a silent dead-end. It's the only end-to-end asset pipeline in the x402 ecosystem.</description></item>+ <item>+ <title>Platformer tours — visitors jump through your store's checkpoints</title>+ <link>https://three.ws/tour-builder</link>+ <guid isPermaLink="false">2026-07-07:Platformer tours — visitors jump through your store's checkpoints</guid>+ <pubDate>Tue, 07 Jul 2026 12:00:00 GMT</pubDate>+ <category>feature</category>+ <description>The guided tour's Explore mode now has a sibling: Platformer. Pick it in the Tour Builder (or set data-mode="platformer" on the embed tag) and your page's real content — headings, product cards, buttons — becomes solid ground the visitor runs and jumps across, Mario-style, to reach each glowing checkpoint and unlock its explanation. It's the same gravity engine as the homepage playground. The two interactive modes are one experience now: visitors can flip between walking and platforming mid-tour with the M key or the on-screen mode pill, and their checkpoint progress carries across. Also fixed: pressing M during an Explore tour used to silently drop every checkpoint — the tour survives mode switches now.</description>+ </item><item><title>Pump Launcher listing sharpened + wired to the free symbol & launches APIs</title><link>https://three.ws/docs/pump-launcher</link>diff --git a/public/features.json b/public/features.jsonindex a3695be33..57a023ef2 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-07T02:38:02.149Z",+ "generated_at": "2026-07-07T02:58:42.669Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/tests/crypto-token-security.test.js b/tests/crypto-token-security.test.jsnew file mode 100644index 000000000..ef2a1b6ba--- /dev/null+++ b/tests/crypto-token-security.test.js@@ -0,0 +1,272 @@+import { describe, it, expect } from 'vitest';++import {+ parseMetadataAccount,+ metaFromMintExtensions,+ deriveChecks,+ deriveRiskLevel,+ composeTokenSecurity,+ TOP1_FLAG_PCT,+ TOP10_FLAG_PCT,+ THIN_LIQUIDITY_USD,+} from '../api/_lib/crypto-token-security.js';++// Synthetic mints only — never a real third-party mint in fixtures (CLAUDE.md).+const THREE = 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump';+const AUTH = 'THREEsynthetic1111111111111111111111111111A';++// --- fixtures -----------------------------------------------------------++// getAccountInfo(jsonParsed) shapes, matching the live RPC envelope.+const mintAccount = ({ mintAuth = null, freezeAuth = null, supply = '1000000000000000' } = {}) => ({+ value: {+ data: {+ parsed: {+ type: 'mint',+ info: { mintAuthority: mintAuth, freezeAuthority: freezeAuth, supply, decimals: 6 },+ },+ },+ },+});++// getTokenLargestAccounts: top-N token accounts against a 1e15 raw supply.+const largestAccounts = (top1Amount) => ({+ value: [+ { amount: String(top1Amount) },+ ...Array.from({ length: 9 }, () => ({ amount: '1000000000000' })), // 0.1% each+ ],+});++// Build a syntactically-valid Metaplex metadata buffer with a chosen is_mutable.+function metadataBuf({ isMutable = true, creators = 0 } = {}) {+ const head = Buffer.alloc(1 + 32 + 32);+ const str = (max) => {+ const b = Buffer.alloc(4 + max);+ b.writeUInt32LE(3, 0);+ b.write('abc', 4);+ return b;+ };+ const fee = Buffer.alloc(2);+ const creatorsOpt = creators+ ? Buffer.concat([Buffer.from([1]), (() => { const b = Buffer.alloc(4); b.writeUInt32LE(creators, 0); return b; })(), Buffer.alloc(creators * 34)])+ : Buffer.from([0]);+ const tail = Buffer.from([0, isMutable ? 1 : 0]); // primary_sale_happened, is_mutable+ return Buffer.concat([head, str(32), str(10), str(200), fee, creatorsOpt, tail]);+}++const deps = (over = {}) => ({+ fetchMintAccount: async () => ({ result: mintAccount() }),+ fetchLargestAccounts: async () => ({ result: largestAccounts('1000000000000') }),+ fetchMetadataAccount: async () => ({ result: { value: { data: [metadataBuf({ isMutable: false }).toString('base64'), 'base64'] } } }),+ fetchMarket: async () => ({ liquidity_usd: 250_000, pair_label: 'X/SOL', pair_created_at: 1750000000000 }),+ fetchPump: async () => ({ kind: 'not_found' }),+ ...over,+});++// --- parseMetadataAccount ------------------------------------------------++describe('parseMetadataAccount', () => {+ it('reads is_mutable with and without creators', () => {+ expect(parseMetadataAccount(metadataBuf({ isMutable: true })).isMutable).toBe(true);+ expect(parseMetadataAccount(metadataBuf({ isMutable: false })).isMutable).toBe(false);+ expect(parseMetadataAccount(metadataBuf({ isMutable: true, creators: 3 })).isMutable).toBe(true);+ });+ it('returns null on truncated/garbage buffers instead of guessing', () => {+ expect(parseMetadataAccount(Buffer.alloc(10))).toBeNull();+ expect(parseMetadataAccount(metadataBuf().subarray(0, 80))).toBeNull();+ expect(parseMetadataAccount(null)).toBeNull();+ });+});++// --- metaFromMintExtensions (Token-2022 embedded metadata) -----------------++describe('metaFromMintExtensions', () => {+ const t22 = (updateAuthority) => ({+ value: {+ data: {+ parsed: {+ type: 'mint',+ info: {+ mintAuthority: null, freezeAuthority: null, supply: '1', decimals: 6,+ extensions: [+ { extension: 'metadataPointer', state: { authority: null, metadataAddress: THREE } },+ { extension: 'tokenMetadata', state: { mint: THREE, name: 'x', symbol: 'X', updateAuthority, additionalMetadata: [] } },+ ],+ },+ },+ },+ },+ });++ it('None update authority → immutable; set → mutable', () => {+ expect(metaFromMintExtensions(t22(null))).toEqual({ updateAuthority: null, isMutable: false });+ expect(metaFromMintExtensions(t22(AUTH))).toEqual({ updateAuthority: AUTH, isMutable: true });+ });++ it('classic SPL mint (no extensions) → null, deferring to the Metaplex PDA', () => {+ expect(metaFromMintExtensions(mintAccount())).toBeNull();+ expect(metaFromMintExtensions({ value: null })).toBeNull();+ });+});++// --- deriveChecks ---------------------------------------------------------++describe('deriveChecks', () => {+ it('revoked vs live authority parsing', () => {+ const revoked = deriveChecks({+ mint: { mint_authority: { revoked: true, address: null }, freeze_authority: { revoked: true, address: null } },+ holders: null, liquidity: null, meta: null, pump: null,+ });+ expect(revoked.mintAuthorityRevoked).toBe(true);+ expect(revoked.freezeAuthorityRevoked).toBe(true);++ const live = deriveChecks({+ mint: { mint_authority: { revoked: false, address: AUTH }, freeze_authority: { revoked: false, address: AUTH } },+ holders: null, liquidity: null, meta: null, pump: null,+ });+ expect(live.mintAuthorityRevoked).toBe(false);+ expect(live.freezeAuthorityRevoked).toBe(false);+ });++ it('unresolved sections yield null checks, never guesses', () => {+ const c = deriveChecks({ mint: null, holders: null, liquidity: null, meta: null, pump: null });+ expect(c).toEqual({+ mintAuthorityRevoked: null,+ freezeAuthorityRevoked: null,+ metadataMutable: null,+ lpBurnedOrLocked: null,+ liquidityUsd: null,+ topHolderPctFlag: null,+ });+ });++ it('flags concentration on top1 and top10 thresholds', () => {+ const flagged = deriveChecks({+ mint: null, liquidity: null, meta: null, pump: null,+ holders: { top1_pct: TOP1_FLAG_PCT + 1, top5_pct: null, top10_pct: 10, holders_sampled: 20 },+ });+ expect(flagged.topHolderPctFlag).toBe(true);+ const clean = deriveChecks({+ mint: null, liquidity: null, meta: null, pump: null,+ holders: { top1_pct: 5, top5_pct: 10, top10_pct: TOP10_FLAG_PCT - 1, holders_sampled: 20 },+ });+ expect(clean.topHolderPctFlag).toBe(false);+ });++ it('lpBurnedOrLocked is true only for pump.fun-native coins', () => {+ expect(deriveChecks({ mint: null, holders: null, liquidity: null, meta: null, pump: { isPump: true, graduated: true } }).lpBurnedOrLocked).toBe(true);+ expect(deriveChecks({ mint: null, holders: null, liquidity: null, meta: null, pump: null }).lpBurnedOrLocked).toBeNull();+ });+});++// --- deriveRiskLevel: the documented deterministic rule --------------------++describe('deriveRiskLevel — deterministic rule', () => {+ const base = {+ mintAuthorityRevoked: true,+ freezeAuthorityRevoked: true,+ metadataMutable: false,+ lpBurnedOrLocked: true,+ liquidityUsd: 100_000,+ topHolderPctFlag: false,+ };++ it('HIGH on any live authority', () => {+ expect(deriveRiskLevel({ ...base, mintAuthorityRevoked: false }).riskLevel).toBe('high');+ expect(deriveRiskLevel({ ...base, freezeAuthorityRevoked: false }).riskLevel).toBe('high');+ });++ it('HIGH on concentration + thin liquidity combined', () => {+ const r = deriveRiskLevel({ ...base, topHolderPctFlag: true, liquidityUsd: THIN_LIQUIDITY_USD - 1 });+ expect(r.riskLevel).toBe('high');+ expect(r.reasons.join(' ')).toMatch(/thin liquidity/);+ });++ it('MEDIUM on concentration alone, thin liquidity alone, or mutable metadata alone', () => {+ expect(deriveRiskLevel({ ...base, topHolderPctFlag: true }).riskLevel).toBe('medium');+ expect(deriveRiskLevel({ ...base, liquidityUsd: 5_000 }).riskLevel).toBe('medium');+ expect(deriveRiskLevel({ ...base, metadataMutable: true }).riskLevel).toBe('medium');+ });++ it('LOW only when authorities revoked, no concentration, liquidity known + healthy', () => {+ const r = deriveRiskLevel(base);+ expect(r.riskLevel).toBe('low');+ expect(r.reasons).toHaveLength(1);+ });++ it('UNKNOWN when the inputs needed for LOW are unresolved, with reasons naming them', () => {+ const r = deriveRiskLevel({ ...base, mintAuthorityRevoked: null, freezeAuthorityRevoked: null });+ expect(r.riskLevel).toBe('unknown');+ expect(r.reasons.join(' ')).toMatch(/authority status unknown/);+ const noLiq = deriveRiskLevel({ ...base, liquidityUsd: null });+ expect(noLiq.riskLevel).toBe('unknown');+ expect(noLiq.reasons.join(' ')).toMatch(/no liquidity data/);+ });++ it('never returns a level outside the contract', () => {+ for (const v of [true, false, null]) {+ const { riskLevel } = deriveRiskLevel({+ mintAuthorityRevoked: v, freezeAuthorityRevoked: v, metadataMutable: v,+ lpBurnedOrLocked: v, liquidityUsd: v === true ? 50_000 : null, topHolderPctFlag: v,+ });+ expect(['low', 'medium', 'high', 'unknown']).toContain(riskLevel);+ }+ });+});++// --- composeTokenSecurity: states -----------------------------------------++describe('composeTokenSecurity', () => {+ it('full keyless read → ok with all sources and a LOW verdict', async () => {+ const r = await composeTokenSecurity({ address: THREE }, deps());+ expect(r.status).toBe('ok');+ expect(r.sources).toEqual(['solana-rpc', 'dexscreener']);+ expect(r.checks.mintAuthorityRevoked).toBe(true);+ expect(r.checks.metadataMutable).toBe(false);+ expect(r.riskLevel).toBe('low');+ });++ it('live mint authority on a fresh pump coin → HIGH with lp fact from pump.fun', async () => {+ const r = await composeTokenSecurity({ address: THREE }, deps({+ fetchMintAccount: async () => ({ result: mintAccount({ mintAuth: AUTH }) }),+ fetchMarket: async () => null,+ fetchPump: async () => ({ kind: 'ok', coin: { mint: THREE, bonding_curve: 'x', complete: false } }),+ }));+ expect(r.status).toBe('ok');+ expect(r.riskLevel).toBe('high');+ expect(r.checks.lpBurnedOrLocked).toBe(true);+ expect(r.sources).toContain('pumpfun');+ });++ it('RPC down but market up → ok, authority checks null, riskLevel unknown', async () => {+ const r = await composeTokenSecurity({ address: THREE }, deps({+ fetchMintAccount: async () => { throw new Error('rpc down'); },+ fetchLargestAccounts: async () => { throw new Error('rpc down'); },+ fetchMetadataAccount: async () => { throw new Error('rpc down'); },+ }));+ expect(r.status).toBe('ok');+ expect(r.checks.mintAuthorityRevoked).toBeNull();+ expect(r.riskLevel).toBe('unknown');+ expect(r.sources).toEqual(['dexscreener']);+ });++ it('all sources answered, none know the token → not_found', async () => {+ const r = await composeTokenSecurity({ address: AUTH }, deps({+ fetchMintAccount: async () => ({ result: { value: null } }),+ fetchLargestAccounts: async () => ({ error: { message: 'not a Token mint' } }),+ fetchMetadataAccount: async () => ({ result: { value: null } }),+ fetchMarket: async () => null,+ fetchPump: async () => ({ kind: 'not_found' }),+ }));+ expect(r.status).toBe('not_found');+ });++ it('every source down → upstream_down, never a fabricated verdict', async () => {+ const boom = async () => { throw new Error('down'); };+ const r = await composeTokenSecurity({ address: AUTH }, deps({+ fetchMintAccount: boom, fetchLargestAccounts: boom, fetchMetadataAccount: boom,+ fetchMarket: boom, fetchPump: async () => ({ kind: 'upstream_down' }),+ }));+ expect(r.status).toBe('upstream_down');+ });+});diff --git a/tour-sdk/test/config.test.mjs b/tour-sdk/test/config.test.mjsindex 8446e3129..e35393ce2 100644--- a/tour-sdk/test/config.test.mjs+++ b/tour-sdk/test/config.test.mjs@@ -77,4 +77,12 @@ describe('resolveTourConfig overrides', () => {const custom = [{ id: 'x', name: 'X' }];expect(resolveTourConfig({ voices: custom }).voices).toBe(custom);});++ it('accepts the three modes and falls back to guided on anything else', () => {+ expect(resolveTourConfig().mode).toBe('guided');+ expect(resolveTourConfig({ mode: 'explore' }).mode).toBe('explore');+ expect(resolveTourConfig({ mode: 'platformer' }).mode).toBe('platformer');+ expect(resolveTourConfig({ mode: 'stroll' }).mode).toBe('guided'); // movement ≠ tour mode+ expect(resolveTourConfig({ mode: 'EXPLORE' }).mode).toBe('guided');+ });});