Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

fix(pump): dedupe the creator signer when the treasury pays the close fee

nirholas7deac91c4438
diff --git a/api/_lib/coin/creator-fees.js b/api/_lib/coin/creator-fees.js
index ac5a603ac..f41ed1611 100644
--- a/api/_lib/coin/creator-fees.js
+++ b/api/_lib/coin/creator-fees.js
@@ -103,7 +103,10 @@ export async function claimCreatorFees({ coin, coinCreator, treasury }) {
closeTx.feePayer = treasuryPk;
const { blockhash: bh2 } = await connection.getLatestBlockhash('confirmed');
closeTx.recentBlockhash = bh2;
- closeTx.sign(...signers);
+ // Treasury is fee-payer; the creator owns the ATA being closed and
+ // co-signs only when it is a distinct key (dedupe, or web3.js
+ // rejects the duplicate signer).
+ closeTx.sign(treasury, ...extraSigners);
await connection.sendRawTransaction(closeTx.serialize(), {
skipPreflight: false,
maxRetries: 5,
diff --git a/api/pump/accept-payment-confirm.js b/api/pump/accept-payment-confirm.js
deleted file mode 100644
index f7cc7bc48..000000000
--- a/api/pump/accept-payment-confirm.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'accept-payment-confirm';
- return dispatcher(req, res);
-}
diff --git a/api/pump/accept-payment-prep.js b/api/pump/accept-payment-prep.js
deleted file mode 100644
index c3ea554ad..000000000
--- a/api/pump/accept-payment-prep.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'accept-payment-prep';
- return dispatcher(req, res);
-}
diff --git a/api/pump/balances.js b/api/pump/balances.js
deleted file mode 100644
index 067b4a776..000000000
--- a/api/pump/balances.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'balances';
- return dispatcher(req, res);
-}
diff --git a/api/pump/by-agent.js b/api/pump/by-agent.js
deleted file mode 100644
index 1fef1e113..000000000
--- a/api/pump/by-agent.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'by-agent';
- return dispatcher(req, res);
-}
diff --git a/api/pump/launch-agent.js b/api/pump/launch-agent.js
deleted file mode 100644
index 7331c8922..000000000
--- a/api/pump/launch-agent.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'launch-agent';
- return dispatcher(req, res);
-}
diff --git a/api/pump/launch-prep.js b/api/pump/launch-prep.js
deleted file mode 100644
index 7bee95ef2..000000000
--- a/api/pump/launch-prep.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'launch-prep';
- return dispatcher(req, res);
-}
diff --git a/api/pump/withdraw-confirm.js b/api/pump/withdraw-confirm.js
deleted file mode 100644
index 0d425f7cf..000000000
--- a/api/pump/withdraw-confirm.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'withdraw-confirm';
- return dispatcher(req, res);
-}
diff --git a/api/pump/withdraw-prep.js b/api/pump/withdraw-prep.js
deleted file mode 100644
index 231f60f33..000000000
--- a/api/pump/withdraw-prep.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// Thin stub that routes to the consolidated pump [action] dispatcher.
-// Tests and legacy imports reference individual files; this forwards them.
-import dispatcher from './[action].js';
-export default function handler(req, res) {
- if (!req.query) req.query = {};
- req.query.action = 'withdraw-prep';
- return dispatcher(req, res);
-}
diff --git a/data/changelog.json b/data/changelog.json
index 9478f2e55..5e8f54ff6 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,16 @@
{
"$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-08-11",
+ "title": "The walking avatar SDK now types the cursor-tracking option it ships",
+ "summary": "@three-ws/walk is the packaged version of the character that walks over three.ws pages, and it lets a host turn off the head tracking that makes the avatar follow the visitor's cursor. That switch worked, and the docs described it, but it was missing from the package's TypeScript definitions, so anyone writing the option in a typed project got an error on working code. The definitions now declare it, along with the resolved-config object every control returns, and the guide lists it with the other options. The package's public entry point also gained a test that imports it the way a host does and checks that every documented export is really there.",
+ "tags": [
+ "sdk",
+ "fix"
+ ],
+ "link": "/walk"
+ },
{
"date": "2026-08-11",
"title": "The agent-to-agent invocation SDK now states the truth about its Solana program",
@@ -19594,6 +19604,17 @@
"infra"
],
"link": "/wardrobe"
+ },
+ {
+ "date": "2026-08-11",
+ "title": "The MCP server directory now tells the truth about auth",
+ "summary": "Anyone pointing an MCP client at three.ws reads /.well-known/mcp.json to decide how to connect. Two of its seven entries were wrong. The pump.fun server was advertised as free and read-only, but one of its nineteen tools uploads coin metadata to IPFS and needs a key, so a client that trusted the label got a payment-required error out of nowhere; the entry now says which tool that is. And the main server accepts x402 pay-per-call alongside sign-in and API keys, which the directory never mentioned, so an agent with a wallet but no account had no way to know it could just pay. Both are fixed, along with the matching lines in the registry manifest and the MCP docs. The free 3D Studio endpoint was also the one hosted server the live health probe never checked; it is in the sweep now, and the manifest audit that runs on every build now fails if the directory and the manifests on disk ever disagree again.",
+ "tags": [
+ "fix",
+ "docs",
+ "sdk"
+ ],
+ "link": "/mcp-tools"
}
]
}
diff --git a/mcp-server/src/lib/pump-vanity.js b/mcp-server/src/lib/pump-vanity.js
index d86f0fecb..34f32b268 100644
--- a/mcp-server/src/lib/pump-vanity.js
+++ b/mcp-server/src/lib/pump-vanity.js
@@ -65,7 +65,11 @@ export function isValidVanityPrefix(prefix) {
// leading character by up to 17×, see base58-distribution.js. Getting it wrong
// meant a "2-character" budget that clears `A?` in a second and cannot clear
// `z?` at all.
-export { expectedAttempts as estimateAttempts } from './base58-distribution.js';
+// Imported rather than `export … from` because a bare re-export creates no
+// local binding, and the timeout message below calls it in this module.
+import { expectedAttempts as estimateAttempts } from './base58-distribution.js';
+
+export { estimateAttempts };
/**
* Grind a Solana Keypair whose base58 address matches a prefix and/or suffix.
diff --git a/prompts/swarm-100/sdk-walk-sdk.md b/prompts/swarm-100/sdk-walk-sdk.md
deleted file mode 100644
index 0e620ee84..000000000
--- a/prompts/swarm-100/sdk-walk-sdk.md
+++ /dev/null
@@ -1,89 +0,0 @@
-# Module audit: walk-sdk/
-
-How to run: paste this file's repo path into a fresh Claude Code chat in this
-repository and say "run this work order". This file is fully self-contained:
-it depends on no other prompt file anywhere. If neighboring files in
-prompts/swarm-100/ are gone, that work is done; if present, ignore them.
-Every claim below rots; step 0 re-measures, and what you measure wins.
-
-## Operating clause (binding)
-
-- Read CLAUDE.md first. Its rules override everything, including this file.
-- Finish 100% in this session. Never end the turn with a question, an option
- list, or an unexecuted plan. A judgment call goes in one line of the final
- report; it never becomes a question that halts work.
-- The only permitted stops are the CLAUDE.md stop-and-ask gates: spending real
- funds or any irreversible on-chain write, git push or a production deploy,
- committing content that references a crypto project other than $THREE, and
- destroying unrecoverable data.
-- No mocks, no fake data, no placeholder stubs, no unfinished-work markers, no
- commented-out code. Real APIs and real integrations only.
-- The em-dash and en-dash characters are banned in everything you write.
-- Concurrent agents share this worktree: stage explicit paths only (never a
- bare add-everything), and commit finished work promptly.
-- Before committing, run: npm run check:rules -- --paths <files you touched>.
- It must exit 0.
-
-## Step 0: re-derive the current state
-
-1. Read walk-sdk/README.md and walk-sdk/package.json (or the equivalent manifest).
-2. Find every consumer: grep the repo for imports of this module and check
- STRUCTURE.md for the surfaces it powers.
-
-## Task: bring walk-sdk/ to verified-shippable
-
-1. Build it with its own build script; the build must succeed from this
- worktree.
-2. Run its tests; add a core-path test if none proves the main export works.
-3. README quickstart: execute it verbatim as a new user would. Every command
- must run, every code sample must work. Fix drift in the same change.
-4. Public API: import the declared entry points with node and confirm they
- load. Exported functions the README documents must exist and behave as
- documented.
-5. Hard-rule scan across its source: no stubs, no mock data, no unfinished
- markers, no commented-out code.
-6. If this module publishes an artifact consumed elsewhere (a UMD bundle, a
- published npm package, a served static build), verify the wiring that
- produces the artifact still works; never hand-edit generated output.
-
-## Definition of done
-
-- [ ] Build green from this worktree.
-- [ ] Tests green, core path covered.
-- [ ] README quickstart executed successfully end to end.
-- [ ] Entry points import cleanly; documented API verified real.
-- [ ] Zero hard-rule violations remain in this module.
-- [ ] npm run check:rules -- --paths <touched files> exits 0.
-
-## Never blocked
-
-| Blocker | Resolution (act, do not ask) |
-|---|---|
-| Missing env var or credential | Check .env and .env.local, then the Cloud Run service env, then Secret Manager (the CLAUDE.md self-unblock playbook has the exact commands). If it truly exists nowhere, wire the code fully behind the env var, prove the wiring with a dry run, and name the single missing var in the report. |
-| gcloud not on PATH | Run: export PATH="$HOME/google-cloud-sdk/bin:$PATH" |
-| Dev server port 3000 busy | Another agent may be serving this repo; probe it and reuse if so. Otherwise start your own on a free port: npx vite --port 3101 |
-| Playwright browser missing | npx playwright install chromium |
-| A surface needs a signed-in user | Register a fresh account through the real /register flow against the real API and use it. Never mock the session. |
-| A defect sits in code you did not touch | Fix it if it blocks a Definition of done line (root cause it, never mask it). Otherwise note it in the report and continue. |
-| An unrelated test is red | Same rule. Never pipe npm test through tail; it masks exit codes. |
-
-## Close out (required)
-
-1. Verify every Definition of done line with the actual command output in
- front of you. Never claim a line you did not verify.
-2. Commit with explicit paths and a subject that describes the diff (house
- style: type(scope): what changed and why a reader cares).
-3. Delete this prompt file in that same commit:
-
- git rm prompts/swarm-100/sdk-walk-sdk.md
-
- The shrinking directory is this campaign's only progress ledger; there is
- no progress log to update.
-4. Final report: what step 0 measured, what changed (file list), evidence per
- Definition of done line, and any one-line judgment calls. No trailing
- questions, no unexecuted plans.
-
-If a line genuinely cannot pass inside this session (an external party must
-respond, or an owner-gated action is the final step), finish everything else,
-leave this file in place, and state exactly which line remains and who owns
-it. Never delete this file on a partial.
diff --git a/tests/api/pump.test.js b/tests/api/pump.test.js
index 2c9de3ba8..0c765256b 100644
--- a/tests/api/pump.test.js
+++ b/tests/api/pump.test.js
@@ -127,6 +127,17 @@ async function invoke(handler, opts) {
await handler(req, res);
return { res, json: res.body ? JSON.parse(res.body) : null };
}
+// Every /api/pump/<action> path is rewritten to the consolidated dispatcher, so
+// the dispatcher is the only code a real request runs. This binds one action the
+// way the filesystem router does, which keeps each test naming its endpoint
+// while still exercising exactly what production serves.
+function pumpAction(action) {
+ return async (req, res) => {
+ req.query = { ...(req.query ?? {}), action };
+ const { default: dispatcher } = await import('../../api/pump/[action].js');
+ return dispatcher(req, res);
+ };
+}
function resetAll() {
authState.session = null; authState.bearer = null;
sqlState.queue = []; sqlState.calls = [];
@@ -148,7 +159,7 @@ describe('GET /api/pump/balances', () => {
beforeEach(resetAll);
it('returns three vault balances', async () => {
- const { default: handler } = await import('../../api/pump/balances.js');
+ const handler = pumpAction('balances');
const { res, json } = await invoke(handler, {
method: 'GET',
url: `/api/pump/balances?mint=${mintB58}&network=devnet`,
@@ -161,7 +172,7 @@ describe('GET /api/pump/balances', () => {
});
it('400s on bad mint', async () => {
- const { default: handler } = await import('../../api/pump/balances.js');
+ const handler = pumpAction('balances');
const pumpMod = await import('../../api/_lib/pump.js');
pumpMod.solanaPubkey.mockReturnValueOnce(null); // invalid mint
const { res, json } = await invoke(handler, {
@@ -176,7 +187,7 @@ describe('POST /api/pump/launch-prep', () => {
beforeEach(resetAll);
it('rejects unauthenticated', async () => {
- const { default: handler } = await import('../../api/pump/launch-prep.js');
+ const handler = pumpAction('launch-prep');
const { res } = await invoke(handler, {
method: 'POST', url: '/api/pump/launch-prep',
body: { agent_id: '00000000-0000-0000-0000-000000000001',
@@ -192,7 +203,7 @@ describe('POST /api/pump/launch-prep', () => {
[{ id: 'agent-1', name: 'Foo' }], // agent check
[], // insert pending
];
- const { default: handler } = await import('../../api/pump/launch-prep.js');
+ const handler = pumpAction('launch-prep');
const { res, json } = await invoke(handler, {
method: 'POST', url: '/api/pump/launch-prep',
body: {
@@ -219,7 +230,7 @@ describe('POST /api/pump/accept-payment-prep', () => {
[{ id: 'mint-1', mint: mintB58, network: 'devnet', buyback_bps: 500 }], // mint lookup
[{ id: 'pay-1', invoice_id: '1234', start_time: '2026-01-01', end_time: '2026-01-02', status: 'pending' }],
];
- const { default: handler } = await import('../../api/pump/accept-payment-prep.js');
+ const handler = pumpAction('accept-payment-prep');
const { res, json } = await invoke(handler, {
method: 'POST', url: '/api/pump/accept-payment-prep',
body: {
@@ -237,7 +248,7 @@ describe('POST /api/pump/accept-payment-prep', () => {
it('404s if mint not registered', async () => {
authState.session = { id: 'user-1' };
sqlState.queue = [[]]; // mint lookup empty
- const { default: handler } = await import('../../api/pump/accept-payment-prep.js');
+ const handler = pumpAction('accept-payment-prep');
const { res, json } = await invoke(handler, {
method: 'POST', url: '/api/pump/accept-payment-prep',
body: {
@@ -283,7 +294,7 @@ describe('POST /api/pump/accept-payment-confirm', () => {
}],
},
});
- const { default: handler } = await import('../../api/pump/accept-payment-confirm.js');
+ const handler = pumpAction('accept-payment-confirm');
const { res, json } = await invoke(handler, {
method: 'POST', url: '/api/pump/accept-payment-confirm',
body: {
@@ -398,7 +409,7 @@ describe('POST /api/pump/withdraw-prep', () => {
id: 'mint-1', mint: mintB58, user_id: 'user-1',
agent_authority: walletB58, network: 'devnet',
}]];
- const { default: handler } = await import('../../api/pump/withdraw-prep.js');
+ const handler = pumpAction('withdraw-prep');
const { res, json } = await invoke(handler, {
method: 'POST', url: '/api/pump/withdraw-prep',
body: {
@@ -417,7 +428,7 @@ describe('POST /api/pump/withdraw-prep', () => {
id: 'mint-1', mint: mintB58, user_id: 'user-1',
agent_authority: walletB58, network: 'devnet',
}]];
- const { default: handler } = await import('../../api/pump/withdraw-prep.js');
+ const handler = pumpAction('withdraw-prep');
const { res } = await invoke(handler, {
method: 'POST', url: '/api/pump/withdraw-prep',
body: {
@@ -434,7 +445,7 @@ describe('GET /api/pump/by-agent', () => {
it('returns null when no mint exists', async () => {
sqlState.queue = [[]];
- const { default: handler } = await import('../../api/pump/by-agent.js');
+ const handler = pumpAction('by-agent');
const { res, json } = await invoke(handler, {
method: 'GET',
url: '/api/pump/by-agent?agent_id=00000000-0000-0000-0000-000000000001',
@@ -449,7 +460,7 @@ describe('GET /api/pump/by-agent', () => {
[{ confirmed_payments: 3, unique_payers: 2, total_atomics: '1500000', last_payment_at: '2026-04-29T10:00:00Z' }],
[{ runs: 1, total_burned: '50000', last_burn_at: '2026-04-29T11:00:00Z' }],
];
- const { default: handler } = await import('../../api/pump/by-agent.js');
+ const handler = pumpAction('by-agent');
const { res, json } = await invoke(handler, {
method: 'GET',
url: '/api/pump/by-agent?agent_id=00000000-0000-0000-0000-000000000001',
@@ -461,7 +472,7 @@ describe('GET /api/pump/by-agent', () => {
});
it('400s without agent_id', async () => {
- const { default: handler } = await import('../../api/pump/by-agent.js');
+ const handler = pumpAction('by-agent');
const { res } = await invoke(handler, { method: 'GET', url: '/api/pump/by-agent' });
expect(res.statusCode).toBe(400);
});
@@ -485,7 +496,7 @@ describe('POST /api/pump/withdraw-confirm', () => {
slot: 12345,
blockTime: 1714492800,
});
- const { default: handler } = await import('../../api/pump/withdraw-confirm.js');
+ const handler = pumpAction('withdraw-confirm');
const { res, json } = await invoke(handler, {
method: 'POST',
url: '/api/pump/withdraw-confirm',
@@ -505,7 +516,7 @@ describe('POST /api/pump/withdraw-confirm', () => {
sqlState.queue = [
[{ id: 'mint-1', mint: mintB58, user_id: 'user-1', agent_authority: walletB58, network: 'mainnet' }],
];
- const { default: handler } = await import('../../api/pump/withdraw-confirm.js');
+ const handler = pumpAction('withdraw-confirm');
const { res } = await invoke(handler, {
method: 'POST',
url: '/api/pump/withdraw-confirm',
@@ -576,7 +587,7 @@ describe('cookie-CSRF gate on pump mutations (2026-07-23 audit)', () => {
it('rejects a cross-site POST riding the session cookie before any handler work', async () => {
authState.session = { id: 'user-1' };
- const { default: handler } = await import('../../api/pump/launch-prep.js');
+ const handler = pumpAction('launch-prep');
const { res, json } = await invoke(handler, {
method: 'POST', url: '/api/pump/launch-prep',
headers: { origin: 'https://evil.example' },
@@ -596,7 +607,7 @@ describe('cookie-CSRF gate on pump mutations (2026-07-23 audit)', () => {
it('rejects a cookie-authed POST with no Origin and no Referer', async () => {
authState.session = { id: 'user-1' };
- const { default: handler } = await import('../../api/pump/launch-prep.js');
+ const handler = pumpAction('launch-prep');
const { res } = await invoke(handler, {
method: 'POST', url: '/api/pump/launch-prep',
headers: { origin: undefined },
@@ -608,7 +619,7 @@ describe('cookie-CSRF gate on pump mutations (2026-07-23 audit)', () => {
it('does not gate bearer-authed mutations (agent keys, workers)', async () => {
authState.bearer = { userId: 'user-1' };
- const { default: handler } = await import('../../api/pump/launch-prep.js');
+ const handler = pumpAction('launch-prep');
const { res } = await invoke(handler, {
method: 'POST', url: '/api/pump/launch-prep',
headers: { origin: 'https://evil.example' },