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.

sns + agenc: subdomain claims, x402 pay-by-name, agenc SDK actions

nirholas4ae3f0ea98a7
diff --git a/api/_lib/rate-limit.js b/api/_lib/rate-limit.js
index d00c22055..7a5d54645 100644
--- a/api/_lib/rate-limit.js
+++ b/api/_lib/rate-limit.js
@@ -84,6 +84,7 @@ export const limits = {
x402PayGlobal: () => getLimiter('x402:pay:global', { limit: 600, window: '1 h' }).limit('global'),
checkName: (ip) => getLimiter('check-name:ip', { limit: 60, window: '1 m' }).limit(ip),
ensResolve: (ip) => getLimiter('ens:resolve:ip', { limit: 60, window: '1 m' }).limit(ip),
+ snsResolve: (ip) => getLimiter('sns:resolve:ip', { limit: 60, window: '1 m' }).limit(ip),
// Generic public read endpoints (explore, showcase, public agent fetch). 60/min per IP.
publicIp: (ip) => getLimiter('public:ip', { limit: 60, window: '1 m' }).limit(ip),
// Skills marketplace browse — isolated bucket so traffic on other public endpoints
diff --git a/api/_lib/threews-sns.js b/api/_lib/threews-sns.js
new file mode 100644
index 000000000..925b288bf
--- /dev/null
+++ b/api/_lib/threews-sns.js
@@ -0,0 +1,128 @@
+// threews.sol subdomain helpers.
+//
+// The platform owns `threews.sol` on Solana Name Service. This module wraps
+// the @bonfida/spl-name-service v3 SDK to mint `<label>.threews.sol`
+// subdomains, set a URL record on them (so Brave's built-in SNS resolution
+// routes the subdomain to the user's three.ws showcase page), and transfer
+// ownership to the user's wallet — all in a single transaction signed by
+// the platform parent-domain keypair.
+//
+// Env (required for any write op):
+// THREEWS_SOL_OWNER_SECRET_BASE58 base58-encoded 64-byte ed25519 secret
+// for the wallet that owns `threews.sol`.
+// THREEWS_PARENT_DOMAIN (optional, default 'threews')
+// the parent label whose subdomains we mint. Override only if the
+// platform owns a different root.
+
+import { Keypair, PublicKey, Transaction } from '@solana/web3.js';
+import bs58 from 'bs58';
+import { solanaConnection } from './agent-pumpfun.js';
+
+export const PARENT_LABEL = (process.env.THREEWS_PARENT_DOMAIN || 'threews').toLowerCase();
+
+const SUBDOMAIN_RE = /^[a-z0-9-]{1,63}$/;
+// Reserve labels that look like internal app paths, common impersonations,
+// or short reserved words. Matches the spirit of agents/check-name's denylist.
+const DENYLIST = new Set([
+ 'admin', 'root', 'system', 'api', 'app', 'www', 'mail', 'help', 'support',
+ 'about', 'login', 'signup', 'logout', 'signin', 'auth', 'oauth', 'pay',
+ 'three', 'threews', 'three-ws', 'anthropic', 'claude', 'openai', 'sol',
+ 'wallet', 'staff', 'team', 'official', 'verified',
+]);
+
+export function normalizeLabel(input) {
+ if (typeof input !== 'string') return null;
+ const trimmed = input
+ .trim()
+ .toLowerCase()
+ .replace(new RegExp(`\\.${PARENT_LABEL}(\\.sol)?$`), '')
+ .replace(/\.sol$/, '');
+ if (!SUBDOMAIN_RE.test(trimmed)) return null;
+ if (DENYLIST.has(trimmed)) return null;
+ return trimmed;
+}
+
+export function fullDomain(label) {
+ return `${label}.${PARENT_LABEL}.sol`;
+}
+
+/**
+ * Decode the platform parent-domain keypair from env. Throws when missing —
+ * callers must guard with `hasOwnerKey()` and return a friendly 503 otherwise.
+ */
+export function loadParentOwnerKeypair() {
+ const raw = process.env.THREEWS_SOL_OWNER_SECRET_BASE58;
+ if (!raw) throw new Error('THREEWS_SOL_OWNER_SECRET_BASE58 not configured');
+ const secret = bs58.decode(raw.trim());
+ if (secret.length !== 64) throw new Error('THREEWS_SOL_OWNER_SECRET_BASE58 must decode to 64 bytes');
+ return Keypair.fromSecretKey(secret);
+}
+
+export function hasOwnerKey() {
+ return !!process.env.THREEWS_SOL_OWNER_SECRET_BASE58;
+}
+
+/**
+ * Returns the on-chain owner of `<label>.<parent>.sol`, or null if the
+ * subdomain has not been registered yet.
+ */
+export async function getSubdomainOwner(label) {
+ const sns = await import('@bonfida/spl-name-service');
+ const conn = solanaConnection('mainnet');
+ try {
+ const { pubkey } = sns.getDomainKeySync(`${label}.${PARENT_LABEL}`);
+ const { registry } = await sns.NameRegistryState.retrieve(conn, pubkey);
+ return registry.owner.toBase58();
+ } catch {
+ return null;
+ }
+}
+
+/**
+ * Mint `<label>.threews.sol` as a single transaction signed by the platform:
+ * 1. create the subdomain (parent owner pays rent, becomes interim owner)
+ * 2. set its URL record to `urlRecordValue` (parent owner signs)
+ * 3. transfer ownership of the subdomain to `recipientWallet`
+ *
+ * Returns the tx signature on success.
+ */
+export async function mintSubdomain({ label, recipientWallet, urlRecordValue }) {
+ const sns = await import('@bonfida/spl-name-service');
+ const conn = solanaConnection('mainnet');
+ const parentKp = loadParentOwnerKeypair();
+ const recipient = new PublicKey(recipientWallet);
+
+ const createIxs = await sns.createSubdomain(
+ conn,
+ `${label}.${PARENT_LABEL}`,
+ parentKp.publicKey,
+ 2000,
+ parentKp.publicKey,
+ );
+
+ const recordIx = sns.createRecordV2Instruction(
+ `${label}.${PARENT_LABEL}`,
+ sns.Record.Url,
+ urlRecordValue,
+ parentKp.publicKey,
+ parentKp.publicKey,
+ );
+
+ const transferIx = await sns.transferSubdomain(
+ conn,
+ `${label}.${PARENT_LABEL}`,
+ recipient,
+ true,
+ parentKp.publicKey,
+ );
+
+ const tx = new Transaction().add(...createIxs, recordIx, transferIx);
+ tx.feePayer = parentKp.publicKey;
+ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');
+ tx.recentBlockhash = blockhash;
+ tx.sign(parentKp);
+
+ const sig = await conn.sendRawTransaction(tx.serialize(), { skipPreflight: false });
+ await conn.confirmTransaction({ signature: sig, blockhash, lastValidBlockHeight }, 'confirmed');
+ return sig;
+}
diff --git a/api/_lib/x402.js b/api/_lib/x402.js
index db2e87dd2..71170af08 100644
--- a/api/_lib/x402.js
+++ b/api/_lib/x402.js
@@ -48,9 +48,35 @@
import { sql } from './db.js';
import { json, error } from './http.js';
+import { resolveSnsName } from '../../src/solana/sns.js';
export const X402_VERSION = 'x402/0.1';
+const SNS_NAME_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*\.sol$/i;
+
+// Resolve the manifest's `recipient` to a concrete base58 wallet, and surface
+// the human-readable .sol name in `recipient_name` whenever one is available.
+//
+// Inputs in priority order:
+// 1. `payments.receiver` — already a base58 wallet (most agents today).
+// 2. `payments.receiver` set to a .sol or subdomain — resolve via SNS.
+// 3. `agent.meta.sns_domain` — preferred display name even when receiver
+// is a base58 wallet, so x402 clients can show "paying nich.threews.sol"
+// instead of a raw key.
+async function resolveRecipient({ agent, payments }) {
+ const receiver = payments?.receiver;
+ const metaName = agent?.meta?.sns_domain || null;
+ const metaNameFull = metaName
+ ? (metaName.endsWith('.sol') ? metaName : `${metaName}.sol`)
+ : null;
+
+ if (typeof receiver === 'string' && SNS_NAME_RE.test(receiver)) {
+ const resolved = await resolveSnsName(receiver);
+ return { recipient: resolved || null, recipient_name: receiver.toLowerCase() };
+ }
+ return { recipient: receiver || null, recipient_name: metaNameFull };
+}
+
/**
* Emit a 402 Payment Required response with a canonical manifest body.
*
@@ -62,12 +88,16 @@ export const X402_VERSION = 'x402/0.1';
* @param {string} opts.currency Mint pubkey (base58) for the currency token.
* @param {number} [opts.validForSec=900] Manifest validity in seconds (default 15m).
*/
-export function emit402(res, { agent, skill, amount, currency, validForSec = 900 }) {
+export async function emit402(res, { agent, skill, amount, currency, validForSec = 900 }) {
const payments = agent?.meta?.payments || agent?.payments;
if (!payments?.configured) {
// Misconfigured: we shouldn't gate a skill behind 402 if payments aren't on.
return error(res, 500, 'misconfigured', 'agent has no payments config');
}
+ const { recipient, recipient_name } = await resolveRecipient({ agent, payments });
+ if (!recipient) {
+ return error(res, 412, 'recipient_unresolved', 'agent payments.receiver could not be resolved to a wallet');
+ }
const validUntil = Math.floor(Date.now() / 1000) + validForSec;
const manifest = {
version: X402_VERSION,
@@ -76,7 +106,8 @@ export function emit402(res, { agent, skill, amount, currency, validForSec = 900
skill,
amount: String(amount),
currency,
- recipient: payments.receiver,
+ recipient,
+ recipient_name,
memo: String(Math.floor(Date.now() / 1000)),
valid_until: validUntil,
intent_url: '/api/agents/payments/pay-prep',
@@ -152,9 +183,10 @@ export async function consumeIntent(intentId) {
* Helper: respond with the manifest only (no 402), for prefetch/discovery
* via `GET /api/agents/:id/x402/:skill/manifest`.
*/
-export function manifestOnly(res, opts) {
+export async function manifestOnly(res, opts) {
const validUntil = Math.floor(Date.now() / 1000) + (opts.validForSec || 900);
const payments = opts.agent.meta?.payments || opts.agent.payments;
+ const { recipient, recipient_name } = await resolveRecipient({ agent: opts.agent, payments });
return json(res, 200, {
version: X402_VERSION,
kind: 'agent-skill',
@@ -162,7 +194,8 @@ export function manifestOnly(res, opts) {
skill: opts.skill,
amount: String(opts.amount),
currency: opts.currency,
- recipient: payments?.receiver,
+ recipient,
+ recipient_name,
valid_until: validUntil,
intent_url: '/api/agents/payments/pay-prep',
verify_url: '/api/agents/payments/pay-confirm',
diff --git a/api/agents/sns.js b/api/agents/sns.js
index fb2132faf..85e255adc 100644
--- a/api/agents/sns.js
+++ b/api/agents/sns.js
@@ -32,13 +32,19 @@ import { env } from '../_lib/env.js';
import { loadAgentForSigning, solanaConnection } from '../_lib/agent-pumpfun.js';
const SNS_API = 'https://sns-api.bonfida.com';
-const DOMAIN_RE = /^[a-z0-9-]{1,63}(\.sol)?$/i;
+// Accept a label or dotted subdomain, optionally suffixed `.sol`.
+const DOMAIN_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*(?:\.sol)?$/i;
const USDC_MINT = 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v';
function normalizeDomain(input) {
if (typeof input !== 'string') return null;
const trimmed = input.trim().toLowerCase().replace(/\.sol$/, '');
- if (!trimmed || !/^[a-z0-9-]{1,63}$/.test(trimmed)) return null;
+ if (!trimmed) return null;
+ // Each dotted segment is a valid SNS label.
+ const segments = trimmed.split('.');
+ for (const seg of segments) {
+ if (!/^[a-z0-9-]{1,63}$/.test(seg)) return null;
+ }
return trimmed;
}
diff --git a/api/agents/solana-wallet.js b/api/agents/solana-wallet.js
index 30088a230..7f736b869 100644
--- a/api/agents/solana-wallet.js
+++ b/api/agents/solana-wallet.js
@@ -7,6 +7,7 @@ import { cors, json, method, error, readJson } from '../_lib/http.js';
import { limits, clientIp } from '../_lib/rate-limit.js';
import { generateSolanaAgentWallet } from '../_lib/agent-wallet.js';
import { solanaConnection, solanaPublicConnection } from '../_lib/agent-pumpfun.js';
+import { reverseLookupAddress } from '../../src/solana/sns.js';
import { Keypair, PublicKey, LAMPORTS_PER_SOL } from '@solana/web3.js';
import { webcrypto } from 'node:crypto';
import { env } from '../_lib/env.js';
@@ -16,6 +17,19 @@ const subtle = globalThis.crypto?.subtle || webcrypto.subtle;
const BASE58_RE = /^[1-9A-HJ-NP-Za-km-z]+$/;
const AIRDROP_LAMPORTS = LAMPORTS_PER_SOL;
+// Bonfida reverse-lookup is rate-limited and pulls a few KB per call. Memoize
+// 10 minutes per-address so wallet card refreshes (every 30s) don't refetch.
+const SNS_CACHE_TTL_MS = 10 * 60_000;
+const _snsCache = new Map();
+async function _reverseSnsCached(address) {
+ const hit = _snsCache.get(address);
+ if (hit && Date.now() - hit.at < SNS_CACHE_TTL_MS) return hit.value;
+ let value = null;
+ try { value = await reverseLookupAddress(address); } catch { value = null; }
+ _snsCache.set(address, { at: Date.now(), value });
+ return value;
+}
+
async function _deriveKey() {
const raw = new TextEncoder().encode(env.JWT_SECRET);
const base = await subtle.importKey('raw', raw, 'HKDF', false, ['deriveKey']);
@@ -265,8 +279,26 @@ async function handleWallet(req, res, id) {
}
}
+ // SNS is mainnet-only. Skip the lookup on devnet — it always returns null
+ // and just burns a network round-trip. Prefer the user's manually-attached
+ // SNS id (meta.sns_domain) over the on-chain favorite so the wallet card
+ // matches whatever they picked on the SNS dashboard.
+ const attachedSns = meta.sns_domain ? `${meta.sns_domain}.sol` : null;
+ const favoriteSns = net === 'mainnet' && !attachedSns
+ ? await _reverseSnsCached(meta.solana_address)
+ : null;
+
return json(res, req.method === 'POST' ? 201 : 200, {
- data: { address: meta.solana_address, network, lamports, sol: lamports == null ? null : lamports / 1e9, vanity_prefix: meta.solana_vanity_prefix || null, source: meta.solana_wallet_source || (meta.encrypted_solana_secret ? 'generated' : null) },
+ data: {
+ address: meta.solana_address,
+ network,
+ lamports,
+ sol: lamports == null ? null : lamports / 1e9,
+ vanity_prefix: meta.solana_vanity_prefix || null,
+ source: meta.solana_wallet_source || (meta.encrypted_solana_secret ? 'generated' : null),
+ sns_domain: attachedSns || favoriteSns,
+ sns_source: attachedSns ? 'attached' : (favoriteSns ? 'favorite' : null),
+ },
});
}
diff --git a/api/chat-skills.js b/api/chat-skills.js
index ad14049cb..830637770 100644
--- a/api/chat-skills.js
+++ b/api/chat-skills.js
@@ -1,27 +1,28 @@
// GET /api/chat-skills - rich local-skill feed for the chat Skills modal.
//
// Returns a normalized list that combines:
-// 1. In-code AgentSkills (66+) - MCP-exposed handlers, surfaced as
+// 1. Agent-runtime skills (66+) - MCP-exposed handlers, surfaced as
// installable tool packs whose clientDefinition.body POSTs to /api/mcp.
// 2. SKILL.md packs on disk (.agents/skills, pump-fun-skills,
// public/skills, examples/skills) - surfaced as knowledge skills
// whose body is injected into the system prompt on install.
//
-// Kept separate from /api/skills-manifest (which preserves the simpler
-// machine-readable shape consumed by external manifest readers).
+// Skill metadata is read from data/_generated/skill-metadata.json, produced
+// by scripts/build-skill-metadata.mjs at build time. Importing AgentSkills
+// directly here would pull Three.js, @solana, @metaplex-foundation, @coinbase,
+// etc. into the deployed function and exceed Vercel's 300mb function limit.
import { readFileSync } from 'fs';
import { cors, json, method, wrap } from './_lib/http.js';
-import { AgentSkills } from '../src/agent-skills.js';
import { loadLocalSkillPacks } from '../src/skills/local-packs.js';
const { version } = JSON.parse(
readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
);
-const _noop = () => {};
-const _stub = { emit: _noop, on: _noop, off: _noop, add: _noop, query: () => [] };
-const _skills = new AgentSkills(_stub, _stub);
+const _skillMetadata = JSON.parse(
+ readFileSync(new URL('../data/_generated/skill-metadata.json', import.meta.url), 'utf8'),
+);
function mcpToolNameFor(skillName) {
return `skill_${skillName.replace(/[-.]/g, '_')}`;
@@ -72,7 +73,7 @@ function buildClientToolFor(skill) {
function buildAgentRuntimeEntries() {
const out = [];
- for (const skill of _skills.list()) {
+ for (const skill of _skillMetadata) {
if (!skill.description) continue;
const base = {
id: `local:agent-runtime:${skill.name}`,
diff --git a/api/portfolio/[action].js b/api/portfolio/[action].js
index 2ff21e5b7..22324f77c 100644
--- a/api/portfolio/[action].js
+++ b/api/portfolio/[action].js
@@ -17,7 +17,7 @@ import { logAudit } from '../_lib/audit.js';
import { sql } from '../_lib/db.js';
import { getBalances, walletUsdTotal, invalidateBalances } from '../_lib/balances.js';
import { recoverAgentKey, recoverSolanaAgentKeypair } from '../_lib/agent-wallet.js';
-import { reverseLookupAddress } from '../../src/solana/sns.js';
+import { reverseLookupAddress, resolveSolanaRecipient } from '../../src/solana/sns.js';
import { env } from '../_lib/env.js';
import { z } from 'zod';
@@ -284,12 +284,14 @@ async function sendEvm({ agent, asset, recipient, amount, memo }) {
}
async function sendSolana({ agent, asset, recipient, amount, userId }) {
- if (!SOL_ADDR_RE.test(recipient)) {
- const e = new Error('invalid Solana recipient');
+ const { address: resolvedRecipient, resolved_from } = await resolveSolanaRecipient(recipient);
+ if (!resolvedRecipient) {
+ const e = new Error('invalid Solana recipient — must be a base58 address or a registered .sol name');
e.code = 'validation_error';
e.status = 400;
throw e;
}
+ recipient = resolvedRecipient;
const encryptedSecret = agent.meta?.encrypted_solana_secret;
if (!encryptedSecret) {
const e = new Error('agent has no Solana key');
@@ -350,7 +352,7 @@ async function sendSolana({ agent, asset, recipient, amount, userId }) {
// 'confirmed' commitment takes 10-30s under load and the function would
// time out (Vercel default 10s). The signature is the receipt.
const sig = await conn.sendRawTransaction(tx.serialize(), { skipPreflight: false });
- return { tx_hash: sig };
+ return { tx_hash: sig, recipient, resolved_from };
}
async function handleSend(req, res) {
@@ -391,7 +393,9 @@ async function handleSend(req, res) {
meta: {
chain: body.chain,
asset: body.asset,
- recipient: body.recipient,
+ recipient: out.recipient || body.recipient,
+ recipient_typed: body.recipient,
+ resolved_from: out.resolved_from || null,
amount: body.amount,
tx_hash: out.tx_hash,
},
diff --git a/api/skills-manifest.js b/api/skills-manifest.js
index 5f0705ac0..6b73f62e6 100644
--- a/api/skills-manifest.js
+++ b/api/skills-manifest.js
@@ -1,17 +1,21 @@
-// GET /api/skills-manifest — machine-readable manifest of agent skills
+// GET /api/skills-manifest — machine-readable manifest of agent skills.
+//
+// Skill metadata is read from data/_generated/skill-metadata.json, produced
+// by scripts/build-skill-metadata.mjs at build time. Importing AgentSkills
+// directly here would pull Three.js, @solana, @metaplex-foundation, @coinbase,
+// etc. into the deployed function and exceed Vercel's 300mb function limit.
import { readFileSync } from 'fs';
import { cors, json, method, wrap } from './_lib/http.js';
import { buildSkillManifest } from '../src/skill-manifest.js';
-import { AgentSkills } from '../src/agent-skills.js';
const { version } = JSON.parse(
readFileSync(new URL('../package.json', import.meta.url), 'utf8'),
);
-const _noop = () => {};
-const _stub = { emit: _noop, on: _noop, off: _noop, add: _noop, query: () => [] };
-const _skills = new AgentSkills(_stub, _stub);
+const _skillMetadata = JSON.parse(
+ readFileSync(new URL('../data/_generated/skill-metadata.json', import.meta.url), 'utf8'),
+);
export default wrap(async (req, res) => {
if (cors(req, res, { methods: 'GET,OPTIONS', origins: '*' })) return;
@@ -23,7 +27,7 @@ export default wrap(async (req, res) => {
buildSkillManifest({
agentId: '3d-agent',
version,
- skills: _skills.list(),
+ skills: _skillMetadata,
}),
{ 'cache-control': 'public, max-age=60' },
);
diff --git a/api/sns-subdomain.js b/api/sns-subdomain.js
new file mode 100644
index 000000000..e8670c8bc
--- /dev/null
+++ b/api/sns-subdomain.js
@@ -0,0 +1,159 @@
+// Mint subdomains under the platform-owned parent .sol (default: threews.sol).
+//
+// GET /api/sns-subdomain?label=<label> → availability check.
+// POST /api/sns-subdomain
+// body { label, agent_id?, owner_address?, space? }
+//
+// - label : required, 1–63 chars of [a-z0-9-], no leading/trailing hyphen.
+// - owner_address : optional. Solana base58 wallet to receive ownership.
+// Defaults to the agent's own solana_address when agent_id
+// is given, otherwise to the caller's primary linked
+// Solana wallet.
+// - agent_id : optional. When set, the new subdomain is attached as
+// the agent's SNS identity (meta.sns_domain).
+// - space : optional, 1000–10000. Bytes reserved on the subdomain
+// registry. Default 2000.
+//
+// The platform keypair (THREEWS_SOL_PARENT_SECRET_BASE58) signs both the
+// subdomain creation and the immediate transfer of ownership. The caller's
+// wallet does not need to sign.
+
+import { getSessionUser, authenticateBearer, extractBearer } from './_lib/auth.js';
+import { sql } from './_lib/db.js';
+import { cors, json, method, error, readJson, wrap } from './_lib/http.js';
+import { limits, clientIp } from './_lib/rate-limit.js';
+import {
+ checkSubdomainAvailability,
+ createNamedSubdomain,
+ getParentDomain,
+ normalizeLabel,
+} from '../src/solana/sns-subdomain.js';
+import { Connection } from '@solana/web3.js';
+
+const SOLANA_RPC = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
+const ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+
+async function resolveAuth(req) {
+ const session = await getSessionUser(req);
+ if (session) return { userId: session.id };
+ const bearer = await authenticateBearer(extractBearer(req));
+ if (bearer) return { userId: bearer.userId };
+ return null;
+}
+
+async function resolveTargetOwner({ userId, agentId, ownerAddress }) {
+ if (ownerAddress) {
+ if (!ADDR_RE.test(ownerAddress)) {
+ return { error: { status: 400, code: 'validation_error', msg: 'owner_address must be a base58 Solana public key' } };
+ }
+ const [linked] = await sql`
+ SELECT id FROM user_wallets
+ WHERE user_id = ${userId} AND address = ${ownerAddress} AND chain_type = 'solana'
+ LIMIT 1
+ `;
+ if (!linked) {
+ return { error: { status: 403, code: 'forbidden', msg: 'owner_address is not a Solana wallet linked to your account' } };
+ }
+ return { address: ownerAddress };
+ }
+
+ if (agentId) {
+ const [agent] = await sql`
+ SELECT id, meta FROM agent_identities
+ WHERE id = ${agentId} AND user_id = ${userId} AND deleted_at IS NULL
+ `;
+ if (!agent) return { error: { status: 404, code: 'not_found', msg: 'agent not found' } };
+ const addr = agent.meta?.solana_address;
+ if (!addr) {
+ return { error: { status: 412, code: 'agent_missing_wallet', msg: 'agent has no solana wallet — provision one via POST /api/agents/:id/solana before minting a subdomain' } };
+ }
+ return { address: addr, agent };
+ }
+
+ const [primary] = await sql`
+ SELECT address FROM user_wallets
+ WHERE user_id = ${userId} AND chain_type = 'solana'
+ ORDER BY (is_primary IS TRUE) DESC, created_at ASC
+ LIMIT 1
+ `;
+ if (!primary) {
+ return { error: { status: 412, code: 'no_solana_wallet', msg: 'link a Solana wallet first via POST /api/auth/wallet, or pass owner_address / agent_id' } };
+ }
+ return { address: primary.address };
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,POST,OPTIONS', credentials: true })) return;
+
+ if (req.method === 'GET') {
+ const rl = await limits.snsResolve(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const url = new URL(req.url, 'http://x');
+ const label = normalizeLabel(url.searchParams.get('label'));
+ const parentDomain = getParentDomain().replace(/\.sol$/, '');
+ if (!label) {
+ return error(res, 400, 'validation_error', 'label must be 1–63 lowercase [a-z0-9-] chars with no leading/trailing hyphen');
+ }
+ const connection = new Connection(SOLANA_RPC, 'confirmed');
+ const availability = await checkSubdomainAvailability({ connection, parentDomain, label });
+ return json(res, 200, {
+ data: {
+ label,
+ parent: `${parentDomain}.sol`,
+ full_name: `${label}.${parentDomain}.sol`,
+ available: !availability.exists,
+ owner: availability.owner,
+ },
+ });
+ }
+
+ if (!method(req, res, ['POST'])) return;
+
+ const auth = await resolveAuth(req);
+ if (!auth) return error(res, 401, 'unauthorized', 'sign in or provide a bearer token');
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const body = await readJson(req).catch(() => ({}));
+ const label = normalizeLabel(body?.label);
+ if (!label) {
+ return error(res, 400, 'validation_error', 'label must be 1–63 lowercase [a-z0-9-] chars with no leading/trailing hyphen');
+ }
+ const agentId = typeof body?.agent_id === 'string' ? body.agent_id.trim() : null;
+ const ownerAddress = typeof body?.owner_address === 'string' ? body.owner_address.trim() : null;
+ const space = Number.isInteger(body?.space) && body.space >= 1000 && body.space <= 10000 ? body.space : 2000;
+
+ const target = await resolveTargetOwner({ userId: auth.userId, agentId, ownerAddress });
+ if (target.error) return error(res, target.error.status, target.error.code, target.error.msg);
+
+ let minted;
+ try {
+ minted = await createNamedSubdomain({ label, newOwner: target.address, space });
+ } catch (err) {
+ const status = err?.status || 500;
+ const code = err?.code || 'mint_failed';
+ return error(res, status, code, err?.message || 'subdomain mint failed');
+ }
+
+ // Attach to the agent's identity when requested. We store the resolved
+ // full name (e.g. "nich.threews.sol") so x402 manifests can carry it
+ // directly via recipient_name without re-resolving.
+ if (agentId && target.agent) {
+ const nextMeta = { ...(target.agent.meta || {}), sns_domain: minted.fullName, sns_owner_wallet: target.address };
+ await sql`UPDATE agent_identities SET meta = ${JSON.stringify(nextMeta)}::jsonb WHERE id = ${agentId}`;
+ }
+
+ return json(res, 201, {
+ data: {
+ ok: true,
+ full_name: minted.fullName,
+ parent: minted.parent,
+ owner: minted.owner,
+ signature: minted.signature,
+ explorer: `https://solscan.io/tx/${minted.signature}`,
+ attached_to_agent: agentId && target.agent ? agentId : null,
+ },
+ });
+});
diff --git a/api/sns.js b/api/sns.js
new file mode 100644
index 000000000..4e8dfd542
--- /dev/null
+++ b/api/sns.js
@@ -0,0 +1,105 @@
+// GET /api/sns?name=<label>[.sol] → resolve .sol → owner base58
+// GET /api/sns?address=<base58> → reverse-lookup wallet → primary .sol
+//
+// Public, rate-limited per IP. Both directions are cached in-process for
+// 5 minutes (negative results for 60s) so repeated UX previews don't hammer
+// the Bonfida RPC pool. Mainnet only — SNS is not deployed on devnet.
+
+import { cors, error, json, method, wrap } from './_lib/http.js';
+import { limits, clientIp } from './_lib/rate-limit.js';
+import { resolveSnsName, reverseLookupAddress } from '../src/solana/sns.js';
+
+// Accept a bare label (`nick`), a top-level domain (`nick.sol`), or any depth
+// of subdomain (`nich.threews.sol`). Each segment is the SNS label rule:
+// 1–63 chars of [a-z0-9-]. SNS itself enforces semantic validity on-chain.
+const NAME_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*(?:\.sol)?$/i;
+const ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+
+const POSITIVE_TTL_MS = 5 * 60_000;
+const NEGATIVE_TTL_MS = 60_000;
+
+const forwardCache = new Map(); // name → { value, expiresAt }
+const reverseCache = new Map(); // address → { value, expiresAt }
+
+function getCached(map, key) {
+ const hit = map.get(key);
+ if (!hit) return undefined;
+ if (Date.now() > hit.expiresAt) {
+ map.delete(key);
+ return undefined;
+ }
+ return hit.value;
+}
+
+function setCached(map, key, value) {
+ const ttl = value ? POSITIVE_TTL_MS : NEGATIVE_TTL_MS;
+ map.set(key, { value, expiresAt: Date.now() + ttl });
+}
+
+function normalizeName(input) {
+ const trimmed = String(input || '').trim().toLowerCase();
+ if (!NAME_RE.test(trimmed)) return null;
+ // Bonfida `resolve()` accepts subdomain dotted form (`nich.threews`) without
+ // the `.sol` suffix; strip it once if present.
+ return trimmed.endsWith('.sol') ? trimmed.slice(0, -4) : trimmed;
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ const rl = await limits.snsResolve(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const url = new URL(req.url, 'http://x');
+ const rawName = url.searchParams.get('name');
+ const rawAddr = url.searchParams.get('address');
+
+ if (rawName && rawAddr) {
+ return error(res, 400, 'validation_error', 'pass either name or address, not both');
+ }
+
+ if (rawName) {
+ const bare = normalizeName(rawName);
+ if (!bare) return error(res, 400, 'validation_error', 'name must be a [a-z0-9-]{1,63} label or dotted subdomain, optionally ending in .sol');
+ const domain = `${bare}.sol`;
+ let address = getCached(forwardCache, bare);
+ if (address === undefined) {
+ address = await resolveSnsName(bare);
+ setCached(forwardCache, bare, address);
+ }
+ if (!address) {
+ return json(res, 404, {
+ error: 'not_found',
+ error_description: `${domain} does not resolve`,
+ }, { 'cache-control': 'public, max-age=30' });
+ }
+ return json(res, 200, { data: { name: domain, address, network: 'solana' } }, {
+ 'cache-control': 'public, max-age=300',
+ });
+ }
+
+ if (rawAddr) {
+ const addr = rawAddr.trim();
+ if (!ADDR_RE.test(addr)) return error(res, 400, 'validation_error', 'address must be a base58 Solana public key');
+ let name = getCached(reverseCache, addr);
+ if (name === undefined) {
+ name = await reverseLookupAddress(addr);
+ setCached(reverseCache, addr, name);
+ }
+ if (!name) {
+ return json(res, 404, {
+ error: 'not_found',
+ error_description: 'no primary .sol domain set for this address',
+ }, { 'cache-control': 'public, max-age=30' });
+ }
+ return json(res, 200, { data: { name, address: addr, network: 'solana' } }, {
+ 'cache-control': 'public, max-age=300',
+ });
+ }
+
+ return error(res, 400, 'validation_error', 'pass ?name=foo.sol or ?address=<base58>');
+});
+
+// Exported for unit tests. Not part of the public HTTP surface.
+export const _internals = { forwardCache, reverseCache, normalizeName };
diff --git a/api/threews/subdomain.js b/api/threews/subdomain.js
new file mode 100644
index 000000000..b68991b6b
--- /dev/null
+++ b/api/threews/subdomain.js
@@ -0,0 +1,204 @@
+// /api/threews/subdomain
+//
+// GET ?label=<label> → availability check on `<label>.threews.sol`.
+// Returns { available, owner, claim, full }.
+// POST { label, owner_wallet? } → mint `<label>.threews.sol`, set its URL
+// record to https://three.ws/u/<label>, and
+// transfer ownership to `owner_wallet` (or
+// to the caller's default agent wallet).
+// Requires authentication.
+// DELETE → release the caller's stored subdomain
+// claim (does NOT release the on-chain
+// subdomain; that's still owned by the
+// recipient wallet).
+//
+// Constraint: `label` must equal the caller's `username`. Subdomains showcase
+// the user's profile at /u/<label> — making them divergent would let users
+// impersonate other handles.
+
+import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';
+import { sql } from '../_lib/db.js';
+import { cors, error, json, method, readJson, wrap } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { env } from '../_lib/env.js';
+import {
+ PARENT_LABEL,
+ fullDomain,
+ getSubdomainOwner,
+ hasOwnerKey,
+ mintSubdomain,
+ normalizeLabel,
+} from '../_lib/threews-sns.js';
+
+const ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+
+async function resolveAuth(req) {
+ const session = await getSessionUser(req);
+ if (session) return { userId: session.id };
+ const bearer = await authenticateBearer(extractBearer(req));
+ if (bearer) return { userId: bearer.userId };
+ return null;
+}
+
+async function handleCheck(req, res) {
+ const url = new URL(req.url, 'http://x');
+ const label = normalizeLabel(url.searchParams.get('label'));
+ if (!label) {
+ return error(res, 400, 'validation_error', 'label must match [a-z0-9-]{1,63} and not be reserved');
+ }
+
+ const [claim] = await sql`
+ SELECT s.label, s.parent, s.owner_wallet, s.url_record, s.created_at,
+ u.id AS user_id, u.username, u.display_name
+ FROM user_subdomains s
+ JOIN users u ON u.id = s.user_id
+ WHERE s.label = ${label} AND s.parent = ${PARENT_LABEL}
+ LIMIT 1
+ `;
+
+ let owner = null;
+ if (claim) {
+ owner = claim.owner_wallet;
+ } else {
+ owner = await getSubdomainOwner(label);
+ }
+
+ return json(res, 200, {
+ data: {
+ full: fullDomain(label),
+ label,
+ parent: PARENT_LABEL,
+ available: !owner,
+ owner,
+ claim: claim ? {
+ user_id: claim.user_id,
+ username: claim.username,
+ display_name: claim.display_name,
+ owner_wallet: claim.owner_wallet,
+ url_record: claim.url_record,
+ created_at: claim.created_at,
+ } : null,
+ showcase_url: claim ? `${env.APP_ORIGIN}/u/${claim.username}` : null,
+ },
+ }, { 'cache-control': 'public, max-age=30' });
+}
+
+async function handleMint(req, res, auth) {
+ if (!hasOwnerKey()) {
+ return error(res, 503, 'config_missing', 'subdomain minting unavailable — platform owner key not configured');
+ }
+
+ const body = await readJson(req).catch(() => ({}));
+ const label = normalizeLabel(body?.label);
+ if (!label) {
+ return error(res, 400, 'validation_error', 'label must match [a-z0-9-]{1,63} and not be reserved');
+ }
+
+ const [user] = await sql`
+ SELECT id, username FROM users
+ WHERE id = ${auth.userId} AND deleted_at IS NULL
+ `;
+ if (!user) return error(res, 404, 'not_found', 'user not found');
+ if (!user.username) {
+ return error(res, 409, 'no_username', 'set a username on your account before claiming a subdomain');
+ }
+ if (user.username.toLowerCase() !== label) {
+ return error(res, 409, 'username_mismatch', `subdomain label must match your username (@${user.username})`);
+ }
+
+ const [existing] = await sql`
+ SELECT id FROM user_subdomains
+ WHERE label = ${label} AND parent = ${PARENT_LABEL}
+ LIMIT 1
+ `;
+ if (existing) return error(res, 409, 'conflict', `${fullDomain(label)} is already claimed`);
+
+ const onChainOwner = await getSubdomainOwner(label);
+ if (onChainOwner) {
+ return error(res, 409, 'conflict', `${fullDomain(label)} is already registered on-chain to ${onChainOwner}`);
+ }
+
+ let recipientWallet = typeof body?.owner_wallet === 'string' ? body.owner_wallet.trim() : '';
+ if (recipientWallet && !ADDR_RE.test(recipientWallet)) {
+ return error(res, 400, 'validation_error', 'owner_wallet must be a base58 Solana public key');
+ }
+ if (recipientWallet) {
+ // Caller must have linked this wallet to their account so we don't mint
+ // a subdomain to a third-party wallet.
+ const [walletRow] = await sql`
+ SELECT id FROM user_wallets
+ WHERE user_id = ${auth.userId} AND address = ${recipientWallet} AND chain_type = 'solana'
+ LIMIT 1
+ `;
+ if (!walletRow) return error(res, 403, 'forbidden', 'owner_wallet must be linked to your account');
+ } else {
+ // Fall back to the caller's default agent Solana wallet.
+ const [defaultAgent] = await sql`
+ SELECT meta->>'solana_address' AS sol FROM agent_identities
+ WHERE user_id = ${auth.userId} AND deleted_at IS NULL
+ ORDER BY created_at ASC
+ LIMIT 1
+ `;
+ if (!defaultAgent?.sol) {
+ return error(res, 409, 'no_wallet', 'pass owner_wallet or create an agent first (which provisions a Solana wallet)');
+ }
+ recipientWallet = defaultAgent.sol;
+ }
+
+ const urlRecord = `${env.APP_ORIGIN}/u/${user.username}`;
+ let signature;
+ try {
+ signature = await mintSubdomain({
+ label,
+ recipientWallet,
+ urlRecordValue: urlRecord,
+ });
+ } catch (err) {
+ console.error('[threews/subdomain] mint_failed', err);
+ return error(res, 502, 'upstream_error', err?.message || 'subdomain mint failed');
+ }
+
+ const [row] = await sql`
+ INSERT INTO user_subdomains (user_id, label, parent, owner_wallet, url_record, signature)
+ VALUES (${auth.userId}, ${label}, ${PARENT_LABEL}, ${recipientWallet}, ${urlRecord}, ${signature})
+ RETURNING id, label, parent, owner_wallet, url_record, signature, created_at
+ `;
+
+ return json(res, 201, {
+ data: {
+ ...row,
+ full: fullDomain(label),
+ showcase_url: `${env.APP_ORIGIN}/u/${user.username}`,
+ },
+ });
+}
+
+async function handleDelete(req, res, auth) {
+ const url = new URL(req.url, 'http://x');
+ const label = normalizeLabel(url.searchParams.get('label'));
+ if (!label) return error(res, 400, 'validation_error', 'label required');
+
+ const rows = await sql`
+ DELETE FROM user_subdomains
+ WHERE user_id = ${auth.userId} AND label = ${label} AND parent = ${PARENT_LABEL}
+ RETURNING id, label, parent
+ `;
+ if (rows.length === 0) return error(res, 404, 'not_found', 'claim not found');
+ return json(res, 200, { data: { released: rows[0], note: 'on-chain ownership unchanged' } });
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,POST,DELETE,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET', 'POST', 'DELETE'])) return;
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ if (req.method === 'GET') return handleCheck(req, res);
+
+ const auth = await resolveAuth(req);
+ if (!auth) return error(res, 401, 'unauthorized', 'sign in required');
+
+ if (req.method === 'POST') return handleMint(req, res, auth);
+ return handleDelete(req, res, auth);
+});
diff --git a/api/users/by-subdomain.js b/api/users/by-subdomain.js
new file mode 100644
index 000000000..221cc023e
--- /dev/null
+++ b/api/users/by-subdomain.js
@@ -0,0 +1,49 @@
+// GET /api/users/by-subdomain?label=<label>[&parent=threews]
+//
+// Reverse-lookup: given a `<label>.<parent>.sol` claim, return the user_id +
+// username that owns it (public fields only). Powers the /u/:label showcase
+// when accessed via a SNS-resolved Brave URL.
+
+import { sql } from '../_lib/db.js';
+import { cors, error, json, method, wrap } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { PARENT_LABEL, normalizeLabel } from '../_lib/threews-sns.js';
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,OPTIONS' })) return;
+ if (!method(req, res, ['GET'])) return;
+
+ const rl = await limits.snsResolve(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ const url = new URL(req.url, 'http://x');
+ const label = normalizeLabel(url.searchParams.get('label'));
+ const parent = (url.searchParams.get('parent') || PARENT_LABEL).toLowerCase();
+ if (!label) return error(res, 400, 'validation_error', 'label required');
+
+ const [row] = await sql`
+ SELECT s.label, s.parent, s.owner_wallet, s.url_record, s.created_at,
+ u.id AS user_id, u.username, u.display_name
+ FROM user_subdomains s
+ JOIN users u ON u.id = s.user_id
+ WHERE s.label = ${label} AND s.parent = ${parent}
+ LIMIT 1
+ `;
+ if (!row) return error(res, 404, 'not_found', `${label}.${parent}.sol is not claimed`);
+
+ return json(res, 200, {
+ data: {
+ label: row.label,
+ parent: row.parent,
+ full: `${row.label}.${row.parent}.sol`,
+ user: {
+ id: row.user_id,
+ username: row.username,
+ display_name: row.display_name,
+ },
+ owner_wallet: row.owner_wallet,
+ url_record: row.url_record,
+ created_at: row.created_at,
+ },
+ }, { 'cache-control': 'public, max-age=120' });
+});
diff --git a/api/x402/pay-by-name.js b/api/x402/pay-by-name.js
new file mode 100644
index 000000000..6af1df4dd
--- /dev/null
+++ b/api/x402/pay-by-name.js
@@ -0,0 +1,304 @@
+// /api/x402/pay-by-name
+//
+// Unified payment routing: pay a recipient identified by *name* instead of by
+// raw address. Resolves the name across three namespaces in this order:
+//
+// 1. `@<username>` (or bare username, 3–30 chars [a-z0-9_-]) — looks up
+// `users.username`, then picks that user's default agent's Solana
+// address. Falls through if no match.
+// 2. `<anything>.sol` (including subdomains like `nich.threews.sol`) —
+// resolved on-chain via Bonfida `resolve()`.
+// 3. raw base58 address — passes through.
+//
+// GET /api/x402/pay-by-name?name=<name>
+// Resolve only. Returns { name, address, source, full?, claim? }.
+//
+// POST /api/x402/pay-by-name { name, amount_usdc, message?, mode }
+// mode='prep': build an unsigned USDC SPL transfer tx with the caller's
+// `payer_wallet` (passed in body) as fee payer + source. Returns the
+// base64-encoded VersionedTransaction for browser wallet signing.
+// mode='send' (requires auth + agent_id): server signs as the caller's
+// specified agent (must be theirs), broadcasts the transfer, returns
+// the signature.
+
+import {
+ Connection,
+ PublicKey,
+ TransactionMessage,
+ VersionedTransaction,
+} from '@solana/web3.js';
+import {
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ getAssociatedTokenAddressSync,
+ createTransferCheckedInstruction,
+ createAssociatedTokenAccountIdempotentInstruction,
+} from '@solana/spl-token';
+
+import { getSessionUser, authenticateBearer, extractBearer } from '../_lib/auth.js';
+import { sql } from '../_lib/db.js';
+import { cors, error, json, method, readJson, wrap } from '../_lib/http.js';
+import { limits, clientIp } from '../_lib/rate-limit.js';
+import { solanaConnection, loadAgentForSigning } from '../_lib/agent-pumpfun.js';
+import { PARENT_LABEL } from '../_lib/threews-sns.js';
+
+const USDC_MINT = new PublicKey('EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
+const USDC_DECIMALS = 6;
+const ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+const HANDLE_RE = /^@?[a-z0-9_-]{3,30}$/i;
+const SOL_DOMAIN_RE = /^[a-z0-9-]+(\.[a-z0-9-]+)*\.sol$/i;
+
+async function resolveAuth(req) {
+ const session = await getSessionUser(req);
+ if (session) return { userId: session.id };
+ const bearer = await authenticateBearer(extractBearer(req));
+ if (bearer) return { userId: bearer.userId };
+ return null;
+}
+
+/**
+ * Resolve a name (handle, .sol domain, or raw address) to a recipient.
+ * Returns { address, source, resolved, claim? } or null.
+ */
+async function resolveName(rawName) {
+ const name = String(rawName || '').trim();
+ if (!name) return null;
+
+ // 1. raw base58 address — return as-is.
+ if (ADDR_RE.test(name)) {
+ return { address: name, source: 'address', resolved: name };
+ }
+
+ // 2. .sol domains, including subdomains (foo.threews.sol).
+ if (SOL_DOMAIN_RE.test(name)) {
+ const bare = name.replace(/\.sol$/i, '');
+ // If it's a `<label>.threews` form, also surface our DB claim so
+ // callers can show the showcase link.
+ let claim = null;
+ const threewsSuffix = `.${PARENT_LABEL}`;
+ if (bare.toLowerCase().endsWith(threewsSuffix)) {
+ const label = bare.slice(0, -threewsSuffix.length).toLowerCase();
+ const [row] = await sql`
+ SELECT s.label, s.parent, u.id AS user_id, u.username, u.display_name
+ FROM user_subdomains s
+ JOIN users u ON u.id = s.user_id
+ WHERE s.label = ${label} AND s.parent = ${PARENT_LABEL}
+ LIMIT 1
+ `;
+ if (row) {
+ claim = {
+ user_id: row.user_id,
+ username: row.username,
+ display_name: row.display_name,
+ };
+ }
+ }
+ try {
+ const sns = await import('@bonfida/spl-name-service');
+ const conn = solanaConnection('mainnet');
+ const pk = await sns.resolve(conn, bare);
+ return {
+ address: pk.toBase58(),
+ source: 'sns',
+ resolved: name.toLowerCase(),
+ ...(claim ? { claim } : {}),
+ };
+ } catch {
+ return null;
+ }
+ }
+
+ // 3. @username or bare username.
+ if (HANDLE_RE.test(name)) {
+ const handle = name.replace(/^@/, '').toLowerCase();
+ const [user] = await sql`
+ SELECT id, username, display_name FROM users
+ WHERE lower(username) = ${handle} AND deleted_at IS NULL
+ LIMIT 1
+ `;
+ if (!user) return null;
+ const [agent] = await sql`
+ SELECT meta->>'solana_address' AS sol
+ FROM agent_identities
+ WHERE user_id = ${user.id} AND deleted_at IS NULL
+ ORDER BY created_at ASC
+ LIMIT 1
+ `;
+ if (!agent?.sol) return null;
+ return {
+ address: agent.sol,
+ source: 'username',
+ resolved: `@${user.username}`,
+ claim: { user_id: user.id, username: user.username, display_name: user.display_name },
+ };
+ }
+
+ return null;
+}
+
+function parseAmountUsdc(input) {
+ const n = Number(input);
+ if (!Number.isFinite(n) || n <= 0) return null;
+ // 6 decimals → cap at 10_000 USDC per call to bound damage if misused.
+ if (n > 10_000) return null;
+ return BigInt(Math.round(n * 10 ** USDC_DECIMALS));
+}
+
+async function buildTransferIxs({ payer, recipient, amountAtoms }) {
+ const payerAta = getAssociatedTokenAddressSync(
+ USDC_MINT,
+ payer,
+ false,
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ );
+ const recipientAta = getAssociatedTokenAddressSync(
+ USDC_MINT,
+ recipient,
+ false,
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ );
+ const ataIx = createAssociatedTokenAccountIdempotentInstruction(
+ payer,
+ recipientAta,
+ recipient,
+ USDC_MINT,
+ TOKEN_PROGRAM_ID,
+ ASSOCIATED_TOKEN_PROGRAM_ID,
+ );
+ const transferIx = createTransferCheckedInstruction(
+ payerAta,
+ USDC_MINT,
+ recipientAta,
+ payer,
+ amountAtoms,
+ USDC_DECIMALS,
+ [],
+ TOKEN_PROGRAM_ID,
+ );
+ return [ataIx, transferIx];
+}
+
+async function handleResolve(req, res) {
+ const url = new URL(req.url, 'http://x');
+ const name = url.searchParams.get('name');
+ if (!name) return error(res, 400, 'validation_error', 'name required');
+ const resolved = await resolveName(name);
+ if (!resolved) return error(res, 404, 'not_found', `could not resolve "${name}"`);
+ return json(res, 200, { data: resolved }, { 'cache-control': 'public, max-age=60' });
+}
+
+async function handlePrep(req, res, body) {
+ const payerWallet = String(body?.payer_wallet || '').trim();
+ if (!ADDR_RE.test(payerWallet)) {
+ return error(res, 400, 'validation_error', 'payer_wallet must be a base58 Solana public key');
+ }
+ const resolved = await resolveName(body?.name);
+ if (!resolved) return error(res, 404, 'not_found', `could not resolve "${body?.name}"`);
+ const amountAtoms = parseAmountUsdc(body?.amount_usdc);
+ if (!amountAtoms) return error(res, 400, 'validation_error', 'amount_usdc must be > 0 and ≤ 10000');
+
+ const payer = new PublicKey(payerWallet);
+ const recipient = new PublicKey(resolved.address);
+ if (payer.equals(recipient)) {
+ return error(res, 400, 'self_pay', 'payer and recipient resolve to the same wallet');
+ }
+ const conn = solanaConnection('mainnet');
+ const ixs = await buildTransferIxs({ payer, recipient, amountAtoms });
+ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');
+ const msg = new TransactionMessage({
+ payerKey: payer,
+ recentBlockhash: blockhash,
+ instructions: ixs,
+ }).compileToV0Message();
+ const tx = new VersionedTransaction(msg);
+
+ return json(res, 200, {
+ data: {
+ recipient: resolved,
+ amount_usdc: Number(amountAtoms) / 10 ** USDC_DECIMALS,
+ tx_base64: Buffer.from(tx.serialize()).toString('base64'),
+ blockhash,
+ last_valid_block_height: lastValidBlockHeight,
+ mint: USDC_MINT.toBase58(),
+ },
+ });
+}
+
+async function handleSend(req, res, auth, body) {
+ const agentId = String(body?.agent_id || '').trim();
+ if (!agentId) return error(res, 400, 'validation_error', 'agent_id required when mode=send');
+
+ const resolved = await resolveName(body?.name);
+ if (!resolved) return error(res, 404, 'not_found', `could not resolve "${body?.name}"`);
+ const amountAtoms = parseAmountUsdc(body?.amount_usdc);
+ if (!amountAtoms) return error(res, 400, 'validation_error', 'amount_usdc must be > 0 and ≤ 10000');
+
+ const loaded = await loadAgentForSigning(agentId, auth.userId, {
+ reason: 'x402_pay_by_name',
+ meta: { name: body?.name, amount_usdc: Number(amountAtoms) / 10 ** USDC_DECIMALS },
+ });
+ if (loaded.error) return error(res, loaded.error.status, loaded.error.code, loaded.error.msg);
+ const { keypair } = loaded;
+ const recipient = new PublicKey(resolved.address);
+ if (keypair.publicKey.equals(recipient)) {
+ return error(res, 400, 'self_pay', 'agent and recipient resolve to the same wallet');
+ }
+
+ const conn = solanaConnection('mainnet');
+ const ixs = await buildTransferIxs({
+ payer: keypair.publicKey,
+ recipient,
+ amountAtoms,
+ });
+ const { blockhash, lastValidBlockHeight } = await conn.getLatestBlockhash('confirmed');
+ const msg = new TransactionMessage({
+ payerKey: keypair.publicKey,
+ recentBlockhash: blockhash,
+ instructions: ixs,
+ }).compileToV0Message();
+ const tx = new VersionedTransaction(msg);
+ tx.sign([keypair]);
+
+ let signature;
+ try {
+ signature = await conn.sendRawTransaction(tx.serialize(), { skipPreflight: false });
+ await conn.confirmTransaction(
+ { signature, blockhash, lastValidBlockHeight },
+ 'confirmed',
+ );
+ } catch (err) {
+ console.error('[pay-by-name] send_failed', err);
+ return error(res, 502, 'upstream_error', err?.message || 'transfer failed');
+ }
+
+ return json(res, 200, {
+ data: {
+ recipient: resolved,
+ payer: keypair.publicKey.toBase58(),
+ amount_usdc: Number(amountAtoms) / 10 ** USDC_DECIMALS,
+ signature,
+ mode: 'send',
+ },
+ });
+}
+
+export default wrap(async (req, res) => {
+ if (cors(req, res, { methods: 'GET,POST,OPTIONS', credentials: true })) return;
+ if (!method(req, res, ['GET', 'POST'])) return;
+
+ const rl = await limits.authIp(clientIp(req));
+ if (!rl.success) return error(res, 429, 'rate_limited', 'too many requests');
+
+ if (req.method === 'GET') return handleResolve(req, res);
+
+ const body = await readJson(req).catch(() => ({}));
+ const mode = body?.mode === 'send' ? 'send' : 'prep';
+
+ if (mode === 'prep') return handlePrep(req, res, body);
+
+ const auth = await resolveAuth(req);
+ if (!auth) return error(res, 401, 'unauthorized', 'sign in required for mode=send');
+ return handleSend(req, res, auth, body);
+});
diff --git a/docs/internal/SNS_PARTNERSHIP_PROPOSAL.md b/docs/internal/SNS_PARTNERSHIP_PROPOSAL.md
new file mode 100644
index 000000000..b1a0ca98c
--- /dev/null
+++ b/docs/internal/SNS_PARTNERSHIP_PROPOSAL.md
@@ -0,0 +1,110 @@
+# three.ws × SNS — Partnership Proposal
+
+**To:** Bilal El Alamy / SNS leadership
+**From:** Nicholas, three.ws
+**Date:** 2026-05-23
+
+---
+
+## Why now
+
+SNS owns Solana's identity layer — 350K+ .sol domains, the canonical mapping from human-readable name to wallet. three.ws is building the embodiment layer — 3D agents that live on Solana, transact via x402, and trade on Pump.fun. Every .sol domain deserves a face. Every three.ws agent needs a name. The fit is structural, not cosmetic.
+
+We are not asking SNS to build anything new. We have already shipped the integration end-to-end on our side. This proposal is about making the integration official, joint-marketed, and (where it makes sense) revenue-shared.
+
+---
+
+## What is already live on three.ws
+
+### 1. x402 payment routing by .sol name
+
+Every x402 402-Payment-Required manifest emitted by a three.ws agent now carries the recipient's .sol domain alongside the wallet address. Payers — humans or agents — see and verify the human-readable name before signing.
+
+- **Manifest field added:** `recipient_name`, populated from the agent's `meta.sns_domain` or by resolving a .sol-style `payments.receiver` via SNS.
+- **Fully backward-compatible:** clients that don't read `recipient_name` continue to pay against `recipient` (base58 wallet) as before.
+- **Code:** [api/_lib/x402.js](../../api/_lib/x402.js) — `resolveRecipient()` + `emit402()` + `manifestOnly()`.
+
+This is the first x402 implementation in the Solana ecosystem that pays *by name*.
+
+### 2. User-registered names assigned to agents
+
+Users can register a .sol domain and assign it to one of their agents in a single flow. From that moment, every public surface the agent appears on — agent page, x402 manifest, MCP tool listing, marketplace card — displays the .sol name in place of the raw wallet.
+
+- **Attach existing .sol:** `POST /api/agents/:id/sns { domain }` — verifies on-chain ownership across the agent wallet and the user's linked wallets, then writes `meta.sns_domain`.
+- **Register fresh:** `POST /api/agents/:id/sns/register-prep` + `register-confirm` — builds an unsigned tx for the user's wallet, confirms the on-chain owner, attaches the alias.
+- **Agent-pays variant:** `POST /api/agents/:id/sns/register` — the agent's own wallet pays in USDC and the alias is attached automatically.
+- **Code:** [api/agents/sns.js](../../api/agents/sns.js).
+
+### 3. Subdomains under `threews.sol`
+
+three.ws owns `threews.sol`. We have built a one-call endpoint that mints any-label subdomain — `nich.threews.sol`, `claude.threews.sol`, `vernington.threews.sol` — and transfers ownership to the user (or their agent) in a single transaction. The platform absorbs the SOL gas cost so there is zero wallet-signing friction.
+
+- **Endpoint:** `POST /api/sns-subdomain { label, agent_id?, owner_address? }`.
+- **Availability check:** `GET /api/sns-subdomain?label=nich` — on-chain lookup, no upstream call to Bonfida.
+- **Atomic create + transfer:** parent owner keypair signs `createSubdomain` and immediately `transferSubdomain` to the requested final owner, bundled into one VersionedTransaction. The subdomain is never claimable by a third party in between.
+- **Code:** [api/sns-subdomain.js](../../api/sns-subdomain.js), [src/solana/sns-subdomain.js](../../src/solana/sns-subdomain.js).
+
+Every three.ws user is one POST away from owning a `*.threews.sol` subdomain. Every agent is one POST away from being named.
+
+---
+
+## What we ask from SNS
+
+1. **Co-marketing.** One email + one X post + one Discord announcement to the .sol holder base when we launch the `*.threews.sol` subdomain program. We commit to symmetric coverage on our channels.
+2. **Listing.** three.ws on the SNS partners page as the official embodiment partner.
+3. **API tier.** Partnership-grade rate limits on `sns-api.bonfida.com` for bulk resolution and reverse lookups — our `recipient_name` enrichment hits this on every x402 manifest emission, so we are the heavy reader you want to formalise.
+4. **Roadmap input.** A shared channel (Telegram / Slack) to coordinate on subdomain-related primitives — sub-of-sub naming, on-chain SOL records for embedded avatars, transfer hooks.
+
+---
+
+## What SNS gets
+
+- A consumer-facing visual product attached to every .sol — increases domain perceived value and retention.
+- Distribution into the AI-agent narrative (currently the dominant Solana retail story via Pump.fun).
+- Revenue share on co-branded subdomains where we sell pricing tiers (vanity labels, single-letter subs).
+- Featured placement across three.ws agent pages, MCP tooling, the agent marketplace, and the public x402 payment manifests — every payment receipt for a named agent advertises SNS.
+
+---
+
+## Proposed next step
+
+A 30-minute call this week. We bring a working demo:
+
+1. A user registers `claude.threews.sol` from our UI — confirmed on-chain in under 5 seconds, zero gas paid by the user.
+2. We assign it to a freshly-spawned agent.
+3. We make an x402 payment to that agent. The 402 manifest shows `recipient_name: "claude.threews.sol"`. The payer sees and verifies the name before signing.
+
+No slides. Working software.
+
+---
+
+## Appendix: technical surface
+
+- Forward resolution: `GET /api/sns?name=nich.threews.sol` → `{ address, network: "solana" }`.
+- Reverse resolution: `GET /api/sns?address=<base58>` → primary .sol domain.
+- Subdomain mint: `POST /api/sns-subdomain { label, agent_id?, owner_address? }`.
+- Subdomain availability: `GET /api/sns-subdomain?label=<label>`.
+- Agent attach: `POST /api/agents/:id/sns { domain }`.
+- Agent register (user-pays): `/api/agents/:id/sns/register-prep` + `/register-confirm`.
+- Agent register (agent-pays): `POST /api/agents/:id/sns/register { domain }`.
+- x402 manifest schema, augmented:
+
+ ```json
+ {
+ "version": "x402/0.1",
+ "kind": "agent-skill",
+ "agent_id": "…",
+ "skill": "…",
+ "amount": "1000000",
+ "currency": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
+ "recipient": "<base58 wallet>",
+ "recipient_name": "claude.threews.sol",
+ "memo": "…",
+ "valid_until": 1716508800,
+ "intent_url": "/api/agents/payments/pay-prep",
+ "verify_url": "/api/agents/payments/pay-confirm",
+ "retry_with_header": "x-payment-intent"
+ }
+ ```
+
+- Parent owner keypair: held by three.ws under `THREEWS_SOL_PARENT_SECRET_BASE58`. Subdomains transfer ownership immediately after mint; the platform never retains custody.
diff --git a/mcp-server/package.json b/mcp-server/package.json
index fa318ffa8..03cf944ed 100644
--- a/mcp-server/package.json
+++ b/mcp-server/package.json
@@ -49,14 +49,17 @@
"prepublishOnly": "node -e \"import('./src/index.js').catch(e => { if (!e.message.includes('facilitator')) throw e })\" 2>/dev/null; echo 'package check ok'"
},
"dependencies": {
+ "@coinbase/x402": "^2.1.0",
+ "@coral-xyz/anchor": "^0.32.1",
"@modelcontextprotocol/sdk": "^1.29.0",
"@solana/web3.js": "latest",
+ "@tetsuo-ai/protocol": "^0.2.0",
+ "@tetsuo-ai/sdk": "^1.4.0",
"@x402/core": "^2.12.0",
"@x402/evm": "^2.12.0",
"@x402/extensions": "^2.12.0",
"@x402/mcp": "^2.12.0",
"@x402/svm": "^2.12.0",
- "@coinbase/x402": "^2.1.0",
"bs58": "^6.0.0",
"ethers": "^6.16.0",
"zod": "^3.23.8"
diff --git a/mcp-server/src/index.js b/mcp-server/src/index.js
index 5def2218d..f09ffe783 100755
--- a/mcp-server/src/index.js
+++ b/mcp-server/src/index.js
@@ -27,6 +27,9 @@ import { buildOptimizeGlbTool } from './tools/optimize-glb.js';
import { buildSentimentPulseTool } from './tools/sentiment-pulse.js';
import { buildEnsSnsResolveTool } from './tools/ens-sns-resolve.js';
import { buildAgentDelegateActionTool } from './tools/agent-delegate-action.js';
+import { buildAgenCListTasksTool } from './tools/agenc-list-tasks.js';
+import { buildAgenCGetTaskTool } from './tools/agenc-get-task.js';
+import { buildAgenCGetAgentTool } from './tools/agenc-get-agent.js';
async function main() {
// Force the shared x402 resource server to initialize before any tool is
@@ -51,8 +54,10 @@ async function main() {
'compression (optimize_glb), text-to-speech (tts_speak), ENS + SNS name resolution ' +
'(ens_sns_resolve), agent-to-agent delegation (agent_delegate_action), token sentiment pulse ' +
'(sentiment_pulse), pose generation (get_pose_seed), Solana token snapshots (pump_snapshot), ' +
- 'ERC-8004 agent reputation (agent_reputation), and Solana vanity address mining ' +
- '(vanity_grinder, upto-priced).',
+ 'ERC-8004 agent reputation (agent_reputation), Solana vanity address mining ' +
+ '(vanity_grinder, upto-priced), and AgenC coordination protocol reads — ' +
+ 'task discovery, task status + lifecycle, and agent registry lookup ' +
+ '(agenc_list_tasks, agenc_get_task, agenc_get_agent).',
});
const tools = await Promise.all([
@@ -67,6 +72,9 @@ async function main() {
buildPumpSnapshotTool(),
buildAgentReputationTool(),
buildVanityGrinderTool(),
+ buildAgenCListTasksTool(),
+ buildAgenCGetTaskTool(),
+ buildAgenCGetAgentTool(),
]);
for (const t of tools) {
diff --git a/mcp-server/src/tools/agenc-client.js b/mcp-server/src/tools/agenc-client.js
new file mode 100644
index 000000000..9ca1fe572
--- /dev/null
+++ b/mcp-server/src/tools/agenc-client.js
@@ -0,0 +1,122 @@
+// Shared AgenC read-only client used by the agenc-* MCP tools.
+//
+// Constructs an Anchor `Program` bound to the AgenC coordination protocol
+// (agenc.tech, Tetsuo Corp) so the read-only helpers in @tetsuo-ai/sdk can be
+// invoked without forcing every tool to know about Anchor's wallet plumbing.
+//
+// Cluster + RPC are resolved at call time so a single MCP server process can
+// service both mainnet and devnet tools.
+
+import { Connection, Keypair, PublicKey } from '@solana/web3.js';
+import { AnchorProvider, Program } from '@coral-xyz/anchor';
+import { AGENC_COORDINATION_IDL } from '@tetsuo-ai/protocol';
+import { DEVNET_RPC, MAINNET_RPC, PROGRAM_ID } from '@tetsuo-ai/sdk';
+
+// Devnet program ID validated by the AgenC team on 2026-03-22.
+// Source: https://docs.agenc.tech/docs/runtime/api/.
+export const AGENC_DEVNET_PROGRAM_ID = new PublicKey(
+ '6UcJzbTEemBz3aY5wK5qKHGMD7bdRsmR4smND29gB2ab',
+);
+export const AGENC_MAINNET_PROGRAM_ID = PROGRAM_ID;
+
+function pickRpc(cluster) {
+ const override = (process.env.AGENC_RPC_URL || '').trim();
+ if (override) return override;
+ if (cluster === 'devnet') {
+ return (process.env.SOLANA_DEVNET_RPC_URL || '').trim() || DEVNET_RPC;
+ }
+ return (process.env.SOLANA_RPC_URL || '').trim() || MAINNET_RPC;
+}
+
+function buildReadOnlyWallet() {
+ // Anchor's Wallet interface needs a payer slot + publicKey to construct a
+ // provider; we hold an ephemeral keypair purely for type satisfaction and
+ // refuse to sign anything with it. The MCP tools only expose read paths.
+ const ephemeral = Keypair.generate();
+ const refuse = () => {
+ throw new Error(
+ 'agenc-client read-only wallet refuses to sign — this tool exposes read paths only.',
+ );
+ };
+ return {
+ payer: ephemeral,
+ publicKey: ephemeral.publicKey,
+ async signTransaction(_tx) {
+ refuse();
+ },
+ async signAllTransactions(_txs) {
+ refuse();
+ },
+ };
+}
+
+/**
+ * Build a read-only AgenC client for `cluster` ("mainnet" | "devnet").
+ * Returns { connection, program, programId, cluster, rpcUrl }.
+ */
+export function getAgenCClient(cluster = 'mainnet') {
+ const c = cluster === 'devnet' ? 'devnet' : 'mainnet';
+ const rpcUrl = pickRpc(c);
+ const connection = new Connection(rpcUrl, 'confirmed');
+ const provider = new AnchorProvider(connection, buildReadOnlyWallet(), {
+ commitment: 'confirmed',
+ preflightCommitment: 'confirmed',
+ });
+ const programId = c === 'devnet' ? AGENC_DEVNET_PROGRAM_ID : AGENC_MAINNET_PROGRAM_ID;
+ const program = new Program(AGENC_COORDINATION_IDL, provider);
+ return { connection, program, programId, cluster: c, rpcUrl };
+}
+
+/** Normalize a base58 pubkey string. Returns a PublicKey or throws. */
+export function parsePubkey(s, label = 'pubkey') {
+ if (!s || typeof s !== 'string') {
+ throw new Error(`${label} must be a base58 string`);
+ }
+ return new PublicKey(s.trim());
+}
+
+/** Convert bigint values inside an object to strings so JSON.stringify works. */
+export function serializeBigInts(value) {
+ if (value === null || value === undefined) return value;
+ if (typeof value === 'bigint') return value.toString();
+ if (value instanceof Uint8Array) return Buffer.from(value).toString('hex');
+ if (value instanceof PublicKey) return value.toBase58();
+ if (Array.isArray(value)) return value.map(serializeBigInts);
+ if (typeof value === 'object') {
+ const out = {};
+ for (const [k, v] of Object.entries(value)) {
+ out[k] = serializeBigInts(v);
+ }
+ return out;
+ }
+ return value;
+}
+
+/** Translate a TaskState enum value to a human label. Matches @tetsuo-ai/sdk. */
+export function taskStateLabel(state) {
+ const map = {
+ 0: 'Open',
+ 1: 'Claimed',
+ 2: 'Completed',
+ 3: 'Cancelled',
+ 4: 'Disputed',
+ 5: 'Expired',
+ };
+ if (typeof state === 'number') return map[state] ?? `Unknown(${state})`;
+ if (state && typeof state === 'object') {
+ const key = Object.keys(state)[0];
+ return key ? key[0].toUpperCase() + key.slice(1) : 'Unknown';
+ }
+ return String(state);
+}
+
+/** Translate an AgentStatus enum value to a label. */
+export function agentStatusLabel(status) {
+ const map = { 0: 'Inactive', 1: 'Active', 2: 'Busy', 3: 'Suspended' };
+ if (typeof status === 'number') return map[status] ?? `Unknown(${status})`;
+ if (status && typeof status === 'object') {
+ const key = Object.keys(status)[0];
+ return key ? key[0].toUpperCase() + key.slice(1) : 'Unknown';
+ }
+ return String(status);
+}
diff --git a/mcp-server/src/tools/agenc-get-agent.js b/mcp-server/src/tools/agenc-get-agent.js
new file mode 100644
index 000000000..a9cabe73e
--- /dev/null
+++ b/mcp-server/src/tools/agenc-get-agent.js
@@ -0,0 +1,150 @@
+// `agenc_get_agent` — paid MCP tool that looks up an AgenC agent's on-chain
+// registration. Returns capability bitmask, status, endpoint, reputation,
+// stake, and active-task count.
+//
+// Pricing: $0.001 USDC, settled `exact` on Base or Solana.
+
+import { z } from 'zod';
+import { PublicKey } from '@solana/web3.js';
+import { createHash } from 'node:crypto';
+import { deriveAgentPda, getAgent } from '@tetsuo-ai/sdk';
+
+import { paid } from '../payments.js';
+import {
+ getAgenCClient,
+ parsePubkey,
+ serializeBigInts,
+ agentStatusLabel,
+} from './agenc-client.js';
+
+const TOOL_NAME = 'agenc_get_agent';
+const TOOL_DESCRIPTION =
+ 'Look up an AgenC agent\'s on-chain registration. Pass either agentPda (the derived account address) OR agentId (32-byte hex, "0x"-prefixed hex, or any UTF-8 label which is hashed via SHA-256). Returns the agent\'s authority wallet, capability bitmask, endpoint URL, status, reputation, stake, and active task count. AgenC = agenc.tech (Tetsuo Corp). Paid: $0.001 USDC.';
+
+function resolveAgentId(input) {
+ const s = String(input).trim();
+ if (s.startsWith('0x') || s.startsWith('0X')) {
+ const hex = s.slice(2);
+ if (hex.length !== 64) throw new Error('hex agentId must be 32 bytes');
+ return Uint8Array.from(Buffer.from(hex, 'hex'));
+ }
+ if (/^[0-9a-fA-F]{64}$/.test(s)) {
+ return Uint8Array.from(Buffer.from(s, 'hex'));
+ }
+ return Uint8Array.from(createHash('sha256').update(s, 'utf8').digest());
+}
+
+const inputJsonSchema = {
+ type: 'object',
+ properties: {
+ agentPda: {
+ type: 'string',
+ description: 'Base58 agent account PDA. Mutually exclusive with agentId.',
+ minLength: 32,
+ maxLength: 44,
+ },
+ agentId: {
+ type: 'string',
+ description: '32-byte agent id as 64-char hex, "0x"-prefixed hex, or any UTF-8 label (SHA-256 hashed).',
+ minLength: 1,
+ maxLength: 256,
+ },
+ cluster: {
+ type: 'string',
+ enum: ['mainnet', 'devnet'],
+ description: 'Solana cluster. Defaults to mainnet.',
+ },
+ },
+ additionalProperties: false,
+};
+
+const inputZodShape = {
+ agentPda: z.string().min(32).max(44).optional(),
+ agentId: z.string().min(1).max(256).optional(),
+ cluster: z.enum(['mainnet', 'devnet']).optional(),
+};
+
+export async function buildAgenCGetAgentTool() {
+ const handler = await paid(
+ {
+ toolName: TOOL_NAME,
+ description: TOOL_DESCRIPTION,
+ scheme: 'exact',
+ priceUsd: '$0.001',
+ inputSchema: inputJsonSchema,
+ example: { agentId: 'my-three-ws-bot', cluster: 'devnet' },
+ outputExample: {
+ ok: true,
+ cluster: 'devnet',
+ agentPda: '7p…',
+ agent: {
+ agentId: 'a3…',
+ authority: '5y…',
+ capabilities: '1',
+ status: 'Active',
+ endpoint: 'https://three.ws/agents/my-bot',
+ reputation: 0,
+ stakeAmount: '1000000',
+ activeTasks: 0,
+ registeredAt: 1716000000,
+ },
+ },
+ },
+ async ({ agentPda, agentId, cluster }) => {
+ const client = getAgenCClient(cluster);
+ let pda;
+ if (agentPda) {
+ pda = parsePubkey(agentPda, 'agentPda');
+ } else if (agentId) {
+ pda = deriveAgentPda(resolveAgentId(agentId), client.programId);
+ } else {
+ return {
+ ok: false,
+ error: 'missing_input',
+ message: 'Provide either agentPda or agentId.',
+ };
+ }
+
+ const agent = await getAgent(client.program, pda);
+ if (!agent) {
+ return serializeBigInts({
+ ok: false,
+ error: 'not_found',
+ cluster: client.cluster,
+ programId: client.programId.toBase58(),
+ agentPda: pda.toBase58(),
+ message: 'no agent account at that PDA on this cluster',
+ });
+ }
+
+ return serializeBigInts({
+ ok: true,
+ cluster: client.cluster,
+ rpcUrl: client.rpcUrl,
+ programId: client.programId.toBase58(),
+ agentPda: pda.toBase58(),
+ agent: {
+ agentId: Buffer.from(agent.agentId).toString('hex'),
+ authority: agent.authority.toBase58(),
+ capabilities: agent.capabilities.toString(),
+ status: agentStatusLabel(agent.status),
+ statusRaw: typeof agent.status === 'number' ? agent.status : null,
+ endpoint: agent.endpoint,
+ metadataUri: agent.metadataUri,
+ stakeAmount: agent.stakeAmount.toString(),
+ activeTasks: agent.activeTasks,
+ reputation: agent.reputation,
+ registeredAt: agent.registeredAt,
+ },
+ fetchedAt: new Date().toISOString(),
+ });
+ },
+ );
+ return {
+ name: TOOL_NAME,
+ title: 'AgenC get agent ($0.001)',
+ description: TOOL_DESCRIPTION,
+ inputSchema: inputZodShape,
+ handler,
+ };
+}
diff --git a/mcp-server/src/tools/agenc-get-task.js b/mcp-server/src/tools/agenc-get-task.js
new file mode 100644
index 000000000..2ed9d37a4
--- /dev/null
+++ b/mcp-server/src/tools/agenc-get-task.js
@@ -0,0 +1,194 @@
+// `agenc_get_task` — paid MCP tool that fetches the current state and lifecycle
+// timeline of a single AgenC task. Useful for any agent that wants to decide
+// whether to bid/claim, or for monitoring an in-flight job.
+//
+// Pricing: $0.001 USDC, settled `exact` on Base or Solana.
+
+import { z } from 'zod';
+import { PublicKey } from '@solana/web3.js';
+import { createHash } from 'node:crypto';
+import {
+ deriveTaskPda,
+ getTask,
+ getTaskLifecycleSummary,
+} from '@tetsuo-ai/sdk';
+
+import { paid } from '../payments.js';
+import {
+ getAgenCClient,
+ parsePubkey,
+ serializeBigInts,
+ taskStateLabel,
+} from './agenc-client.js';
+
+const TOOL_NAME = 'agenc_get_task';
+const TOOL_DESCRIPTION =
+ 'Fetch the on-chain state and lifecycle timeline of a single AgenC task. Pass either taskPda (the derived account address) OR the {creator, taskId} pair, where taskId may be a 64-char hex string or any UTF-8 label (hashed to 32 bytes). Returns state, reward, deadline, worker counts, lifecycle events, and reward mint. AgenC = agenc.tech (Tetsuo Corp). Paid: $0.001 USDC.';
+
+function resolveTaskId(input) {
+ const s = String(input).trim();
+ if (s.startsWith('0x') || s.startsWith('0X')) {
+ const hex = s.slice(2);
+ if (hex.length !== 64) throw new Error('hex taskId must be 32 bytes');
+ return Uint8Array.from(Buffer.from(hex, 'hex'));
+ }
+ if (/^[0-9a-fA-F]{64}$/.test(s)) {
+ return Uint8Array.from(Buffer.from(s, 'hex'));
+ }
+ return Uint8Array.from(createHash('sha256').update(s, 'utf8').digest());
+}
+
+const inputJsonSchema = {
+ type: 'object',
+ properties: {
+ taskPda: {
+ type: 'string',
+ description: 'Base58 task account PDA. If omitted, supply creator + taskId.',
+ minLength: 32,
+ maxLength: 44,
+ },
+ creator: {
+ type: 'string',
+ description: 'Base58 task creator wallet (required if taskPda is omitted).',
+ minLength: 32,
+ maxLength: 44,
+ },
+ taskId: {
+ type: 'string',
+ description: '32-byte task id as 64-char hex, "0x"-prefixed hex, or any UTF-8 label (hashed via SHA-256).',
+ minLength: 1,
+ maxLength: 256,
+ },
+ cluster: {
+ type: 'string',
+ enum: ['mainnet', 'devnet'],
+ description: 'Solana cluster. Defaults to mainnet.',
+ },
+ includeLifecycle: {
+ type: 'boolean',
+ description: 'When true (default), include the lifecycle event timeline. Set false for a cheaper read.',
+ },
+ },
+ additionalProperties: false,
+};
+
+const inputZodShape = {
+ taskPda: z.string().min(32).max(44).optional(),
+ creator: z.string().min(32).max(44).optional(),
+ taskId: z.string().min(1).max(256).optional(),
+ cluster: z.enum(['mainnet', 'devnet']).optional(),
+ includeLifecycle: z.boolean().optional(),
+};
+
+export async function buildAgenCGetTaskTool() {
+ const handler = await paid(
+ {
+ toolName: TOOL_NAME,
+ description: TOOL_DESCRIPTION,
+ scheme: 'exact',
+ priceUsd: '$0.001',
+ inputSchema: inputJsonSchema,
+ example: { taskPda: '8xQ…', cluster: 'devnet' },
+ outputExample: {
+ ok: true,
+ cluster: 'devnet',
+ taskPda: '8xQ…',
+ task: {
+ taskId: 'a1b2…',
+ state: 'Claimed',
+ rewardAmount: '50000000',
+ currentWorkers: 1,
+ maxWorkers: 1,
+ },
+ lifecycle: {
+ timeline: [{ eventName: 'created', timestamp: 1716000000 }],
+ },
+ },
+ },
+ async ({ taskPda, creator, taskId, cluster, includeLifecycle }) => {
+ const client = getAgenCClient(cluster);
+ let pda;
+ if (taskPda) {
+ pda = parsePubkey(taskPda, 'taskPda');
+ } else {
+ if (!creator || !taskId) {
+ return {
+ ok: false,
+ error: 'missing_input',
+ message: 'Provide either taskPda OR both creator and taskId.',
+ };
+ }
+ pda = deriveTaskPda(
+ parsePubkey(creator, 'creator'),
+ resolveTaskId(taskId),
+ client.programId,
+ );
+ }
+
+ const task = await getTask(client.program, pda);
+ if (!task) {
+ return serializeBigInts({
+ ok: false,
+ error: 'not_found',
+ cluster: client.cluster,
+ programId: client.programId.toBase58(),
+ taskPda: pda.toBase58(),
+ message: 'no task account at that PDA on this cluster',
+ });
+ }
+ const taskOut = {
+ taskId: Buffer.from(task.taskId).toString('hex'),
+ state: taskStateLabel(task.state),
+ stateRaw: typeof task.state === 'number' ? task.state : null,
+ creator: task.creator.toBase58(),
+ rewardAmount: task.rewardAmount.toString(),
+ rewardMint: task.rewardMint ? task.rewardMint.toBase58() : null,
+ deadline: task.deadline,
+ currentWorkers: task.currentWorkers,
+ maxWorkers: task.maxWorkers,
+ completedAt: task.completedAt,
+ constraintHash: task.constraintHash
+ ? Buffer.from(task.constraintHash).toString('hex')
+ : null,
+ private: task.constraintHash != null,
+ };
+
+ let lifecycleOut = null;
+ if (includeLifecycle !== false) {
+ const lifecycle = await getTaskLifecycleSummary(client.program, pda);
+ if (lifecycle) {
+ lifecycleOut = {
+ currentState: taskStateLabel(lifecycle.currentState),
+ createdAt: lifecycle.createdAt,
+ currentWorkers: lifecycle.currentWorkers,
+ maxWorkers: lifecycle.maxWorkers,
+ timeline: lifecycle.timeline.map((e) => ({
+ eventName: e.eventName,
+ timestamp: e.timestamp,
+ txSignature: e.txSignature ?? null,
+ actor: e.actor ? e.actor.toBase58() : null,
+ })),
+ };
+ }
+ }
+
+ return serializeBigInts({
+ ok: true,
+ cluster: client.cluster,
+ rpcUrl: client.rpcUrl,
+ programId: client.programId.toBase58(),
+ taskPda: pda.toBase58(),
+ task: taskOut,
+ lifecycle: lifecycleOut,
+ fetchedAt: new Date().toISOString(),
+ });
+ },
+ );
+ return {
+ name: TOOL_NAME,
+ title: 'AgenC get task ($0.001)',
+ description: TOOL_DESCRIPTION,
+ inputSchema: inputZodShape,
+ handler,
+ };
+}
diff --git a/mcp-server/src/tools/agenc-list-tasks.js b/mcp-server/src/tools/agenc-list-tasks.js
new file mode 100644
index 000000000..e31e49d9e
--- /dev/null
+++ b/mcp-server/src/tools/agenc-list-tasks.js
@@ -0,0 +1,117 @@
+// `agenc_list_tasks` — paid MCP tool that lists every public AgenC task
+// created by a given Solana wallet on the AgenC coordination protocol.
+//
+// Pricing: $0.001 USDC, settled `exact` on Base or Solana.
+//
+// AgenC = agenc.tech (Tetsuo Corp). Coordination protocol on Solana. This tool
+// surfaces the on-chain task marketplace so any MCP client (Claude Desktop,
+// Cursor, three.ws agents) can discover open jobs without standing up Anchor.
+
+import { z } from 'zod';
+import { getTasksByCreator } from '@tetsuo-ai/sdk';
+
+import { paid } from '../payments.js';
+import {
+ getAgenCClient,
+ parsePubkey,
+ serializeBigInts,
+ taskStateLabel,
+} from './agenc-client.js';
+
+const TOOL_NAME = 'agenc_list_tasks';
+const TOOL_DESCRIPTION =
+ 'List every public AgenC task created by a given Solana wallet. AgenC (agenc.tech, by Tetsuo Corp) is a Solana coordination protocol where agents bid on, claim, and complete tasks with SOL/SPL escrow and optional zero-knowledge settlement. Returns task PDA, state, reward, deadline, worker counts, and reward mint for each task. Specify cluster="devnet" for the dev cluster (program 6UcJzbT...), otherwise mainnet. Paid: $0.001 USDC.';
+
+const inputJsonSchema = {
+ type: 'object',
+ properties: {
+ creator: {
+ type: 'string',
+ description: 'Base58 Solana pubkey of the task creator wallet.',
+ minLength: 32,
+ maxLength: 44,
+ },
+ cluster: {
+ type: 'string',
+ enum: ['mainnet', 'devnet'],
+ description: 'Solana cluster to query. Defaults to mainnet.',
+ },
+ },
+ required: ['creator'],
+ additionalProperties: false,
+};
+
+const inputZodShape = {
+ creator: z.string().min(32).max(44),
+ cluster: z.enum(['mainnet', 'devnet']).optional(),
+};
+
+export async function buildAgenCListTasksTool() {
+ const handler = await paid(
+ {
+ toolName: TOOL_NAME,
+ description: TOOL_DESCRIPTION,
+ scheme: 'exact',
+ priceUsd: '$0.001',
+ inputSchema: inputJsonSchema,
+ example: {
+ creator: '5yC9BM8KUsJTPbWPLfA2N8qH1s9V8DQ3Vcw1G6Jdpump',
+ cluster: 'devnet',
+ },
+ outputExample: {
+ ok: true,
+ cluster: 'devnet',
+ programId: '6UcJzbTEemBz3aY5wK5qKHGMD7bdRsmR4smND29gB2ab',
+ creator: '5yC9BM8KUsJTPbWPLfA2N8qH1s9V8DQ3Vcw1G6Jdpump',
+ count: 1,
+ tasks: [
+ {
+ taskId: '11d3...',
+ state: 'Open',
+ rewardAmount: '50000000',
+ rewardMint: null,
+ deadline: 1716508800,
+ currentWorkers: 0,
+ maxWorkers: 1,
+ },
+ ],
+ },
+ },
+ async ({ creator, cluster }) => {
+ const creatorPk = parsePubkey(creator, 'creator');
+ const client = getAgenCClient(cluster);
+ const tasks = await getTasksByCreator(client.program, creatorPk);
+ const rows = tasks.map((t) => ({
+ taskId: Buffer.from(t.taskId).toString('hex'),
+ state: taskStateLabel(t.state),
+ stateRaw: typeof t.state === 'number' ? t.state : null,
+ rewardAmount: t.rewardAmount.toString(),
+ rewardMint: t.rewardMint ? t.rewardMint.toBase58() : null,
+ deadline: t.deadline,
+ currentWorkers: t.currentWorkers,
+ maxWorkers: t.maxWorkers,
+ completedAt: t.completedAt,
+ constraintHash: t.constraintHash
+ ? Buffer.from(t.constraintHash).toString('hex')
+ : null,
+ }));
+ return serializeBigInts({
+ ok: true,
+ cluster: client.cluster,
+ rpcUrl: client.rpcUrl,
+ programId: client.programId.toBase58(),
+ creator: creatorPk.toBase58(),
+ count: rows.length,
+ tasks: rows,
+ fetchedAt: new Date().toISOString(),
+ });
+ },
+ );
+ return {
+ name: TOOL_NAME,
+ title: 'AgenC list tasks ($0.001)',
+ description: TOOL_DESCRIPTION,
+ inputSchema: inputZodShape,
+ handler,
+ };
+}
diff --git a/migrations/20260523130000_create_user_subdomains.sql b/migrations/20260523130000_create_user_subdomains.sql
new file mode 100644
index 000000000..c6e8ef2ba
--- /dev/null
+++ b/migrations/20260523130000_create_user_subdomains.sql
@@ -0,0 +1,27 @@
+-- threews.sol subdomain claims.
+--
+-- Each row records that user_id owns the on-chain subdomain
+-- `<label>.<parent>.sol` (parent = 'threews' for the platform-owned root).
+-- The on-chain SNS registry is the source of truth for ownership; this table
+-- exists so we can do fast availability checks, drive the /u/:label showcase
+-- without hitting the RPC, and bind a subdomain back to a app user_id.
+
+CREATE TABLE IF NOT EXISTS user_subdomains (
+ id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
+ user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
+ label text NOT NULL CHECK (label ~ '^[a-z0-9-]{1,63}$'),
+ parent text NOT NULL DEFAULT 'threews',
+ owner_wallet text NOT NULL, -- base58 Solana address that owns the subdomain on-chain
+ url_record text, -- value set in the SNS URL record (e.g. https://three.ws/u/nich)
+ signature text NOT NULL, -- tx signature of the creation
+ created_at timestamptz NOT NULL DEFAULT now()
+);
+
+CREATE UNIQUE INDEX IF NOT EXISTS user_subdomains_label_parent
+ ON user_subdomains(label, parent);
+
+CREATE INDEX IF NOT EXISTS user_subdomains_user
+ ON user_subdomains(user_id);
+
+CREATE INDEX IF NOT EXISTS user_subdomains_owner_wallet
+ ON user_subdomains(owner_wallet);
diff --git a/package-lock.json b/package-lock.json
index 153e3a533..6545a428f 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1007,8 +1007,11 @@
"license": "Apache-2.0",
"dependencies": {
"@coinbase/x402": "^2.1.0",
+ "@coral-xyz/anchor": "^0.32.1",
"@modelcontextprotocol/sdk": "^1.29.0",
"@solana/web3.js": "latest",
+ "@tetsuo-ai/protocol": "^0.2.0",
+ "@tetsuo-ai/sdk": "^1.4.0",
"@x402/core": "^2.12.0",
"@x402/evm": "^2.12.0",
"@x402/extensions": "^2.12.0",
@@ -1025,6 +1028,60 @@
"node": ">=20"
}
},
+ "mcp-server/node_modules/@coral-xyz/anchor": {
+ "version": "0.32.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.32.1.tgz",
+ "integrity": "sha512-zAyxFtfeje2FbMA1wzgcdVs7Hng/MijPKpRijoySPCicnvcTQs/+dnPZ/cR+LcXM9v9UYSyW81uRNYZtN5G4yg==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "mcp-server/node_modules/@coral-xyz/anchor/node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "mcp-server/node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "mcp-server/node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "mcp-server/node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
"multiplayer": {
"name": "@three.ws/multiplayer",
"version": "0.1.0",
@@ -19914,6 +19971,261 @@
}
}
},
+ "node_modules/@tetsuo-ai/protocol": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@tetsuo-ai/protocol/-/protocol-0.2.0.tgz",
+ "integrity": "sha512-W4p7zd19lFxvmeXwJy3yZeo8z4iiNoVoMMEwO99fB47o3p0LNy1oO8+4YxN5BgcM57kKTV5/EhjaK8SLu7vCfg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@tetsuo-ai/sdk/-/sdk-1.4.0.tgz",
+ "integrity": "sha512-ql6zCgBv0vrELetMqINU98Yb+u95WgrTLf20mWDyZAsNkYQJpTPeM0q8Jld5Xh4oYQ+peWagdxPo6zq8BNqONQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": ">=0.32.1",
+ "@solana/web3.js": ">=1.98.4",
+ "chalk": "^5.6.2",
+ "commander": "^14.0.3",
+ "ora": "^9.3.0"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "peerDependencies": {
+ "@coral-xyz/anchor": ">=0.29.0",
+ "@solana/web3.js": ">=1.90.0"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/@coral-xyz/anchor": {
+ "version": "0.32.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.32.1.tgz",
+ "integrity": "sha512-zAyxFtfeje2FbMA1wzgcdVs7Hng/MijPKpRijoySPCicnvcTQs/+dnPZ/cR+LcXM9v9UYSyW81uRNYZtN5G4yg==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/ansi-regex": {
+ "version": "6.2.2",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
+ "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/cli-cursor": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/cli-spinners": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-3.4.0.tgz",
+ "integrity": "sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/is-interactive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
+ "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/is-unicode-supported": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/log-symbols": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-7.0.1.tgz",
+ "integrity": "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==",
+ "license": "MIT",
+ "dependencies": {
+ "is-unicode-supported": "^2.0.0",
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/onetime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+ "license": "MIT",
+ "dependencies": {
+ "mimic-function": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/ora": {
+ "version": "9.4.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-9.4.0.tgz",
+ "integrity": "sha512-84cglkRILFxdtA8hAvLNdMrtBpPNBTrQ9/ulg0FA7xLMnD6mifv+enAIeRmvtv+WgdCE+LPGOfQmtJRrVaIVhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.6.2",
+ "cli-cursor": "^5.0.0",
+ "cli-spinners": "^3.2.0",
+ "is-interactive": "^2.0.0",
+ "is-unicode-supported": "^2.1.0",
+ "log-symbols": "^7.0.1",
+ "stdin-discarder": "^0.3.2",
+ "string-width": "^8.1.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/restore-cursor": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/string-width": {
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz",
+ "integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==",
+ "license": "MIT",
+ "dependencies": {
+ "get-east-asian-width": "^1.5.0",
+ "strip-ansi": "^7.1.2"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/strip-ansi": {
+ "version": "7.2.0",
+ "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
+ "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
"node_modules/@three-ws/agent-ui": {
"resolved": "agent-ui-sdk",
"link": true
@@ -29821,6 +30133,18 @@
"node": "6.* || 8.* || >= 10.*"
}
},
+ "node_modules/get-east-asian-width": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
+ "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
@@ -38034,6 +38358,18 @@
"node": ">=6"
}
},
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/mimic-response": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
@@ -43675,7 +44011,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
- "dev": true,
"license": "ISC",
"engines": {
"node": ">=14"
@@ -44089,6 +44424,18 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/stdin-discarder": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.3.2.tgz",
+ "integrity": "sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/stop-iteration-iterator": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz",
@@ -48062,6 +48409,18 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/yoctocolors": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz",
+ "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/yoga-layout": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/yoga-layout/-/yoga-layout-3.2.1.tgz",
diff --git a/package.json b/package.json
index a0fe6dd78..e1e29d172 100644
--- a/package.json
+++ b/package.json
@@ -55,7 +55,7 @@
"dev:lib": "TARGET=lib vite",
"build:pages": "node scripts/build-page-index.mjs",
"build:news": "node scripts/build-news.mjs",
- "prebuild": "node scripts/build-news.mjs && node scripts/build-page-index.mjs && npm run build:club-assets",
+ "prebuild": "node scripts/build-news.mjs && node scripts/build-page-index.mjs && node scripts/build-skill-metadata.mjs && npm run build:club-assets",
"build": "vite build",
"build:wasm": "PATH=\"$HOME/.cargo/bin:$PATH\" RUSTFLAGS='-C target-feature=+simd128' wasm-pack build crates/vanity-grinder --target web --release --out-dir ../../src/solana/vanity/wasm && printf '%s\\n' '# wasm-pack writes a default `*` gitignore that excludes everything.' '# Override it: the generated files in this directory ARE checked in so the' '# app builds without requiring a Rust toolchain at install time. Run' '# `npm run build:wasm` after editing /crates/vanity-grinder/src/lib.rs to' '# refresh these artifacts.' '!*' > src/solana/vanity/wasm/.gitignore",
"build:animations": "node scripts/build-animations.mjs",
diff --git a/pages/agent-detail.html b/pages/agent-detail.html
index 35242e4c9..fe71e5d4e 100644
--- a/pages/agent-detail.html
+++ b/pages/agent-detail.html
@@ -80,8 +80,9 @@
<input type="number" id="withdraw-amount" class="ad-input" placeholder="0.0">
</div>
<div class="ad-form-group">
- <label for="recipient-address">Recipient Address</label>
- <input type="text" id="recipient-address" class="ad-input" placeholder="Enter wallet address">
+ <label for="recipient-address">Recipient address or .sol name</label>
+ <input type="text" id="recipient-address" class="ad-input" placeholder="Wallet address or yourname.sol" autocomplete="off" spellcheck="false">
+ <div id="recipient-resolved" class="ad-resolved" hidden></div>
</div>
</div>
<div class="ad-modal-footer">
diff --git a/pages/profile.html b/pages/profile.html
index 97ebc09dd..e43612ee2 100644
--- a/pages/profile.html
+++ b/pages/profile.html
@@ -900,6 +900,60 @@
</span>`
: '';
+ // SNS subdomain pill + pay-by-name button.
+ // Look up `<username>.threews.sol`; if claimed, badge it as a verified
+ // on-chain handle and surface the pay-by-name action.
+ const snsPillSlot = `<span id="up-sns-pill"></span><span id="up-pay-slot"></span>`;
+ (async () => {
+ try {
+ const r = await fetch(`/api/threews/subdomain?label=${encodeURIComponent(user.username)}`);
+ if (!r.ok) return;
+ const j = await r.json();
+ const d = j?.data;
+ if (!d?.claim || d.claim.username !== user.username) return;
+ const pill = document.getElementById('up-sns-pill');
+ if (pill) {
+ pill.outerHTML = `<a class="up-wallet-pill" style="text-decoration:none" href="https://www.sns.id/domain?domain=${attr(d.full)}" target="_blank" rel="noopener" title="${attr(d.full)}">
+ <svg width="10" height="10" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0l2.39 4.84L16 5.92l-4 3.9L13 16l-5-2.63L3 16l1-6.18L0 5.92l5.61-1.08z"/></svg>
+ ${esc(d.full)}
+ </a>`;
+ }
+ const paySlot = document.getElementById('up-pay-slot');
+ if (paySlot) {
+ paySlot.outerHTML = `<button class="up-wallet-pill" id="up-pay-btn" style="cursor:pointer;border:0;font-family:inherit" data-name="${attr(d.full)}">
+ Pay @${esc(user.username)} in USDC
+ </button>`;
+ document.getElementById('up-pay-btn')?.addEventListener('click', () => openPay(d.full));
+ }
+ } catch {}
+ })();
+
+ async function openPay(name) {
+ const amount = prompt(`How much USDC do you want to send to ${name}?`, '1');
+ if (!amount) return;
+ const num = Number(amount);
+ if (!Number.isFinite(num) || num <= 0) { alert('invalid amount'); return; }
+ const payerWallet = prompt('Your Solana wallet address (the one paying):', '');
+ if (!payerWallet) return;
+ try {
+ const res = await fetch('/api/x402/pay-by-name', {
+ method: 'POST',
+ headers: { 'content-type': 'application/json' },
+ body: JSON.stringify({ mode: 'prep', name, amount_usdc: num, payer_wallet: payerWallet.trim() }),
+ });
+ const data = await res.json();
+ if (!res.ok) {
+ alert(data?.error_description || 'Could not prepare payment.');
+ return;
+ }
+ const d = data.data;
+ alert(`Payment prepared.\n\nTo: ${d.recipient.resolved} (${d.recipient.address.slice(0,6)}…${d.recipient.address.slice(-4)})\nAmount: ${d.amount_usdc} USDC\n\nSign and broadcast the returned transaction with your Solana wallet (base64 tx is in the console).`);
+ console.log('[pay-by-name tx_base64]', d.tx_base64);
+ } catch (err) {
+ alert(err?.message || 'Network error.');
+ }
+ }
+
// Stats strip
const statDefs = [
['avatars', 'Avatars'],
@@ -945,7 +999,10 @@
<h1 class="up-display-name">${esc(display)}</h1>
<p class="up-handle">@${esc(user.username)}</p>
${metaBits.length ? `<div class="up-meta-line">${metaBits.join('')}</div>` : ''}
- ${walletPill}
+ <div class="up-pill-row" style="display:flex;flex-wrap:wrap;gap:.4rem;align-items:center">
+ ${walletPill}
+ ${snsPillSlot}
+ </div>
</div>
</div>
<div class="up-stats">${statsHtml}</div>
diff --git a/pages/threews-claim.html b/pages/threews-claim.html
new file mode 100644
index 000000000..ea0561ad5
--- /dev/null
+++ b/pages/threews-claim.html
@@ -0,0 +1,297 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <title>Claim your threews.sol subdomain</title>
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <meta name="description" content="Claim your own subdomain on threews.sol and get a Brave-resolvable personal showcase page." />
+ <meta name="theme-color" content="#000000" />
+ <link rel="shortcut icon" href="/favicon.ico" />
+ <link rel="stylesheet" href="/style.css" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <style>
+ body {
+ min-height: 100vh;
+ display: flex;
+ flex-direction: column;
+ background: #000;
+ color: rgba(255, 255, 255, 0.92);
+ font-family: 'PPNeueMontreal', system-ui, sans-serif;
+ }
+ .tw-wrap {
+ max-width: 720px;
+ margin: 0 auto;
+ padding: 4rem 1.618rem 6rem;
+ width: 100%;
+ }
+ .tw-eyebrow {
+ font-size: 0.764rem;
+ letter-spacing: 0.1em;
+ color: rgba(255, 255, 255, 0.4);
+ text-transform: uppercase;
+ margin-bottom: 0.5rem;
+ }
+ h1 {
+ font-size: 2.2rem;
+ font-weight: 500;
+ margin: 0 0 0.4rem;
+ line-height: 1.1;
+ }
+ .tw-sub {
+ color: rgba(255, 255, 255, 0.6);
+ margin: 0 0 2.5rem;
+ font-size: 1rem;
+ line-height: 1.5;
+ }
+ .tw-card {
+ border: 1px solid rgba(255, 255, 255, 0.08);
+ border-radius: 14px;
+ padding: 1.5rem;
+ background: rgba(255, 255, 255, 0.02);
+ margin-bottom: 1.5rem;
+ }
+ label {
+ display: block;
+ font-size: 0.85rem;
+ color: rgba(255, 255, 255, 0.5);
+ margin-bottom: 0.4rem;
+ }
+ .tw-input-row {
+ display: flex;
+ align-items: stretch;
+ border: 1px solid rgba(255, 255, 255, 0.12);
+ border-radius: 10px;
+ overflow: hidden;
+ background: #0a0a0a;
+ }
+ .tw-input-row input {
+ flex: 1;
+ border: 0;
+ background: transparent;
+ color: rgba(255, 255, 255, 0.95);
+ padding: 0.95rem 1rem;
+ font-size: 1.05rem;
+ font-family: inherit;
+ outline: none;
+ }
+ .tw-suffix {
+ display: flex;
+ align-items: center;
+ padding: 0 1rem;
+ color: rgba(255, 255, 255, 0.45);
+ background: rgba(255, 255, 255, 0.03);
+ border-left: 1px solid rgba(255, 255, 255, 0.06);
+ font-variant-numeric: tabular-nums;
+ }
+ .tw-status {
+ margin-top: 0.75rem;
+ font-size: 0.85rem;
+ min-height: 1.2em;
+ }
+ .tw-status.ok { color: #69e16f; }
+ .tw-status.bad { color: #ff7a7a; }
+ .tw-status.muted { color: rgba(255, 255, 255, 0.5); }
+ .tw-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.5rem;
+ background: #fff;
+ color: #000;
+ border: 0;
+ border-radius: 10px;
+ padding: 0.85rem 1.25rem;
+ font-size: 1rem;
+ font-weight: 500;
+ font-family: inherit;
+ cursor: pointer;
+ margin-top: 1rem;
+ }
+ .tw-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
+ .tw-btn.ghost {
+ background: transparent;
+ color: rgba(255, 255, 255, 0.85);
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ }
+ .tw-result {
+ border: 1px solid rgba(105, 225, 111, 0.3);
+ background: rgba(105, 225, 111, 0.05);
+ border-radius: 12px;
+ padding: 1.25rem;
+ margin-top: 1.5rem;
+ display: none;
+ }
+ .tw-result.on { display: block; }
+ .tw-result h3 { margin: 0 0 0.5rem; font-weight: 500; font-size: 1.05rem; }
+ .tw-result a {
+ color: #69e16f;
+ text-decoration: none;
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
+ font-size: 0.9rem;
+ word-break: break-all;
+ }
+ .tw-help {
+ font-size: 0.85rem;
+ color: rgba(255, 255, 255, 0.5);
+ line-height: 1.6;
+ }
+ .tw-help code {
+ background: rgba(255, 255, 255, 0.06);
+ padding: 0.1em 0.4em;
+ border-radius: 4px;
+ font-size: 0.85em;
+ }
+ .tw-bullets {
+ margin: 0;
+ padding-left: 1.2em;
+ }
+ .tw-bullets li { margin-bottom: 0.4em; }
+ </style>
+ </head>
+ <body>
+ <main class="tw-wrap">
+ <div class="tw-eyebrow">threews.sol</div>
+ <h1>Claim your subdomain</h1>
+ <p class="tw-sub">
+ Get <code style="background:rgba(255,255,255,.06);padding:.1em .4em;border-radius:4px;">yourname.threews.sol</code>
+ as a Solana Name Service subdomain. Brave Browser resolves it directly to
+ your three.ws showcase. Your agents, avatars, and skills, all under one name.
+ </p>
+
+ <section class="tw-card">
+ <label for="tw-label">Subdomain label</label>
+ <div class="tw-input-row">
+ <input id="tw-label" type="text" autocomplete="off" autocapitalize="off" spellcheck="false" placeholder="yourhandle" maxlength="63" />
+ <div class="tw-suffix">.threews.sol</div>
+ </div>
+ <div class="tw-status muted" id="tw-status">Type a label to check availability.</div>
+ <button class="tw-btn" id="tw-mint" disabled>Mint subdomain</button>
+ <p class="tw-help" style="margin-top:1rem">
+ Minting is paid by three.ws. The on-chain subdomain is transferred to
+ your agent's Solana wallet (or a wallet you've linked). Your label must
+ match your account username.
+ </p>
+ </section>
+
+ <div class="tw-result" id="tw-result"></div>
+
+ <section class="tw-card">
+ <h3 style="margin:0 0 .5rem;font-weight:500">What this gives you</h3>
+ <ul class="tw-bullets tw-help">
+ <li><code>yourname.threews.sol</code> resolves to your showcase in Brave</li>
+ <li>A pay-by-name handle — anyone can <code>POST /api/x402/pay-by-name</code> with <code>yourname.threews.sol</code> to send you USDC</li>
+ <li>Ownership transfers to your wallet; we just set the URL record</li>
+ <li>Verified profile badge at <a href="/u/" style="color:#69e16f">/u/yourname</a></li>
+ </ul>
+ </section>
+ </main>
+
+ <script type="module">
+ const labelEl = document.getElementById('tw-label');
+ const statusEl = document.getElementById('tw-status');
+ const mintBtn = document.getElementById('tw-mint');
+ const resultEl = document.getElementById('tw-result');
+
+ let checkTimer = null;
+ let lastChecked = null;
+ let csrfToken = null;
+
+ labelEl.addEventListener('input', () => {
+ const raw = labelEl.value.trim().toLowerCase();
+ const cleaned = raw.replace(/[^a-z0-9-]/g, '');
+ if (cleaned !== raw) labelEl.value = cleaned;
+ mintBtn.disabled = true;
+ clearTimeout(checkTimer);
+ if (!cleaned) {
+ statusEl.textContent = 'Type a label to check availability.';
+ statusEl.className = 'tw-status muted';
+ return;
+ }
+ statusEl.textContent = 'Checking…';
+ statusEl.className = 'tw-status muted';
+ checkTimer = setTimeout(() => check(cleaned), 350);
+ });
+
+ async function check(label) {
+ try {
+ const res = await fetch(`/api/threews/subdomain?label=${encodeURIComponent(label)}`);
+ const data = await res.json();
+ if (!res.ok) {
+ statusEl.textContent = data?.error_description || 'Could not check this label.';
+ statusEl.className = 'tw-status bad';
+ return;
+ }
+ lastChecked = data?.data;
+ if (lastChecked.available) {
+ statusEl.textContent = `${lastChecked.full} is available.`;
+ statusEl.className = 'tw-status ok';
+ mintBtn.disabled = false;
+ } else {
+ const who = lastChecked.claim?.username
+ ? `claimed by @${lastChecked.claim.username}`
+ : `owned by ${lastChecked.owner}`;
+ statusEl.textContent = `${lastChecked.full} — ${who}.`;
+ statusEl.className = 'tw-status bad';
+ }
+ } catch (err) {
+ statusEl.textContent = err?.message || 'Network error.';
+ statusEl.className = 'tw-status bad';
+ }
+ }
+
+ async function getCsrf() {
+ if (csrfToken) return csrfToken;
+ const res = await fetch('/api/csrf-token', { credentials: 'same-origin' });
+ if (!res.ok) throw new Error('not signed in');
+ const data = await res.json();
+ csrfToken = data?.data?.token;
+ return csrfToken;
+ }
+
+ mintBtn.addEventListener('click', async () => {
+ if (!lastChecked?.available) return;
+ mintBtn.disabled = true;
+ statusEl.textContent = 'Minting on-chain…';
+ statusEl.className = 'tw-status muted';
+ resultEl.classList.remove('on');
+ try {
+ const token = await getCsrf().catch(() => null);
+ const headers = { 'content-type': 'application/json' };
+ if (token) headers['x-csrf-token'] = token;
+ const res = await fetch('/api/threews/subdomain', {
+ method: 'POST',
+ headers,
+ credentials: 'same-origin',
+ body: JSON.stringify({ label: lastChecked.label }),
+ });
+ const data = await res.json();
+ if (!res.ok) {
+ statusEl.textContent = data?.error_description || 'Mint failed.';
+ statusEl.className = 'tw-status bad';
+ mintBtn.disabled = false;
+ return;
+ }
+ const d = data.data;
+ statusEl.textContent = `${d.full} minted.`;
+ statusEl.className = 'tw-status ok';
+ resultEl.innerHTML = `
+ <h3>${d.full} is yours.</h3>
+ <p class="tw-help" style="margin:.4em 0">
+ Brave users can type <strong>${d.full}</strong> in the URL bar and
+ land on your showcase. Anyone can pay you by sending to that name
+ via the pay-by-name API.
+ </p>
+ <p style="margin:.4em 0">
+ <a href="${d.showcase_url}">${d.showcase_url}</a><br>
+ <span class="tw-help">tx: <a href="https://solscan.io/tx/${encodeURIComponent(d.signature)}" target="_blank" rel="noopener">${d.signature}</a></span>
+ </p>
+ `;
+ resultEl.classList.add('on');
+ } catch (err) {
+ statusEl.textContent = err?.message || 'Mint failed.';
+ statusEl.className = 'tw-status bad';
+ mintBtn.disabled = false;
+ }
+ });
+ </script>
+ </body>
+</html>
diff --git a/public/animations/clips/av-pose1.json b/public/animations/clips/av-pose1.json
index d4c75dafc..4b4cffb1b 100644
--- a/public/animations/clips/av-pose1.json
+++ b/public/animations/clips/av-pose1.json
@@ -1 +1 @@
-{"name":"av-pose1","duration":0,"tracks":[{"name":"Hips.position","times":[0],"values":[0.22710368037223816,0.9879486560821533,0.010035848245024681],"type":"vector"},{"name":"Hips.quaternion","times":[0],"values":[-0.017638495191931725,-0.2722373902797699,-0.001053386484272778,0.9620679020881653],"type":"quaternion"},{"name":"Hips.scale","times":[0],"values":[1,0.9999998807907104,1],"type":"vector"},{"name":"Spine.position","times":[0],"values":[-7.683410352399278e-9,0.08465532213449478,9.442105763923792e-9],"type":"vector"},{"name":"Spine.quaternion","times":[0],"values":[-0.016673505306243896,0.007150137796998024,0.0007383860065601766,0.9998351335525513],"type":"quaternion"},{"name":"Spine.scale","times":[0],"values":[1.0000001192092896,1,1],"type":"vector"},{"name":"Spine1.position","times":[0],"values":[2.6484450188490882e-9,0.12686902284622192,4.62640947773707e-9],"type":"vector"},{"name":"Spine1.quaternion","times":[0],"values":[-0.011865307576954365,-0.015601061284542084,0.0016731475479900837,0.9998064637184143],"type":"quaternion"},{"name":"Spine1.scale","times":[0],"values":[0.9999998807907104,0.9999998807907104,0.9999997615814209],"type":"vector"},{"name":"Spine2.position","times":[0],"values":[1.2111589953178736e-8,0.1697169840335846,1.0165318364840914e-8],"type":"vector"},{"name":"Spine2.quaternion","times":[0],"values":[-0.018228936940431595,-0.027748625725507736,-0.0003906515776179731,0.9994486570358276],"type":"quaternion"},{"name":"Spine2.scale","times":[0],"values":[1.0000001192092896,0.9999998211860657,1],"type":"vector"},{"name":"Neck.position","times":[0],"values":[2.6091679927731093e-8,0.1833627074956894,-4.713934487199367e-8],"type":"vector"},{"name":"Neck.quaternion","times":[0],"values":[0.2021181285381317,0.018318748101592064,-0.014682899229228497,0.9790797233581543],"type":"quaternion"},{"name":"Neck.scale","times":[0],"values":[1.0000001192092896,1.0000001192092896,1],"type":"vector"},{"name":"Head.position","times":[0],"values":[3.488684541252951e-8,0.11675456911325455,2.269680621225234e-8],"type":"vector"},{"name":"Head.quaternion","times":[0],"values":[-0.0508711002767086,0.1575472205877304,-0.02741112932562828,0.9858193397521973],"type":"quaternion"},{"name":"Head.scale","times":[0],"values":[1,1,1],"type":"vector"},{"name":"LeftShoulder.position","times":[0],"values":[0.0462932325899601,0.1546010673046112,0.004505448509007692],"type":"vector"},{"name":"LeftShoulder.quaternion","times":[0],"values":[0.571010410785675,0.4496723413467407,-0.5457017421722412,0.4170748293399811],"type":"quaternion"},{"name":"LeftShoulder.scale","times":[0],"values":[0.9999998211860657,0.9999998211860657,1],"type":"vector"},{"name":"LeftArm.position","times":[0],"values":[-2.534388698904877e-8,0.13761229813098907,-3.885594423991279e-8],"type":"vector"},{"name":"LeftArm.quaternion","times":[0],"values":[0.5412200689315796,0.11190522462129593,-0.010658721439540386,0.8333333134651184],"type":"quaternion"},{"name":"LeftArm.scale","times":[0],"values":[1,1,0.9999999403953552],"type":"vector"},{"name":"LeftForeArm.position","times":[0],"values":[-2.6180792644936446e-8,0.2531951665878296,1.5928540264553703e-8],"type":"vector"},{"name":"LeftForeArm.quaternion","times":[0],"values":[0.01980099268257618,0.02451196499168873,0.14334224164485931,0.9891713857650757],"type":"quaternion"},{"name":"LeftForeArm.scale","times":[0],"values":[0.9999998211860657,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"LeftHand.position","times":[0],"values":[-1.3397167819562128e-8,0.27483826875686646,-3.7470584857146605e-8],"type":"vector"},{"name":"LeftHand.quaternion","times":[0],"values":[-0.009855138137936592,-0.00895487517118454,-0.028931016102433205,0.9994927048683167],"type":"quaternion"},{"name":"LeftHand.scale","times":[0],"values":[0.9999999403953552,1.0000001192092896,1],"type":"vector"},{"name":"LeftHandThumb1.position","times":[0],"values":[-0.020194295793771744,0.03266836702823639,0.009225639514625072],"type":"vector"},{"name":"LeftHandThumb1.quaternion","times":[0],"values":[0.09660612791776657,0.04760229215025902,0.3425404727458954,0.9333099126815796],"type":"quaternion"},{"name":"LeftHandThumb1.scale","times":[0],"values":[1,0.9999999403953552,1],"type":"vector"},{"name":"LeftHandThumb2.position","times":[0],"values":[-1.6634176347452012e-7,0.027922755107283592,-1.0778523318322186e-7],"type":"vector"},{"name":"LeftHandThumb2.quaternion","times":[0],"values":[0.046138521283864975,-0.00566489715129137,-0.3986840546131134,0.915909469127655],"type":"quaternion"},{"name":"LeftHandThumb2.scale","times":[0],"values":[1,1,0.9999998807907104],"type":"vector"},{"name":"LeftHandThumb3.position","times":[0],"values":[-2.909264829042968e-9,0.02590855211019516,5.975656591772349e-8],"type":"vector"},{"name":"LeftHandThumb3.quaternion","times":[0],"values":[-0.02691243216395378,0.009485953487455845,0.0307578444480896,0.9991194605827332],"type":"quaternion"},{"name":"LeftHandThumb3.scale","times":[0],"values":[0.9999999403953552,1,1.0000001192092896],"type":"vector"},{"name":"LeftHandIndex1.position","times":[0],"values":[-0.02058575488626957,0.07845994085073471,-0.002534119412302971],"type":"vector"},{"name":"LeftHandIndex1.quaternion","times":[0],"values":[0.09431245177984238,-0.02144789882004261,-0.021314701065421104,0.9950833320617676],"type":"quaternion"},{"name":"LeftHandIndex1.scale","times":[0],"values":[1.0000001192092896,1,1.000000238418579],"type":"vector"},{"name":"LeftHandIndex2.position","times":[0],"values":[5.422855053893727e-9,0.03837945684790611,2.6089105631399434e-7],"type":"vector"},{"name":"LeftHandIndex2.quaternion","times":[0],"values":[0.1484101563692093,0.010814904235303402,-0.0025952341966331005,0.9888633489608765],"type":"quaternion"},{"name":"LeftHandIndex2.scale","times":[0],"values":[1,0.9999999403953552,1],"type":"vector"},{"name":"LeftHandIndex3.position","times":[0],"values":[-5.087942955839253e-9,0.02156774140894413,-1.205587238928274e-7],"type":"vector"},{"name":"LeftHandIndex3.quaternion","times":[0],"values":[0.15660452842712402,0.004280957859009504,-0.005098668858408928,0.9876389503479004],"type":"quaternion"},{"name":"LeftHandIndex3.scale","times":[0],"values":[0.9999998807907104,0.9999999403953552,1],"type":"vector"},{"name":"LeftHandMiddle1.position","times":[0],"values":[-0.0018829249311238527,0.0817376896739006,-0.0046820626594126225],"type":"vector"},{"name":"LeftHandMiddle1.quaternion","times":[0],"values":[0.17893840372562408,-0.032650575041770935,-0.1056300699710846,0.9776284098625183],"type":"quaternion"},{"name":"LeftHandMiddle1.scale","times":[0],"values":[0.9999999403953552,1.0000001192092896,1.0000001192092896],"type":"vector"},{"name":"LeftHandMiddle2.position","times":[0],"values":[5.322894125470157e-8,0.04397998005151749,2.8703411203423457e-7],"type":"vector"},{"name":"LeftHandMiddle2.quaternion","times":[0],"values":[0.18954485654830933,0.005539071746170521,-0.005852672271430492,0.9818390011787415],"type":"quaternion"},{"name":"LeftHandMiddle2.scale","times":[0],"values":[1,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"LeftHandMiddle3.position","times":[0],"values":[-4.759123317654712e-9,0.022322459146380424,-1.9596423328493984e-7],"type":"vector"},{"name":"LeftHandMiddle3.quaternion","times":[0],"values":[0.13216321170330048,0.0032556846272200346,-0.004002028610557318,0.9912145733833313],"type":"quaternion"},{"name":"LeftHandMiddle3.scale","times":[0],"values":[0.9999999403953552,1,1],"type":"vector"},{"name":"LeftHandRing1.position","times":[0],"values":[0.018368063494563103,0.08156660944223404,-0.002380664460361004],"type":"vector"},{"name":"LeftHandRing1.quaternion","times":[0],"values":[0.22309152781963348,-0.07349289208650589,-0.11858632415533066,0.964762270450592],"type":"quaternion"},{"name":"LeftHandRing1.scale","times":[0],"values":[0.9999999403953552,1,1],"type":"vector"},{"name":"LeftHandRing2.position","times":[0],"values":[-1.953001493859574e-8,0.034330740571022034,-6.268609520354573e-10],"type":"vector"},{"name":"LeftHandRing2.quaternion","times":[0],"values":[0.16470664739608765,0.005326032172888517,0.0020931288599967957,0.9863260388374329],"type":"quaternion"},{"name":"LeftHandRing2.scale","times":[0],"values":[1,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"LeftHandRing3.position","times":[0],"values":[7.902550436256206e-8,0.022869953885674477,-6.393820939365469e-8],"type":"vector"},{"name":"LeftHandRing3.quaternion","times":[0],"values":[0.30609163641929626,0.010189606808125973,-0.004974913317710161,0.9519345164299011],"type":"quaternion"},{"name":"LeftHandRing3.scale","times":[0],"values":[0.9999999403953552,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"LeftHandPinky1.position","times":[0],"values":[0.03241877257823944,0.07114378362894058,0.001523372600786388],"type":"vector"},{"name":"LeftHandPinky1.quaternion","times":[0],"values":[0.17989295721054077,-0.057033970952034,-0.09700494259595871,0.977228581905365],"type":"quaternion"},{"name":"LeftHandPinky1.scale","times":[0],"values":[0.9999999403953552,1,1],"type":"vector"},{"name":"LeftHandPinky2.position","times":[0],"values":[-8.806433804409153e-9,0.027698123827576637,5.636472906189738e-7],"type":"vector"},{"name":"LeftHandPinky2.quaternion","times":[0],"values":[0.09287857264280319,0.006804470904171467,-0.03585001081228256,0.9950085878372192],"type":"quaternion"},{"name":"LeftHandPinky2.scale","times":[0],"values":[0.9999997019767761,1,0.9999999403953552],"type":"vector"},{"name":"LeftHandPinky3.position","times":[0],"values":[3.627158662311558e-8,0.018653014674782753,1.2276649385967175e-7],"type":"vector"},{"name":"LeftHandPinky3.quaternion","times":[0],"values":[0.3026178181171417,0.03352458029985428,0.007893020287156105,0.9524894952774048],"type":"quaternion"},{"name":"LeftHandPinky3.scale","times":[0],"values":[0.9999998211860657,0.9999998807907104,1],"type":"vector"},{"name":"RightShoulder.position","times":[0],"values":[-0.046316973865032196,0.15459416806697845,0.004504240117967129],"type":"vector"},{"name":"RightShoulder.quaternion","times":[0],"values":[0.5896373391151428,-0.4582756757736206,0.5385028123855591,0.3902895152568817],"type":"quaternion"},{"name":"RightShoulder.scale","times":[0],"values":[0.9999998807907104,1,1],"type":"vector"},{"name":"RightArm.position","times":[0],"values":[-1.0961487717509044e-8,0.13761229813098907,1.5495676564114547e-7],"type":"vector"},{"name":"RightArm.quaternion","times":[0],"values":[0.5275523066520691,-0.07642792165279388,0.022038761526346207,0.8457905650138855],"type":"quaternion"},{"name":"RightArm.scale","times":[0],"values":[0.9999998807907104,0.9999998807907104,0.9999998211860657],"type":"vector"},{"name":"RightForeArm.position","times":[0],"values":[-4.7634611810565275e-9,0.25319498777389526,1.658282222649632e-8],"type":"vector"},{"name":"RightForeArm.quaternion","times":[0],"values":[0.00598891219124198,0.00556867616251111,-0.10757777839899063,0.9941630363464355],"type":"quaternion"},{"name":"RightForeArm.scale","times":[0],"values":[0.9999999403953552,0.9999998211860657,0.9999998211860657],"type":"vector"},{"name":"RightHand.position","times":[0],"values":[-8.985546529061139e-9,0.2748381793498993,-1.2352863620890275e-7],"type":"vector"},{"name":"RightHand.quaternion","times":[0],"values":[0.05968368053436279,-0.1474071890115738,0.08935597538948059,0.9832214713096619],"type":"quaternion"},{"name":"RightHand.scale","times":[0],"values":[1.0000001192092896,0.9999998211860657,0.9999999403953552],"type":"vector"},{"name":"RightHandThumb1.position","times":[0],"values":[0.02019430324435234,0.03266853466629982,0.009225426241755486],"type":"vector"},{"name":"RightHandThumb1.quaternion","times":[0],"values":[0.050914466381073,-0.030817843973636627,-0.34445637464523315,0.9369139671325684],"type":"quaternion"},{"name":"RightHandThumb1.scale","times":[0],"values":[1,1,1],"type":"vector"},{"name":"RightHandThumb2.position","times":[0],"values":[2.9665683243251806e-8,0.027922801673412323,1.1995524573649163e-7],"type":"vector"},{"name":"RightHandThumb2.quaternion","times":[0],"values":[0.04613921046257019,0.00566446827724576,0.3986843526363373,0.9159093499183655],"type":"quaternion"},{"name":"RightHandThumb2.scale","times":[0],"values":[1,1.0000001192092896,0.9999999403953552],"type":"vector"},{"name":"RightHandThumb3.position","times":[0],"values":[1.7185186607093783e-8,0.025908594951033592,1.3586934244358417e-7],"type":"vector"},{"name":"RightHandThumb3.quaternion","times":[0],"values":[-0.02690984681248665,-0.009485946036875248,-0.03075776994228363,0.9991195201873779],"type":"quaternion"},{"name":"RightHandThumb3.scale","times":[0],"values":[0.9999998807907104,1,1],"type":"vector"},{"name":"RightHandIndex1.position","times":[0],"values":[0.020585762336850166,0.078459732234478,-0.0025341783184558153],"type":"vector"},{"name":"RightHandIndex1.quaternion","times":[0],"values":[0.09431198984384537,0.021447984501719475,0.02131461165845394,0.9950833320617676],"type":"quaternion"},{"name":"RightHandIndex1.scale","times":[0],"values":[1,1.0000001192092896,0.9999999403953552],"type":"vector"},{"name":"RightHandIndex2.position","times":[0],"values":[-8.751034386023093e-8,0.03837978094816208,1.1997498461369105e-7],"type":"vector"},{"name":"RightHandIndex2.quaternion","times":[0],"values":[0.14841143786907196,-0.010814760811626911,0.002595363650470972,0.9888632297515869],"type":"quaternion"},{"name":"RightHandIndex2.scale","times":[0],"values":[1,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"RightHandIndex3.position","times":[0],"values":[-2.6222313209700587e-8,0.021567661315202713,-1.573985386471577e-8],"type":"vector"},{"name":"RightHandIndex3.quaternion","times":[0],"values":[0.15660448372364044,-0.0042808325961232185,0.005098788067698479,0.9876389503479004],"type":"quaternion"},{"name":"RightHandIndex3.scale","times":[0],"values":[1,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"RightHandMiddle1.position","times":[0],"values":[0.0018828734755516052,0.08173748850822449,-0.00468215299770236],"type":"vector"},{"name":"RightHandMiddle1.quaternion","times":[0],"values":[0.1789379119873047,0.03265073895454407,0.10563002526760101,0.9776285290718079],"type":"quaternion"},{"name":"RightHandMiddle1.scale","times":[0],"values":[1.0000001192092896,1.0000001192092896,1],"type":"vector"},{"name":"RightHandMiddle2.position","times":[0],"values":[-1.410089200959419e-8,0.04398008808493614,3.9500721982221876e-7],"type":"vector"},{"name":"RightHandMiddle2.quaternion","times":[0],"values":[0.1895465850830078,-0.005538972094655037,0.005852727685123682,0.9818387031555176],"type":"quaternion"},{"name":"RightHandMiddle2.scale","times":[0],"values":[0.9999999403953552,1,1],"type":"vector"},{"name":"RightHandMiddle3.position","times":[0],"values":[-2.1873672650940534e-8,0.022322187200188637,3.501811463024751e-8],"type":"vector"},{"name":"RightHandMiddle3.quaternion","times":[0],"values":[0.2491811215877533,-0.0027561564929783344,0.0043609910644590855,0.9684431552886963],"type":"quaternion"},{"name":"RightHandMiddle3.scale","times":[0],"values":[1,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"RightHandRing1.position","times":[0],"values":[-0.018368078395724297,0.08156631886959076,-0.0023807475809007883],"type":"vector"},{"name":"RightHandRing1.quaternion","times":[0],"values":[0.2230934500694275,0.07349297404289246,0.11858633160591125,0.9647618532180786],"type":"quaternion"},{"name":"RightHandRing1.scale","times":[0],"values":[1,1.0000001192092896,1],"type":"vector"},{"name":"RightHandRing2.position","times":[0],"values":[-3.5898210626328364e-8,0.03433087468147278,-2.38709958466643e-7],"type":"vector"},{"name":"RightHandRing2.quaternion","times":[0],"values":[0.16470608115196228,-0.005325973965227604,-0.0020930322352796793,0.9863260984420776],"type":"quaternion"},{"name":"RightHandRing2.scale","times":[0],"values":[1,1,1],"type":"vector"},{"name":"RightHandRing3.position","times":[0],"values":[1.093457857592739e-8,0.022869912907481194,5.304719863374885e-8],"type":"vector"},{"name":"RightHandRing3.quaternion","times":[0],"values":[0.3060915768146515,-0.010189698077738285,0.004974923096597195,0.9519345164299011],"type":"quaternion"},{"name":"RightHandRing3.scale","times":[0],"values":[1,1.000000238418579,1],"type":"vector"},{"name":"RightHandPinky1.position","times":[0],"values":[-0.03241875395178795,0.07114369422197342,0.0015233675949275494],"type":"vector"},{"name":"RightHandPinky1.quaternion","times":[0],"values":[0.1798933446407318,0.05703401565551758,0.0970044806599617,0.977228581905365],"type":"quaternion"},{"name":"RightHandPinky1.scale","times":[0],"values":[0.9999999403953552,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"RightHandPinky2.position","times":[0],"values":[3.878068355334108e-8,0.027698198333382607,4.980245194019517e-7],"type":"vector"},{"name":"RightHandPinky2.quaternion","times":[0],"values":[0.09287756681442261,-0.006804333068430424,0.03585046902298927,0.995008647441864],"type":"quaternion"},{"name":"RightHandPinky2.scale","times":[0],"values":[0.9999998807907104,1,0.9999998807907104],"type":"vector"},{"name":"RightHandPinky3.position","times":[0],"values":[-1.7610352287533715e-8,0.018653109669685364,-1.4471804377080844e-7],"type":"vector"},{"name":"RightHandPinky3.quaternion","times":[0],"values":[0.3026178181171417,-0.03352457657456398,-0.007893037982285023,0.9524895548820496],"type":"quaternion"},{"name":"RightHandPinky3.scale","times":[0],"values":[0.9999998211860657,0.9999998807907104,0.9999998807907104],"type":"vector"},{"name":"LeftUpLeg.position","times":[0],"values":[0.08899363875389099,-0.033911626785993576,0.00041269176290370524],"type":"vector"},{"name":"LeftUpLeg.quaternion","times":[0],"values":[0.00033979941508732736,-0.016199136152863503,-0.9985584616661072,0.051171451807022095],"type":"quaternion"},{"name":"LeftUpLeg.scale","times":[0],"values":[1,1.0000003576278687,0.9999999403953552],"type":"vector"},{"name":"LeftLeg.position","times":[0],"values":[-1.1518758169515309e-9,0.42363572120666504,-1.2649498337680143e-8],"type":"vector"},{"name":"LeftLeg.quaternion","times":[0],"values":[-0.09699910134077072,0.012138101272284985,-0.01620997115969658,0.995078444480896],"type":"quaternion"},{"name":"LeftLeg.scale","times":[0],"values":[0.9999998211860657,0.9999999403953552,1],"type":"vector"},{"name":"LeftFoot.position","times":[0],"values":[4.9040064453720333e-8,0.449582040309906,-2.009827504423356e-8],"type":"vector"},{"name":"LeftFoot.quaternion","times":[0],"values":[0.5461446046829224,-0.13326583802700043,0.00580661790445447,0.8270021677017212],"type":"quaternion"},{"name":"LeftFoot.scale","times":[0],"values":[0.9999998807907104,0.9999997019767761,0.9999999403953552],"type":"vector"},{"name":"LeftToeBase.position","times":[0],"values":[-7.456774753222817e-9,0.155905619263649,4.268529707474045e-8],"type":"vector"},{"name":"LeftToeBase.quaternion","times":[0],"values":[0.27553632855415344,0.001503920997492969,-0.005248375702649355,0.9612751603126526],"type":"quaternion"},{"name":"LeftToeBase.scale","times":[0],"values":[0.9999999403953552,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"RightUpLeg.position","times":[0],"values":[-0.08970773965120316,-0.03391169011592865,0.0004127086140215397],"type":"vector"},{"name":"RightUpLeg.quaternion","times":[0],"values":[-0.17017285525798798,-0.060363732278347015,0.9824117422103882,0.04758844152092934],"type":"quaternion"},{"name":"RightUpLeg.scale","times":[0],"values":[1.0000001192092896,1.000000238418579,1],"type":"vector"},{"name":"RightLeg.position","times":[0],"values":[8.161410214313491e-9,0.423635870218277,1.855397968597572e-8],"type":"vector"},{"name":"RightLeg.quaternion","times":[0],"values":[-0.02732759900391102,8.433758580395079e-7,-7.496361753567271e-9,0.9996265769004822],"type":"quaternion"},{"name":"RightLeg.scale","times":[0],"values":[1,1,1],"type":"vector"},{"name":"RightFoot.position","times":[0],"values":[1.2718579966985999e-8,0.4495818316936493,-1.3006963506256852e-8],"type":"vector"},{"name":"RightFoot.quaternion","times":[0],"values":[0.5588557124137878,0.053525812923908234,0.03843045234680176,0.8266428709030151],"type":"quaternion"},{"name":"RightFoot.scale","times":[0],"values":[0.9999998211860657,0.9999999403953552,0.9999998807907104],"type":"vector"},{"name":"RightToeBase.position","times":[0],"values":[-1.7257835160933155e-9,0.15582458674907684,1.988975739664056e-8],"type":"vector"},{"name":"RightToeBase.quaternion","times":[0],"values":[0.275579035282135,0.001447245478630066,-0.005276028532534838,0.9612628817558289],"type":"quaternion"},{"name":"RightToeBase.scale","times":[0],"values":[1,1,1],"type":"vector"}],"uuid":"e5e7b071-948f-4dc0-b635-b70a0806bcce","blendMode":2500}
\ No newline at end of file
+{"name":"av-pose1","duration":1,"tracks":[{"name":"Hips.position","times":[0,1],"values":[0.22710368037223816,0.9879486560821533,0.010035848245024681,0.22710368037223816,0.9879486560821533,0.010035848245024681],"type":"vector"},{"name":"Hips.quaternion","times":[0,1],"values":[-0.017638495191931725,-0.2722373902797699,-0.001053386484272778,0.9620679020881653,-0.017638495191931725,-0.2722373902797699,-0.001053386484272778,0.9620679020881653],"type":"quaternion"},{"name":"Hips.scale","times":[0,1],"values":[1,0.9999998807907104,1,1,0.9999998807907104,1],"type":"vector"},{"name":"Spine.position","times":[0,1],"values":[-7.683410352399278e-9,0.08465532213449478,9.442105763923792e-9,-7.683410352399278e-9,0.08465532213449478,9.442105763923792e-9],"type":"vector"},{"name":"Spine.quaternion","times":[0,1],"values":[-0.016673505306243896,0.007150137796998024,0.0007383860065601766,0.9998351335525513,-0.016673505306243896,0.007150137796998024,0.0007383860065601766,0.9998351335525513],"type":"quaternion"},{"name":"Spine.scale","times":[0,1],"values":[1.0000001192092896,1,1,1.0000001192092896,1,1],"type":"vector"},{"name":"Spine1.position","times":[0,1],"values":[2.6484450188490882e-9,0.12686902284622192,4.62640947773707e-9,2.6484450188490882e-9,0.12686902284622192,4.62640947773707e-9],"type":"vector"},{"name":"Spine1.quaternion","times":[0,1],"values":[-0.011865307576954365,-0.015601061284542084,0.0016731475479900837,0.9998064637184143,-0.011865307576954365,-0.015601061284542084,0.0016731475479900837,0.9998064637184143],"type":"quaternion"},{"name":"Spine1.scale","times":[0,1],"values":[0.9999998807907104,0.9999998807907104,0.9999997615814209,0.9999998807907104,0.9999998807907104,0.9999997615814209],"type":"vector"},{"name":"Spine2.position","times":[0,1],"values":[1.2111589953178736e-8,0.1697169840335846,1.0165318364840914e-8,1.2111589953178736e-8,0.1697169840335846,1.0165318364840914e-8],"type":"vector"},{"name":"Spine2.quaternion","times":[0,1],"values":[-0.018228936940431595,-0.027748625725507736,-0.0003906515776179731,0.9994486570358276,-0.018228936940431595,-0.027748625725507736,-0.0003906515776179731,0.9994486570358276],"type":"quaternion"},{"name":"Spine2.scale","times":[0,1],"values":[1.0000001192092896,0.9999998211860657,1,1.0000001192092896,0.9999998211860657,1],"type":"vector"},{"name":"Neck.position","times":[0,1],"values":[2.6091679927731093e-8,0.1833627074956894,-4.713934487199367e-8,2.6091679927731093e-8,0.1833627074956894,-4.713934487199367e-8],"type":"vector"},{"name":"Neck.quaternion","times":[0,1],"values":[0.2021181285381317,0.018318748101592064,-0.014682899229228497,0.9790797233581543,0.2021181285381317,0.018318748101592064,-0.014682899229228497,0.9790797233581543],"type":"quaternion"},{"name":"Neck.scale","times":[0,1],"values":[1.0000001192092896,1.0000001192092896,1,1.0000001192092896,1.0000001192092896,1],"type":"vector"},{"name":"Head.position","times":[0,1],"values":[3.488684541252951e-8,0.11675456911325455,2.269680621225234e-8,3.488684541252951e-8,0.11675456911325455,2.269680621225234e-8],"type":"vector"},{"name":"Head.quaternion","times":[0,1],"values":[-0.0508711002767086,0.1575472205877304,-0.02741112932562828,0.9858193397521973,-0.0508711002767086,0.1575472205877304,-0.02741112932562828,0.9858193397521973],"type":"quaternion"},{"name":"Head.scale","times":[0,1],"values":[1,1,1,1,1,1],"type":"vector"},{"name":"LeftShoulder.position","times":[0,1],"values":[0.0462932325899601,0.1546010673046112,0.004505448509007692,0.0462932325899601,0.1546010673046112,0.004505448509007692],"type":"vector"},{"name":"LeftShoulder.quaternion","times":[0,1],"values":[0.571010410785675,0.4496723413467407,-0.5457017421722412,0.4170748293399811,0.571010410785675,0.4496723413467407,-0.5457017421722412,0.4170748293399811],"type":"quaternion"},{"name":"LeftShoulder.scale","times":[0,1],"values":[0.9999998211860657,0.9999998211860657,1,0.9999998211860657,0.9999998211860657,1],"type":"vector"},{"name":"LeftArm.position","times":[0,1],"values":[-2.534388698904877e-8,0.13761229813098907,-3.885594423991279e-8,-2.534388698904877e-8,0.13761229813098907,-3.885594423991279e-8],"type":"vector"},{"name":"LeftArm.quaternion","times":[0,1],"values":[0.5412200689315796,0.11190522462129593,-0.010658721439540386,0.8333333134651184,0.5412200689315796,0.11190522462129593,-0.010658721439540386,0.8333333134651184],"type":"quaternion"},{"name":"LeftArm.scale","times":[0,1],"values":[1,1,0.9999999403953552,1,1,0.9999999403953552],"type":"vector"},{"name":"LeftForeArm.position","times":[0,1],"values":[-2.6180792644936446e-8,0.2531951665878296,1.5928540264553703e-8,-2.6180792644936446e-8,0.2531951665878296,1.5928540264553703e-8],"type":"vector"},{"name":"LeftForeArm.quaternion","times":[0,1],"values":[0.01980099268257618,0.02451196499168873,0.14334224164485931,0.9891713857650757,0.01980099268257618,0.02451196499168873,0.14334224164485931,0.9891713857650757],"type":"quaternion"},{"name":"LeftForeArm.scale","times":[0,1],"values":[0.9999998211860657,0.9999998807907104,0.9999999403953552,0.9999998211860657,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"LeftHand.position","times":[0,1],"values":[-1.3397167819562128e-8,0.27483826875686646,-3.7470584857146605e-8,-1.3397167819562128e-8,0.27483826875686646,-3.7470584857146605e-8],"type":"vector"},{"name":"LeftHand.quaternion","times":[0,1],"values":[-0.009855138137936592,-0.00895487517118454,-0.028931016102433205,0.9994927048683167,-0.009855138137936592,-0.00895487517118454,-0.028931016102433205,0.9994927048683167],"type":"quaternion"},{"name":"LeftHand.scale","times":[0,1],"values":[0.9999999403953552,1.0000001192092896,1,0.9999999403953552,1.0000001192092896,1],"type":"vector"},{"name":"LeftHandThumb1.position","times":[0,1],"values":[-0.020194295793771744,0.03266836702823639,0.009225639514625072,-0.020194295793771744,0.03266836702823639,0.009225639514625072],"type":"vector"},{"name":"LeftHandThumb1.quaternion","times":[0,1],"values":[0.09660612791776657,0.04760229215025902,0.3425404727458954,0.9333099126815796,0.09660612791776657,0.04760229215025902,0.3425404727458954,0.9333099126815796],"type":"quaternion"},{"name":"LeftHandThumb1.scale","times":[0,1],"values":[1,0.9999999403953552,1,1,0.9999999403953552,1],"type":"vector"},{"name":"LeftHandThumb2.position","times":[0,1],"values":[-1.6634176347452012e-7,0.027922755107283592,-1.0778523318322186e-7,-1.6634176347452012e-7,0.027922755107283592,-1.0778523318322186e-7],"type":"vector"},{"name":"LeftHandThumb2.quaternion","times":[0,1],"values":[0.046138521283864975,-0.00566489715129137,-0.3986840546131134,0.915909469127655,0.046138521283864975,-0.00566489715129137,-0.3986840546131134,0.915909469127655],"type":"quaternion"},{"name":"LeftHandThumb2.scale","times":[0,1],"values":[1,1,0.9999998807907104,1,1,0.9999998807907104],"type":"vector"},{"name":"LeftHandThumb3.position","times":[0,1],"values":[-2.909264829042968e-9,0.02590855211019516,5.975656591772349e-8,-2.909264829042968e-9,0.02590855211019516,5.975656591772349e-8],"type":"vector"},{"name":"LeftHandThumb3.quaternion","times":[0,1],"values":[-0.02691243216395378,0.009485953487455845,0.0307578444480896,0.9991194605827332,-0.02691243216395378,0.009485953487455845,0.0307578444480896,0.9991194605827332],"type":"quaternion"},{"name":"LeftHandThumb3.scale","times":[0,1],"values":[0.9999999403953552,1,1.0000001192092896,0.9999999403953552,1,1.0000001192092896],"type":"vector"},{"name":"LeftHandIndex1.position","times":[0,1],"values":[-0.02058575488626957,0.07845994085073471,-0.002534119412302971,-0.02058575488626957,0.07845994085073471,-0.002534119412302971],"type":"vector"},{"name":"LeftHandIndex1.quaternion","times":[0,1],"values":[0.09431245177984238,-0.02144789882004261,-0.021314701065421104,0.9950833320617676,0.09431245177984238,-0.02144789882004261,-0.021314701065421104,0.9950833320617676],"type":"quaternion"},{"name":"LeftHandIndex1.scale","times":[0,1],"values":[1.0000001192092896,1,1.000000238418579,1.0000001192092896,1,1.000000238418579],"type":"vector"},{"name":"LeftHandIndex2.position","times":[0,1],"values":[5.422855053893727e-9,0.03837945684790611,2.6089105631399434e-7,5.422855053893727e-9,0.03837945684790611,2.6089105631399434e-7],"type":"vector"},{"name":"LeftHandIndex2.quaternion","times":[0,1],"values":[0.1484101563692093,0.010814904235303402,-0.0025952341966331005,0.9888633489608765,0.1484101563692093,0.010814904235303402,-0.0025952341966331005,0.9888633489608765],"type":"quaternion"},{"name":"LeftHandIndex2.scale","times":[0,1],"values":[1,0.9999999403953552,1,1,0.9999999403953552,1],"type":"vector"},{"name":"LeftHandIndex3.position","times":[0,1],"values":[-5.087942955839253e-9,0.02156774140894413,-1.205587238928274e-7,-5.087942955839253e-9,0.02156774140894413,-1.205587238928274e-7],"type":"vector"},{"name":"LeftHandIndex3.quaternion","times":[0,1],"values":[0.15660452842712402,0.004280957859009504,-0.005098668858408928,0.9876389503479004,0.15660452842712402,0.004280957859009504,-0.005098668858408928,0.9876389503479004],"type":"quaternion"},{"name":"LeftHandIndex3.scale","times":[0,1],"values":[0.9999998807907104,0.9999999403953552,1,0.9999998807907104,0.9999999403953552,1],"type":"vector"},{"name":"LeftHandMiddle1.position","times":[0,1],"values":[-0.0018829249311238527,0.0817376896739006,-0.0046820626594126225,-0.0018829249311238527,0.0817376896739006,-0.0046820626594126225],"type":"vector"},{"name":"LeftHandMiddle1.quaternion","times":[0,1],"values":[0.17893840372562408,-0.032650575041770935,-0.1056300699710846,0.9776284098625183,0.17893840372562408,-0.032650575041770935,-0.1056300699710846,0.9776284098625183],"type":"quaternion"},{"name":"LeftHandMiddle1.scale","times":[0,1],"values":[0.9999999403953552,1.0000001192092896,1.0000001192092896,0.9999999403953552,1.0000001192092896,1.0000001192092896],"type":"vector"},{"name":"LeftHandMiddle2.position","times":[0,1],"values":[5.322894125470157e-8,0.04397998005151749,2.8703411203423457e-7,5.322894125470157e-8,0.04397998005151749,2.8703411203423457e-7],"type":"vector"},{"name":"LeftHandMiddle2.quaternion","times":[0,1],"values":[0.18954485654830933,0.005539071746170521,-0.005852672271430492,0.9818390011787415,0.18954485654830933,0.005539071746170521,-0.005852672271430492,0.9818390011787415],"type":"quaternion"},{"name":"LeftHandMiddle2.scale","times":[0,1],"values":[1,0.9999999403953552,0.9999999403953552,1,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"LeftHandMiddle3.position","times":[0,1],"values":[-4.759123317654712e-9,0.022322459146380424,-1.9596423328493984e-7,-4.759123317654712e-9,0.022322459146380424,-1.9596423328493984e-7],"type":"vector"},{"name":"LeftHandMiddle3.quaternion","times":[0,1],"values":[0.13216321170330048,0.0032556846272200346,-0.004002028610557318,0.9912145733833313,0.13216321170330048,0.0032556846272200346,-0.004002028610557318,0.9912145733833313],"type":"quaternion"},{"name":"LeftHandMiddle3.scale","times":[0,1],"values":[0.9999999403953552,1,1,0.9999999403953552,1,1],"type":"vector"},{"name":"LeftHandRing1.position","times":[0,1],"values":[0.018368063494563103,0.08156660944223404,-0.002380664460361004,0.018368063494563103,0.08156660944223404,-0.002380664460361004],"type":"vector"},{"name":"LeftHandRing1.quaternion","times":[0,1],"values":[0.22309152781963348,-0.07349289208650589,-0.11858632415533066,0.964762270450592,0.22309152781963348,-0.07349289208650589,-0.11858632415533066,0.964762270450592],"type":"quaternion"},{"name":"LeftHandRing1.scale","times":[0,1],"values":[0.9999999403953552,1,1,0.9999999403953552,1,1],"type":"vector"},{"name":"LeftHandRing2.position","times":[0,1],"values":[-1.953001493859574e-8,0.034330740571022034,-6.268609520354573e-10,-1.953001493859574e-8,0.034330740571022034,-6.268609520354573e-10],"type":"vector"},{"name":"LeftHandRing2.quaternion","times":[0,1],"values":[0.16470664739608765,0.005326032172888517,0.0020931288599967957,0.9863260388374329,0.16470664739608765,0.005326032172888517,0.0020931288599967957,0.9863260388374329],"type":"quaternion"},{"name":"LeftHandRing2.scale","times":[0,1],"values":[1,0.9999998807907104,0.9999999403953552,1,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"LeftHandRing3.position","times":[0,1],"values":[7.902550436256206e-8,0.022869953885674477,-6.393820939365469e-8,7.902550436256206e-8,0.022869953885674477,-6.393820939365469e-8],"type":"vector"},{"name":"LeftHandRing3.quaternion","times":[0,1],"values":[0.30609163641929626,0.010189606808125973,-0.004974913317710161,0.9519345164299011,0.30609163641929626,0.010189606808125973,-0.004974913317710161,0.9519345164299011],"type":"quaternion"},{"name":"LeftHandRing3.scale","times":[0,1],"values":[0.9999999403953552,0.9999999403953552,0.9999999403953552,0.9999999403953552,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"LeftHandPinky1.position","times":[0,1],"values":[0.03241877257823944,0.07114378362894058,0.001523372600786388,0.03241877257823944,0.07114378362894058,0.001523372600786388],"type":"vector"},{"name":"LeftHandPinky1.quaternion","times":[0,1],"values":[0.17989295721054077,-0.057033970952034,-0.09700494259595871,0.977228581905365,0.17989295721054077,-0.057033970952034,-0.09700494259595871,0.977228581905365],"type":"quaternion"},{"name":"LeftHandPinky1.scale","times":[0,1],"values":[0.9999999403953552,1,1,0.9999999403953552,1,1],"type":"vector"},{"name":"LeftHandPinky2.position","times":[0,1],"values":[-8.806433804409153e-9,0.027698123827576637,5.636472906189738e-7,-8.806433804409153e-9,0.027698123827576637,5.636472906189738e-7],"type":"vector"},{"name":"LeftHandPinky2.quaternion","times":[0,1],"values":[0.09287857264280319,0.006804470904171467,-0.03585001081228256,0.9950085878372192,0.09287857264280319,0.006804470904171467,-0.03585001081228256,0.9950085878372192],"type":"quaternion"},{"name":"LeftHandPinky2.scale","times":[0,1],"values":[0.9999997019767761,1,0.9999999403953552,0.9999997019767761,1,0.9999999403953552],"type":"vector"},{"name":"LeftHandPinky3.position","times":[0,1],"values":[3.627158662311558e-8,0.018653014674782753,1.2276649385967175e-7,3.627158662311558e-8,0.018653014674782753,1.2276649385967175e-7],"type":"vector"},{"name":"LeftHandPinky3.quaternion","times":[0,1],"values":[0.3026178181171417,0.03352458029985428,0.007893020287156105,0.9524894952774048,0.3026178181171417,0.03352458029985428,0.007893020287156105,0.9524894952774048],"type":"quaternion"},{"name":"LeftHandPinky3.scale","times":[0,1],"values":[0.9999998211860657,0.9999998807907104,1,0.9999998211860657,0.9999998807907104,1],"type":"vector"},{"name":"RightShoulder.position","times":[0,1],"values":[-0.046316973865032196,0.15459416806697845,0.004504240117967129,-0.046316973865032196,0.15459416806697845,0.004504240117967129],"type":"vector"},{"name":"RightShoulder.quaternion","times":[0,1],"values":[0.5896373391151428,-0.4582756757736206,0.5385028123855591,0.3902895152568817,0.5896373391151428,-0.4582756757736206,0.5385028123855591,0.3902895152568817],"type":"quaternion"},{"name":"RightShoulder.scale","times":[0,1],"values":[0.9999998807907104,1,1,0.9999998807907104,1,1],"type":"vector"},{"name":"RightArm.position","times":[0,1],"values":[-1.0961487717509044e-8,0.13761229813098907,1.5495676564114547e-7,-1.0961487717509044e-8,0.13761229813098907,1.5495676564114547e-7],"type":"vector"},{"name":"RightArm.quaternion","times":[0,1],"values":[0.5275523066520691,-0.07642792165279388,0.022038761526346207,0.8457905650138855,0.5275523066520691,-0.07642792165279388,0.022038761526346207,0.8457905650138855],"type":"quaternion"},{"name":"RightArm.scale","times":[0,1],"values":[0.9999998807907104,0.9999998807907104,0.9999998211860657,0.9999998807907104,0.9999998807907104,0.9999998211860657],"type":"vector"},{"name":"RightForeArm.position","times":[0,1],"values":[-4.7634611810565275e-9,0.25319498777389526,1.658282222649632e-8,-4.7634611810565275e-9,0.25319498777389526,1.658282222649632e-8],"type":"vector"},{"name":"RightForeArm.quaternion","times":[0,1],"values":[0.00598891219124198,0.00556867616251111,-0.10757777839899063,0.9941630363464355,0.00598891219124198,0.00556867616251111,-0.10757777839899063,0.9941630363464355],"type":"quaternion"},{"name":"RightForeArm.scale","times":[0,1],"values":[0.9999999403953552,0.9999998211860657,0.9999998211860657,0.9999999403953552,0.9999998211860657,0.9999998211860657],"type":"vector"},{"name":"RightHand.position","times":[0,1],"values":[-8.985546529061139e-9,0.2748381793498993,-1.2352863620890275e-7,-8.985546529061139e-9,0.2748381793498993,-1.2352863620890275e-7],"type":"vector"},{"name":"RightHand.quaternion","times":[0,1],"values":[0.05968368053436279,-0.1474071890115738,0.08935597538948059,0.9832214713096619,0.05968368053436279,-0.1474071890115738,0.08935597538948059,0.9832214713096619],"type":"quaternion"},{"name":"RightHand.scale","times":[0,1],"values":[1.0000001192092896,0.9999998211860657,0.9999999403953552,1.0000001192092896,0.9999998211860657,0.9999999403953552],"type":"vector"},{"name":"RightHandThumb1.position","times":[0,1],"values":[0.02019430324435234,0.03266853466629982,0.009225426241755486,0.02019430324435234,0.03266853466629982,0.009225426241755486],"type":"vector"},{"name":"RightHandThumb1.quaternion","times":[0,1],"values":[0.050914466381073,-0.030817843973636627,-0.34445637464523315,0.9369139671325684,0.050914466381073,-0.030817843973636627,-0.34445637464523315,0.9369139671325684],"type":"quaternion"},{"name":"RightHandThumb1.scale","times":[0,1],"values":[1,1,1,1,1,1],"type":"vector"},{"name":"RightHandThumb2.position","times":[0,1],"values":[2.9665683243251806e-8,0.027922801673412323,1.1995524573649163e-7,2.9665683243251806e-8,0.027922801673412323,1.1995524573649163e-7],"type":"vector"},{"name":"RightHandThumb2.quaternion","times":[0,1],"values":[0.04613921046257019,0.00566446827724576,0.3986843526363373,0.9159093499183655,0.04613921046257019,0.00566446827724576,0.3986843526363373,0.9159093499183655],"type":"quaternion"},{"name":"RightHandThumb2.scale","times":[0,1],"values":[1,1.0000001192092896,0.9999999403953552,1,1.0000001192092896,0.9999999403953552],"type":"vector"},{"name":"RightHandThumb3.position","times":[0,1],"values":[1.7185186607093783e-8,0.025908594951033592,1.3586934244358417e-7,1.7185186607093783e-8,0.025908594951033592,1.3586934244358417e-7],"type":"vector"},{"name":"RightHandThumb3.quaternion","times":[0,1],"values":[-0.02690984681248665,-0.009485946036875248,-0.03075776994228363,0.9991195201873779,-0.02690984681248665,-0.009485946036875248,-0.03075776994228363,0.9991195201873779],"type":"quaternion"},{"name":"RightHandThumb3.scale","times":[0,1],"values":[0.9999998807907104,1,1,0.9999998807907104,1,1],"type":"vector"},{"name":"RightHandIndex1.position","times":[0,1],"values":[0.020585762336850166,0.078459732234478,-0.0025341783184558153,0.020585762336850166,0.078459732234478,-0.0025341783184558153],"type":"vector"},{"name":"RightHandIndex1.quaternion","times":[0,1],"values":[0.09431198984384537,0.021447984501719475,0.02131461165845394,0.9950833320617676,0.09431198984384537,0.021447984501719475,0.02131461165845394,0.9950833320617676],"type":"quaternion"},{"name":"RightHandIndex1.scale","times":[0,1],"values":[1,1.0000001192092896,0.9999999403953552,1,1.0000001192092896,0.9999999403953552],"type":"vector"},{"name":"RightHandIndex2.position","times":[0,1],"values":[-8.751034386023093e-8,0.03837978094816208,1.1997498461369105e-7,-8.751034386023093e-8,0.03837978094816208,1.1997498461369105e-7],"type":"vector"},{"name":"RightHandIndex2.quaternion","times":[0,1],"values":[0.14841143786907196,-0.010814760811626911,0.002595363650470972,0.9888632297515869,0.14841143786907196,-0.010814760811626911,0.002595363650470972,0.9888632297515869],"type":"quaternion"},{"name":"RightHandIndex2.scale","times":[0,1],"values":[1,0.9999998807907104,0.9999999403953552,1,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"RightHandIndex3.position","times":[0,1],"values":[-2.6222313209700587e-8,0.021567661315202713,-1.573985386471577e-8,-2.6222313209700587e-8,0.021567661315202713,-1.573985386471577e-8],"type":"vector"},{"name":"RightHandIndex3.quaternion","times":[0,1],"values":[0.15660448372364044,-0.0042808325961232185,0.005098788067698479,0.9876389503479004,0.15660448372364044,-0.0042808325961232185,0.005098788067698479,0.9876389503479004],"type":"quaternion"},{"name":"RightHandIndex3.scale","times":[0,1],"values":[1,0.9999999403953552,0.9999999403953552,1,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"RightHandMiddle1.position","times":[0,1],"values":[0.0018828734755516052,0.08173748850822449,-0.00468215299770236,0.0018828734755516052,0.08173748850822449,-0.00468215299770236],"type":"vector"},{"name":"RightHandMiddle1.quaternion","times":[0,1],"values":[0.1789379119873047,0.03265073895454407,0.10563002526760101,0.9776285290718079,0.1789379119873047,0.03265073895454407,0.10563002526760101,0.9776285290718079],"type":"quaternion"},{"name":"RightHandMiddle1.scale","times":[0,1],"values":[1.0000001192092896,1.0000001192092896,1,1.0000001192092896,1.0000001192092896,1],"type":"vector"},{"name":"RightHandMiddle2.position","times":[0,1],"values":[-1.410089200959419e-8,0.04398008808493614,3.9500721982221876e-7,-1.410089200959419e-8,0.04398008808493614,3.9500721982221876e-7],"type":"vector"},{"name":"RightHandMiddle2.quaternion","times":[0,1],"values":[0.1895465850830078,-0.005538972094655037,0.005852727685123682,0.9818387031555176,0.1895465850830078,-0.005538972094655037,0.005852727685123682,0.9818387031555176],"type":"quaternion"},{"name":"RightHandMiddle2.scale","times":[0,1],"values":[0.9999999403953552,1,1,0.9999999403953552,1,1],"type":"vector"},{"name":"RightHandMiddle3.position","times":[0,1],"values":[-2.1873672650940534e-8,0.022322187200188637,3.501811463024751e-8,-2.1873672650940534e-8,0.022322187200188637,3.501811463024751e-8],"type":"vector"},{"name":"RightHandMiddle3.quaternion","times":[0,1],"values":[0.2491811215877533,-0.0027561564929783344,0.0043609910644590855,0.9684431552886963,0.2491811215877533,-0.0027561564929783344,0.0043609910644590855,0.9684431552886963],"type":"quaternion"},{"name":"RightHandMiddle3.scale","times":[0,1],"values":[1,0.9999999403953552,0.9999999403953552,1,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"RightHandRing1.position","times":[0,1],"values":[-0.018368078395724297,0.08156631886959076,-0.0023807475809007883,-0.018368078395724297,0.08156631886959076,-0.0023807475809007883],"type":"vector"},{"name":"RightHandRing1.quaternion","times":[0,1],"values":[0.2230934500694275,0.07349297404289246,0.11858633160591125,0.9647618532180786,0.2230934500694275,0.07349297404289246,0.11858633160591125,0.9647618532180786],"type":"quaternion"},{"name":"RightHandRing1.scale","times":[0,1],"values":[1,1.0000001192092896,1,1,1.0000001192092896,1],"type":"vector"},{"name":"RightHandRing2.position","times":[0,1],"values":[-3.5898210626328364e-8,0.03433087468147278,-2.38709958466643e-7,-3.5898210626328364e-8,0.03433087468147278,-2.38709958466643e-7],"type":"vector"},{"name":"RightHandRing2.quaternion","times":[0,1],"values":[0.16470608115196228,-0.005325973965227604,-0.0020930322352796793,0.9863260984420776,0.16470608115196228,-0.005325973965227604,-0.0020930322352796793,0.9863260984420776],"type":"quaternion"},{"name":"RightHandRing2.scale","times":[0,1],"values":[1,1,1,1,1,1],"type":"vector"},{"name":"RightHandRing3.position","times":[0,1],"values":[1.093457857592739e-8,0.022869912907481194,5.304719863374885e-8,1.093457857592739e-8,0.022869912907481194,5.304719863374885e-8],"type":"vector"},{"name":"RightHandRing3.quaternion","times":[0,1],"values":[0.3060915768146515,-0.010189698077738285,0.004974923096597195,0.9519345164299011,0.3060915768146515,-0.010189698077738285,0.004974923096597195,0.9519345164299011],"type":"quaternion"},{"name":"RightHandRing3.scale","times":[0,1],"values":[1,1.000000238418579,1,1,1.000000238418579,1],"type":"vector"},{"name":"RightHandPinky1.position","times":[0,1],"values":[-0.03241875395178795,0.07114369422197342,0.0015233675949275494,-0.03241875395178795,0.07114369422197342,0.0015233675949275494],"type":"vector"},{"name":"RightHandPinky1.quaternion","times":[0,1],"values":[0.1798933446407318,0.05703401565551758,0.0970044806599617,0.977228581905365,0.1798933446407318,0.05703401565551758,0.0970044806599617,0.977228581905365],"type":"quaternion"},{"name":"RightHandPinky1.scale","times":[0,1],"values":[0.9999999403953552,0.9999999403953552,0.9999999403953552,0.9999999403953552,0.9999999403953552,0.9999999403953552],"type":"vector"},{"name":"RightHandPinky2.position","times":[0,1],"values":[3.878068355334108e-8,0.027698198333382607,4.980245194019517e-7,3.878068355334108e-8,0.027698198333382607,4.980245194019517e-7],"type":"vector"},{"name":"RightHandPinky2.quaternion","times":[0,1],"values":[0.09287756681442261,-0.006804333068430424,0.03585046902298927,0.995008647441864,0.09287756681442261,-0.006804333068430424,0.03585046902298927,0.995008647441864],"type":"quaternion"},{"name":"RightHandPinky2.scale","times":[0,1],"values":[0.9999998807907104,1,0.9999998807907104,0.9999998807907104,1,0.9999998807907104],"type":"vector"},{"name":"RightHandPinky3.position","times":[0,1],"values":[-1.7610352287533715e-8,0.018653109669685364,-1.4471804377080844e-7,-1.7610352287533715e-8,0.018653109669685364,-1.4471804377080844e-7],"type":"vector"},{"name":"RightHandPinky3.quaternion","times":[0,1],"values":[0.3026178181171417,-0.03352457657456398,-0.007893037982285023,0.9524895548820496,0.3026178181171417,-0.03352457657456398,-0.007893037982285023,0.9524895548820496],"type":"quaternion"},{"name":"RightHandPinky3.scale","times":[0,1],"values":[0.9999998211860657,0.9999998807907104,0.9999998807907104,0.9999998211860657,0.9999998807907104,0.9999998807907104],"type":"vector"},{"name":"LeftUpLeg.position","times":[0,1],"values":[0.08899363875389099,-0.033911626785993576,0.00041269176290370524,0.08899363875389099,-0.033911626785993576,0.00041269176290370524],"type":"vector"},{"name":"LeftUpLeg.quaternion","times":[0,1],"values":[0.00033979941508732736,-0.016199136152863503,-0.9985584616661072,0.051171451807022095,0.00033979941508732736,-0.016199136152863503,-0.9985584616661072,0.051171451807022095],"type":"quaternion"},{"name":"LeftUpLeg.scale","times":[0,1],"values":[1,1.0000003576278687,0.9999999403953552,1,1.0000003576278687,0.9999999403953552],"type":"vector"},{"name":"LeftLeg.position","times":[0,1],"values":[-1.1518758169515309e-9,0.42363572120666504,-1.2649498337680143e-8,-1.1518758169515309e-9,0.42363572120666504,-1.2649498337680143e-8],"type":"vector"},{"name":"LeftLeg.quaternion","times":[0,1],"values":[-0.09699910134077072,0.012138101272284985,-0.01620997115969658,0.995078444480896,-0.09699910134077072,0.012138101272284985,-0.01620997115969658,0.995078444480896],"type":"quaternion"},{"name":"LeftLeg.scale","times":[0,1],"values":[0.9999998211860657,0.9999999403953552,1,0.9999998211860657,0.9999999403953552,1],"type":"vector"},{"name":"LeftFoot.position","times":[0,1],"values":[4.9040064453720333e-8,0.449582040309906,-2.009827504423356e-8,4.9040064453720333e-8,0.449582040309906,-2.009827504423356e-8],"type":"vector"},{"name":"LeftFoot.quaternion","times":[0,1],"values":[0.5461446046829224,-0.13326583802700043,0.00580661790445447,0.8270021677017212,0.5461446046829224,-0.13326583802700043,0.00580661790445447,0.8270021677017212],"type":"quaternion"},{"name":"LeftFoot.scale","times":[0,1],"values":[0.9999998807907104,0.9999997019767761,0.9999999403953552,0.9999998807907104,0.9999997019767761,0.9999999403953552],"type":"vector"},{"name":"LeftToeBase.position","times":[0,1],"values":[-7.456774753222817e-9,0.155905619263649,4.268529707474045e-8,-7.456774753222817e-9,0.155905619263649,4.268529707474045e-8],"type":"vector"},{"name":"LeftToeBase.quaternion","times":[0,1],"values":[0.27553632855415344,0.001503920997492969,-0.005248375702649355,0.9612751603126526,0.27553632855415344,0.001503920997492969,-0.005248375702649355,0.9612751603126526],"type":"quaternion"},{"name":"LeftToeBase.scale","times":[0,1],"values":[0.9999999403953552,0.9999998807907104,0.9999999403953552,0.9999999403953552,0.9999998807907104,0.9999999403953552],"type":"vector"},{"name":"RightUpLeg.position","times":[0,1],"values":[-0.08970773965120316,-0.03391169011592865,0.0004127086140215397,-0.08970773965120316,-0.03391169011592865,0.0004127086140215397],"type":"vector"},{"name":"RightUpLeg.quaternion","times":[0,1],"values":[-0.17017285525798798,-0.060363732278347015,0.9824117422103882,0.04758844152092934,-0.17017285525798798,-0.060363732278347015,0.9824117422103882,0.04758844152092934],"type":"quaternion"},{"name":"RightUpLeg.scale","times":[0,1],"values":[1.0000001192092896,1.000000238418579,1,1.0000001192092896,1.000000238418579,1],"type":"vector"},{"name":"RightLeg.position","times":[0,1],"values":[8.161410214313491e-9,0.423635870218277,1.855397968597572e-8,8.161410214313491e-9,0.423635870218277,1.855397968597572e-8],"type":"vector"},{"name":"RightLeg.quaternion","times":[0,1],"values":[-0.02732759900391102,8.433758580395079e-7,-7.496361753567271e-9,0.9996265769004822,-0.02732759900391102,8.433758580395079e-7,-7.496361753567271e-9,0.9996265769004822],"type":"quaternion"},{"name":"RightLeg.scale","times":[0,1],"values":[1,1,1,1,1,1],"type":"vector"},{"name":"RightFoot.position","times":[0,1],"values":[1.2718579966985999e-8,0.4495818316936493,-1.3006963506256852e-8,1.2718579966985999e-8,0.4495818316936493,-1.3006963506256852e-8],"type":"vector"},{"name":"RightFoot.quaternion","times":[0,1],"values":[0.5588557124137878,0.053525812923908234,0.03843045234680176,0.8266428709030151,0.5588557124137878,0.053525812923908234,0.03843045234680176,0.8266428709030151],"type":"quaternion"},{"name":"RightFoot.scale","times":[0,1],"values":[0.9999998211860657,0.9999999403953552,0.9999998807907104,0.9999998211860657,0.9999999403953552,0.9999998807907104],"type":"vector"},{"name":"RightToeBase.position","times":[0,1],"values":[-1.7257835160933155e-9,0.15582458674907684,1.988975739664056e-8,-1.7257835160933155e-9,0.15582458674907684,1.988975739664056e-8],"type":"vector"},{"name":"RightToeBase.quaternion","times":[0,1],"values":[0.275579035282135,0.001447245478630066,-0.005276028532534838,0.9612628817558289,0.275579035282135,0.001447245478630066,-0.005276028532534838,0.9612628817558289],"type":"quaternion"},{"name":"RightToeBase.scale","times":[0,1],"values":[1,1,1,1,1,1],"type":"vector"}],"uuid":"e5e7b071-948f-4dc0-b635-b70a0806bcce","blendMode":2500}
\ No newline at end of file
diff --git a/public/dashboard/portfolio-asset.html b/public/dashboard/portfolio-asset.html
index 16a1be7f3..483dc5c19 100644
--- a/public/dashboard/portfolio-asset.html
+++ b/public/dashboard/portfolio-asset.html
@@ -643,6 +643,7 @@
function openSend(asset) {
const opts = asset.holdings.map((h) => ({ value: h.agent_id, label: `${h.agent_name} · ${fmtAmt(h.amount)} ${asset.symbol}`, address: h.address }));
if (!opts.length) return;
+ const placeholder = asset.chain === 'solana' ? 'Solana address or yourname.sol' : '0x…';
openModal(`
<h3>Send ${escapeHtml(asset.symbol)}</h3>
<p class="sub">${chainLabel(asset.chain)}</p>
@@ -650,8 +651,9 @@
<label><span>From wallet</span>
<select name="agent_id">${opts.map((o) => `<option value="${escapeHtml(o.value)}">${escapeHtml(o.label)}</option>`).join('')}</select>
</label>
- <label><span>Recipient address</span>
- <input name="recipient" data-mono required placeholder="${asset.chain === 'solana' ? 'Solana address (base58)' : '0x…'}" />
+ <label><span>Recipient${asset.chain === 'solana' ? ' address or .sol name' : ' address'}</span>
+ <input name="recipient" data-mono required placeholder="${placeholder}" autocomplete="off" spellcheck="false" />
+ <small id="recipient-resolved" class="muted" style="display:none;margin-top:6px;font-family:ui-monospace,monospace;font-size:11.5px;word-break:break-all"></small>
</label>
<label><span>Amount</span>
<input name="amount" inputmode="decimal" required placeholder="0.0" pattern="[0-9]*\\.?[0-9]*" />
@@ -664,7 +666,59 @@
</form>
`, () => {
$$('cancel').onclick = closeModal;
- $$('send-form').addEventListener('submit', (e) => onSendSubmit(e, asset));
+ const form = $$('send-form');
+ form.addEventListener('submit', (e) => onSendSubmit(e, asset));
+ if (asset.chain === 'solana') {
+ const input = form.querySelector('input[name="recipient"]');
+ const status = $$('recipient-resolved');
+ attachSnsTypeahead(input, status);
+ }
+ });
+ }
+
+ const SOL_NAME_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*(?:\.sol)?$/i;
+ const SOL_ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+ function attachSnsTypeahead(input, status) {
+ let seq = 0;
+ function setStatus(kind, text) {
+ status.style.display = text ? '' : 'none';
+ status.textContent = text || '';
+ status.style.color = kind === 'ok'
+ ? '#7be07b'
+ : kind === 'warn'
+ ? '#ff9a9a'
+ : 'var(--muted)';
+ }
+ async function lookup(name) {
+ const myId = ++seq;
+ try {
+ const r = await fetch(`/api/sns?name=${encodeURIComponent(name)}`);
+ if (myId !== seq) return;
+ if (r.status === 404) { setStatus('warn', `${name} does not resolve`); return; }
+ if (!r.ok) {
+ const j = await r.json().catch(() => ({}));
+ setStatus('warn', j.error_description || `lookup failed (${r.status})`);
+ return;
+ }
+ const { data } = await r.json();
+ if (myId !== seq) return;
+ setStatus('ok', `→ ${data.address}`);
+ } catch (err) {
+ if (myId === seq) setStatus('warn', err.message || 'lookup failed');
+ }
+ }
+ input.addEventListener('input', () => {
+ const raw = input.value.trim();
+ seq++;
+ if (!raw) { setStatus('', ''); return; }
+ if (SOL_ADDR_RE.test(raw)) { setStatus('', ''); return; }
+ if (/\.sol$/i.test(raw) || (SOL_NAME_RE.test(raw) && !SOL_ADDR_RE.test(raw))) {
+ setStatus('', 'Resolving .sol…');
+ const myId = seq;
+ setTimeout(() => { if (myId === seq) lookup(raw); }, 300);
+ return;
+ }
+ setStatus('warn', 'Not a valid Solana address or .sol name');
});
}
diff --git a/public/dashboard/portfolio.html b/public/dashboard/portfolio.html
index 9651886c8..ed8ae4323 100644
--- a/public/dashboard/portfolio.html
+++ b/public/dashboard/portfolio.html
@@ -837,6 +837,7 @@
const id = t.mint || t.contract;
if (id) assets.push({ value: id, label: t.symbol });
}
+ const placeholder = w.chain === 'solana' ? 'Solana address or yourname.sol' : '0x…';
openModal(`
<h3>Send from ${escapeHtml(w.agent_name)}</h3>
<p class="sub">${chainLabel(w.chain, w.chain_id)} · ${shortAddr(w.address)}</p>
@@ -844,8 +845,9 @@
<label><span>Asset</span>
<select name="asset">${assets.map((a) => `<option value="${escapeHtml(a.value)}">${escapeHtml(a.label)}</option>`).join('')}</select>
</label>
- <label><span>Recipient address</span>
- <input name="recipient" data-mono required placeholder="${w.chain === 'solana' ? 'Solana address (base58)' : '0x…'}" />
+ <label><span>Recipient${w.chain === 'solana' ? ' address or .sol name' : ' address'}</span>
+ <input name="recipient" data-mono required placeholder="${placeholder}" autocomplete="off" spellcheck="false" />
+ <small id="recipient-resolved" class="muted" style="display:none;margin-top:6px;font-family:ui-monospace,monospace;font-size:11.5px;word-break:break-all"></small>
</label>
<label><span>Amount</span>
<input name="amount" inputmode="decimal" required placeholder="0.0" pattern="[0-9]*\\.?[0-9]*" />
@@ -858,7 +860,62 @@
</form>
`, () => {
$('cancel').onclick = closeModal;
- $('send-form').addEventListener('submit', (e) => onSendSubmit(e, w));
+ const form = $('send-form');
+ form.addEventListener('submit', (e) => onSendSubmit(e, w));
+ if (w.chain === 'solana') {
+ const input = form.querySelector('input[name="recipient"]');
+ const status = $('recipient-resolved');
+ attachSnsTypeahead(input, status);
+ }
+ });
+ }
+
+ // Solana recipient typeahead. Shows resolved address inline as the user
+ // types a .sol name. The backend also resolves server-side so this is
+ // only for UX; we don't block submit on it.
+ const SOL_NAME_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*(?:\.sol)?$/i;
+ const SOL_ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+ function attachSnsTypeahead(input, status) {
+ let seq = 0;
+ function setStatus(kind, text) {
+ status.style.display = text ? '' : 'none';
+ status.textContent = text || '';
+ status.style.color = kind === 'ok'
+ ? '#7be07b'
+ : kind === 'warn'
+ ? '#ff9a9a'
+ : 'var(--muted)';
+ }
+ async function lookup(name) {
+ const myId = ++seq;
+ try {
+ const r = await fetch(`/api/sns?name=${encodeURIComponent(name)}`);
+ if (myId !== seq) return;
+ if (r.status === 404) { setStatus('warn', `${name} does not resolve`); return; }
+ if (!r.ok) {
+ const j = await r.json().catch(() => ({}));
+ setStatus('warn', j.error_description || `lookup failed (${r.status})`);
+ return;
+ }
+ const { data } = await r.json();
+ if (myId !== seq) return;
+ setStatus('ok', `→ ${data.address}`);
+ } catch (err) {
+ if (myId === seq) setStatus('warn', err.message || 'lookup failed');
+ }
+ }
+ input.addEventListener('input', () => {
+ const raw = input.value.trim();
+ seq++;
+ if (!raw) { setStatus('', ''); return; }
+ if (SOL_ADDR_RE.test(raw)) { setStatus('', ''); return; }
+ if (/\.sol$/i.test(raw) || (SOL_NAME_RE.test(raw) && !SOL_ADDR_RE.test(raw))) {
+ setStatus('', 'Resolving .sol…');
+ const myId = seq;
+ setTimeout(() => { if (myId === seq) lookup(raw); }, 300);
+ return;
+ }
+ setStatus('warn', 'Not a valid Solana address or .sol name');
});
}
diff --git a/public/demos/agents/face-mocap.html b/public/demos/agents/face-mocap.html
index 2a089a2d9..3306ae4c8 100644
--- a/public/demos/agents/face-mocap.html
+++ b/public/demos/agents/face-mocap.html
@@ -333,7 +333,7 @@
<p class="hero-sub">
MediaPipe Face Landmarker reads 478 landmarks and 52 ARKit blendshapes
every frame, one-euro filtered, calibrated to your neutral pose, and
- written straight onto an Avaturn-style rig. Record a take, replay it
+ written straight onto a rigged humanoid avatar. Record a take, replay it
on any avatar.
</p>
</div>
diff --git a/public/demos/pricing.html b/public/demos/pricing.html
index d0ac0062a..ad810f842 100644
--- a/public/demos/pricing.html
+++ b/public/demos/pricing.html
@@ -282,7 +282,7 @@
</div>
</div>
- <p class="hint">Move your mouse over a tier — she jumps over and points at the CTA.</p>
+ <p class="hint">Move your mouse over a tier — she walks across and points at the CTA.</p>
</div>
<canvas id="avatar-canvas"></canvas>
@@ -330,7 +330,7 @@
renderer.setSize(window.innerWidth, window.innerHeight, false);
updateFrustum();
// Re-snap to the currently-targeted tier so layout shifts don't leave her floating
- if (avatar && activeTier && phase !== 'jumping') {
+ if (avatar && activeTier && phase === 'idle') {
const t = standOnTopOf(activeTier);
gsap.killTweensOf(avatar.position);
gsap.to(avatar.position, { x: t.x, y: t.y, duration: 0.35, overwrite: true });
@@ -370,19 +370,53 @@
return domToWorld(r.left + r.width / 2, r.top + FEET_TOP_OFFSET_PX);
}
- // phase: loading | idle | jumping (declared above)
+ // phase: loading | idle | walking | jumping (declared above)
// activeTier: tier she's currently associated with (declared above)
+ let walkT = 0, walkStart = null, walkEnd = null, walkDur = 0.85;
let jumpT = 0, jumpStart = null, jumpEnd = null, jumpLift = 0;
+ const WALK_SPEED = 5; // world units per second
const JUMP_S = 0.85;
function smoothstep(t) { return t * t * (3 - 2 * t); }
- function jumpToTier(tierEl) {
- if (!avatar || tierEl === activeTier) return;
- // Visual: mark the new tier active, clear the old one
+ // Pro is the "most popular" pedestal — she leaps onto it from
+ // either neighbour for a dramatic entrance, and walks everywhere
+ // else (including stepping back down off Pro).
+ function shouldJump(fromEl, toEl) {
+ if (!fromEl || !toEl) return false;
+ const from = fromEl.dataset.tier;
+ const to = toEl.dataset.tier;
+ return (from === 'basic' && to === 'pro') ||
+ (from === 'enterprise' && to === 'pro');
+ }
+
+ function beginMove(tierEl) {
if (activeTier) activeTier.classList.remove('is-active');
activeTier = tierEl;
activeTier.classList.add('is-active');
+ }
+
+ function walkToTier(tierEl) {
+ if (!avatar || tierEl === activeTier) return;
+ beginMove(tierEl);
+
+ phase = 'walking';
+ walkT = 0;
+ walkStart = { x: avatar.position.x, y: avatar.position.y };
+ walkEnd = standOnTopOf(tierEl);
+ // Distance-based duration so short hops finish quickly and long
+ // strolls don't blur into a teleport.
+ const dx = Math.abs(walkEnd.x - walkStart.x);
+ walkDur = Math.max(0.4, dx / WALK_SPEED);
+ setAnimation('walk', { loop: true });
+ // Turn to profile so the walk cycle reads sideways toward the destination
+ const dir = Math.sign(walkEnd.x - walkStart.x) || 0;
+ gsap.to(avatar.rotation, { y: dir * (Math.PI / 2), duration: 0.25, overwrite: true });
+ }
+
+ function jumpToTier(tierEl) {
+ if (!avatar || tierEl === activeTier) return;
+ beginMove(tierEl);
phase = 'jumping';
jumpT = 0;
@@ -392,20 +426,19 @@
const dx = Math.abs(jumpEnd.x - jumpStart.x);
jumpLift = Math.max(1.2, dx * 0.32);
setAnimation('jump', { loop: false, hold: true });
- // Face direction of travel
+ // Face direction of travel — slight yaw, not full profile
const dir = Math.sign(jumpEnd.x - jumpStart.x) || 0;
gsap.to(avatar.rotation, { y: dir * 0.25, duration: 0.2, overwrite: true });
}
- // Per-tier personality. Three dramatic clips rotated across the
- // tiers so she reads as having a "vibe" on each plan:
- // falling — Mixamo "Falling" (long airborne fall, looks comedic)
- // dying — Mixamo "Dying" (collapse to ground)
+ // Per-tier personality. Two clips rotated across the tiers so she
+ // reads as having a "vibe" on each plan:
+ // walk — Mixamo "Walk" (cycles a few steps in place)
// falltolanding — Mixamo "Fall To Landing" (forward roll out of a fall)
const TIER_PERSONALITY = {
- basic: { land: 'falling', ctaClick: 'dying', settleMs: 1500 },
- pro: { land: 'dying', ctaClick: 'falltolanding', settleMs: 2000 },
- enterprise: { land: 'falltolanding', ctaClick: 'falling', settleMs: 1700 },
+ basic: { land: 'walk', ctaClick: 'falltolanding', settleMs: 1500 },
+ pro: { land: 'falltolanding', ctaClick: 'walk', settleMs: 2000 },
+ enterprise: { land: 'walk', ctaClick: 'falltolanding', settleMs: 1700 },
};
function personalityFor(tierEl) {
return TIER_PERSONALITY[tierEl?.dataset.tier] ?? TIER_PERSONALITY.basic;
@@ -415,7 +448,7 @@
// gesture from the dramatic-clip pool and play a fragment, then
// crossfade back to idle. Prevents the "frozen avatar" look
// between hovers without overpowering the idle.
- const FIDGETS = ['falling', 'dying', 'falltolanding'];
+ const FIDGETS = ['walk', 'falltolanding'];
let fidgetTimer = null;
function scheduleFidget() {
clearTimeout(fidgetTimer);
@@ -434,7 +467,10 @@
function landOnTier() {
phase = 'idle';
- avatar.position.set(jumpEnd.x, jumpEnd.y, 0);
+ // Snap to the tier's true top-edge — guards against float drift
+ // at p>=1 and any layout shift during the move.
+ const snap = standOnTopOf(activeTier);
+ avatar.position.set(snap.x, snap.y, 0);
// Card "thump" on landing — sells weight
const t = activeTier;
gsap.killTweensOf(t);
@@ -460,11 +496,11 @@
// fire. We resolve which tier the cursor is over by walking the rects
// from a single mousemove on the grid container.
//
- // Debounce: ~120ms of stable hover before committing to a jump, so
- // sweeping across tiers doesn't stack three jumps on top of each other.
+ // Debounce: ~120ms of stable hover before committing to a move, so
+ // sweeping across tiers doesn't stack three trips on top of each other.
let hoverTimer = null;
let hoverPendingTier = null;
- function scheduleJump(tierEl) {
+ function scheduleMove(tierEl) {
if (!tierEl) {
clearTimeout(hoverTimer);
hoverPendingTier = null;
@@ -481,10 +517,12 @@
hoverPendingTier = tierEl;
hoverTimer = setTimeout(() => {
hoverPendingTier = null;
- if (phase === 'jumping') {
- setTimeout(() => scheduleJump(tierEl), 200);
- } else {
+ if (phase === 'walking' || phase === 'jumping') {
+ setTimeout(() => scheduleMove(tierEl), 200);
+ } else if (shouldJump(activeTier, tierEl)) {
jumpToTier(tierEl);
+ } else {
+ walkToTier(tierEl);
}
}, 120);
}
@@ -500,9 +538,9 @@
const tiersGrid = document.getElementById('tiers');
tiersGrid.addEventListener('mousemove', e => {
- scheduleJump(tierAtPoint(e.clientX, e.clientY));
+ scheduleMove(tierAtPoint(e.clientX, e.clientY));
});
- tiersGrid.addEventListener('mouseleave', () => scheduleJump(null));
+ tiersGrid.addEventListener('mouseleave', () => scheduleMove(null));
// CTA clicks — tier-specific reaction. Prevent navigation in the
// demo so the page doesn't refresh mid-gesture.
@@ -530,7 +568,7 @@
// ── ResizeObserver on each tier so reflow re-snaps the avatar ────
const ro = new ResizeObserver(() => {
- if (avatar && activeTier && phase !== 'jumping') {
+ if (avatar && activeTier && phase === 'idle') {
const t = standOnTopOf(activeTier);
gsap.killTweensOf(avatar.position);
gsap.to(avatar.position, { x: t.x, y: t.y, duration: 0.35, overwrite: true });
@@ -542,8 +580,7 @@
// Loaded up front so per-tier personality + idle fidgets can play
// instantly without a fetch hiccup mid-hover.
const CLIPS = [
- 'idle', 'walk', 'jump',
- 'falling', 'dying', 'falltolanding',
+ 'idle', 'walk', 'jump', 'falltolanding',
];
new GLTFLoader().load('/avatars/cz.glb', gltf => {
@@ -590,7 +627,15 @@
const dt = Math.min(clock.getDelta(), 0.05);
mixer?.update(dt);
- if (phase === 'jumping' && avatar && jumpStart && jumpEnd) {
+ if (phase === 'walking' && avatar && walkStart && walkEnd) {
+ walkT += dt;
+ const p = Math.min(walkT / walkDur, 1);
+ const e = smoothstep(p);
+ const x = walkStart.x + (walkEnd.x - walkStart.x) * e;
+ const y = walkStart.y + (walkEnd.y - walkStart.y) * e;
+ avatar.position.set(x, y, 0);
+ if (p >= 1) landOnTier();
+ } else if (phase === 'jumping' && avatar && jumpStart && jumpEnd) {
jumpT += dt;
const p = Math.min(jumpT / JUMP_S, 1);
const e = smoothstep(p);
diff --git a/public/sitemap.xml b/public/sitemap.xml
index c1e4d085e..3c66c7c94 100644
--- a/public/sitemap.xml
+++ b/public/sitemap.xml
@@ -2,277 +2,277 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://three.ws/</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>1.0</priority>
</url>
<url>
<loc>https://three.ws/discover</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/gallery</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/walk</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/marketplace</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/community</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/sitemap</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://three.ws/create</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/app</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/validation</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/studio</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/artifact</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://three.ws/widgets</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/hydrate</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/features</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/launchpad</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/walkaround</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/brain</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/lipsync</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/lipsync/mic</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/avatar-artifact</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://three.ws/pay</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/pumpfun</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/pump-live</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/pump-dashboard</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/strategy-lab</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/vanity-wallet</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/eth-vanity</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/pump-visualizer</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/chat</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/agent</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/agents</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>daily</changefreq>
<priority>0.7</priority>
</url>
<url>
<loc>https://three.ws/reputation</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.6</priority>
</url>
<url>
<loc>https://three.ws/login</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>yearly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://three.ws/register</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>yearly</changefreq>
<priority>0.4</priority>
</url>
<url>
<loc>https://three.ws/forgot-password</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>yearly</changefreq>
<priority>0.2</priority>
</url>
<url>
<loc>https://three.ws/docs</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.9</priority>
</url>
<url>
<loc>https://three.ws/docs/quick-start</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>weekly</changefreq>
<priority>0.8</priority>
</url>
<url>
<loc>https://three.ws/docs/agent-system</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/erc8004</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/embedding</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/web-component</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/mcp</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/skills</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/widgets</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/api-reference</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/sdk</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/docs/listings</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>https://three.ws/tutorials</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
</url>
<url>
<loc>https://three.ws/blog</loc>
@@ -300,13 +300,13 @@
</url>
<url>
<loc>https://three.ws/legal/privacy</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>yearly</changefreq>
<priority>0.2</priority>
</url>
<url>
<loc>https://three.ws/legal/tos</loc>
- <lastmod>2026-05-22</lastmod>
+ <lastmod>2026-05-23</lastmod>
<changefreq>yearly</changefreq>
<priority>0.2</priority>
</url>
diff --git a/scripts/build-skill-metadata.mjs b/scripts/build-skill-metadata.mjs
new file mode 100644
index 000000000..07870a22b
--- /dev/null
+++ b/scripts/build-skill-metadata.mjs
@@ -0,0 +1,37 @@
+#!/usr/bin/env node
+/**
+ * Generate data/_generated/skill-metadata.json from AgentSkills.list().
+ *
+ * Why: api/chat-skills.js and api/skills-manifest.js only need skill metadata
+ * (name, description, inputSchema, mcpExposed). Importing AgentSkills at
+ * runtime drags in Three.js, @solana, @metaplex-foundation, @coinbase, etc.
+ * via the registered skill modules — pushing the deployed Vercel function
+ * over the 300mb hard limit. The build-time generator pays that import cost
+ * here, then the function reads a small JSON file at runtime.
+ */
+import { writeFileSync, mkdirSync } from 'node:fs';
+import { resolve, dirname } from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+import { AgentSkills } from '../src/agent-skills.js';
+
+const here = dirname(fileURLToPath(import.meta.url));
+const root = resolve(here, '..');
+const outFile = resolve(root, 'data/_generated/skill-metadata.json');
+
+const noop = () => {};
+const stub = { emit: noop, on: noop, off: noop, add: noop, query: () => [] };
+const skills = new AgentSkills(stub, stub);
+
+const entries = skills.list().map((s) => ({
+ name: s.name,
+ description: s.description || '',
+ mcpExposed: !!s.mcpExposed,
+ inputSchema: s.inputSchema || { type: 'object', properties: {} },
+ animationHint: s.animationHint || null,
+}));
+
+mkdirSync(dirname(outFile), { recursive: true });
+writeFileSync(outFile, JSON.stringify(entries, null, '\t') + '\n');
+
+console.log(`[build-skill-metadata] wrote ${entries.length} skills → ${outFile}`);
diff --git a/solana-agent-sdk/package-lock.json b/solana-agent-sdk/package-lock.json
index 0e5a89fbe..a3ffd92e5 100644
--- a/solana-agent-sdk/package-lock.json
+++ b/solana-agent-sdk/package-lock.json
@@ -9,8 +9,11 @@
"version": "0.1.0",
"license": "MIT",
"dependencies": {
+ "@coral-xyz/anchor": "^0.32.1",
"@solana/spl-token": "^0.4.9",
"@solana/web3.js": "^1.98.0",
+ "@tetsuo-ai/protocol": "^0.2.0",
+ "@tetsuo-ai/sdk": "^1.4.0",
"bs58": "^6.0.0"
},
"devDependencies": {
@@ -537,6 +540,97 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/@coral-xyz/anchor": {
+ "version": "0.32.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.32.1.tgz",
+ "integrity": "sha512-zAyxFtfeje2FbMA1wzgcdVs7Hng/MijPKpRijoySPCicnvcTQs/+dnPZ/cR+LcXM9v9UYSyW81uRNYZtN5G4yg==",
+ "license": "(MIT OR Apache-2.0)",
+ "dependencies": {
+ "@coral-xyz/anchor-errors": "^0.31.1",
+ "@coral-xyz/borsh": "^0.31.1",
+ "@noble/hashes": "^1.3.1",
+ "@solana/web3.js": "^1.69.0",
+ "bn.js": "^5.1.2",
+ "bs58": "^4.0.1",
+ "buffer-layout": "^1.2.2",
+ "camelcase": "^6.3.0",
+ "cross-fetch": "^3.1.5",
+ "eventemitter3": "^4.0.7",
+ "pako": "^2.0.3",
+ "superstruct": "^0.15.4",
+ "toml": "^3.0.0"
+ },
+ "engines": {
+ "node": ">=17"
+ }
+ },
+ "node_modules/@coral-xyz/anchor-errors": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.31.1.tgz",
+ "integrity": "sha512-NhNEku4F3zzUSBtrYz84FzYWm48+9OvmT1Hhnwr6GnPQry2dsEqH/ti/7ASjjpoFTWRnPXrjAIT1qM6Isop+LQ==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/@coral-xyz/anchor/node_modules/base-x": {
+ "version": "3.0.11",
+ "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz",
+ "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/@coral-xyz/anchor/node_modules/bs58": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz",
+ "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==",
+ "license": "MIT",
+ "dependencies": {
+ "base-x": "^3.0.2"
+ }
+ },
+ "node_modules/@coral-xyz/anchor/node_modules/camelcase": {
+ "version": "6.3.0",
+ "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz",
+ "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/@coral-xyz/anchor/node_modules/eventemitter3": {
+ "version": "4.0.7",
+ "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz",
+ "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==",
+ "license": "MIT"
+ },
+ "node_modules/@coral-xyz/anchor/node_modules/superstruct": {
+ "version": "0.15.5",
+ "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz",
+ "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==",
+ "license": "MIT"
+ },
+ "node_modules/@coral-xyz/borsh": {
+ "version": "0.31.1",
+ "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.31.1.tgz",
+ "integrity": "sha512-9N8AU9F0ubriKfNE3g1WF0/4dtlGXoBN/hd1PvbNBamBNwRgHxH4P+o3Zt7rSEloW1HUs6LfZEchlx9fW7POYw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "bn.js": "^5.1.2",
+ "buffer-layout": "^1.2.0"
+ },
+ "engines": {
+ "node": ">=10"
+ },
+ "peerDependencies": {
+ "@solana/web3.js": "^1.69.0"
+ }
+ },
"node_modules/@emnapi/core": {
"version": "1.10.0",
"resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz",
@@ -2373,6 +2467,44 @@
"tslib": "^2.8.0"
}
},
+ "node_modules/@tetsuo-ai/protocol": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@tetsuo-ai/protocol/-/protocol-0.2.0.tgz",
+ "integrity": "sha512-W4p7zd19lFxvmeXwJy3yZeo8z4iiNoVoMMEwO99fB47o3p0LNy1oO8+4YxN5BgcM57kKTV5/EhjaK8SLu7vCfg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/@tetsuo-ai/sdk/-/sdk-1.4.0.tgz",
+ "integrity": "sha512-ql6zCgBv0vrELetMqINU98Yb+u95WgrTLf20mWDyZAsNkYQJpTPeM0q8Jld5Xh4oYQ+peWagdxPo6zq8BNqONQ==",
+ "license": "MIT",
+ "dependencies": {
+ "@coral-xyz/anchor": ">=0.32.1",
+ "@solana/web3.js": ">=1.98.4",
+ "chalk": "^5.6.2",
+ "commander": "^14.0.3",
+ "ora": "^9.3.0"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "peerDependencies": {
+ "@coral-xyz/anchor": ">=0.29.0",
+ "@solana/web3.js": ">=1.90.0"
+ }
+ },
+ "node_modules/@tetsuo-ai/sdk/node_modules/commander": {
+ "version": "14.0.3",
+ "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.3.tgz",
+ "integrity": "sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ }
+ },
"node_modules/@tybys/wasm-util": {
"version": "0.10.1",
"resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.1.tgz",
@@ -2852,7 +2984,6 @@
"version": "6.2.2",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz",
"integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==",
- "dev": true,
"license": "MIT",
"engines": {
"node": ">=12"
@@ -3269,6 +3400,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/buffer-layout": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz",
+ "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=4.5"
+ }
+ },
"node_modules/bufferutil": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz",
@@ -3411,6 +3551,33 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/cli-cursor": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+ "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+ "license": "MIT",
+ "dependencies": {
+ "restore-cursor": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/cli-spinners": {
+ "version": "3.4.0",
+ "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-3.4.0.tgz",
+ "integrity": "sha512-bXfOC4QcT1tKXGorxL3wbJm6XJPDqEnij2gQ2m7ESQuE+/z9YFIWnl/5RpTiKWbMq3EVKR4fRLJGn6DVfu0mpw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/cliui": {
"version": "8.0.1",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
@@ -3583,6 +3750,15 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/cross-fetch": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.2.0.tgz",
+ "integrity": "sha512-Q+xVJLoGOeIMXZmbUK4HYk+69cQH6LudR0Vu/pRm2YlU/hDV9CiS0gKUMaWY5f2NeUH9C1nV3bsTlCo0FsTV1Q==",
+ "license": "MIT",
+ "dependencies": {
+ "node-fetch": "^2.7.0"
+ }
+ },
"node_modules/cross-spawn": {
"version": "7.0.6",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
@@ -4010,6 +4186,18 @@
"node": "6.* || 8.* || >= 10.*"
}
},
+ "node_modules/get-east-asian-width": {
+ "version": "1.6.0",
+ "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.6.0.tgz",
+ "integrity": "sha512-QRbvDIbx6YklUe6RxeTeleMR0yv3cYH6PsPZHcnVn7xv7zO1BHN8r0XETu8n6Ye3Q+ahtSarc3WgtNWmehIBfA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/get-package-type": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz",
@@ -4226,6 +4414,18 @@
"node": ">=6"
}
},
+ "node_modules/is-interactive": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz",
+ "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/is-stream": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz",
@@ -4239,6 +4439,18 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/is-unicode-supported": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-2.1.0.tgz",
+ "integrity": "sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/isexe": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -5577,6 +5789,22 @@
"dev": true,
"license": "MIT"
},
+ "node_modules/log-symbols": {
+ "version": "7.0.1",
+ "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-7.0.1.tgz",
+ "integrity": "sha512-ja1E3yCr9i/0hmBVaM0bfwDjnGy8I/s6PP4DFp+yP+a+mrHO4Rm7DtmnqROTUkHIkqffC84YY7AeqX6oFk0WFg==",
+ "license": "MIT",
+ "dependencies": {
+ "is-unicode-supported": "^2.0.0",
+ "yoctocolors": "^2.1.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/lru-cache": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
@@ -5660,6 +5888,18 @@
"node": ">=6"
}
},
+ "node_modules/mimic-function": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz",
+ "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/minimatch": {
"version": "9.0.9",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
@@ -5862,6 +6102,44 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/ora": {
+ "version": "9.4.0",
+ "resolved": "https://registry.npmjs.org/ora/-/ora-9.4.0.tgz",
+ "integrity": "sha512-84cglkRILFxdtA8hAvLNdMrtBpPNBTrQ9/ulg0FA7xLMnD6mifv+enAIeRmvtv+WgdCE+LPGOfQmtJRrVaIVhQ==",
+ "license": "MIT",
+ "dependencies": {
+ "chalk": "^5.6.2",
+ "cli-cursor": "^5.0.0",
+ "cli-spinners": "^3.2.0",
+ "is-interactive": "^2.0.0",
+ "is-unicode-supported": "^2.1.0",
+ "log-symbols": "^7.0.1",
+ "stdin-discarder": "^0.3.2",
+ "string-width": "^8.1.0"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/ora/node_modules/string-width": {
+ "version": "8.2.1",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-8.2.1.tgz",
+ "integrity": "sha512-IIaP0g3iy9Cyy18w3M9YcaDudujEAVHKt3a3QJg1+sr/oX96TbaGUubG0hJyCjCBThFH+tFpcIyoUHUn1ogaLA==",
+ "license": "MIT",
+ "dependencies": {
+ "get-east-asian-width": "^1.5.0",
+ "strip-ansi": "^7.1.2"
+ },
+ "engines": {
+ "node": ">=20"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/p-limit": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
@@ -5924,6 +6202,12 @@
"dev": true,
"license": "BlueOak-1.0.0"
},
+ "node_modules/pako": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz",
+ "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==",
+ "license": "(MIT AND Zlib)"
+ },
"node_modules/parse-json": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz",
@@ -6188,6 +6472,37 @@
"node": ">=8"
}
},
+ "node_modules/restore-cursor": {
+ "version": "5.1.0",
+ "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+ "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+ "license": "MIT",
+ "dependencies": {
+ "onetime": "^7.0.0",
+ "signal-exit": "^4.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/restore-cursor/node_modules/onetime": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+ "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+ "license": "MIT",
+ "dependencies": {
+ "mimic-function": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/rollup": {
"version": "4.60.2",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.60.2.tgz",
@@ -6370,7 +6685,6 @@
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
"integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
- "dev": true,
"license": "ISC",
"engines": {
"node": ">=14"
@@ -6440,6 +6754,18 @@
"node": ">=10"
}
},
+ "node_modules/stdin-discarder": {
+ "version": "0.3.2",
+ "resolved": "https://registry.npmjs.org/stdin-discarder/-/stdin-discarder-0.3.2.tgz",
+ "integrity": "sha512-eCPu1qRxPVkl5605OTWF8Wz40b4Mf45NY5LQmVPQ599knfs5QhASUm9GbJ5BDMDOXgrnh0wyEdvzmL//YMlw0A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/stream-chain": {
"version": "2.2.5",
"resolved": "https://registry.npmjs.org/stream-chain/-/stream-chain-2.2.5.tgz",
@@ -6560,7 +6886,6 @@
"version": "7.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz",
"integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==",
- "dev": true,
"license": "MIT",
"dependencies": {
"ansi-regex": "^6.2.2"
@@ -6820,6 +7145,12 @@
"dev": true,
"license": "BSD-3-Clause"
},
+ "node_modules/toml": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
+ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
+ "license": "MIT"
+ },
"node_modules/tr46": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
@@ -7441,6 +7772,18 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/yoctocolors": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/yoctocolors/-/yoctocolors-2.1.2.tgz",
+ "integrity": "sha512-CzhO+pFNo8ajLM2d2IW/R93ipy99LWjtwblvC1RsoSUMZgyLbYFr221TnSNT7GjGdYui6P459mw9JH/g/zW2ug==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
"node_modules/zod": {
"version": "3.25.76",
"resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
diff --git a/solana-agent-sdk/package.json b/solana-agent-sdk/package.json
index caf98683f..552777bb3 100644
--- a/solana-agent-sdk/package.json
+++ b/solana-agent-sdk/package.json
@@ -41,8 +41,11 @@
"test": "node --experimental-vm-modules node_modules/.bin/jest"
},
"dependencies": {
+ "@coral-xyz/anchor": "^0.32.1",
"@solana/spl-token": "^0.4.9",
"@solana/web3.js": "^1.98.0",
+ "@tetsuo-ai/protocol": "^0.2.0",
+ "@tetsuo-ai/sdk": "^1.4.0",
"bs58": "^6.0.0"
},
"peerDependencies": {
diff --git a/solana-agent-sdk/src/actions/agenc/agents.ts b/solana-agent-sdk/src/actions/agenc/agents.ts
new file mode 100644
index 000000000..50743cf20
--- /dev/null
+++ b/solana-agent-sdk/src/actions/agenc/agents.ts
@@ -0,0 +1,131 @@
+// AgenC agent registry — thin three.ws-shaped wrappers around the
+// @tetsuo-ai/sdk agent helpers. Adds ergonomic conversions: a 32-byte agentId
+// can be supplied as a hex string ("0x…"), a base58 32-byte string, or a UTF-8
+// label (hashed via SHA-256 to 32 bytes).
+
+import { PublicKey } from "@solana/web3.js";
+import { createHash } from "node:crypto";
+import {
+ deriveAgentPda,
+ getAgent,
+ registerAgent,
+ type AgentState,
+ type RegisterAgentParams,
+} from "@tetsuo-ai/sdk";
+import bs58 from "bs58";
+import {
+ requireAgenCSigner,
+ type AgenCClient,
+} from "./client.js";
+
+export type AgenCAgentIdInput = Uint8Array | number[] | string;
+
+/**
+ * Normalize an agent identifier into the exact 32-byte form AgenC expects.
+ * Accepts: a 32-byte Uint8Array/number[], a 0x-prefixed 64-hex string,
+ * a 32-byte base58 string, or any UTF-8 label (hashed via SHA-256).
+ */
+export function toAgenCAgentId(input: AgenCAgentIdInput): Uint8Array {
+ if (input instanceof Uint8Array) {
+ if (input.length !== 32) {
+ throw new Error(`agentId must be 32 bytes, got ${input.length}`);
+ }
+ return input;
+ }
+ if (Array.isArray(input)) {
+ if (input.length !== 32) {
+ throw new Error(`agentId must be 32 bytes, got ${input.length}`);
+ }
+ return Uint8Array.from(input);
+ }
+ const s = input.trim();
+ if (s.startsWith("0x") || s.startsWith("0X")) {
+ const hex = s.slice(2);
+ if (hex.length !== 64 || !/^[0-9a-fA-F]+$/.test(hex)) {
+ throw new Error(`hex agentId must be exactly 32 bytes (64 hex chars)`);
+ }
+ return Uint8Array.from(Buffer.from(hex, "hex"));
+ }
+ // Try base58 → must decode to exactly 32 bytes; otherwise treat as label.
+ try {
+ const decoded = bs58.decode(s);
+ if (decoded.length === 32) return decoded;
+ } catch {
+ // fall through to label hashing
+ }
+ // UTF-8 label: hash to 32 bytes so any human-readable identifier maps to a
+ // deterministic on-chain id.
+ return Uint8Array.from(createHash("sha256").update(s, "utf8").digest());
+}
+
+export interface AgenCRegisterAgentArgs {
+ /** 32-byte agent id (or any string — hashed via toAgenCAgentId). */
+ agentId: AgenCAgentIdInput;
+ /** u64 capability bitmask describing what this agent can do. */
+ capabilities: number | bigint;
+ /** Public endpoint where the agent can be reached (URL or DID). */
+ endpoint: string;
+ /** Optional pointer to extended metadata (IPFS/HTTPS). */
+ metadataUri?: string | null;
+ /**
+ * Stake in lamports. Required to satisfy on-chain economic checks; the
+ * AgenC protocol slashes this on dispute resolution.
+ */
+ stakeAmount: number | bigint;
+}
+
+export interface AgenCRegisterAgentResult {
+ agentPda: PublicKey;
+ agentId: Uint8Array;
+ txSignature: string;
+}
+
+/** Register a new agent on the AgenC coordination protocol. */
+export async function registerAgenCAgent(
+ client: AgenCClient,
+ args: AgenCRegisterAgentArgs,
+): Promise<AgenCRegisterAgentResult> {
+ const signer = requireAgenCSigner(client);
+ const agentId = toAgenCAgentId(args.agentId);
+ const params: RegisterAgentParams = {
+ agentId,
+ capabilities: args.capabilities,
+ endpoint: args.endpoint,
+ metadataUri: args.metadataUri ?? null,
+ stakeAmount: args.stakeAmount,
+ };
+ const result = await registerAgent(
+ client.connection,
+ client.program,
+ signer,
+ params,
+ );
+ return {
+ agentPda: result.agentPda,
+ agentId,
+ txSignature: result.txSignature,
+ };
+}
+
+/**
+ * Look up an AgenC agent by id (32-byte form, hex string, or label) or by PDA.
+ * Returns null if the account does not exist.
+ */
+export async function getAgenCAgent(
+ client: AgenCClient,
+ idOrPda: AgenCAgentIdInput | PublicKey,
+): Promise<AgentState | null> {
+ const agentPda =
+ idOrPda instanceof PublicKey
+ ? idOrPda
+ : deriveAgentPda(toAgenCAgentId(idOrPda), client.programId);
+ return getAgent(client.program, agentPda);
+}
+
+/** Derive the on-chain PDA for an AgenC agent without fetching state. */
+export function deriveAgenCAgentPda(
+ client: AgenCClient,
+ id: AgenCAgentIdInput,
+): PublicKey {
+ return deriveAgentPda(toAgenCAgentId(id), client.programId);
+}
diff --git a/solana-agent-sdk/src/actions/agenc/client.ts b/solana-agent-sdk/src/actions/agenc/client.ts
new file mode 100644
index 000000000..da0e58c55
--- /dev/null
+++ b/solana-agent-sdk/src/actions/agenc/client.ts
@@ -0,0 +1,156 @@
+// AgenC client — wraps Connection + Anchor Program for the AgenC coordination
+// protocol (agenc.tech, published by Tetsuo Corp). Lets three.ws agents
+// register, list tasks, claim, and complete work on the public protocol
+// without taking a direct dependency on Anchor in user-land code.
+
+import {
+ Connection,
+ Keypair,
+ PublicKey,
+ Transaction,
+ VersionedTransaction,
+} from "@solana/web3.js";
+import {
+ AnchorProvider,
+ Program,
+ type Wallet,
+ type Idl,
+} from "@coral-xyz/anchor";
+import { AGENC_COORDINATION_IDL } from "@tetsuo-ai/protocol";
+import { DEVNET_RPC, MAINNET_RPC, PROGRAM_ID } from "@tetsuo-ai/sdk";
+import bs58 from "bs58";
+
+export type AgenCCluster = "mainnet" | "devnet";
+
+/**
+ * Devnet AgenC program ID validated by the protocol team on 2026-03-22.
+ * Source: https://docs.agenc.tech/docs/runtime/api/.
+ */
+export const AGENC_DEVNET_PROGRAM_ID = new PublicKey(
+ "6UcJzbTEemBz3aY5wK5qKHGMD7bdRsmR4smND29gB2ab",
+);
+
+/**
+ * Mainnet AgenC program ID. `PROGRAM_ID` exported from `@tetsuo-ai/sdk`
+ * points at mainnet; we re-export here for clarity at call sites.
+ */
+export const AGENC_MAINNET_PROGRAM_ID = PROGRAM_ID;
+
+export interface AgenCClientOptions {
+ /** "mainnet" or "devnet"; ignored if `rpcUrl` is set. Defaults to "mainnet". */
+ cluster?: AgenCCluster;
+ /** Override the RPC endpoint (e.g. a Helius/Triton URL). */
+ rpcUrl?: string;
+ /**
+ * Signer for mutating instructions. Read-only operations work without one.
+ * Pass either a raw `Keypair` (preferred — AgenC's SDK takes `Keypair`),
+ * a base58 string, or a 64-byte secret-key array.
+ */
+ signer?: Keypair | string | Uint8Array | number[];
+ /** Override the AgenC coordination program ID (advanced; rarely needed). */
+ programId?: PublicKey;
+}
+
+export interface AgenCClient {
+ connection: Connection;
+ program: Program<Idl>;
+ programId: PublicKey;
+ cluster: AgenCCluster;
+ signer: Keypair | null;
+}
+
+function resolveSigner(
+ signer: AgenCClientOptions["signer"],
+): Keypair | null {
+ if (!signer) return null;
+ if (signer instanceof Keypair) return signer;
+ if (typeof signer === "string") {
+ return Keypair.fromSecretKey(bs58.decode(signer));
+ }
+ return Keypair.fromSecretKey(Uint8Array.from(signer));
+}
+
+function buildWallet(signer: Keypair | null): Wallet {
+ if (signer) {
+ return {
+ payer: signer,
+ publicKey: signer.publicKey,
+ async signTransaction<T extends Transaction | VersionedTransaction>(
+ tx: T,
+ ): Promise<T> {
+ if (tx instanceof VersionedTransaction) tx.sign([signer]);
+ else (tx as Transaction).partialSign(signer);
+ return tx;
+ },
+ async signAllTransactions<T extends Transaction | VersionedTransaction>(
+ txs: T[],
+ ): Promise<T[]> {
+ for (const tx of txs) {
+ if (tx instanceof VersionedTransaction) tx.sign([signer]);
+ else (tx as Transaction).partialSign(signer);
+ }
+ return txs;
+ },
+ };
+ }
+ // Read-only wallet: signing throws. Anchor still needs a valid publicKey +
+ // payer slot for provider construction, so we hold an ephemeral keypair —
+ // it is never used to authorize a transaction.
+ const ephemeral = Keypair.generate();
+ return {
+ payer: ephemeral,
+ publicKey: ephemeral.publicKey,
+ async signTransaction<T extends Transaction | VersionedTransaction>(
+ _tx: T,
+ ): Promise<T> {
+ throw new Error(
+ "AgenC client is read-only — pass `signer` in createAgenCClient() to mutate.",
+ );
+ },
+ async signAllTransactions<T extends Transaction | VersionedTransaction>(
+ _txs: T[],
+ ): Promise<T[]> {
+ throw new Error(
+ "AgenC client is read-only — pass `signer` in createAgenCClient() to mutate.",
+ );
+ },
+ };
+}
+
+/**
+ * Build an AgenCClient bound to a Solana cluster and (optionally) a signer.
+ * Read-only methods (list tasks, get agent, get task status) work without a
+ * signer; any state-mutating call requires `signer` to be set.
+ */
+export function createAgenCClient(opts: AgenCClientOptions = {}): AgenCClient {
+ const cluster: AgenCCluster = opts.cluster ?? "mainnet";
+ const rpcUrl =
+ opts.rpcUrl ?? (cluster === "devnet" ? DEVNET_RPC : MAINNET_RPC);
+ const connection = new Connection(rpcUrl, "confirmed");
+ const signer = resolveSigner(opts.signer);
+ const provider = new AnchorProvider(connection, buildWallet(signer), {
+ commitment: "confirmed",
+ preflightCommitment: "confirmed",
+ });
+
+ const programId =
+ opts.programId ??
+ (cluster === "devnet"
+ ? AGENC_DEVNET_PROGRAM_ID
+ : AGENC_MAINNET_PROGRAM_ID);
+
+ const idl = AGENC_COORDINATION_IDL as unknown as Idl;
+ const program = new Program(idl, provider);
+
+ return { connection, program, programId, cluster, signer };
+}
+
+/** Throws if the client was built without a signer. Used by mutating helpers. */
+export function requireAgenCSigner(client: AgenCClient): Keypair {
+ if (!client.signer) {
+ throw new Error(
+ "AgenC client is read-only — pass `signer` in createAgenCClient() to mutate.",
+ );
+ }
+ return client.signer;
+}
diff --git a/solana-agent-sdk/src/actions/agenc/index.ts b/solana-agent-sdk/src/actions/agenc/index.ts
new file mode 100644
index 000000000..a08041981
--- /dev/null
+++ b/solana-agent-sdk/src/actions/agenc/index.ts
@@ -0,0 +1,70 @@
+// AgenC adapter — public barrel.
+//
+// Lets three.ws agents register on the AgenC coordination protocol
+// (agenc.tech, Tetsuo Corp), discover tasks, claim work, and submit
+// completions. Wraps `@tetsuo-ai/sdk` so callers don't need to touch
+// Anchor's `Program` directly.
+//
+// Quick start:
+//
+// import { createAgenCClient, registerAgenCAgent } from "@three-ws/solana-agent";
+//
+// const client = createAgenCClient({ cluster: "devnet", signer: myKeypair });
+// await registerAgenCAgent(client, {
+// agentId: "my-three-ws-bot",
+// capabilities: 1n,
+// endpoint: "https://three.ws/agents/my-bot",
+// stakeAmount: 1_000_000,
+// });
+
+export {
+ createAgenCClient,
+ requireAgenCSigner,
+ AGENC_DEVNET_PROGRAM_ID,
+ AGENC_MAINNET_PROGRAM_ID,
+ type AgenCClient,
+ type AgenCClientOptions,
+ type AgenCCluster,
+} from "./client.js";
+
+export {
+ registerAgenCAgent,
+ getAgenCAgent,
+ deriveAgenCAgentPda,
+ toAgenCAgentId,
+ type AgenCAgentIdInput,
+ type AgenCRegisterAgentArgs,
+ type AgenCRegisterAgentResult,
+} from "./agents.js";
+
+export {
+ createAgenCTask,
+ getAgenCTask,
+ getAgenCTaskLifecycle,
+ listAgenCTasksByCreator,
+ claimAgenCTask,
+ completeAgenCTask,
+ generateAgenCTaskId,
+ toAgenCTaskId,
+ encodeAgenCDescription,
+ formatTaskState,
+ AGENC_TASK_TYPE,
+ type AgenCTaskTypeName,
+ type AgenCTaskIdInput,
+ type AgenCCreateTaskArgs,
+ type AgenCCreateTaskResult,
+ type AgenCClaimTaskArgs,
+ type AgenCClaimTaskResult,
+ type AgenCCompleteTaskArgs,
+ type AgenCCompleteTaskResult,
+} from "./tasks.js";
+
+// Re-exports from the upstream SDK that round out the surface for advanced
+// callers. Anything you can't do via this adapter, you can still reach via
+// `@tetsuo-ai/sdk` directly.
+export type {
+ AgentState,
+ TaskStatus,
+ TaskLifecycleSummary,
+ TaskState,
+} from "@tetsuo-ai/sdk";
diff --git a/solana-agent-sdk/src/actions/agenc/tasks.ts b/solana-agent-sdk/src/actions/agenc/tasks.ts
new file mode 100644
index 000000000..493b634b8
--- /dev/null
+++ b/solana-agent-sdk/src/actions/agenc/tasks.ts
@@ -0,0 +1,263 @@
+// AgenC task lifecycle — three.ws-shaped wrappers around @tetsuo-ai/sdk task
+// helpers. Covers create / list / get / claim / complete. Mutations require
+// a client built with `signer`; reads work on any client.
+
+import { PublicKey } from "@solana/web3.js";
+import { createHash, randomBytes } from "node:crypto";
+import {
+ claimTask,
+ completeTask,
+ createTask,
+ deriveTaskPda,
+ formatTaskState,
+ getTask,
+ getTaskLifecycleSummary,
+ getTasksByCreator,
+ type TaskLifecycleSummary,
+ type TaskParams,
+ type TaskStatus,
+} from "@tetsuo-ai/sdk";
+import { toAgenCAgentId, type AgenCAgentIdInput } from "./agents.js";
+import {
+ requireAgenCSigner,
+ type AgenCClient,
+} from "./client.js";
+
+/** Public-protocol task type discriminants per AgenC IDL. */
+export const AGENC_TASK_TYPE = {
+ Exclusive: 0,
+ Collaborative: 1,
+ Competitive: 2,
+} as const;
+export type AgenCTaskTypeName = keyof typeof AGENC_TASK_TYPE;
+
+export type AgenCTaskIdInput = Uint8Array | number[] | string;
+
+/**
+ * Normalize a task id to its 32-byte form. Mirrors `toAgenCAgentId`:
+ * 32-byte raw bytes / 0x-hex / SHA-256 of a UTF-8 label.
+ */
+export function toAgenCTaskId(input: AgenCTaskIdInput): Uint8Array {
+ if (input instanceof Uint8Array) {
+ if (input.length !== 32) throw new Error(`taskId must be 32 bytes`);
+ return input;
+ }
+ if (Array.isArray(input)) {
+ if (input.length !== 32) throw new Error(`taskId must be 32 bytes`);
+ return Uint8Array.from(input);
+ }
+ const s = input.trim();
+ if (s.startsWith("0x") || s.startsWith("0X")) {
+ const hex = s.slice(2);
+ if (hex.length !== 64) throw new Error(`hex taskId must be 32 bytes`);
+ return Uint8Array.from(Buffer.from(hex, "hex"));
+ }
+ return Uint8Array.from(createHash("sha256").update(s, "utf8").digest());
+}
+
+/** Generate a fresh random 32-byte task id. */
+export function generateAgenCTaskId(): Uint8Array {
+ return Uint8Array.from(randomBytes(32));
+}
+
+/**
+ * AgenC's TaskParams.description must be exactly 64 bytes. This helper packs
+ * an arbitrary string into that shape: short strings are zero-padded; longer
+ * strings are summarized as `sha256(text)` (32 bytes) concatenated with the
+ * first 32 bytes of UTF-8 so the on-chain hash both binds the full payload
+ * and preserves a readable prefix.
+ */
+export function encodeAgenCDescription(text: string): Uint8Array {
+ const utf8 = Buffer.from(text, "utf8");
+ if (utf8.length <= 64) {
+ const out = Buffer.alloc(64);
+ utf8.copy(out, 0);
+ return Uint8Array.from(out);
+ }
+ const hash = createHash("sha256").update(utf8).digest();
+ const prefix = utf8.subarray(0, 32);
+ return Uint8Array.from(Buffer.concat([hash, prefix], 64));
+}
+
+export interface AgenCCreateTaskArgs {
+ /** 32-byte task id; pass `generateAgenCTaskId()` for a random one. */
+ taskId?: AgenCTaskIdInput;
+ /** Agent id of the creator (32-byte form or label). */
+ creatorAgentId: AgenCAgentIdInput;
+ /** Required capability bitmask (u64). */
+ requiredCapabilities: number | bigint;
+ /** Free-form task description; encoded into the on-chain 64-byte slot. */
+ description: string | Uint8Array | Buffer;
+ /** Reward in lamports (or token base units when `rewardMint` is set). */
+ rewardAmount: number | bigint;
+ /** Maximum concurrent workers (u8). */
+ maxWorkers: number;
+ /** Unix timestamp (seconds) the task must be completed by. */
+ deadline: number;
+ /** Task type: "Exclusive" | "Collaborative" | "Competitive". */
+ taskType?: AgenCTaskTypeName;
+ /** Minimum reputation a worker needs (u16). Defaults to 0. */
+ minReputation?: number;
+ /** Optional SPL mint for token-denominated rewards. */
+ rewardMint?: PublicKey | null;
+ /** Optional creator token account when `rewardMint` is set. */
+ creatorTokenAccount?: PublicKey;
+}
+
+export interface AgenCCreateTaskResult {
+ taskPda: PublicKey;
+ taskId: Uint8Array;
+ txSignature: string;
+}
+
+/** Create a new public AgenC task. */
+export async function createAgenCTask(
+ client: AgenCClient,
+ args: AgenCCreateTaskArgs,
+): Promise<AgenCCreateTaskResult> {
+ const signer = requireAgenCSigner(client);
+ const taskId = args.taskId
+ ? toAgenCTaskId(args.taskId)
+ : generateAgenCTaskId();
+ const description =
+ typeof args.description === "string"
+ ? encodeAgenCDescription(args.description)
+ : (() => {
+ const buf = Buffer.isBuffer(args.description)
+ ? args.description
+ : Buffer.from(args.description);
+ if (buf.length !== 64) {
+ throw new Error(
+ `description bytes must be exactly 64 bytes, got ${buf.length}. Use encodeAgenCDescription(string) to pack arbitrary text.`,
+ );
+ }
+ return Uint8Array.from(buf);
+ })();
+
+ const params: TaskParams = {
+ taskId,
+ requiredCapabilities: args.requiredCapabilities,
+ description,
+ rewardAmount: args.rewardAmount,
+ maxWorkers: args.maxWorkers,
+ deadline: args.deadline,
+ taskType: AGENC_TASK_TYPE[args.taskType ?? "Exclusive"],
+ minReputation: args.minReputation ?? 0,
+ rewardMint: args.rewardMint ?? null,
+ creatorTokenAccount: args.creatorTokenAccount,
+ };
+
+ const result = await createTask(
+ client.connection,
+ client.program,
+ signer,
+ toAgenCAgentId(args.creatorAgentId),
+ params,
+ );
+
+ return {
+ taskPda: result.taskPda,
+ taskId,
+ txSignature: result.txSignature,
+ };
+}
+
+/** Fetch a single task. Pass either the on-chain PDA or `{creator, taskId}`. */
+export async function getAgenCTask(
+ client: AgenCClient,
+ ref: PublicKey | { creator: PublicKey; taskId: AgenCTaskIdInput },
+): Promise<TaskStatus | null> {
+ const taskPda =
+ ref instanceof PublicKey
+ ? ref
+ : deriveTaskPda(ref.creator, toAgenCTaskId(ref.taskId), client.programId);
+ return getTask(client.program, taskPda);
+}
+
+/** Fetch the timeline + current state for a task. */
+export async function getAgenCTaskLifecycle(
+ client: AgenCClient,
+ taskPda: PublicKey,
+): Promise<TaskLifecycleSummary | null> {
+ return getTaskLifecycleSummary(client.program, taskPda);
+}
+
+/** List every task created by a given creator wallet. */
+export async function listAgenCTasksByCreator(
+ client: AgenCClient,
+ creator: PublicKey,
+): Promise<TaskStatus[]> {
+ return getTasksByCreator(client.program, creator);
+}
+
+export interface AgenCClaimTaskArgs {
+ taskPda: PublicKey;
+ workerAgentId: AgenCAgentIdInput;
+}
+
+export interface AgenCClaimTaskResult {
+ txSignature: string;
+}
+
+/** Claim a public task as a worker. */
+export async function claimAgenCTask(
+ client: AgenCClient,
+ args: AgenCClaimTaskArgs,
+): Promise<AgenCClaimTaskResult> {
+ const signer = requireAgenCSigner(client);
+ const result = await claimTask(
+ client.connection,
+ client.program,
+ signer,
+ toAgenCAgentId(args.workerAgentId),
+ args.taskPda,
+ );
+ return { txSignature: result.txSignature };
+}
+
+export interface AgenCCompleteTaskArgs {
+ taskPda: PublicKey;
+ workerAgentId: AgenCAgentIdInput;
+ /** 32-byte proof hash. Pass raw bytes or a 0x-hex string. */
+ proofHash: Uint8Array | number[] | string;
+ /** Optional 64-byte result payload. */
+ resultData?: Uint8Array | number[] | null;
+}
+
+export interface AgenCCompleteTaskResult {
+ txSignature: string;
+}
+
+function normalizeProofHash(
+ input: AgenCCompleteTaskArgs["proofHash"],
+): Uint8Array {
+ if (input instanceof Uint8Array) return input;
+ if (Array.isArray(input)) return Uint8Array.from(input);
+ const s = input.trim();
+ const hex = s.startsWith("0x") || s.startsWith("0X") ? s.slice(2) : s;
+ if (hex.length !== 64 || !/^[0-9a-fA-F]+$/.test(hex)) {
+ throw new Error(`proofHash must be 32 bytes (64 hex chars)`);
+ }
+ return Uint8Array.from(Buffer.from(hex, "hex"));
+}
+
+/** Complete a public task (non-private flow — use completeTaskPrivate via @tetsuo-ai/sdk for zk settlement). */
+export async function completeAgenCTask(
+ client: AgenCClient,
+ args: AgenCCompleteTaskArgs,
+): Promise<AgenCCompleteTaskResult> {
+ const signer = requireAgenCSigner(client);
+ const result = await completeTask(
+ client.connection,
+ client.program,
+ signer,
+ toAgenCAgentId(args.workerAgentId),
+ args.taskPda,
+ normalizeProofHash(args.proofHash),
+ args.resultData ?? null,
+ );
+ return { txSignature: result.txSignature };
+}
+
+/** Human-readable label for a TaskState enum value (re-exported for convenience). */
+export { formatTaskState };
diff --git a/solana-agent-sdk/src/index.ts b/solana-agent-sdk/src/index.ts
index 34d423350..f632af26b 100644
--- a/solana-agent-sdk/src/index.ts
+++ b/solana-agent-sdk/src/index.ts
@@ -50,3 +50,6 @@ export { memoInstruction, MEMO_PROGRAM_ID } from "./utils/memo.js";
// Format utilities
export { toUiAmount } from "./utils/format.js";
+
+// AgenC adapter — read + write the AgenC coordination protocol (agenc.tech).
+export * from "./actions/agenc/index.js";
diff --git a/src/agent-detail.css b/src/agent-detail.css
index 6f7dd945c..f510abeee 100644
--- a/src/agent-detail.css
+++ b/src/agent-detail.css
@@ -387,6 +387,18 @@ a { color: inherit; text-decoration: none; }
border-color: var(--ad-line-2);
}
+.ad-resolved {
+ margin-top: 6px;
+ font-family: ui-monospace, monospace;
+ font-size: 12px;
+ color: var(--ad-muted);
+ word-break: break-all;
+}
+
+.ad-resolved.ok { color: #81c784; }
+.ad-resolved.warn { color: #ff8a80; }
+.ad-resolved.loading { color: var(--ad-muted); font-style: italic; }
+
.ad-modal-footer {
display: flex;
justify-content: flex-end;
diff --git a/src/agent-detail.js b/src/agent-detail.js
index 397d515de..cc8ca37bc 100644
--- a/src/agent-detail.js
+++ b/src/agent-detail.js
@@ -440,6 +440,109 @@ function renderEmbedPolicy(p) {
card.style.display = '';
}
+const SOL_NAME_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*(?:\.sol)?$/i;
+const SOL_ADDR_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+
+// In-flight resolution token — used by both the typeahead and the confirm
+// handler so the latter doesn't fire while a lookup is still pending and so a
+// stale typeahead response can't overwrite a newer one.
+function makeSnsResolver(inputEl, statusEl) {
+ let seq = 0;
+ let lastInput = '';
+ let lastResolved = null; // { name: 'foo.sol', address: 'BASE58' } | { name: null, address: 'raw' } | null
+ let pending = null;
+
+ function setStatus(kind, text) {
+ statusEl.hidden = !text;
+ statusEl.textContent = text || '';
+ statusEl.className = `ad-resolved${kind ? ` ${kind}` : ''}`;
+ }
+
+ async function lookup(name) {
+ const myId = ++seq;
+ pending = (async () => {
+ try {
+ const r = await fetch(`/api/sns?name=${encodeURIComponent(name)}`, { credentials: 'include' });
+ if (myId !== seq) return null; // superseded
+ if (r.status === 404) {
+ setStatus('warn', `${name} does not resolve`);
+ lastResolved = null;
+ return null;
+ }
+ if (!r.ok) {
+ const j = await r.json().catch(() => ({}));
+ setStatus('warn', j?.error_description || `lookup failed (${r.status})`);
+ lastResolved = null;
+ return null;
+ }
+ const { data } = await r.json();
+ if (myId !== seq) return null;
+ setStatus('ok', `→ ${data.address}`);
+ lastResolved = { name: data.name, address: data.address };
+ return lastResolved;
+ } catch (err) {
+ if (myId === seq) setStatus('warn', err.message || 'lookup failed');
+ return null;
+ } finally {
+ if (myId === seq) pending = null;
+ }
+ })();
+ return pending;
+ }
+
+ function onInput() {
+ const raw = inputEl.value.trim();
+ if (raw === lastInput) return;
+ lastInput = raw;
+ seq++; // invalidate any in-flight lookup
+ pending = null;
+ lastResolved = null;
+
+ if (!raw) { setStatus('', ''); return; }
+ if (SOL_ADDR_RE.test(raw)) {
+ lastResolved = { name: null, address: raw };
+ setStatus('', '');
+ return;
+ }
+ if (/\.sol$/i.test(raw) || (SOL_NAME_RE.test(raw) && !SOL_ADDR_RE.test(raw))) {
+ setStatus('loading', 'Resolving .sol…');
+ // debounce briefly so we don't fire for every keystroke
+ const myId = seq;
+ setTimeout(() => {
+ if (myId !== seq) return;
+ lookup(raw);
+ }, 300);
+ return;
+ }
+ setStatus('warn', 'Not a valid Solana address or .sol name');
+ }
+
+ async function resolveForSubmit() {
+ // If a lookup is in flight, wait for it.
+ if (pending) await pending;
+ const raw = inputEl.value.trim();
+ if (!raw) return null;
+ if (lastResolved?.address) return lastResolved.address;
+ if (SOL_ADDR_RE.test(raw)) return raw;
+ if (/\.sol$/i.test(raw) || SOL_NAME_RE.test(raw)) {
+ const r = await lookup(raw);
+ return r?.address || null;
+ }
+ return null;
+ }
+
+ function reset() {
+ seq++;
+ pending = null;
+ lastInput = '';
+ lastResolved = null;
+ setStatus('', '');
+ }
+
+ inputEl.addEventListener('input', onInput);
+ return { resolveForSubmit, reset };
+}
+
function bindWalletActions() {
const receiveBtn = document.getElementById('receive-btn');
const withdrawBtn = document.getElementById('withdraw-btn');
@@ -453,6 +556,8 @@ function bindWalletActions() {
const confirmWithdrawBtn = document.getElementById('confirm-withdraw-btn');
const withdrawAmountInput = document.getElementById('withdraw-amount');
const recipientAddressInput = document.getElementById('recipient-address');
+ const recipientResolvedEl = document.getElementById('recipient-resolved');
+ const snsResolver = makeSnsResolver(recipientAddressInput, recipientResolvedEl);
receiveBtn.addEventListener('click', () => {
const walletAddress = walletAddressSpan.dataset.full;
@@ -487,19 +592,26 @@ function bindWalletActions() {
}
const amount = parseFloat(withdrawAmountInput.value);
- const recipientAddress = recipientAddressInput.value;
+ const typedRecipient = recipientAddressInput.value.trim();
if (isNaN(amount) || amount <= 0) {
alert('Please enter a valid amount.');
return;
}
- if (!recipientAddress) {
+ if (!typedRecipient) {
alert('Please enter a recipient address.');
return;
}
+ confirmWithdrawBtn.disabled = true;
try {
+ const recipientAddress = await snsResolver.resolveForSubmit();
+ if (!recipientAddress) {
+ alert(`Could not resolve "${typedRecipient}" to a Solana address.`);
+ return;
+ }
+
const recipientPubKey = new solanaWeb3.PublicKey(recipientAddress);
const transaction = new solanaWeb3.Transaction().add(
solanaWeb3.SystemProgram.transfer({
@@ -518,15 +630,21 @@ function bindWalletActions() {
const signature = await connection.sendRawTransaction(signedTransaction.serialize());
await connection.confirmTransaction(signature);
- alert(`Withdrawal of ${amount} SOL to ${recipientAddress} successful!`);
+ const displayTarget = typedRecipient === recipientAddress
+ ? recipientAddress
+ : `${typedRecipient} (${recipientAddress})`;
+ alert(`Withdrawal of ${amount} SOL to ${displayTarget} successful!`);
modal.classList.add('hidden');
withdrawAmountInput.value = '';
recipientAddressInput.value = '';
+ snsResolver.reset();
} catch (error) {
console.error('Withdrawal failed:', error);
alert(`Withdrawal failed: ${error.message}`);
+ } finally {
+ confirmWithdrawBtn.disabled = false;
}
});
diff --git a/src/agent-solana-wallet.js b/src/agent-solana-wallet.js
index cd742a928..e6ce07abc 100644
--- a/src/agent-solana-wallet.js
+++ b/src/agent-solana-wallet.js
@@ -133,6 +133,8 @@ const STYLE = `
.agent-sol-wallet .sub { color: rgba(230,230,234,0.6); font-size: .78rem; margin: 0 0 .65rem; }
.agent-sol-wallet .addr { font-family: ui-monospace, monospace; font-size: .8rem; background: rgba(255,255,255,0.05); color: #e6e6ea; padding: .4rem .55rem; border-radius: 5px; word-break: break-all; border: 1px solid rgba(255,255,255,0.06); }
.agent-sol-wallet .addr .pfx { background: linear-gradient(90deg,#ffd54f,#ff8a65); color: #1a1a1a; padding: 0 2px; border-radius: 2px; font-weight: 600; }
+.agent-sol-wallet .sns { display: inline-flex; align-items: center; gap: .35rem; margin-top: .35rem; padding: .2rem .55rem; font-family: ui-monospace, monospace; font-size: .78rem; font-weight: 600; color: #1a1a1a; background: linear-gradient(90deg,#a5d6a7,#80cbc4); border-radius: 999px; }
+.agent-sol-wallet .sns::before { content: '◎'; font-weight: 700; }
.agent-sol-wallet .row { display: flex; gap: .5rem; align-items: center; margin-top: .65rem; flex-wrap: wrap; }
.agent-sol-wallet button { font: inherit; padding: .4rem .8rem; border-radius: 6px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.04); color: #e6e6ea; cursor: pointer; }
.agent-sol-wallet button:hover:not(:disabled) { background: rgba(255,255,255,0.08); }
@@ -244,6 +246,7 @@ export function mountAgentSolanaWalletCard({ panel, identity, onProvisioned }) {
network: 'mainnet',
sol: null,
lamports: null,
+ snsDomain: null,
busy: false,
err: null,
activity: [],
@@ -266,6 +269,7 @@ export function mountAgentSolanaWalletCard({ panel, identity, onProvisioned }) {
state.source = r.data.source || null;
state.lamports = r.data.lamports;
state.sol = r.data.sol;
+ state.snsDomain = r.data.sns_domain || null;
_propagate(identity, r.data);
} else if (r.status === 'none') {
state.address = null;
@@ -287,6 +291,7 @@ export function mountAgentSolanaWalletCard({ panel, identity, onProvisioned }) {
if (r.status === 'ok') {
state.lamports = r.data.lamports;
state.sol = r.data.sol;
+ state.snsDomain = r.data.sns_domain || null;
render();
}
}
@@ -357,6 +362,7 @@ export function mountAgentSolanaWalletCard({ panel, identity, onProvisioned }) {
root.innerHTML = `
<h3>Solana wallet${state.source ? `<span class="src">· ${_esc(state.source)}</span>` : ''}</h3>
<div class="addr"><span class="pfx">${_esc(pfx)}</span>${_esc(rest)}</div>
+ ${state.snsDomain ? `<div><span class="sns" title="Primary .sol domain for this wallet">${_esc(state.snsDomain)}</span></div>` : ''}
<div class="balance">
<span class="sol">${_esc(solDisplay)}</span>
<span class="net">
diff --git a/src/solana/sns-subdomain.js b/src/solana/sns-subdomain.js
new file mode 100644
index 000000000..effad8a55
--- /dev/null
+++ b/src/solana/sns-subdomain.js
@@ -0,0 +1,143 @@
+/**
+ * Create a subdomain under a .sol parent owned by the platform.
+ *
+ * The platform holds the keypair for the parent domain (e.g. `threews.sol`).
+ * `createSubdomain` itself opens the new registry with the parent owner set
+ * as the owner of the subdomain; we then immediately transfer it to the
+ * requested final owner — both instructions are bundled into one tx so the
+ * subdomain is never claimable by a third party between create and transfer.
+ *
+ * The parent owner is the only signer. We use it as fee payer as well — gas
+ * is small (well under 0.01 SOL per subdomain) and absorbing it removes any
+ * wallet-signing UX from the user.
+ */
+
+import { Connection, Keypair, PublicKey, TransactionMessage, VersionedTransaction } from '@solana/web3.js';
+import bs58 from 'bs58';
+
+const DEFAULT_RPC_URL = process.env.SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
+
+/**
+ * Load the platform keypair that owns the parent .sol from
+ * THREEWS_SOL_PARENT_SECRET_BASE58 (a base58-encoded 64-byte ed25519 secret).
+ */
+export function loadParentOwnerKeypair() {
+ const b58 = process.env.THREEWS_SOL_PARENT_SECRET_BASE58;
+ if (!b58) {
+ const e = new Error('THREEWS_SOL_PARENT_SECRET_BASE58 is not set — subdomain minting is disabled');
+ e.status = 503;
+ e.code = 'parent_owner_unconfigured';
+ throw e;
+ }
+ let raw;
+ try {
+ raw = bs58.decode(b58);
+ } catch (err) {
+ const e = new Error(`THREEWS_SOL_PARENT_SECRET_BASE58 is not valid base58: ${err?.message}`);
+ e.status = 503;
+ e.code = 'parent_owner_misconfigured';
+ throw e;
+ }
+ if (raw.length !== 64) {
+ const e = new Error(`THREEWS_SOL_PARENT_SECRET_BASE58 decoded to ${raw.length} bytes; expected 64`);
+ e.status = 503;
+ e.code = 'parent_owner_misconfigured';
+ throw e;
+ }
+ return Keypair.fromSecretKey(raw);
+}
+
+export function getParentDomain() {
+ return (process.env.THREEWS_SOL_PARENT_DOMAIN || 'threews.sol').toLowerCase();
+}
+
+const LABEL_RE = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/;
+
+/**
+ * Validate a single subdomain label. Mirrors DNS-ish rules: 1–63 chars, no
+ * leading/trailing hyphen, lowercase letters/digits/hyphens only.
+ */
+export function normalizeLabel(input) {
+ const s = String(input || '').trim().toLowerCase();
+ if (!s) return null;
+ if (s.length > 63) return null;
+ if (!LABEL_RE.test(s)) return null;
+ return s;
+}
+
+/**
+ * Check whether `label.<parent>` already exists on-chain.
+ * Returns { exists: boolean, owner: string|null }.
+ */
+export async function checkSubdomainAvailability({ connection, parentDomain, label }) {
+ const sns = await import('@bonfida/spl-name-service');
+ const fullName = `${label}.${parentDomain.replace(/\.sol$/, '')}`;
+ const { pubkey } = sns.getDomainKeySync(fullName);
+ try {
+ const { registry } = await sns.NameRegistryState.retrieve(connection, pubkey);
+ return { exists: true, owner: registry.owner.toBase58() };
+ } catch {
+ return { exists: false, owner: null };
+ }
+}
+
+/**
+ * Build + send a transaction that:
+ * 1. createSubdomain(label.parentDomain) — parent owner signs, becomes owner
+ * of the freshly-minted registry.
+ * 2. transferSubdomain(label.parentDomain → newOwner) — parent owner signs
+ * again to hand the subdomain to the requested final owner.
+ *
+ * Returns { signature, fullName, owner }.
+ */
+export async function createNamedSubdomain({ label, newOwner, space = 2000, rpcUrl = DEFAULT_RPC_URL }) {
+ const cleanLabel = normalizeLabel(label);
+ if (!cleanLabel) {
+ const e = new Error('invalid subdomain label');
+ e.status = 400;
+ e.code = 'validation_error';
+ throw e;
+ }
+ const parentDomain = getParentDomain().replace(/\.sol$/, '');
+ const fullName = `${cleanLabel}.${parentDomain}`;
+ const newOwnerKey = new PublicKey(newOwner);
+
+ const parentKp = loadParentOwnerKeypair();
+ const connection = new Connection(rpcUrl, 'confirmed');
+
+ const availability = await checkSubdomainAvailability({
+ connection,
+ parentDomain,
+ label: cleanLabel,
+ });
+ if (availability.exists) {
+ const e = new Error(`${fullName}.sol already exists`);
+ e.status = 409;
+ e.code = 'conflict';
+ throw e;
+ }
+
+ const sns = await import('@bonfida/spl-name-service');
+ const createIxs = await sns.createSubdomain(connection, fullName, parentKp.publicKey, space);
+ const transferIxs = await sns.transferSubdomain(connection, fullName, newOwnerKey, true);
+
+ const ixs = [...createIxs, ...transferIxs];
+ const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash('confirmed');
+ const message = new TransactionMessage({
+ payerKey: parentKp.publicKey,
+ recentBlockhash: blockhash,
+ instructions: ixs,
+ }).compileToV0Message();
+ const tx = new VersionedTransaction(message);
+ tx.sign([parentKp]);
+
+ const signature = await connection.sendRawTransaction(tx.serialize(), { skipPreflight: false });
+ await connection.confirmTransaction({ signature, blockhash, lastValidBlockHeight }, 'confirmed');
+
+ return {
+ signature,
+ fullName: `${fullName}.sol`,
+ owner: newOwnerKey.toBase58(),
+ parent: `${parentDomain}.sol`,
+ };
+}
diff --git a/src/solana/sns.js b/src/solana/sns.js
index f40e4ac07..e576b9150 100644
--- a/src/solana/sns.js
+++ b/src/solana/sns.js
@@ -51,3 +51,32 @@ export async function reverseLookupAddress(addr) {
return null;
}
}
+
+const SOL_ADDRESS_RE = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+// Bare label, dotted subdomain (`nich.threews`), or either with a `.sol` suffix.
+const SOL_NAME_RE = /^[a-z0-9-]{1,63}(?:\.[a-z0-9-]{1,63})*(?:\.sol)?$/i;
+
+/**
+ * Resolve a user-supplied Solana recipient string to a base58 address.
+ *
+ * Accepts:
+ * - a raw base58 address (returned as-is)
+ * - a .sol domain name with or without the suffix (resolved via SNS)
+ *
+ * @param {string} input
+ * @returns {Promise<{ address: string|null, resolved_from: string|null }>}
+ */
+export async function resolveSolanaRecipient(input) {
+ const trimmed = String(input || '').trim();
+ if (SOL_ADDRESS_RE.test(trimmed)) {
+ return { address: trimmed, resolved_from: null };
+ }
+ if (SOL_NAME_RE.test(trimmed)) {
+ const bare = trimmed.toLowerCase().replace(/\.sol$/, '');
+ const address = await resolveSnsName(bare);
+ if (address && SOL_ADDRESS_RE.test(address)) {
+ return { address, resolved_from: `${bare}.sol` };
+ }
+ }
+ return { address: null, resolved_from: null };
+}
diff --git a/tests/api/sns.test.js b/tests/api/sns.test.js
new file mode 100644
index 000000000..da7ab14c1
--- /dev/null
+++ b/tests/api/sns.test.js
@@ -0,0 +1,141 @@
+// /api/sns endpoint — forward + reverse Solana Name Service lookups. We mock
+// the underlying `src/solana/sns.js` helpers so the test runs offline, and
+// assert the HTTP envelope (input validation, 404 vs 200 shape, Cache-Control
+// hints) plus the in-process positive/negative cache.
+
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+
+const resolveSnsName = vi.fn();
+const reverseLookupAddress = vi.fn();
+
+vi.mock('../../src/solana/sns.js', () => ({
+ resolveSnsName: (...a) => resolveSnsName(...a),
+ reverseLookupAddress: (...a) => reverseLookupAddress(...a),
+}));
+
+vi.mock('../../api/_lib/rate-limit.js', () => ({
+ limits: { snsResolve: vi.fn(async () => ({ success: true })) },
+ clientIp: () => '127.0.0.1',
+}));
+
+const ADDR = 'HKKp49zUBeaABFMpBWKCJPoNDLiR4AEEr8FJKuZPn6Nk';
+
+const handlerMod = await import('../../api/sns.js');
+const handler = handlerMod.default;
+const { forwardCache, reverseCache } = handlerMod._internals;
+
+function makeReq(url, method = 'GET') {
+ return { url, method, headers: { host: 'x' }, query: {} };
+}
+function makeRes() {
+ return {
+ statusCode: 200,
+ _h: {},
+ setHeader(k, v) { this._h[k.toLowerCase()] = v; },
+ getHeader(k) { return this._h[k.toLowerCase()]; },
+ end(body) { this._body = body; },
+ };
+}
+async function call(url, method) {
+ const res = makeRes();
+ await handler(makeReq(url, method), res);
+ let body = null;
+ try { body = JSON.parse(res._body); } catch {}
+ return { res, body };
+}
+
+beforeEach(() => {
+ resolveSnsName.mockReset();
+ reverseLookupAddress.mockReset();
+ forwardCache.clear();
+ reverseCache.clear();
+});
+
+describe('GET /api/sns?name=…', () => {
+ it('resolves a valid .sol name and returns address + Cache-Control', async () => {
+ resolveSnsName.mockResolvedValue(ADDR);
+ const { res, body } = await call('/api/sns?name=bonfida.sol');
+ expect(res.statusCode).toBe(200);
+ expect(body.data).toEqual({ name: 'bonfida.sol', address: ADDR, network: 'solana' });
+ expect(res.getHeader('cache-control')).toMatch(/max-age=300/);
+ expect(resolveSnsName).toHaveBeenCalledWith('bonfida');
+ });
+
+ it('accepts a bare label without .sol', async () => {
+ resolveSnsName.mockResolvedValue(ADDR);
+ const { body } = await call('/api/sns?name=bonfida');
+ expect(body.data.name).toBe('bonfida.sol');
+ expect(resolveSnsName).toHaveBeenCalledWith('bonfida');
+ });
+
+ it('accepts dotted subdomain names', async () => {
+ resolveSnsName.mockResolvedValue(ADDR);
+ const { res, body } = await call('/api/sns?name=nich.threews.sol');
+ expect(res.statusCode).toBe(200);
+ expect(body.data.name).toBe('nich.threews.sol');
+ expect(resolveSnsName).toHaveBeenCalledWith('nich.threews');
+ });
+
+ it('returns 404 when the name has no owner', async () => {
+ resolveSnsName.mockResolvedValue(null);
+ const { res, body } = await call('/api/sns?name=does-not-exist.sol');
+ expect(res.statusCode).toBe(404);
+ expect(body.error_description).toMatch(/does not resolve/);
+ expect(res.getHeader('cache-control')).toMatch(/max-age=30/);
+ });
+
+ it('rejects malformed names', async () => {
+ const { res, body } = await call('/api/sns?name=NOT*A*NAME');
+ expect(res.statusCode).toBe(400);
+ expect(body.error).toBe('validation_error');
+ expect(resolveSnsName).not.toHaveBeenCalled();
+ });
+
+ it('caches positive lookups so repeated calls hit memory once', async () => {
+ resolveSnsName.mockResolvedValue(ADDR);
+ await call('/api/sns?name=bonfida.sol');
+ await call('/api/sns?name=bonfida.sol');
+ await call('/api/sns?name=BONFIDA.sol');
+ expect(resolveSnsName).toHaveBeenCalledTimes(1);
+ });
+});
+
+describe('GET /api/sns?address=…', () => {
+ it('reverses a valid address to a .sol name', async () => {
+ reverseLookupAddress.mockResolvedValue('bonfida.sol');
+ const { res, body } = await call(`/api/sns?address=${ADDR}`);
+ expect(res.statusCode).toBe(200);
+ expect(body.data).toEqual({ name: 'bonfida.sol', address: ADDR, network: 'solana' });
+ expect(reverseLookupAddress).toHaveBeenCalledWith(ADDR);
+ });
+
+ it('returns 404 when no primary domain is set', async () => {
+ reverseLookupAddress.mockResolvedValue(null);
+ const { res, body } = await call(`/api/sns?address=${ADDR}`);
+ expect(res.statusCode).toBe(404);
+ expect(body.error_description).toMatch(/no primary/);
+ });
+
+ it('rejects malformed addresses', async () => {
+ const { res } = await call('/api/sns?address=not-an-address');
+ expect(res.statusCode).toBe(400);
+ expect(reverseLookupAddress).not.toHaveBeenCalled();
+ });
+});
+
+describe('GET /api/sns (input validation)', () => {
+ it('rejects calls with neither name nor address', async () => {
+ const { res } = await call('/api/sns');
+ expect(res.statusCode).toBe(400);
+ });
+
+ it('rejects calls with both name and address', async () => {
+ const { res } = await call(`/api/sns?name=x.sol&address=${ADDR}`);
+ expect(res.statusCode).toBe(400);
+ });
+
+ it('rejects non-GET methods', async () => {
+ const { res } = await call('/api/sns?name=x.sol', 'POST');
+ expect(res.statusCode).toBe(405);
+ });
+});
diff --git a/tests/solana-sns.test.js b/tests/solana-sns.test.js
index 59cc55571..59f74e376 100644
--- a/tests/solana-sns.test.js
+++ b/tests/solana-sns.test.js
@@ -21,7 +21,7 @@ vi.mock('@solana/web3.js', () => {
return { Connection, PublicKey };
});
-const { resolveSnsName, reverseLookupAddress } = await import('../src/solana/sns.js');
+const { resolveSnsName, reverseLookupAddress, resolveSolanaRecipient } = await import('../src/solana/sns.js');
describe('resolveSnsName', () => {
beforeEach(() => {
@@ -92,3 +92,57 @@ describe('reverseLookupAddress', () => {
expect(await reverseLookupAddress('someaddr')).toBeNull();
});
});
+
+describe('resolveSolanaRecipient', () => {
+ beforeEach(() => {
+ resolveMock.mockReset();
+ });
+
+ const VALID_ADDR = 'HKKp49zUBeaABFMpBWKCJPoNDLiR4AEEr8FJKuZPn6Nk';
+
+ it('passes a raw base58 address through unchanged', async () => {
+ const out = await resolveSolanaRecipient(VALID_ADDR);
+ expect(out).toEqual({ address: VALID_ADDR, resolved_from: null });
+ expect(resolveMock).not.toHaveBeenCalled();
+ });
+
+ it('resolves a .sol name and reports what it resolved from', async () => {
+ resolveMock.mockResolvedValue({ toBase58: () => VALID_ADDR });
+ const out = await resolveSolanaRecipient('bonfida.sol');
+ expect(out).toEqual({ address: VALID_ADDR, resolved_from: 'bonfida.sol' });
+ expect(resolveMock).toHaveBeenCalledWith(expect.anything(), 'bonfida');
+ });
+
+ it('resolves a bare label without the .sol suffix', async () => {
+ resolveMock.mockResolvedValue({ toBase58: () => VALID_ADDR });
+ const out = await resolveSolanaRecipient('bonfida');
+ expect(out.address).toBe(VALID_ADDR);
+ expect(out.resolved_from).toBe('bonfida.sol');
+ });
+
+ it('returns null address when the name does not resolve', async () => {
+ resolveMock.mockResolvedValue(null);
+ const out = await resolveSolanaRecipient('does-not-exist.sol');
+ expect(out).toEqual({ address: null, resolved_from: null });
+ });
+
+ it('returns null address for malformed input', async () => {
+ const out = await resolveSolanaRecipient('NOT*A*NAME');
+ expect(out.address).toBeNull();
+ expect(resolveMock).not.toHaveBeenCalled();
+ });
+
+ it('does not blindly trust a non-base58 result from the SNS sdk', async () => {
+ resolveMock.mockResolvedValue({ toBase58: () => '!!not-base58!!' });
+ const out = await resolveSolanaRecipient('weird.sol');
+ expect(out.address).toBeNull();
+ });
+
+ it('handles dotted subdomain SNS names', async () => {
+ resolveMock.mockResolvedValue({ toBase58: () => VALID_ADDR });
+ const out = await resolveSolanaRecipient('nich.threews.sol');
+ expect(out.address).toBe(VALID_ADDR);
+ expect(out.resolved_from).toBe('nich.threews.sol');
+ expect(resolveMock).toHaveBeenCalledWith(expect.anything(), 'nich.threews');
+ });
+});
diff --git a/vercel.json b/vercel.json
index d48b5b800..972f88023 100644
--- a/vercel.json
+++ b/vercel.json
@@ -8,15 +8,15 @@
},
"functions": {
"api/club/tips-stream.js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 300
},
"api/tts/speak.js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 60
},
"api/**/*.js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 30
}
},
@@ -1019,6 +1019,22 @@
"src": "/api/users/me/earnings",
"dest": "/api/users/earnings.js"
},
+ {
+ "src": "/api/users/by-subdomain",
+ "dest": "/api/users/by-subdomain.js"
+ },
+ {
+ "src": "/api/threews/subdomain",
+ "dest": "/api/threews/subdomain.js"
+ },
+ {
+ "src": "/api/x402/pay-by-name",
+ "dest": "/api/x402/pay-by-name.js"
+ },
+ {
+ "src": "/threews/claim",
+ "dest": "/threews-claim.html"
+ },
{
"src": "/api/users/([^/]+)",
"dest": "/api/users/[username]?username=$1"
diff --git a/vite.config.js b/vite.config.js
index e69f240ad..1a19d4e32 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -143,6 +143,7 @@ const appConfig = {
'launch-week': resolve(__dirname, 'pages/three-ws-launch-week.html'),
community: resolve(__dirname, 'pages/community.html'),
profile: resolve(__dirname, 'pages/profile.html'),
+ 'threews-claim': resolve(__dirname, 'pages/threews-claim.html'),
'avatar-page': resolve(__dirname, 'pages/avatar-page.html'),
'widget-studio': resolve(__dirname, 'pages/widget-studio.html'),
creating: resolve(__dirname, 'pages/creating.html'),