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.

Add Transaction History dashboard page + fix history endpoint

nirholasd95290a04314
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1fda091eb..db707c086 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,25 +6,35 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
## 2026-06-18
+- **Bundle specific skills into your subscription plans** — When you create or edit a subscription plan in the agent editor's Monetization tab, you can now tick exactly which of your agent's skills the plan includes. Subscribers to that plan get unlimited access to those skills for the life of their subscription, and the plan list shows what each plan bundles at a glance — so you can offer a focused starter plan and a fuller pro plan side by side. `[feature, improvement]`
- **Coin community worlds no longer get stuck on “Connecting…”** — Opening a coin community world could occasionally hang on “Connecting…” forever — you'd see only yourself, with chat, voice, and shared building all stalled and no way to recover short of a reload. It happened when the game server accepted the connection but never finished the join handshake, for instance while a server instance was waking from idle. The connection now has a firm time limit: if the handshake doesn't complete in time it retries on its own, and if the server stays unreachable it drops you cleanly into single-player so you can still explore and build locally — with the status pill tappable to reconnect. The same safeguard covers the open /walk world and the IRL map. `[fix]`
- **Connect a wallet and your $THREE tier is recognized — no account needed** — You no longer need a three.ws account to be seen as a $THREE holder. Connect your Solana wallet and the site reads your tier straight from your on-chain holdings: the holder chip in the top bar shows your live tier (◆ Bronze, Silver, Gold…) and holder features like High-quality generation on Forge unlock from the connected wallet alone. When a feature needs proof the wallet is yours, you approve a single free signature that moves no funds. Switch or disconnect a wallet and your tier updates instantly, no reload. Signed-in accounts keep working exactly as before. (`/forge`) `[improvement]`
- **Embedded 3D agents animate on any site, not just three.ws** — When you drop the <agent-3d> tag onto a page hosted somewhere other than three.ws, the avatar's gestures — waving, celebrating, thinking — silently failed to load: the animation clips were being requested from the host page's own domain instead of from three.ws, so each one came back as a 404. The component now resolves its animation library against three.ws no matter where it's embedded, so an agent reacts and emotes correctly on partner pages, live demos, and any third-party site. `[fix, sdk]`
+- **Faster marketplace — agent pages load skill prices from cache** — Agent and marketplace pages now feel snappier. A creator's skill prices are cached for an hour and shared across our servers instead of being re-read from the database on every single page view, so opening an agent, browsing the marketplace, or checking what a skill costs returns faster — especially for popular agents. The cache stays honest: the moment a creator changes a price the old value is cleared everywhere, so you always see the current price, and a purchase is still quoted against the exact price at checkout time. `[improvement, infra]`
- **Forge checkout no longer dead-ends when generation is briefly busy** — When the 3D generator was momentarily rate-limited mid-checkout, Forge could show a raw technical error and look like the payment had failed for good. Now a brief upstream slowdown shows a clear message — your payment was not taken, and the generation retries in a few seconds — and the checkout auto-retries on its own before ever asking you to try again. Your payment only settles once the model is actually produced, so a busy moment never costs you anything. (`/forge`) `[fix]`
+- **Gasless checkout — buy skills and assets with no SOL in your wallet** — Buying a skill, time-pass, or whole asset no longer requires you to hold SOL for the network fee. When your Solana wallet is connected, three.ws now sponsors the transaction fee: the platform builds and pre-signs the payment, and your wallet only adds your own approval. You still pay the USDC price (and sellers still receive their split), but the tiny gas fee is on us — one fewer thing to top up before you check out. If sponsorship is ever unavailable, checkout falls back to the normal pay-your-own-gas flow automatically, so a purchase never gets blocked. `[feature, improvement]`
- **Graduated coins show a live price on agent and community cards** — The bonding-curve card — the compact one on agent profiles, community coin pages, and embeddable widgets — used to go blank with a “No active bonding curve” message the moment a coin graduated to a DEX. Now it reads the coin's live on-chain price instead, marks it “Graduated” at 100%, and shows a real market cap, so $THREE and any other migrated coin display a refreshing price rather than empty space. Those cards also stopped opening a background websocket that could never connect — it had been silently retrying and logging errors on every load. Vault balances now refresh by polling directly and update within seconds. `[improvement, fix]`
- **Holding $THREE now unlocks a premium feature** — $THREE gets its first hard utility: High-quality 3D generation on Forge — the 200k-polygon, PBR-textured tier — is now reserved for $THREE holders. Reach the Bronze holder tier (the entry tier) by holding $THREE and the High tier unlocks automatically, with no payment step. Draft and Standard generation stay free forever, and bring-your-own-key generation is unaffected. Sign in, link your Solana wallet, and the economy page shows your live holder tier and exactly what it unlocks. (`/three`) `[feature]`
- **Leaving a review on an agent profile works again** — Submitting or updating a star rating on an agent's profile was quietly failing for signed-in users — the form said “Save failed” no matter what, because the security token that protects the save was being read incorrectly and never attached. Reviews now save on the first try. Signed-out visitors who tap Submit get a clear “Sign in to leave a review” prompt instead of a dead button, and agent profiles no longer log errors for agents that have no on-chain trading record — the track-record card simply stays hidden. `[fix]`
+- **Manage an agent's subscription tiers straight from the API** — An agent's subscription tiers can now be read and managed directly over the API at /api/agents/:id/tiers — list the tiers on an agent, create one, update its price, billing interval, perks, or bundled skills, and retire one when it's no longer offered. Retiring a tier is always a safe deactivation rather than a hard delete: subscribers already on it keep access until their current period ends, and the response tells you how many are still active, so a tier change never cuts off a paying fan mid-cycle. Only the agent's owner can make changes, and the public listing shows just the active tiers. `[feature, sdk]`
- **New guide: how avatars and animations actually work (FBX, GLB, JSON)** — There's now a full explainer for the 3D pipeline behind every avatar on the site — what FBX, GLB, and animation-clip files each do, how they convert into one another, and how a single dance can play on any character. It also documents the new one-command tool that turns an animated FBX avatar into a web-ready GLB, and the chain that generates a model from a text prompt, rigs it, animates it, and exports it. Useful if you're bringing your own avatar or building on the platform. `[docs]`
+- **Own your skills on-chain — verifiable skill-license NFTs** — Buying a skill can now mint you a real on-chain access key: a 1-of-1 NFT that lands in your own Solana wallet, plus a matching license record anyone can read back to prove you own that skill — no need to trust our database. It's a new Solana program (built with Anchor) where each license is tied to your wallet, the agent, and the specific skill, and a license can be cleanly burned (to dispose or transfer) or revoked on a refund. The platform can verify access straight from the chain at /api/skills/license-onchain, giving true, portable ownership of what you've bought. `[feature, sdk]`
+- **Paid skills are now properly gated — and your purchase always lets you in** — Every paid skill is now access-checked on the server before it runs, so a creator's work can't be used by someone who hasn't paid for it. The flip side matters just as much: if you already bought the skill, hold an active subscription, or have a creator tier that bundles it, you run it straight away with no second charge — subscription tiers now correctly unlock exactly the skills they include. Free trials are spent only as a last resort, never when a purchase or subscription already covers you. If you try a skill you don't have, you get a clear prompt to pick it up from the marketplace instead of a dead end. `[security, feature]`
+- **Pause and reopen your agent's subscription plans** — Managing subscription plans in the agent editor's Monetization tab just got fuller control. Each plan now has an Active toggle: switch one off to hide it from new subscribers (existing members keep access until their period ends), then reopen it whenever you like — paused plans no longer disappear from view. You can also change a plan's billing cycle between weekly and monthly when editing it. Up to three active plans per creator. `[feature, improvement]`
- **Pay $THREE per High generation — no holding required** — Don't hold $THREE yet but want a High-quality model? You can now pay in $THREE for a single High generation instead. Pick High in Forge, choose "Pay" on the holder panel, and a clean payment flow prices it in $THREE, takes one wallet approval, verifies it on-chain, and runs your generation automatically. The platform now genuinely accepts $THREE for compute. One payment buys exactly one High generation, and if a generation fails before it runs your payment stays usable — you're never charged for a model you didn't get. Draft and Standard remain free, and holders still generate High straight away. (`/forge`) `[feature]`
- **Pay the Club cover and your avatar dances on the way in** — When you walk up to the Pole Club door and pay the cover charge, your avatar now breaks into a dance the instant the USDC settles — right as the velvet rope drops — before strolling inside. It's your own moment in the spotlight for making it past the bouncer, the same way the dancers move when you tip them. The dance is skipped automatically if you've turned on reduced motion, so entry stays instant either way. (`/club`) `[feature]`
- **Platform revenue now buys back $THREE onchain — and you can watch it** — The $THREE page has a new Programmatic buybacks panel that turns the protocol's economy into something you can verify, not just read about. Platform revenue is converted into $THREE bought on the open market and routed straight into the treasury — onchain, on a schedule, with every buy recorded against its Solscan receipt. This creates steady buy pressure for holders without ever burning supply. The panel shows how much revenue has been earned and what share of it has already been deployed into buybacks, so the link between the platform earning money and that money supporting $THREE is fully transparent. (`/three-token`) `[feature, infra]`
- **Play is movable on phones again — and avatars load instead of a placeholder** — Two fixes for Play. On phones, the item hotbar had drifted on top of the on-screen movement joystick in the bottom-left corner, so taps meant to steer the stick landed on the hotbar instead and your character wouldn't move at all — with no keyboard to fall back on, you were stuck. The hotbar now sits in a clear band above the joystick, leaving the whole stick tappable. Separately, every avatar — yours, other players', and the loading-screen preview — had started appearing as a plain capsule stand-in because the app was missing the decoder for the compression format the avatars ship in; that decoder is now wired in, so real, animated avatars load everywhere in Play again. `[fix]`
- **Play loads reliably in private windows and embeds, and explains itself if 3D can't start** — Two ways Play could fail silently are fixed. First: if your browser couldn't start 3D graphics — hardware acceleration switched off, an older device, or some in-app browsers — Play used to sit on the loading screen forever with no explanation. It now shows a clear recovery card that tells you what happened and how to fix it, with a one-tap “Try again”. Second: opening Play in a private/incognito window, or where it's embedded inside another page, could stop it loading at all because the browser blocks saved settings there. Play now treats blocked storage gracefully — it falls back to a default name and avatar and loads normally instead of breaking. `[fix]`
- **Pole Club avatar swaps now actually stick** — On the Pole Club stage, tapping “Change avatar” and picking a new look sometimes did nothing — the dancer quietly snapped back to the default. Two fixes: a pick made right after the room loads is no longer overwritten by the room's own startup, and any avatar whose rig can't be animated is now clearly flagged “can’t dance” and skipped — the dancer keeps her current look and a message says why, instead of silently failing. Picks that work apply instantly and stay put. (`/club`) `[fix]`
+- **See every skill you've bought and sold in one Transactions tab** — The dashboard now has a Transactions page that lays out your full payment history in one place: every skill you've purchased from other agents and every sale your own agents have made, newest first. Each row shows the date, whether it was a purchase or a sale, the skill and agent involved, the USDC amount (sellers see their take-home net of the platform fee), and a link straight to the transaction on Solscan or Basescan. Filter by purchases or sales, and download the whole thing as a CSV for your records or taxes. (`/dashboard/transactions`) `[feature]`
+- **Steadier token prices and 3D generation when a provider is busy** — Live bonding-curve prices, market caps, and trade quotes now stay accurate even when a Solana data provider hits its rate limit: the platform transparently rotates to a healthy provider and parks the busy one, instead of repeatedly retrying a maxed-out endpoint and showing stale numbers. The free text-to-3D forge also rides out a cold or briefly-unavailable generation node by retrying once before falling back, so a momentary upstream hiccup no longer turns into a failed generation. `[fix, infra]`
- **The $THREE page now shows a live price chart** — $THREE graduated long ago, so the token page no longer has a bonding curve to climb — but the page still showed a “No active bonding curve” placeholder where the chart should be. That dead space is now a real, live price chart: an area chart with a volume panel underneath, pulling actual trade history (Birdeye with a GeckoTerminal fallback) and refreshing every 30 seconds. Switch between 5m, 15m, 1H, 4H, and 1D timeframes, and read the price and percentage move over the window you're viewing — green when it's up, red when it's down. Buy $THREE and the live trade tape sit right alongside it, unchanged. (`/three-token`) `[improvement]`
- **The 3D agent on the homepage moves again instead of standing frozen** — The live avatar in the homepage hero had stopped animating — it loaded but stood in a stiff arms-out pose, and the Wave, Dance, and Pray buttons did nothing. The viewer only renders frames while something is moving to save your battery, and a recent change meant that starting an animation no longer woke the renderer back up once it had gone idle, so the avatar was stuck on its first frame. The renderer is now nudged awake the instant any animation starts, so the homepage agent idles, walks, and responds to the move buttons as intended. `[fix]`
- **The animated 3D bot in the site footer renders again** — The little animated 3D robot that sits in the footer across the site — and on the sign-in page — had gone missing, leaving an empty space. The model files it loads are compressed, but the footer loader wasn't set up to unpack that format, so it failed before the bot could appear. The decoder is now wired in, so the bot loads and spins as intended everywhere the footer shows. `[fix]`
- **The disco dance floor in coin worlds works again** — Every coin world has a disco pad beside the totem that pulses to a shared beat and crossfades dancers in lockstep. A wiring gap meant the world tried to listen for a beat the connection didn't know about, which threw an error the moment you entered and left the pad dark. The beat is now delivered properly: step onto the pad, hit Dance, and you and everyone else standing on it move to the same animation on the same beat, with the floor and lights pulsing in time. (`/play`) `[fix]`
- **The homepage avatar now prays, then walks** — Tap “🙏 Pray” on the homepage hero and the avatar finishes the prayer and rises straight into a walk — one smooth motion instead of snapping back to a standing idle at the end of the clip. After the walk plays out, the avatar eases back into its gentle idle-and-stroll rhythm. The other one-tap emotes (wave, dance, jump, and the rest) also return to that ambient motion now instead of freezing on their last frame. `[improvement]`
+- **Tip a dancer for a Pole Twerk and she works the pole** — The Club stage has a new headline move: Pole Twerk, now the default style on every pole. Tip a dancer for it and instead of facing the crowd like the other styles, she turns into the pole and works it with her back to the room — a real pole-dancer twerk, not a free-floor one — set to its own track. Pick it (or any other style) from the dropdown on each pole before you tip; all the existing dances are still there. (`/club`) `[feature]`
- **Tipping a dancer goes straight to the wallet now** — Tapping Tip in the Pole Club used to open a three-step “Before you go on-chain” explainer first, and dismissing it cancelled the tip entirely — so first-time visitors couldn't pay without sitting through the wizard. That gate is gone. Tip now opens the wallet-and-amount checkout directly, where you pick Phantom or a browser wallet, see the exact USDC amount, and approve with one signature. The checkout already shows everything the explainer did, so there's no reason to stack a lecture in front of a fraction-of-a-cent tip. (`/club`) `[improvement]`
- **Tipping a dancer in the Club is now one tap** — In the Pole Club, paying a dancer used to pop an extra step that made you pick your wallet before anything happened — annoying when you just want to tip and watch her dance, and worse when tipping pole after pole. Now, when a single wallet is detected, hitting Tip goes straight to the signature: approve the $0.001 USDC and she takes the pole. The same shortcut applies to the cover charge at the door. If you have more than one wallet installed you still get to choose, and the free re-entry option for returning guests is untouched. (`/club`) `[improvement]`
- **Token swaps now confirm success or failure clearly** — When you buy $THREE (or swap any pair) from the swap window, it now tells you exactly how it went. After you approve in your wallet, a banner shows it submitting and confirming on-chain, then resolves to a clear result: a green “Swap confirmed” with the amount you received and a Solscan link, a red on-chain failure with the reason (and a hint to widen slippage when that's the cause), or a “still confirming” notice with a link if the network is slow. Previously a swap could land successfully but the window sat on “Confirming…” indefinitely with no confirmation — because it was waiting on a live socket the swap proxy doesn't carry. It now polls the chain directly and gives you a definite answer in seconds. (`/three-token`) `[fix]`
diff --git a/api/users/me/transaction-history.js b/api/users/me/transaction-history.js
index 0dd7f2be6..b029f2f10 100644
--- a/api/users/me/transaction-history.js
+++ b/api/users/me/transaction-history.js
@@ -9,7 +9,10 @@
* ?limit=50 — number of rows (max 200, default 50)
* ?offset=0 — pagination offset
*
- * Each row includes a `role` field ('buyer' or 'seller') and a Solscan link.
+ * Each row includes a `role` field ('buyer' or 'seller'), a decimals-aware
+ * `amount_display` (the amount that actually settled — for 'tipped' rows that is
+ * the on-chain amount, not the original quote), the seller's `net_display`
+ * (gross minus platform fee), and an `explorer_url` to the block explorer.
*/
import { sql } from '../../_lib/db.js';
@@ -57,14 +60,17 @@ export default wrap(async (req, res) => {
sp.status,
sp.kind,
sp.amount,
+ sp.tipped_amount,
sp.platform_fee_amount,
+ sp.mint_decimals,
sp.currency_mint,
sp.chain,
sp.tx_signature,
+ sp.skill_nft_mint,
sp.confirmed_at,
sp.created_at,
- ai.name AS agent_name,
- ai.handle AS agent_handle,
+ ai.name AS agent_name,
+ ai.profile_image_url AS agent_thumbnail,
'buyer'::text AS role
FROM skill_purchases sp
LEFT JOIN agent_identities ai ON ai.id = sp.agent_id
@@ -83,14 +89,17 @@ export default wrap(async (req, res) => {
sp.status,
sp.kind,
sp.amount,
+ sp.tipped_amount,
sp.platform_fee_amount,
+ sp.mint_decimals,
sp.currency_mint,
sp.chain,
sp.tx_signature,
+ sp.skill_nft_mint,
sp.confirmed_at,
sp.created_at,
- ai.name AS agent_name,
- ai.handle AS agent_handle,
+ ai.name AS agent_name,
+ ai.profile_image_url AS agent_thumbnail,
'seller'::text AS role
FROM skill_purchases sp
JOIN agent_identities ai ON ai.id = sp.agent_id AND ai.user_id = ${userId}
@@ -115,14 +124,31 @@ export default wrap(async (req, res) => {
if (!seen.has(key)) { seen.add(key); deduped.push(row); }
}
- const transactions = deduped.slice(0, limit).map((row) => ({
- ...row,
- amount_display: (Number(row.amount) / 1e6).toFixed(2),
- platform_fee_display: row.platform_fee_amount
- ? (Number(row.platform_fee_amount) / 1e6).toFixed(2)
- : null,
- explorer_url: txLink(row.chain, row.tx_signature),
- }));
+ const toUnits = (atomics, decimals) => {
+ const n = Number(atomics);
+ if (!Number.isFinite(n)) return '0.00';
+ return (n / 10 ** decimals).toFixed(2);
+ };
+
+ const transactions = deduped.slice(0, limit).map((row) => {
+ const decimals = Number(row.mint_decimals ?? 6) || 6;
+ // 'tipped' rows settled for a different amount than the quote — report what
+ // actually moved on-chain, not the original ask. Everything else uses amount.
+ const settledAtomics = row.status === 'tipped' && row.tipped_amount != null
+ ? row.tipped_amount
+ : row.amount;
+ const feeAtomics = Number(row.platform_fee_amount) || 0;
+ // Seller take-home = gross minus the platform fee collected on-chain.
+ const netAtomics = Math.max(0, (Number(settledAtomics) || 0) - feeAtomics);
+ return {
+ ...row,
+ amount_atomics: String(settledAtomics ?? '0'),
+ amount_display: toUnits(settledAtomics, decimals),
+ platform_fee_display: feeAtomics ? toUnits(feeAtomics, decimals) : null,
+ net_display: row.role === 'seller' ? toUnits(netAtomics, decimals) : null,
+ explorer_url: txLink(row.chain, row.tx_signature),
+ };
+ });
return json(res, 200, { transactions, count: transactions.length }, { 'cache-control': 'private, max-age=30' });
});
diff --git a/data/changelog.json b/data/changelog.json
index 685fe3817..ed2d58b74 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1,6 +1,96 @@
{
"$comment": "Curated changelog entries for three.ws \u2014 the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.",
"entries": [
+ {
+ "date": "2026-06-18",
+ "title": "Faster marketplace — agent pages load skill prices from cache",
+ "summary": "Agent and marketplace pages now feel snappier. A creator's skill prices are cached for an hour and shared across our servers instead of being re-read from the database on every single page view, so opening an agent, browsing the marketplace, or checking what a skill costs returns faster — especially for popular agents. The cache stays honest: the moment a creator changes a price the old value is cleared everywhere, so you always see the current price, and a purchase is still quoted against the exact price at checkout time.",
+ "tags": [
+ "improvement",
+ "infra"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Paid skills are now properly gated — and your purchase always lets you in",
+ "summary": "Every paid skill is now access-checked on the server before it runs, so a creator's work can't be used by someone who hasn't paid for it. The flip side matters just as much: if you already bought the skill, hold an active subscription, or have a creator tier that bundles it, you run it straight away with no second charge — subscription tiers now correctly unlock exactly the skills they include. Free trials are spent only as a last resort, never when a purchase or subscription already covers you. If you try a skill you don't have, you get a clear prompt to pick it up from the marketplace instead of a dead end.",
+ "tags": [
+ "security",
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Own your skills on-chain — verifiable skill-license NFTs",
+ "summary": "Buying a skill can now mint you a real on-chain access key: a 1-of-1 NFT that lands in your own Solana wallet, plus a matching license record anyone can read back to prove you own that skill — no need to trust our database. It's a new Solana program (built with Anchor) where each license is tied to your wallet, the agent, and the specific skill, and a license can be cleanly burned (to dispose or transfer) or revoked on a refund. The platform can verify access straight from the chain at /api/skills/license-onchain, giving true, portable ownership of what you've bought.",
+ "tags": [
+ "feature",
+ "sdk"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Manage an agent's subscription tiers straight from the API",
+ "summary": "An agent's subscription tiers can now be read and managed directly over the API at /api/agents/:id/tiers — list the tiers on an agent, create one, update its price, billing interval, perks, or bundled skills, and retire one when it's no longer offered. Retiring a tier is always a safe deactivation rather than a hard delete: subscribers already on it keep access until their current period ends, and the response tells you how many are still active, so a tier change never cuts off a paying fan mid-cycle. Only the agent's owner can make changes, and the public listing shows just the active tiers.",
+ "tags": [
+ "feature",
+ "sdk"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Gasless checkout — buy skills and assets with no SOL in your wallet",
+ "summary": "Buying a skill, time-pass, or whole asset no longer requires you to hold SOL for the network fee. When your Solana wallet is connected, three.ws now sponsors the transaction fee: the platform builds and pre-signs the payment, and your wallet only adds your own approval. You still pay the USDC price (and sellers still receive their split), but the tiny gas fee is on us — one fewer thing to top up before you check out. If sponsorship is ever unavailable, checkout falls back to the normal pay-your-own-gas flow automatically, so a purchase never gets blocked.",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Steadier token prices and 3D generation when a provider is busy",
+ "summary": "Live bonding-curve prices, market caps, and trade quotes now stay accurate even when a Solana data provider hits its rate limit: the platform transparently rotates to a healthy provider and parks the busy one, instead of repeatedly retrying a maxed-out endpoint and showing stale numbers. The free text-to-3D forge also rides out a cold or briefly-unavailable generation node by retrying once before falling back, so a momentary upstream hiccup no longer turns into a failed generation.",
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "See every skill you've bought and sold in one Transactions tab",
+ "summary": "The dashboard now has a Transactions page that lays out your full payment history in one place: every skill you've purchased from other agents and every sale your own agents have made, newest first. Each row shows the date, whether it was a purchase or a sale, the skill and agent involved, the USDC amount (sellers see their take-home net of the platform fee), and a link straight to the transaction on Solscan or Basescan. Filter by purchases or sales, and download the whole thing as a CSV for your records or taxes.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/dashboard/transactions"
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Bundle specific skills into your subscription plans",
+ "summary": "When you create or edit a subscription plan in the agent editor's Monetization tab, you can now tick exactly which of your agent's skills the plan includes. Subscribers to that plan get unlimited access to those skills for the life of their subscription, and the plan list shows what each plan bundles at a glance \u2014 so you can offer a focused starter plan and a fuller pro plan side by side.",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Pause and reopen your agent's subscription plans",
+ "summary": "Managing subscription plans in the agent editor's Monetization tab just got fuller control. Each plan now has an Active toggle: switch one off to hide it from new subscribers (existing members keep access until their period ends), then reopen it whenever you like — paused plans no longer disappear from view. You can also change a plan's billing cycle between weekly and monthly when editing it. Up to three active plans per creator.",
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "title": "Tip a dancer for a Pole Twerk and she works the pole",
+ "summary": "The Club stage has a new headline move: Pole Twerk, now the default style on every pole. Tip a dancer for it and instead of facing the crowd like the other styles, she turns into the pole and works it with her back to the room — a real pole-dancer twerk, not a free-floor one — set to its own track. Pick it (or any other style) from the dropdown on each pole before you tip; all the existing dances are still there.",
+ "tags": [
+ "feature"
+ ],
+ "link": "/club"
+ },
{
"date": "2026-06-18",
"title": "New guide: how avatars and animations actually work (FBX, GLB, JSON)",
diff --git a/pages/dashboard-next/transactions.html b/pages/dashboard-next/transactions.html
new file mode 100644
index 000000000..070e3d9e5
--- /dev/null
+++ b/pages/dashboard-next/transactions.html
@@ -0,0 +1,15 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <title>Transactions · Dashboard · three.ws</title>
+ <meta name="robots" content="noindex" />
+ <link rel="icon" href="/favicon.ico" />
+ <link rel="stylesheet" href="/fonts/fonts.css" />
+ <link rel="stylesheet" href="/dashboard-next/shell.css" />
+ </head>
+ <body>
+ <script type="module" src="/src/dashboard-next/pages/transactions.js"></script>
+ </body>
+</html>
diff --git a/prompts/monetization/15-transaction-history.md b/prompts/monetization/15-transaction-history.md
deleted file mode 100644
index 63842a964..000000000
--- a/prompts/monetization/15-transaction-history.md
+++ /dev/null
@@ -1,86 +0,0 @@
-# Prompt 15: Transaction History
-
-## Objective
-Create a transaction history page or dashboard section for both users (buyers) and creators (sellers) to view past transactions.
-
-## Explanation
-Transparency is key for any platform dealing with payments. Users should be able to see a clear record of their purchases, and creators should be able to track their sales. This task involves creating a new database table to log transactions and building the UI and API to display this history.
-
-## Instructions
-1. **Database Schema:**
- * Create a `transactions` table to log every purchase.
- * Columns should include: `id`, `buyer_user_id`, `creator_user_id`, `agent_id`, `skill_name`, `amount`, `platform_fee`, `currency_mint`, `signature`, and `created_at`.
-
-2. **Log Transactions (Backend):**
- * In your payment confirmation logic (`api/payments/prepare-skill-purchase.js` `GET` handler), after verifying the transaction and granting skill access, insert a new record into this `transactions` table.
-
-3. **Create API Endpoint(s) (Backend):**
- * Create an endpoint `/api/users/me/transaction-history` that returns transactions where the user is either the `buyer_user_id` or the `creator_user_id`.
- * You could add a query parameter `?role=buyer` or `?role=seller` to filter the results.
-
-4. **Build the UI (Frontend):**
- * In the user's dashboard, create a new "Transaction History" tab or section.
- * Fetch data from the new endpoint.
- * Display the transactions in a table or list format.
- * The view should clearly distinguish between sales and purchases. For each transaction, show details like date, item, amount, role (Buyer/Seller), and a link to the transaction on a block explorer like Solscan.
-
-## Code Example (Backend - Logging the transaction)
-
-```javascript
-// Inside the payment confirmation (GET handler) after successful verification
-
-// ...
-await grantSkillToUser(purchaseDetails.userId, purchaseDetails.skillName);
-
-// Now, log the transaction
-await logTransaction({
- buyerUserId: purchaseDetails.userId,
- creatorUserId: purchaseDetails.creatorId, // You need to fetch/store this
- agentId: purchaseDetails.agentId,
- skillName: purchaseDetails.skillName,
- amount: purchaseDetails.amount,
- platformFee: calculatedPlatformFee,
- currencyMint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyB7u6d',
- signature: req.query.signature
-});
-
-res.status(200).json({ status: 'ok', message: 'Purchase confirmed!' });
-```
-
-## UI Table Example (`dashboard.html`)
-
-```html
-<section>
- <h2>Transaction History</h2>
- <div class="table-wrapper">
- <table>
- <thead>
- <tr>
- <th>Date</th>
- <th>Type</th>
- <th>Details</th>
- <th>Amount</th>
- <th>Tx</th>
- </tr>
- </thead>
- <tbody id="transaction-history-body">
- <!-- Rows will be injected here -->
- </tbody>
- </table>
- </div>
-</section>
-```
-
-<!-- AUTO:self-delete-on-complete -->
-
----
-
-## ✅ On completion — delete this file
-
-This file is a unit of work, not a permanent doc. The moment every item above is **built, wired, verified, and committed** to the "Definition of done" in the repo-root `CLAUDE.md`, remove it in the same change:
-
-```bash
-git rm "prompts/monetization/15-transaction-history.md"
-```
-
-Stage the deletion alongside your implementation and include it in the completion commit. This directory is the backlog: a file that still exists is unfinished work; a file that is gone has shipped. Do not delete early, and never leave a completed prompt behind.
diff --git a/public/changelog.json b/public/changelog.json
index 6e9ff557b..40ccf07fb 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,11 +1,22 @@
{
- "generated_at": "2026-06-18T07:01:53.628Z",
+ "generated_at": "2026-06-18T07:40:04.896Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
"url": "https://three.ws"
},
"entries": [
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Bundle specific skills into your subscription plans",
+ "summary": "When you create or edit a subscription plan in the agent editor's Monetization tab, you can now tick exactly which of your agent's skills the plan includes. Subscribers to that plan get unlimited access to those skills for the life of their subscription, and the plan list shows what each plan bundles at a glance — so you can offer a focused starter plan and a fuller pro plan side by side.",
+ "link": null,
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
@@ -37,6 +48,17 @@
"sdk"
]
},
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Faster marketplace — agent pages load skill prices from cache",
+ "summary": "Agent and marketplace pages now feel snappier. A creator's skill prices are cached for an hour and shared across our servers instead of being re-read from the database on every single page view, so opening an agent, browsing the marketplace, or checking what a skill costs returns faster — especially for popular agents. The cache stays honest: the moment a creator changes a price the old value is cleared everywhere, so you always see the current price, and a purchase is still quoted against the exact price at checkout time.",
+ "link": null,
+ "tags": [
+ "improvement",
+ "infra"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
@@ -47,6 +69,17 @@
"fix"
]
},
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Gasless checkout — buy skills and assets with no SOL in your wallet",
+ "summary": "Buying a skill, time-pass, or whole asset no longer requires you to hold SOL for the network fee. When your Solana wallet is connected, three.ws now sponsors the transaction fee: the platform builds and pre-signs the payment, and your wallet only adds your own approval. You still pay the USDC price (and sellers still receive their split), but the tiny gas fee is on us — one fewer thing to top up before you check out. If sponsorship is ever unavailable, checkout falls back to the normal pay-your-own-gas flow automatically, so a purchase never gets blocked.",
+ "link": null,
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
@@ -78,6 +111,17 @@
"fix"
]
},
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Manage an agent's subscription tiers straight from the API",
+ "summary": "An agent's subscription tiers can now be read and managed directly over the API at /api/agents/:id/tiers — list the tiers on an agent, create one, update its price, billing interval, perks, or bundled skills, and retire one when it's no longer offered. Retiring a tier is always a safe deactivation rather than a hard delete: subscribers already on it keep access until their current period ends, and the response tells you how many are still active, so a tier change never cuts off a paying fan mid-cycle. Only the agent's owner can make changes, and the public listing shows just the active tiers.",
+ "link": null,
+ "tags": [
+ "feature",
+ "sdk"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
@@ -88,6 +132,39 @@
"docs"
]
},
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Own your skills on-chain — verifiable skill-license NFTs",
+ "summary": "Buying a skill can now mint you a real on-chain access key: a 1-of-1 NFT that lands in your own Solana wallet, plus a matching license record anyone can read back to prove you own that skill — no need to trust our database. It's a new Solana program (built with Anchor) where each license is tied to your wallet, the agent, and the specific skill, and a license can be cleanly burned (to dispose or transfer) or revoked on a refund. The platform can verify access straight from the chain at /api/skills/license-onchain, giving true, portable ownership of what you've bought.",
+ "link": null,
+ "tags": [
+ "feature",
+ "sdk"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Paid skills are now properly gated — and your purchase always lets you in",
+ "summary": "Every paid skill is now access-checked on the server before it runs, so a creator's work can't be used by someone who hasn't paid for it. The flip side matters just as much: if you already bought the skill, hold an active subscription, or have a creator tier that bundles it, you run it straight away with no second charge — subscription tiers now correctly unlock exactly the skills they include. Free trials are spent only as a last resort, never when a purchase or subscription already covers you. If you try a skill you don't have, you get a clear prompt to pick it up from the marketplace instead of a dead end.",
+ "link": null,
+ "tags": [
+ "security",
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Pause and reopen your agent's subscription plans",
+ "summary": "Managing subscription plans in the agent editor's Monetization tab just got fuller control. Each plan now has an Active toggle: switch one off to hide it from new subscribers (existing members keep access until their period ends), then reopen it whenever you like — paused plans no longer disappear from view. You can also change a plan's billing cycle between weekly and monthly when editing it. Up to three active plans per creator.",
+ "link": null,
+ "tags": [
+ "feature",
+ "improvement"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
@@ -149,6 +226,27 @@
"fix"
]
},
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "See every skill you've bought and sold in one Transactions tab",
+ "summary": "The dashboard now has a Transactions page that lays out your full payment history in one place: every skill you've purchased from other agents and every sale your own agents have made, newest first. Each row shows the date, whether it was a purchase or a sale, the skill and agent involved, the USDC amount (sellers see their take-home net of the platform fee), and a link straight to the transaction on Solscan or Basescan. Filter by purchases or sales, and download the whole thing as a CSV for your records or taxes.",
+ "link": "/dashboard/transactions",
+ "tags": [
+ "feature"
+ ]
+ },
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Steadier token prices and 3D generation when a provider is busy",
+ "summary": "Live bonding-curve prices, market caps, and trade quotes now stay accurate even when a Solana data provider hits its rate limit: the platform transparently rotates to a healthy provider and parks the busy one, instead of repeatedly retrying a maxed-out endpoint and showing stale numbers. The free text-to-3D forge also rides out a cold or briefly-unavailable generation node by retrying once before falling back, so a momentary upstream hiccup no longer turns into a failed generation.",
+ "link": null,
+ "tags": [
+ "fix",
+ "infra"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
@@ -199,6 +297,16 @@
"improvement"
]
},
+ {
+ "date": "2026-06-18",
+ "type": "update",
+ "title": "Tip a dancer for a Pole Twerk and she works the pole",
+ "summary": "The Club stage has a new headline move: Pole Twerk, now the default style on every pole. Tip a dancer for it and instead of facing the crowd like the other styles, she turns into the pole and works it with her back to the room — a real pole-dancer twerk, not a free-floor one — set to its own track. Pick it (or any other style) from the dropdown on each pole before you tip; all the existing dances are still there.",
+ "link": "/club",
+ "tags": [
+ "feature"
+ ]
+ },
{
"date": "2026-06-18",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index 17aa08a4d..c89c2d43e 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -6,6 +6,14 @@
<atom:link href="https://three.ws/changelog.xml" rel="self" type="application/rss+xml"/>
<description>What's new on three.ws — features, improvements, and releases, newest first.</description>
<language>en</language>
+ <item>
+ <title>Bundle specific skills into your subscription plans</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Bundle specific skills into your subscription plans</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>When you create or edit a subscription plan in the agent editor's Monetization tab, you can now tick exactly which of your agent's skills the plan includes. Subscribers to that plan get unlimited access to those skills for the life of their subscription, and the plan list shows what each plan bundles at a glance — so you can offer a focused starter plan and a fuller pro plan side by side.</description>
+ </item>
<item>
<title>Coin community worlds no longer get stuck on “Connecting…”</title>
<link>https://three.ws/changelog</link>
@@ -30,6 +38,14 @@
<category>fix</category>
<description>When you drop the &lt;agent-3d&gt; tag onto a page hosted somewhere other than three.ws, the avatar's gestures — waving, celebrating, thinking — silently failed to load: the animation clips were being requested from the host page's own domain instead of from three.ws, so each one came back as a 404. The component now resolves its animation library against three.ws no matter where it's embedded, so an agent reacts and emotes correctly on partner pages, live demos, and any third-party site.</description>
</item>
+ <item>
+ <title>Faster marketplace — agent pages load skill prices from cache</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Faster marketplace — agent pages load skill prices from cache</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>Agent and marketplace pages now feel snappier. A creator's skill prices are cached for an hour and shared across our servers instead of being re-read from the database on every single page view, so opening an agent, browsing the marketplace, or checking what a skill costs returns faster — especially for popular agents. The cache stays honest: the moment a creator changes a price the old value is cleared everywhere, so you always see the current price, and a purchase is still quoted against the exact price at checkout time.</description>
+ </item>
<item>
<title>Forge checkout no longer dead-ends when generation is briefly busy</title>
<link>https://three.ws/forge</link>
@@ -38,6 +54,14 @@
<category>fix</category>
<description>When the 3D generator was momentarily rate-limited mid-checkout, Forge could show a raw technical error and look like the payment had failed for good. Now a brief upstream slowdown shows a clear message — your payment was not taken, and the generation retries in a few seconds — and the checkout auto-retries on its own before ever asking you to try again. Your payment only settles once the model is actually produced, so a busy moment never costs you anything.</description>
</item>
+ <item>
+ <title>Gasless checkout — buy skills and assets with no SOL in your wallet</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Gasless checkout — buy skills and assets with no SOL in your wallet</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Buying a skill, time-pass, or whole asset no longer requires you to hold SOL for the network fee. When your Solana wallet is connected, three.ws now sponsors the transaction fee: the platform builds and pre-signs the payment, and your wallet only adds your own approval. You still pay the USDC price (and sellers still receive their split), but the tiny gas fee is on us — one fewer thing to top up before you check out. If sponsorship is ever unavailable, checkout falls back to the normal pay-your-own-gas flow automatically, so a purchase never gets blocked.</description>
+ </item>
<item>
<title>Graduated coins show a live price on agent and community cards</title>
<link>https://three.ws/changelog</link>
@@ -62,6 +86,14 @@
<category>fix</category>
<description>Submitting or updating a star rating on an agent's profile was quietly failing for signed-in users — the form said “Save failed” no matter what, because the security token that protects the save was being read incorrectly and never attached. Reviews now save on the first try. Signed-out visitors who tap Submit get a clear “Sign in to leave a review” prompt instead of a dead button, and agent profiles no longer log errors for agents that have no on-chain trading record — the track-record card simply stays hidden.</description>
</item>
+ <item>
+ <title>Manage an agent's subscription tiers straight from the API</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Manage an agent's subscription tiers straight from the API</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>An agent's subscription tiers can now be read and managed directly over the API at /api/agents/:id/tiers — list the tiers on an agent, create one, update its price, billing interval, perks, or bundled skills, and retire one when it's no longer offered. Retiring a tier is always a safe deactivation rather than a hard delete: subscribers already on it keep access until their current period ends, and the response tells you how many are still active, so a tier change never cuts off a paying fan mid-cycle. Only the agent's owner can make changes, and the public listing shows just the active tiers.</description>
+ </item>
<item>
<title>New guide: how avatars and animations actually work (FBX, GLB, JSON)</title>
<link>https://three.ws/changelog</link>
@@ -70,6 +102,30 @@
<category>docs</category>
<description>There's now a full explainer for the 3D pipeline behind every avatar on the site — what FBX, GLB, and animation-clip files each do, how they convert into one another, and how a single dance can play on any character. It also documents the new one-command tool that turns an animated FBX avatar into a web-ready GLB, and the chain that generates a model from a text prompt, rigs it, animates it, and exports it. Useful if you're bringing your own avatar or building on the platform.</description>
</item>
+ <item>
+ <title>Own your skills on-chain — verifiable skill-license NFTs</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Own your skills on-chain — verifiable skill-license NFTs</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Buying a skill can now mint you a real on-chain access key: a 1-of-1 NFT that lands in your own Solana wallet, plus a matching license record anyone can read back to prove you own that skill — no need to trust our database. It's a new Solana program (built with Anchor) where each license is tied to your wallet, the agent, and the specific skill, and a license can be cleanly burned (to dispose or transfer) or revoked on a refund. The platform can verify access straight from the chain at /api/skills/license-onchain, giving true, portable ownership of what you've bought.</description>
+ </item>
+ <item>
+ <title>Paid skills are now properly gated — and your purchase always lets you in</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Paid skills are now properly gated — and your purchase always lets you in</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>security</category>
+ <description>Every paid skill is now access-checked on the server before it runs, so a creator's work can't be used by someone who hasn't paid for it. The flip side matters just as much: if you already bought the skill, hold an active subscription, or have a creator tier that bundles it, you run it straight away with no second charge — subscription tiers now correctly unlock exactly the skills they include. Free trials are spent only as a last resort, never when a purchase or subscription already covers you. If you try a skill you don't have, you get a clear prompt to pick it up from the marketplace instead of a dead end.</description>
+ </item>
+ <item>
+ <title>Pause and reopen your agent's subscription plans</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Pause and reopen your agent's subscription plans</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>Managing subscription plans in the agent editor's Monetization tab just got fuller control. Each plan now has an Active toggle: switch one off to hide it from new subscribers (existing members keep access until their period ends), then reopen it whenever you like — paused plans no longer disappear from view. You can also change a plan's billing cycle between weekly and monthly when editing it. Up to three active plans per creator.</description>
+ </item>
<item>
<title>Pay $THREE per High generation — no holding required</title>
<link>https://three.ws/forge</link>
@@ -118,6 +174,22 @@
<category>fix</category>
<description>On the Pole Club stage, tapping “Change avatar” and picking a new look sometimes did nothing — the dancer quietly snapped back to the default. Two fixes: a pick made right after the room loads is no longer overwritten by the room's own startup, and any avatar whose rig can't be animated is now clearly flagged “can’t dance” and skipped — the dancer keeps her current look and a message says why, instead of silently failing. Picks that work apply instantly and stay put.</description>
</item>
+ <item>
+ <title>See every skill you've bought and sold in one Transactions tab</title>
+ <link>https://three.ws/dashboard/transactions</link>
+ <guid isPermaLink="false">2026-06-18:See every skill you've bought and sold in one Transactions tab</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The dashboard now has a Transactions page that lays out your full payment history in one place: every skill you've purchased from other agents and every sale your own agents have made, newest first. Each row shows the date, whether it was a purchase or a sale, the skill and agent involved, the USDC amount (sellers see their take-home net of the platform fee), and a link straight to the transaction on Solscan or Basescan. Filter by purchases or sales, and download the whole thing as a CSV for your records or taxes.</description>
+ </item>
+ <item>
+ <title>Steadier token prices and 3D generation when a provider is busy</title>
+ <link>https://three.ws/changelog</link>
+ <guid isPermaLink="false">2026-06-18:Steadier token prices and 3D generation when a provider is busy</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>fix</category>
+ <description>Live bonding-curve prices, market caps, and trade quotes now stay accurate even when a Solana data provider hits its rate limit: the platform transparently rotates to a healthy provider and parks the busy one, instead of repeatedly retrying a maxed-out endpoint and showing stale numbers. The free text-to-3D forge also rides out a cold or briefly-unavailable generation node by retrying once before falling back, so a momentary upstream hiccup no longer turns into a failed generation.</description>
+ </item>
<item>
<title>The $THREE page now shows a live price chart</title>
<link>https://three.ws/three-token</link>
@@ -158,6 +230,14 @@
<category>improvement</category>
<description>Tap “🙏 Pray” on the homepage hero and the avatar finishes the prayer and rises straight into a walk — one smooth motion instead of snapping back to a standing idle at the end of the clip. After the walk plays out, the avatar eases back into its gentle idle-and-stroll rhythm. The other one-tap emotes (wave, dance, jump, and the rest) also return to that ambient motion now instead of freezing on their last frame.</description>
</item>
+ <item>
+ <title>Tip a dancer for a Pole Twerk and she works the pole</title>
+ <link>https://three.ws/club</link>
+ <guid isPermaLink="false">2026-06-18:Tip a dancer for a Pole Twerk and she works the pole</guid>
+ <pubDate>Thu, 18 Jun 2026 12:00:00 GMT</pubDate>
+ <category>feature</category>
+ <description>The Club stage has a new headline move: Pole Twerk, now the default style on every pole. Tip a dancer for it and instead of facing the crowd like the other styles, she turns into the pole and works it with her back to the room — a real pole-dancer twerk, not a free-floor one — set to its own track. Pick it (or any other style) from the dropdown on each pole before you tip; all the existing dances are still there.</description>
+ </item>
<item>
<title>Tipping a dancer goes straight to the wallet now</title>
<link>https://three.ws/club</link>
diff --git a/public/features.json b/public/features.json
index 155fe73e7..5affed2be 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-18T07:01:53.616Z",
+ "generated_at": "2026-06-18T07:40:04.878Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/src/dashboard-next/nav.js b/src/dashboard-next/nav.js
index 025d063a1..0b20bc388 100644
--- a/src/dashboard-next/nav.js
+++ b/src/dashboard-next/nav.js
@@ -35,6 +35,7 @@ export const NAV = [
{ path: '/dashboard/holders', label: 'Holders', icon: 'three', group: 'Monetize', tags: ['leaderboard', 'holders', 'rank', 'badge', '$three', 'whale', 'top holders', 'standing'] },
{ path: '/dashboard/analytics', label: 'Analytics', icon: 'chart', group: 'Monetize', tags: ['revenue', 'charts', 'metrics', 'funnel', 'performance', 'views', 'engagement'] },
{ path: '/dashboard/monetize', label: 'Monetize', icon: 'coin', group: 'Monetize', tags: ['revenue', 'payments', 'subscriptions', 'withdrawals', 'earnings', 'plan', 'billing'] },
+ { path: '/dashboard/transactions',label: 'Transactions', icon: 'receipt', group: 'Monetize', tags: ['history', 'purchases', 'sales', 'receipts', 'ledger', 'orders', 'spent', 'earned', 'invoice', 'transaction history', 'buys', 'csv'] },
{ path: '/dashboard/tokens', label: 'Tokens', icon: 'token', group: 'Monetize', tags: ['pump.fun', 'launch', 'bonding curve', 'royalties', 'trade'] },
{ path: '/dashboard/copy', label: 'Copy Trading', icon: 'live', group: 'Monetize', tags: ['copy', 'copy-trade', 'mirror', 'leader', 'follow', 'traders', 'intents', 'pump.fun', 'sniper'] },
{ path: '/dashboard/sniper', label: 'Sniper Strategies', icon: 'live', group: 'Monetize', tags: ['sniper', 'autonomous', 'strategy', 'pump.fun', 'auto-trade', 'budget', 'positions', 'pnl', 'kill-switch'] },
@@ -96,6 +97,7 @@ export const ICONS = {
bounty: '<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="10" cy="10" r="7.5"/><path d="M10 6v8M7 8l3-2 3 2M7 12l3 2 3-2"/></svg>',
gift: '<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><rect x="3" y="8" width="14" height="9" rx="1.5"/><path d="M3 11h14M10 8v9"/><path d="M10 8S8.5 4.5 6.5 4.5a2 2 0 000 4H10zM10 8s1.5-3.5 3.5-3.5a2 2 0 010 4H10z"/></svg>',
pin: '<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M10 2a5 5 0 015 5c0 3.5-5 11-5 11S5 10.5 5 7a5 5 0 015-5z"/><circle cx="10" cy="7" r="1.8"/></svg>',
+ receipt: '<svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5 2.5h10v15l-2-1.2-2 1.2-2-1.2-2 1.2-2-1.2V2.5z"/><path d="M8 6.5h4M8 9.5h4M8 12.5h2.5"/></svg>',
};
/** Resolve the route for the current pathname (exact match wins; falls back to startsWith). */
diff --git a/src/dashboard-next/pages/transactions.js b/src/dashboard-next/pages/transactions.js
new file mode 100644
index 000000000..0194ef078
--- /dev/null
+++ b/src/dashboard-next/pages/transactions.js
@@ -0,0 +1,420 @@
+// dashboard-next — Transaction History page.
+//
+// A single, honest ledger of everything the signed-in user has bought (as a
+// buyer) and sold (as a creator) across their agents' skills. Reads the real
+// /api/users/me/transaction-history endpoint, which is itself backed by the
+// skill_purchases ledger the payment-confirm pipeline writes to — there is no
+// separate copy of the data to drift out of sync.
+//
+// Buyers see what they spent; creators see what they earned (net of platform
+// fee). Every settled row links to the transaction on a block explorer.
+
+import { mountShell } from '../shell.js';
+import { requireUser, get, esc, relTime, ApiError } from '../api.js';
+import { errorStateHTML, emptyStateHTML, ensureStateKitStyles } from '../../shared/state-kit.js';
+
+const FETCH_LIMIT = 200; // endpoint hard cap; we paginate the rest client-side
+const PAGE_SIZE = 25;
+
+const FILTERS = [
+ { key: 'all', label: 'All' },
+ { key: 'buyer', label: 'Purchases' },
+ { key: 'seller', label: 'Sales' },
+];
+
+let allRows = []; // every transaction returned this load
+let activeFilter = 'all';
+let visibleCount = PAGE_SIZE;
+
+(async function boot() {
+ try {
+ const main = await mountShell();
+ await requireUser();
+
+ injectStyles();
+ main.innerHTML = `
+ <div class="tx-head">
+ <div>
+ <h1 class="dn-h1">Transaction History</h1>
+ <p class="dn-h1-sub">Every skill you've purchased and every sale your agents have made, in USDC.</p>
+ </div>
+ <button class="dn-btn" data-action="export" disabled>Download CSV</button>
+ </div>
+ <div data-slot="summary" class="tx-summary"></div>
+ <div class="dn-panel" style="margin-top:18px">
+ <div class="tx-toolbar">
+ <div class="tx-tabs" role="tablist" aria-label="Filter transactions">
+ ${FILTERS.map((f, i) => `
+ <button class="tx-tab${i === 0 ? ' is-active' : ''}" role="tab"
+ aria-selected="${i === 0 ? 'true' : 'false'}" data-filter="${f.key}">${esc(f.label)}</button>
+ `).join('')}
+ </div>
+ <div class="tx-toolbar-meta" data-slot="meta"></div>
+ </div>
+ <div data-slot="body"></div>
+ </div>
+ `;
+
+ wireTabs(main);
+ main.querySelector('[data-action="export"]').addEventListener('click', exportCsv);
+
+ await load(main);
+ } catch (err) {
+ if (err instanceof ApiError && err.status === 401) {
+ const ret = encodeURIComponent(location.pathname + location.search);
+ location.href = `/login?return=${ret}`;
+ return;
+ }
+ throw err;
+ }
+})();
+
+// ── Data ────────────────────────────────────────────────────────────────────
+
+async function load(main) {
+ const body = main.querySelector('[data-slot="body"]');
+ const summary = main.querySelector('[data-slot="summary"]');
+ const exportBtn = main.querySelector('[data-action="export"]');
+
+ body.innerHTML = skeletonRows();
+ summary.innerHTML = summarySkeleton();
+
+ let data;
+ try {
+ data = await get(`/api/users/me/transaction-history?role=all&limit=${FETCH_LIMIT}`);
+ } catch (err) {
+ if (err instanceof ApiError && err.status === 401) throw err;
+ ensureStateKitStyles();
+ summary.innerHTML = '';
+ body.innerHTML = errorStateHTML({
+ title: "Couldn't load your transactions",
+ body: 'We had trouble reaching the ledger. Check your connection and try again.',
+ });
+ body.querySelector('[data-sk-retry]')?.addEventListener('click', () => load(main));
+ return;
+ }
+
+ allRows = Array.isArray(data?.transactions) ? data.transactions : [];
+ visibleCount = PAGE_SIZE;
+ exportBtn.disabled = allRows.length === 0;
+
+ renderSummary(summary);
+ renderBody(main);
+}
+
+// ── Summary cards ─────────────────────────────────────────────────────────────
+
+function renderSummary(host) {
+ const buyer = allRows.filter((r) => r.role === 'buyer');
+ const seller = allRows.filter((r) => r.role === 'seller');
+
+ const spent = buyer.reduce((s, r) => s + numUnits(r.amount_display), 0);
+ const earned = seller.reduce((s, r) => s + numUnits(r.net_display), 0);
+
+ host.innerHTML = [
+ statCard('Total spent', usd(spent), `${buyer.length} purchase${buyer.length === 1 ? '' : 's'}`, 'var(--nxt-ink)'),
+ statCard('Net earned', usd(earned), `${seller.length} sale${seller.length === 1 ? '' : 's'}`, 'var(--nxt-success)'),
+ statCard('Transactions', String(allRows.length), allRows.length >= FETCH_LIMIT ? 'Most recent 200 shown' : 'All time', 'var(--nxt-accent)'),
+ ].join('');
+}
+
+function statCard(title, value, sub, color) {
+ return `
+ <div class="dn-panel tx-stat">
+ <div class="dn-panel-title">${esc(title)}</div>
+ <div class="tx-stat-value" style="color:${color}">${esc(value)}</div>
+ <div class="dn-panel-sub">${esc(sub)}</div>
+ </div>`;
+}
+
+// ── Table body ────────────────────────────────────────────────────────────────
+
+function renderBody(main) {
+ const body = main.querySelector('[data-slot="body"]');
+ const meta = main.querySelector('[data-slot="meta"]');
+ const rows = filteredRows();
+
+ meta.textContent = rows.length
+ ? `${Math.min(visibleCount, rows.length)} of ${rows.length}`
+ : '';
+
+ if (!rows.length) {
+ ensureStateKitStyles();
+ body.innerHTML = emptyStateHTML({
+ title: activeFilter === 'seller' ? 'No sales yet' : activeFilter === 'buyer' ? 'No purchases yet' : 'No transactions yet',
+ body: activeFilter === 'seller'
+ ? 'When someone unlocks one of your agents&#39; paid skills, the sale shows up here.'
+ : activeFilter === 'buyer'
+ ? 'Skills you unlock from other agents will appear here with a receipt and explorer link.'
+ : 'Buy a skill or sell one of yours and it&#39;ll be recorded here — with a link to the on-chain transaction.',
+ actions: activeFilter === 'seller'
+ ? [{ label: 'Set skill prices', href: '/dashboard/monetize', primary: true }]
+ : [{ label: 'Browse the marketplace', href: '/marketplace', primary: true }],
+ });
+ return;
+ }
+
+ const slice = rows.slice(0, visibleCount);
+ body.innerHTML = `
+ <div class="tx-scroll">
+ <table class="tx-table">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Type</th>
+ <th>Details</th>
+ <th style="text-align:right">Amount</th>
+ <th>Status</th>
+ <th>Tx</th>
+ </tr>
+ </thead>
+ <tbody>${slice.map(rowHtml).join('')}</tbody>
+ </table>
+ </div>
+ ${rows.length > visibleCount
+ ? `<div class="tx-more"><button class="dn-btn" data-action="more">Show more · ${rows.length - visibleCount} remaining</button></div>`
+ : ''}
+ `;
+
+ body.querySelector('[data-action="more"]')?.addEventListener('click', () => {
+ visibleCount += PAGE_SIZE;
+ renderBody(main);
+ });
+}
+
+function rowHtml(r) {
+ const when = r.confirmed_at || r.created_at;
+ const isSale = r.role === 'seller';
+
+ const typeTag = isSale
+ ? '<span class="dn-tag success">Sale</span>'
+ : '<span class="dn-tag" style="border-color:var(--nxt-accent);color:var(--nxt-accent)">Purchase</span>';
+
+ const agentName = r.agent_name ? esc(r.agent_name) : 'Unknown agent';
+ const agentCell = r.agent_id && r.agent_name
+ ? `<a class="tx-agent" href="/agent/${encodeURIComponent(r.agent_id)}">${agentName}</a>`
+ : `<span class="tx-agent tx-agent--muted">${agentName}</span>`;
+
+ // Buyer pays out (−), seller takes home (+). Sellers also see gross + fee.
+ const amountCell = isSale
+ ? `<div class="tx-amt tx-amt--in">+${esc(usd(numUnits(r.net_display)))}</div>
+ ${r.platform_fee_display ? `<div class="tx-amt-sub">gross ${esc(usd(numUnits(r.amount_display)))} · fee ${esc(usd(numUnits(r.platform_fee_display)))}</div>` : ''}`
+ : `<div class="tx-amt">−${esc(usd(numUnits(r.amount_display)))}</div>`;
+
+ return `
+ <tr>
+ <td class="tx-when">
+ <div>${esc(formatDate(when))}</div>
+ <div class="tx-when-rel">${esc(relTime(when))}</div>
+ </td>
+ <td>${typeTag}</td>
+ <td>
+ <div class="tx-skill">${esc(humanizeSkill(r.skill))}</div>
+ <div class="tx-sub">${agentCell}${r.skill_nft_mint ? ' · <span class="tx-nft">NFT</span>' : ''}</div>
+ </td>
+ <td style="text-align:right;white-space:nowrap">${amountCell}</td>
+ <td>${statusTag(r)}</td>
+ <td>${txCell(r)}</td>
+ </tr>`;
+}
+
+function statusTag(r) {
+ if (r.kind === 'trial' || r.status === 'trial') return '<span class="dn-tag">Trial</span>';
+ if (r.status === 'tipped') {
+ return `<span class="dn-tag warn" title="Settled for a different amount than quoted — the amount shown is what moved on-chain">Adjusted</span>`;
+ }
+ return '<span class="dn-tag success">Settled</span>';
+}
+
+function txCell(r) {
+ if (!r.explorer_url || !r.tx_signature) {
+ return '<span class="tx-muted">—</span>';
+ }
+ const short = `${String(r.tx_signature).slice(0, 6)}…${String(r.tx_signature).slice(-4)}`;
+ return `<a class="tx-link" href="${esc(r.explorer_url)}" target="_blank" rel="noopener" title="View on block explorer">${esc(short)} ↗</a>`;
+}
+
+// ── Tabs ──────────────────────────────────────────────────────────────────────
+
+function wireTabs(main) {
+ main.querySelectorAll('[data-filter]').forEach((btn) => {
+ btn.addEventListener('click', () => {
+ if (activeFilter === btn.dataset.filter) return;
+ activeFilter = btn.dataset.filter;
+ visibleCount = PAGE_SIZE;
+ main.querySelectorAll('[data-filter]').forEach((b) => {
+ const on = b.dataset.filter === activeFilter;
+ b.classList.toggle('is-active', on);
+ b.setAttribute('aria-selected', on ? 'true' : 'false');
+ });
+ renderBody(main);
+ });
+ });
+}
+
+function filteredRows() {
+ if (activeFilter === 'all') return allRows;
+ return allRows.filter((r) => r.role === activeFilter);
+}
+
+// ── CSV export ────────────────────────────────────────────────────────────────
+
+function exportCsv() {
+ const rows = filteredRows();
+ if (!rows.length) return;
+
+ const header = ['Date', 'Type', 'Skill', 'Agent', 'Amount (USDC)', 'Platform fee (USDC)', 'Status', 'Chain', 'Signature', 'Explorer'];
+ const lines = rows.map((r) => [
+ (r.confirmed_at || r.created_at || ''),
+ r.role === 'seller' ? 'Sale' : 'Purchase',
+ r.skill || '',
+ r.agent_name || '',
+ r.role === 'seller' ? (r.net_display ?? r.amount_display ?? '') : (r.amount_display ?? ''),
+ r.platform_fee_display ?? '',
+ r.kind === 'trial' || r.status === 'trial' ? 'Trial' : r.status === 'tipped' ? 'Adjusted' : 'Settled',
+ r.chain || '',
+ r.tx_signature || '',
+ r.explorer_url || '',
+ ].map(csvCell).join(','));
+
+ const csv = [header.map(csvCell).join(','), ...lines].join('\r\n');
+ const blob = new Blob([csv], { type: 'text/csv;charset=utf-8' });
+ const url = URL.createObjectURL(blob);
+ const a = document.createElement('a');
+ a.href = url;
+ a.download = `three-ws-transactions-${activeFilter}.csv`;
+ document.body.appendChild(a);
+ a.click();
+ a.remove();
+ setTimeout(() => URL.revokeObjectURL(url), 0);
+}
+
+function csvCell(v) {
+ const s = String(v ?? '');
+ return /[",\r\n]/.test(s) ? `"${s.replace(/"/g, '""')}"` : s;
+}
+
+// ── Formatting helpers ────────────────────────────────────────────────────────
+
+function numUnits(displayStr) {
+ const n = parseFloat(displayStr);
+ return Number.isFinite(n) ? n : 0;
+}
+
+function usd(n) {
+ return (Number(n) || 0).toLocaleString('en-US', { style: 'currency', currency: 'USD' });
+}
+
+function formatDate(iso) {
+ const d = new Date(iso);
+ if (isNaN(d)) return '—';
+ return d.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' });
+}
+
+function humanizeSkill(skill) {
+ if (!skill) return 'Skill';
+ return String(skill).replace(/[_-]+/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase());
+}
+
+// ── Skeletons ─────────────────────────────────────────────────────────────────
+
+function summarySkeleton() {
+ return Array.from({ length: 3 }).map(() => `
+ <div class="dn-panel tx-stat">
+ <div class="dn-skeleton" style="height:12px;width:55%;margin-bottom:12px"></div>
+ <div class="dn-skeleton" style="height:28px;width:70%;margin-bottom:8px"></div>
+ <div class="dn-skeleton" style="height:11px;width:45%"></div>
+ </div>`).join('');
+}
+
+function skeletonRows() {
+ return `
+ <div class="tx-scroll">
+ <table class="tx-table">
+ <tbody>
+ ${Array.from({ length: 6 }).map(() => `
+ <tr>
+ <td><div class="dn-skeleton" style="height:12px;width:80px"></div></td>
+ <td><div class="dn-skeleton" style="height:18px;width:64px;border-radius:999px"></div></td>
+ <td><div class="dn-skeleton" style="height:12px;width:60%;margin-bottom:6px"></div><div class="dn-skeleton" style="height:10px;width:40%"></div></td>
+ <td><div class="dn-skeleton" style="height:12px;width:70px;margin-left:auto"></div></td>
+ <td><div class="dn-skeleton" style="height:18px;width:60px;border-radius:999px"></div></td>
+ <td><div class="dn-skeleton" style="height:12px;width:72px"></div></td>
+ </tr>`).join('')}
+ </tbody>
+ </table>
+ </div>`;
+}
+
+// ── Styles ────────────────────────────────────────────────────────────────────
+
+function injectStyles() {
+ if (document.getElementById('tx-styles')) return;
+ const style = document.createElement('style');
+ style.id = 'tx-styles';
+ style.textContent = `
+.tx-head {
+ display:flex; align-items:flex-start; justify-content:space-between;
+ gap:16px; flex-wrap:wrap; margin-bottom:6px;
+}
+.tx-summary {
+ display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-top:14px;
+}
+.tx-stat { padding:16px 18px; }
+.tx-stat-value {
+ font-size:26px; font-weight:700; letter-spacing:-0.02em;
+ margin:6px 0 4px; font-variant-numeric:tabular-nums;
+}
+.tx-toolbar {
+ display:flex; align-items:center; justify-content:space-between;
+ gap:12px; flex-wrap:wrap; margin-bottom:12px;
+}
+.tx-tabs { display:inline-flex; gap:4px; background:rgba(255,255,255,0.04); padding:3px; border-radius:10px; }
+.tx-tab {
+ appearance:none; border:0; background:transparent; cursor:pointer;
+ padding:6px 14px; border-radius:8px; font:inherit; font-size:13px;
+ color:var(--nxt-ink-dim); transition:background 0.15s, color 0.15s;
+}
+.tx-tab:hover { color:var(--nxt-ink); }
+.tx-tab.is-active { background:var(--nxt-accent-soft,rgba(255,255,255,0.1)); color:var(--nxt-ink); font-weight:600; }
+.tx-tab:focus-visible { outline:2px solid var(--nxt-accent); outline-offset:2px; }
+.tx-toolbar-meta { font-size:12px; color:var(--nxt-ink-fade); font-variant-numeric:tabular-nums; }
+
+.tx-scroll { overflow-x:auto; }
+.tx-table { width:100%; border-collapse:collapse; font-size:13px; min-width:640px; }
+.tx-table th {
+ text-align:left; font-weight:500; color:var(--nxt-ink-fade);
+ font-size:11px; text-transform:uppercase; letter-spacing:0.06em;
+ padding:8px 10px; border-bottom:1px solid var(--nxt-stroke);
+}
+.tx-table td { padding:11px 10px; border-bottom:1px solid var(--nxt-stroke); vertical-align:top; }
+.tx-table tbody tr { transition:background 0.1s; }
+.tx-table tbody tr:hover { background:rgba(255,255,255,0.02); }
+
+.tx-when { white-space:nowrap; }
+.tx-when-rel { font-size:11.5px; color:var(--nxt-ink-fade); margin-top:2px; }
+.tx-skill { font-weight:600; color:var(--nxt-ink); }
+.tx-sub { font-size:12px; color:var(--nxt-ink-fade); margin-top:2px; }
+.tx-agent { color:var(--nxt-ink-dim); text-decoration:none; }
+.tx-agent:hover { color:var(--nxt-accent); text-decoration:underline; }
+.tx-agent--muted { color:var(--nxt-ink-fade); }
+.tx-nft {
+ display:inline-block; font-size:10px; font-weight:600; letter-spacing:0.04em;
+ color:var(--nxt-accent); border:1px solid var(--nxt-accent); border-radius:4px; padding:0 4px;
+}
+.tx-amt { font-variant-numeric:tabular-nums; font-weight:600; }
+.tx-amt--in { color:var(--nxt-success); }
+.tx-amt-sub { font-size:11px; color:var(--nxt-ink-fade); margin-top:2px; font-variant-numeric:tabular-nums; }
+.tx-link { color:var(--nxt-accent); text-decoration:none; font-family:'JetBrains Mono',ui-monospace,monospace; font-size:12px; white-space:nowrap; }
+.tx-link:hover { text-decoration:underline; }
+.tx-muted { color:var(--nxt-ink-fade); }
+
+.tx-more { margin-top:14px; text-align:center; }
+
+@media (max-width:640px) {
+ .tx-table { min-width:560px; }
+ .tx-stat-value { font-size:22px; }
+}
+`;
+ document.head.appendChild(style);
+}
diff --git a/tests/api/transaction-history.test.js b/tests/api/transaction-history.test.js
new file mode 100644
index 000000000..ee777f8be
--- /dev/null
+++ b/tests/api/transaction-history.test.js
@@ -0,0 +1,170 @@
+// GET /api/users/me/transaction-history — buyer + seller ledger.
+//
+// The endpoint reads the skill_purchases ledger from two angles: purchases the
+// caller made (buyer leg) and sales on agents the caller owns (seller leg),
+// merges them, and decorates each row with a decimals-aware settled amount, the
+// seller's net (gross − platform fee), and a block-explorer link. These tests
+// pin that decoration and the role filter. DB / auth / limiter are mocked so the
+// suite stays offline.
+
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { invoke } from '../_helpers/monetization.js';
+
+let buyerRows = [];
+let sellerRows = [];
+let calls = [];
+
+const sqlMock = vi.fn((strings, ...values) => {
+ const q = Array.isArray(strings) ? strings.join(' ') : String(strings);
+ calls.push({ q, values });
+ if (/'buyer'::text AS role/.test(q)) return Promise.resolve(buyerRows);
+ if (/'seller'::text AS role/.test(q)) return Promise.resolve(sellerRows);
+ return Promise.resolve([]);
+});
+vi.mock('../../api/_lib/db.js', () => ({ sql: sqlMock }));
+
+let sessionUser = null;
+let bearerUser = null;
+vi.mock('../../api/_lib/auth.js', () => ({
+ getSessionUser: vi.fn(async () => sessionUser),
+ authenticateBearer: vi.fn(async () => bearerUser),
+ extractBearer: vi.fn(() => null),
+}));
+
+let rlSuccess = true;
+vi.mock('../../api/_lib/rate-limit.js', () => ({
+ limits: { widgetRead: vi.fn(async () => ({ success: rlSuccess, reset: Date.now() + 1000, limit: 120, remaining: 0 })) },
+ clientIp: vi.fn(() => '127.0.0.1'),
+}));
+
+const { default: handler } = await import('../../api/users/me/transaction-history.js');
+
+const AGENT_ID = '00000000-0000-4000-8000-000000000abc';
+const URL = '/api/users/me/transaction-history';
+
+const findCall = (re) => calls.find((c) => re.test(c.q));
+
+function buyerRow(over = {}) {
+ return {
+ id: 'p1', agent_id: AGENT_ID, skill: 'web_search', status: 'confirmed', kind: 'purchase',
+ amount: '1000000', tipped_amount: null, platform_fee_amount: '50000', mint_decimals: 6,
+ currency_mint: 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v', chain: 'solana',
+ tx_signature: 'SIG_BUY', skill_nft_mint: null,
+ confirmed_at: '2026-06-17T10:00:00.000Z', created_at: '2026-06-17T09:59:00.000Z',
+ agent_name: 'Helper', agent_thumbnail: null, role: 'buyer', ...over,
+ };
+}
+
+function sellerRow(over = {}) {
+ return {
+ id: 's1', agent_id: AGENT_ID, skill: 'summarize', status: 'confirmed', kind: 'purchase',
+ amount: '1000000', tipped_amount: null, platform_fee_amount: '50000', mint_decimals: 6,
+ currency_mint: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', chain: 'base',
+ tx_signature: '0xabc123', skill_nft_mint: null,
+ confirmed_at: '2026-06-16T10:00:00.000Z', created_at: '2026-06-16T09:59:00.000Z',
+ agent_name: 'Helper', agent_thumbnail: null, role: 'seller', ...over,
+ };
+}
+
+beforeEach(() => {
+ sqlMock.mockClear();
+ calls = [];
+ buyerRows = [];
+ sellerRows = [];
+ sessionUser = null;
+ bearerUser = null;
+ rlSuccess = true;
+});
+
+describe('auth + input guards', () => {
+ it('401s when unauthenticated', async () => {
+ const { status, body } = await invoke(handler, { method: 'GET', url: URL });
+ expect(status).toBe(401);
+ expect(body.error).toBe('unauthorized');
+ expect(calls).toHaveLength(0);
+ });
+
+ it('400s on an unknown role', async () => {
+ sessionUser = { id: 'owner-uuid' };
+ const { status, body } = await invoke(handler, { method: 'GET', url: `${URL}?role=bogus` });
+ expect(status).toBe(400);
+ expect(body.error).toBe('validation_error');
+ });
+
+ it('429s when rate-limited', async () => {
+ sessionUser = { id: 'owner-uuid' };
+ rlSuccess = false;
+ const { status } = await invoke(handler, { method: 'GET', url: URL });
+ expect(status).toBe(429);
+ });
+});
+
+describe('role filter', () => {
+ beforeEach(() => { sessionUser = { id: 'owner-uuid' }; });
+
+ it('role=buyer only runs the buyer leg', async () => {
+ buyerRows = [buyerRow()];
+ const { status, body } = await invoke(handler, { method: 'GET', url: `${URL}?role=buyer` });
+ expect(status).toBe(200);
+ expect(findCall(/'buyer'::text AS role/)).toBeDefined();
+ expect(findCall(/'seller'::text AS role/)).toBeUndefined();
+ expect(body.transactions).toHaveLength(1);
+ expect(body.transactions[0].role).toBe('buyer');
+ });
+
+ it('role=seller only runs the seller leg', async () => {
+ sellerRows = [sellerRow()];
+ const { status, body } = await invoke(handler, { method: 'GET', url: `${URL}?role=seller` });
+ expect(status).toBe(200);
+ expect(findCall(/'seller'::text AS role/)).toBeDefined();
+ expect(findCall(/'buyer'::text AS role/)).toBeUndefined();
+ expect(body.transactions[0].role).toBe('seller');
+ });
+
+ it('role=all merges both legs newest-first', async () => {
+ buyerRows = [buyerRow()]; // 2026-06-17
+ sellerRows = [sellerRow()]; // 2026-06-16
+ const { status, body } = await invoke(handler, { method: 'GET', url: `${URL}?role=all` });
+ expect(status).toBe(200);
+ expect(body.count).toBe(2);
+ expect(body.transactions[0].role).toBe('buyer'); // newer sorts first
+ expect(body.transactions[1].role).toBe('seller');
+ });
+});
+
+describe('row decoration', () => {
+ beforeEach(() => { sessionUser = { id: 'owner-uuid' }; });
+
+ it('formats the buyer amount and links to Solscan', async () => {
+ buyerRows = [buyerRow()];
+ const { body } = await invoke(handler, { method: 'GET', url: `${URL}?role=buyer` });
+ const t = body.transactions[0];
+ expect(t.amount_display).toBe('1.00');
+ expect(t.platform_fee_display).toBe('0.05');
+ expect(t.net_display).toBeNull(); // net is a seller concept
+ expect(t.explorer_url).toBe('https://solscan.io/tx/SIG_BUY');
+ });
+
+ it('reports the seller net (gross − fee) and a Basescan link for EVM', async () => {
+ sellerRows = [sellerRow()];
+ const { body } = await invoke(handler, { method: 'GET', url: `${URL}?role=seller` });
+ const t = body.transactions[0];
+ expect(t.amount_display).toBe('1.00');
+ expect(t.net_display).toBe('0.95');
+ expect(t.explorer_url).toBe('https://basescan.org/tx/0xabc123');
+ });
+
+ it('a tipped row reports the amount that actually settled, not the quote', async () => {
+ buyerRows = [buyerRow({ status: 'tipped', amount: '2000000', tipped_amount: '1500000' })];
+ const { body } = await invoke(handler, { method: 'GET', url: `${URL}?role=buyer` });
+ const t = body.transactions[0];
+ expect(t.amount_display).toBe('1.50');
+ expect(t.amount_atomics).toBe('1500000');
+ });
+
+ it('honours a non-6 mint_decimals when formatting', async () => {
+ buyerRows = [buyerRow({ amount: '500000000', platform_fee_amount: '0', mint_decimals: 9 })];
+ const { body } = await invoke(handler, { method: 'GET', url: `${URL}?role=buyer` });
+ expect(body.transactions[0].amount_display).toBe('0.50'); // 5e8 / 1e9
+ });
+});