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.

docs(packages): correct the pumpfun-skills exports, the vanity grinder claim, and the autopilot key warning

nirholas2137f945d4df
diff --git a/packages/autopilot-mcp/src/config.js b/packages/autopilot-mcp/src/config.js
index f66c417dc..759693c66 100644
--- a/packages/autopilot-mcp/src/config.js
+++ b/packages/autopilot-mcp/src/config.js
@@ -19,7 +19,7 @@ export const THREE_WS_BASE = env('THREE_WS_BASE', 'https://three.ws').replace(/\
// The agent's three.ws credential. Either a three.ws API key (sk_live_… /
// sk_test_…) or an OAuth access token — both authenticate as the owning user via
// `Authorization: Bearer`. REQUIRED: every autopilot endpoint is owner-scoped and
-// returns 401 without it. Treat it like a password; it can move real $THREE.
+// returns 401 without it. Treat it like a password; it can move real SOL.
export const THREE_WS_API_KEY =
env('THREE_WS_API_KEY') || env('THREE_WS_TOKEN') || env('THREE_WS_BEARER') || '';
diff --git a/packages/defi-utils/LICENSE b/packages/defi-utils/LICENSE
new file mode 100644
index 000000000..dff21b7f4
--- /dev/null
+++ b/packages/defi-utils/LICENSE
@@ -0,0 +1,20 @@
+Copyright 2026 nirholas
+
+All rights reserved.
+
+This software is proprietary and may not be used, copied, modified, distributed,
+translated, or made available to any third party without the express written
+permission of the copyright owner.
+
+No rights are granted by implication, estoppel, or otherwise. Use of this
+software is subject to the terms of a separate license agreement with the
+copyright owner.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT.
+
+IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY CLAIM, DAMAGES, OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE,
+ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/packages/pumpfun-skills/README.md b/packages/pumpfun-skills/README.md
index c448cf08a..5938b7218 100644
--- a/packages/pumpfun-skills/README.md
+++ b/packages/pumpfun-skills/README.md
@@ -122,6 +122,12 @@ All build functions return a base64 Solana transaction the caller signs and
broadcasts. Amounts are strings in base units (lamports for SOL, token smallest
units for SPL). `NATIVE_MINT` is re-exported as a convenience for SOL.
+Also exported: `createPumpfunSkills(options)` builds a configured client (custom
+`fetch`, `agentBaseUrl`, `coinsV2Base`, `apiKey`, `headers`) whose methods match
+the functions below; plus the `AGENT_API_BASE`, `COINS_V2_BASE`, and
+`FEE_DESTINATIONS` constants and the `ThreeWsError` / `PaymentRequiredError`
+error classes.
+
### `createCoin(input) → Promise<BuiltTx & { mint: string }>`
Build a new-coin transaction with an optional initial buy. The mint keypair is
@@ -163,8 +169,8 @@ set `outputMint` to `NATIVE_MINT`. Wraps `POST /agents/swap`.
### `coinFees(mint) → Promise<FeeInfo>`
Read-only. Resolve the fee destination, vault balances, sharing config, and
-graduation state for a mint. Reads the bonding curve / AMM pool and
-`coins-v2` directly — no transaction.
+graduation state for a mint. Reads the public `coins-v2` API, which carries the
+bonding-curve, pool, cashback, and sharing-config state. No transaction, no RPC.
**Returns** `FeeInfo`
@@ -177,7 +183,7 @@ graduation state for a mint. Reads the bonding curve / AMM pool and
| `isCashbackCoin` | `boolean` | True if fees route as cashback. |
| `hasSharingConfig` | `boolean` | True if a fee-sharing config is active. |
| `creator` | `string` | Effective creator public key. |
-| `creatorVaultLamports` | `string` | Claimable lamports in the creator vault. |
+| `creatorVaultLamports` | `string` | Claimable lamports in the creator vault (`'0'` when `coins-v2` carries no balance). |
| `sharingConfig` | `object \| null` | `{ address, admin, adminRevoked, shareholders[] }`. |
| `feeDestination` | `'creator' \| 'cashback' \| 'sharing_config'` | Where fees go. |
@@ -216,8 +222,8 @@ Two surfaces, one rule — **the function builds, you sign**:
createCoin / swap coinFees collectFees / sharingConfig
│ │ │
▼ ▼ ▼
-POST fun-block.pump.fun read bonding curve / POST fun-block.pump.fun
- /agents/create-coin AMM pool + coins-v2 /agents/collect-fees
+POST fun-block.pump.fun read coins-v2 (curve, POST fun-block.pump.fun
+ /agents/create-coin pool + fee state) /agents/collect-fees
/agents/swap (no transaction) /agents/sharing-config
│ │ │
▼ ▼ ▼
@@ -235,9 +241,9 @@ base64 transaction FeeInfo JSON base64 transaction
**mint keypair already signed** — you only add the wallet signature. `swap`,
`collect-fees`, and `sharing-config` return a transaction for the wallet to
sign outright.
-- **Read calls** (`coinFees`) hit `coins-v2` and the on-chain bonding
- curve / AMM pool to derive the fee destination and balances. No wallet, no
- signing.
+- **Read calls** (`coinFees`) hit `coins-v2`, which carries the bonding-curve,
+ pool, cashback, and sharing-config state, and derive the fee destination and
+ balances from it. No wallet, no signing, no RPC.
- **State detection is automatic.** `swap` and `collectFees` inspect whether the
coin is still on the bonding curve or graduated to an AMM pool and build the
correct route — you never branch on it yourself.
@@ -247,9 +253,10 @@ environment variable; the build API base is `https://fun-block.pump.fun/agents`.
## Errors & edge cases
-Build functions reject with a `PumpSkillError` carrying the HTTP `status` and
-the upstream body; read functions reject with a plain `Error`. Every state is
-surfaced, never swallowed:
+Every function rejects with a typed `ThreeWsError` carrying a `code`, the HTTP
+`status`, and the upstream `body`; a 402 surfaces as `PaymentRequiredError`, a
+`ThreeWsError` subclass carrying the x402 challenge. Every state is surfaced,
+never swallowed:
| Where | Condition | Meaning | Recovery |
|---|---|---|---|
diff --git a/packages/vanity/README.md b/packages/vanity/README.md
index 0bab165a2..6871aaeaf 100644
--- a/packages/vanity/README.md
+++ b/packages/vanity/README.md
@@ -169,7 +169,7 @@ Returns specific, user-facing error strings (e.g. `invalid character 'O'
### `grindViaApi(options) → Promise<ApiResult>` — the paid lane
-For environments without WASM/Workers, grind a short pattern over the hosted
+For environments that can't grind locally, grind a short pattern over the hosted
[x402](https://x402.org) endpoint instead of locally. Wraps
`GET /api/x402/vanity`. Combined pattern capped at 3 chars; pass an
x402-capable `fetch` to settle the 402 automatically.
@@ -189,48 +189,47 @@ for `format=mnemonic` — `mnemonic`, `wordCount`, `derivationPath`.
## How it works
-Two backends, one `grind()` surface. Picked by environment.
+Two keygen backends, one `grind()` surface. Picked by environment, resolved
+once, then the same batched hot loop runs on either.
```
- grind({ prefix, suffix })
- │
- ┌───────── browser ─┴─ Node ──────────┐
- ▼ ▼
- Web Worker pool (1/core, capped) WASM on the request thread
- │ start/pause/resume/stop │ batched, time-budgeted
- ▼ ▼
- ┌──────────────────────────────────────────────────────────┐
- │ Rust + ed25519-dalek + bs58 → WebAssembly │
- │ grind(prefix, suffix, ignoreCase, batchSize, seed) │
- │ → null | { publicKey: string, secretKey: Uint8Array(64) }│
- └──────────────────────────────────────────────────────────┘
- │ first match wins → pool terminated
- ▼
- { publicKey, secretKey, attempts, durationMs }
+ grind({ prefix, suffix })
+ |
+ +------- Node ----+---- browser/Deno ------+
+ v v
+ crypto.generateKeyPairSync('ed25519') crypto.subtle.generateKey('Ed25519')
+ | |
+ +--------------------+---------------------+
+ v
+ batched loop: keygen -> Base58 encode -> prefix/suffix compare
+ (2,000 keys per batch, then yield so aborts + progress land)
+ |
+ v
+ { publicKey, secretKey, attempts, durationMs, workers: 1 }
```
-- **WASM core** — the hot loop (CSPRNG seed → Ed25519 keygen → Base58 encode →
- prefix/suffix compare) runs entirely inside WebAssembly in fixed-size batches.
- Built from `crates/vanity-grinder` via `npm run build:wasm`; the compiled
- artifact is checked into `src/solana/vanity/wasm/` so there's no Rust
- toolchain at install time.
-- **Browser pool** — one worker per logical core (default `min(cores, 8)`).
- Each worker yields to its event loop between batches, so `pause`/`stop`
- messages land within one batch (≤~200ms). Pausing genuinely frees the cores;
- resume continues the attempt count.
-- **Node path** — no Worker pool in a serverless function, so the same WASM
- module runs single-threaded under a wall-clock budget. The hosted endpoint
- caps patterns at 3 chars for this reason; anything longer belongs in the
- browser pool.
+- **Platform crypto core.** The hot loop (Ed25519 keygen, Base58 encode,
+ prefix/suffix compare) uses the runtime's native crypto primitive. Under
+ Node that is OpenSSL via `generateKeyPairSync`; in the browser it is
+ WebCrypto. No JS big-integer math on the keygen path, no dependencies.
+- **Batched and abortable.** The loop checks 2,000 candidates, then yields to
+ the event loop, so an `AbortSignal` lands within one batch and `onProgress`
+ fires on a ~250ms wall-clock cadence.
+- **Single-threaded by design.** The local path runs on the calling thread;
+ `GrindResult.workers` is always `1`. For long patterns, run several
+ `grind()` calls in your own worker threads or processes if you need
+ parallelism. The hosted x402 endpoint caps patterns at 3 chars because it
+ grinds under a server-side wall-clock budget.
## Security
This is the part that matters for a secret-key tool.
- **Keys are generated locally and never transmitted.** In both the browser and
- Node SDK paths, the keypair is produced on your machine inside WASM. No
- address, no secret key, no prefix is sent to three.ws or anywhere else. There
- is no network call on the local `grind()` path.
+ Node SDK paths, the keypair is produced on your machine by the platform's
+ own crypto primitive. No address, no secret key, no prefix is sent to
+ three.ws or anywhere else. There is no network call on the local `grind()`
+ path.
- **The secret exists once, in memory.** `grind()` resolves with the
`secretKey`; nothing persists it. Capture it (write the wallet, store it
encrypted) before the value goes out of scope.
@@ -276,7 +275,7 @@ The local `grind()` path rejects on:
| Non-Base58 char (`0 O I l`, etc.) | `Error: invalid prefix: invalid character 'O' …` |
| Pattern longer than 6 chars | `Error: length 7 exceeds maximum of 6` |
| `signal` aborted | `AbortError` (`DOMException`) |
-| Worker crash (browser) | The worker's error, rejecting the promise |
+| Runtime without Ed25519 support | `ThreeWsError` (`code: 'no_ed25519'`) naming the required runtimes |
The paid `grindViaApi()` path surfaces the endpoint's HTTP errors:
@@ -287,8 +286,8 @@ The paid `grindViaApi()` path surfaces the endpoint's HTTP errors:
| `grind_exhausted` | 504 | Time budget elapsed without a hit (rare, <1% at 3 chars). | Retry — you weren't charged. |
| `rate_limited` | 429 | Pre-payment probe rate limit. | Honour `retry-after`. |
-Long patterns are designed, not crashed: the server tells you to move to the
-browser pool, where there's no cap and every core is in play.
+Long patterns are designed, not crashed: the server tells you to grind them
+locally with `grind()`, where the only cap is the 6-char-per-pattern ceiling.
## Examples
@@ -303,19 +302,17 @@ writeFileSync(`${publicKey}.json`, JSON.stringify(Array.from(secretKey)));
// → solana config set --keypair ./<address>.json
```
-**Browser — pause/resume a long grind with a controller:**
+**Browser — cancel a long grind from the UI:**
```js
import { grind } from '@three-ws/vanity';
-const controller = {};
-const job = grind({ prefix: 'THREE', controller, onProgress: render });
+const controller = new AbortController();
+const job = grind({ prefix: 'THR', signal: controller.signal, onProgress: render });
-document.querySelector('#pause').onclick = () => controller.pause();
-document.querySelector('#resume').onclick = () => controller.resume();
-document.querySelector('#stop').onclick = () => controller.stop();
+document.querySelector('#stop').onclick = () => controller.abort();
-const { publicKey, secretKey } = await job;
+const { publicKey, secretKey } = await job; // rejects with AbortError on stop
```
**Agent — the free MCP tool, no toolchain:**
diff --git a/packages/vanity/package.json b/packages/vanity/package.json
index 480daa764..9aa3194f7 100644
--- a/packages/vanity/package.json
+++ b/packages/vanity/package.json
@@ -1,7 +1,7 @@
{
"name": "@three-ws/vanity",
"version": "0.1.2",
- "description": "Mine Solana vanity addresses (custom prefix/suffix) fast — WASM-accelerated, in the browser or Node. Ergonomic grind() API over a real Rust/ed25519 grinder, with progress, difficulty/ETA, and a paid x402 fallback.",
+ "description": "Mine Solana vanity addresses (custom prefix/suffix) locally in Node or the browser. Zero-dependency grind() over the platform's native Ed25519, with progress, difficulty/ETA, and a paid x402 fallback.",
"type": "module",
"main": "./src/index.js",
"module": "./src/index.js",
@@ -28,7 +28,6 @@
"vanity-address",
"keypair",
"ed25519",
- "wasm",
"bs58",
"base58",
"wallet",