Skip to content

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

fix(art): proxy the coin logos on the four surfaces that still painted them raw

nirholas050dae5f589c
diff --git a/src/clash.js b/src/clash.js
index aebab6c78..cbb020bae 100644
--- a/src/clash.js
+++ b/src/clash.js
@@ -13,6 +13,7 @@
import { initWalletButton, getConnectedWallet, getConnectedWalletAddress } from './wallet.js';
import { log } from './shared/log.js';
import { updateValue, ring, playRings, setLiveDot } from './ui-juice.js';
+import { proxiedImageURL } from './ipfs.js';
const $ = (id) => document.getElementById(id);
const API = '/api/clash';
@@ -434,8 +435,12 @@ function openRallyDock() {
$('cl-rally-symbol').textContent = e.symbol;
$('cl-rally-hold').textContent = e.usd ? `holding ${fmtUsd(e.usd)}` : `holder · ${short(e.wallet)}`;
const img = $('cl-rally-img');
- if (e.image) {
- img.src = e.image;
+ // Faction art is the coin's own logo, hosted wherever its creator put it, so
+ // it goes through the same-origin proxy: a rate-limited gateway would
+ // otherwise leave the rally dock with a broken tile and a console error.
+ const rallyArt = proxiedImageURL(e.image || '', e.token || '', { width: 128 });
+ if (rallyArt) {
+ img.src = rallyArt;
img.style.display = '';
} else img.style.display = 'none';
updateRallyStats();
diff --git a/src/game/coin-buy.js b/src/game/coin-buy.js
index 3b7e1f311..aa5beeb54 100644
--- a/src/game/coin-buy.js
+++ b/src/game/coin-buy.js
@@ -22,6 +22,7 @@ import './coin-buy.css';
import { detectSolanaWallet, SOLANA_RPC, solanaTxExplorerUrl } from '../erc8004/solana-deploy.js';
import { createSafetyPanel } from '../shared/safety-panel.js';
import { createSmartMoneyPanel } from '../shared/smart-money-panel.js';
+import { proxiedImageURL } from '../ipfs.js';
const WSOL = 'So11111111111111111111111111111111111111112';
const USDC_MINT = {
@@ -87,6 +88,13 @@ function shortAddr(a) {
return a ? `${a.slice(0, 4)}…${a.slice(-4)}` : '';
}
+// The buy sheet shows the coin's own logo, which lives on whichever host its
+// creator used. The same-origin proxy keeps a rate-limited gateway from leaving
+// a broken tile in a purchase flow, and sizes the art to the sheet.
+function coinArt(coin) {
+ return proxiedImageURL(coin?.image || '', coin?.mint || '', { width: 128 });
+}
+
/**
* Map a trade failure to copy the player can act on. A bare "Trade failed."
* tells them nothing; each branch points at the actual next step (add SOL,
@@ -246,7 +254,9 @@ class TradeModal {
this.stagePill = el('span', { class: 'cc-buy-stage', role: 'status', 'aria-live': 'polite', hidden: true });
const head = el('div', { class: 'cc-buy-head' }, [
- this.coin.image ? el('img', { class: 'cc-buy-img', src: this.coin.image, alt: '' }) : el('div', { class: 'cc-buy-img cc-buy-img-ph', text: '◎' }),
+ coinArt(this.coin)
+ ? el('img', { class: 'cc-buy-img', src: coinArt(this.coin), alt: '' })
+ : el('div', { class: 'cc-buy-img cc-buy-img-ph', text: '◎' }),
el('div', { class: 'cc-buy-titles' }, [
el('div', { class: 'cc-buy-name', text: this.coin.name || 'Trade coin' }),
el('div', { class: 'cc-buy-sub' }, [
diff --git a/src/launch-detail.js b/src/launch-detail.js
index b841b1543..3179bcef8 100644
--- a/src/launch-detail.js
+++ b/src/launch-detail.js
@@ -36,6 +36,7 @@ import {
verifiedBadge,
} from './trader-format.js';
import { walletChipEl } from './shared/agent-wallet-chip.js';
+import { proxiedImageURL } from './ipfs.js';
import { agentAvatarGlb, hasCustomAvatar, seeInWorldHref } from './shared/agent-3d.js';
import { resolveDevR2Url } from './shared/dev-r2-proxy.js';
import { terminalLinks } from './shared/trading-terminals.js';
@@ -405,7 +406,12 @@ function renderHero() {
// Identity, with graceful fallback precedence: live market → registry → intel.
const name = coin?.name || reg?.name || intel?.name || 'Unknown coin';
const symbol = (coin?.symbol || reg?.symbol || intel?.symbol || '').toUpperCase();
- const image = coin?.image_uri || coin?.image || intel?.image_uri || null;
+ // Coin art arrives as whatever URL the launch's metadata carried: usually a
+ // public IPFS gateway, which now rate-limits our reads and leaves a no-cors
+ // <img> with nothing to render. /api/img fetches it server-side across
+ // gateways at the 72 px this avatar paints, and answers a placeholder rather
+ // than an error when every one of them is down.
+ const image = proxiedImageURL(coin?.image_uri || coin?.image || intel?.image_uri || '', state.mint || '', { width: 192 });
document.title = `${symbol ? `$${symbol} · ` : ''}${name} · three.ws`;
@@ -1491,12 +1497,16 @@ function buildAgentStage(agent) {
// the loading state reads as "this avatar, arriving" rather than an empty box.
// It fades out once the GLB is framed. Falls back to the CSS gradient alone
// when the agent has no thumbnail.
- if (agent.avatar_thumbnail_url) {
+ // The poster is a blurred backdrop behind the 3D stage, so it never needs the
+ // full-size thumbnail; the proxy also keeps a retired art host from leaving
+ // the stage flat.
+ const posterUrl = proxiedImageURL(agent.avatar_thumbnail_url || '', agent.id || '', { width: 480 });
+ if (posterUrl) {
stage.appendChild(
el('div', {
class: 'ld-agent-stage-poster',
'aria-hidden': 'true',
- style: `background-image:url('${encodeURI(agent.avatar_thumbnail_url)}')`,
+ style: `background-image:url('${encodeURI(posterUrl)}')`,
}),
);
}
diff --git a/src/worlds-lobby.js b/src/worlds-lobby.js
index b9faf7dff..d553e29ed 100644
--- a/src/worlds-lobby.js
+++ b/src/worlds-lobby.js
@@ -15,6 +15,7 @@
import { AvatarGalleryPicker } from './avatar-gallery-picker.js';
import { AgentPicker } from './agent-picker.js';
import { walletChipEl, hasWallet } from './shared/agent-wallet-chip.js';
+import { proxiedImageURL } from './ipfs.js';
// ── tiny DOM helpers ─────────────────────────────────────────────────────────
const $ = (sel, root = document) => root.querySelector(sel);
@@ -336,13 +337,21 @@ async function loadWorlds() {
renderWorlds();
}
+// World tiles paint the coin's own logo from whatever host its metadata named.
+// The same-origin proxy keeps that art alive when a gateway rate-limits us or
+// retires: it answers a generated placeholder rather than an error, and serves
+// the size the card paints rather than whatever the creator uploaded.
+function worldArt(world) {
+ return proxiedImageURL(world?.image || '', world?.token || '', { width: 320 });
+}
+
function worldCard(w) {
const symbol = w.symbol ? `$${w.symbol}` : `${w.token.slice(0, 4)}…${w.token.slice(-4)}`;
const isRobinhood = w.chain === 'robinhood-chain';
const card = el('button', { class: 'wl-card', type: 'button', title: `Enter ${symbol}` }, [
el('div', { class: 'wl-card-art' }, [
- w.image
- ? el('img', { src: w.image, alt: symbol, loading: 'lazy', referrerpolicy: 'no-referrer' })
+ worldArt(w)
+ ? el('img', { src: worldArt(w), alt: symbol, loading: 'lazy', referrerpolicy: 'no-referrer' })
: el('div', { class: 'wl-card-art-ph', text: symbol.slice(0, 3) }),
el('span', { class: 'wl-card-live' }, [el('span', { class: 'wl-live-dot' }), 'live']),
isRobinhood ? el('span', { class: 'wl-card-chain', title: 'Robinhood Chain' }, ['RH']) : null,