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.

feat(avatar-cli): accept a bare Solana address as the manifest owner

nirholas1cda846ac9dd
diff --git a/packages/avatar-cli/src/cli.js b/packages/avatar-cli/src/cli.js
index f3a930753..16eae824c 100755
--- a/packages/avatar-cli/src/cli.js
+++ b/packages/avatar-cli/src/cli.js
@@ -15,7 +15,7 @@ const COMMANDS = {
automatically. Prints to stdout, or writes a file with ${style.cyan('--out')}.
${style.bold('required')}
- --owner <caip10|0x…> Owner identity (eip155:1:0x…, or shorthand 0x…)
+ --owner <caip10|sol|0x…> Owner identity (eip155:1:0x…, a Solana address, or shorthand 0x…)
--name <string> Avatar display name
--mesh <path> Path to a .glb / .gltf / .vrm file
diff --git a/packages/avatar-cli/src/commands/init.js b/packages/avatar-cli/src/commands/init.js
index 5189c0060..85f221fe2 100644
--- a/packages/avatar-cli/src/commands/init.js
+++ b/packages/avatar-cli/src/commands/init.js
@@ -14,12 +14,19 @@ function sha256OfFile(path) {
return createHash('sha256').update(readFileSync(path)).digest('hex');
}
+// Base58 minus the four ambiguous glyphs (0 O I l), the Solana address alphabet.
+const BASE58 = /^[1-9A-HJ-NP-Za-km-z]{32,44}$/;
+
function inferOwner(ownerSpec) {
- // Accept CAIP-10 (chain:namespace:address) or shorthand "0x..." (assumed eip155:1).
+ // Accept CAIP-10 (chain:namespace:address), shorthand "0x..." (assumed
+ // eip155:1), or a bare Solana address (assumed solana:mainnet-beta).
if (!ownerSpec) return null;
if (ownerSpec.startsWith('0x') && ownerSpec.length === 42) {
return { chain: 'eip155:1', address: ownerSpec };
}
+ if (!ownerSpec.includes(':') && BASE58.test(ownerSpec)) {
+ return { chain: 'solana:mainnet-beta', address: ownerSpec };
+ }
const parts = ownerSpec.split(':');
if (parts.length === 3) {
return { chain: `${parts[0]}:${parts[1]}`, address: parts[2] };
@@ -41,7 +48,8 @@ function inferIdFromOwner(name, owner) {
* `three-ws-avatar init` — scaffold a fresh avatar manifest from flags.
*
* Required flags:
- * --owner <caip10|0xaddr> Owner identity (eip155:1:0xabc, or shorthand 0x...)
+ * --owner <caip10|sol|0xaddr> Owner identity (eip155:1:0xabc, a Solana
+ * address, or shorthand 0x...)
* --name <string> Avatar display name
* --mesh <path> Path to GLB/GLTF/VRM file (sha256 computed automatically)
*
@@ -71,7 +79,7 @@ export async function init({ flags }) {
const owner = inferOwner(ownerSpec);
if (!owner) {
failure(`could not parse --owner ${JSON.stringify(ownerSpec)}`);
- hint('expected CAIP-10 (eip155:1:0x…) or shorthand 0x…');
+ hint('expected CAIP-10 (eip155:1:0x…), a Solana address, or shorthand 0x…');
return 1;
}
diff --git a/packages/avatar-cli/test/cli.test.js b/packages/avatar-cli/test/cli.test.js
index e24d52514..8baa1c533 100644
--- a/packages/avatar-cli/test/cli.test.js
+++ b/packages/avatar-cli/test/cli.test.js
@@ -146,6 +146,32 @@ test('init with CAIP-10 owner parses chain correctly', async () => {
assert.equal(manifest.owner.address, 'EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v');
});
+test('init with a bare Solana address defaults to solana:mainnet-beta', async () => {
+ const { code, stdout } = await captured(() =>
+ main([
+ 'init',
+ '--owner',
+ 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump',
+ '--name',
+ 'sol-agent',
+ '--mesh',
+ meshPath,
+ ]),
+ );
+ assert.equal(code, 0);
+ const manifest = JSON.parse(stdout);
+ assert.equal(manifest.owner.chain, 'solana:mainnet-beta');
+ assert.equal(manifest.owner.address, 'FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump');
+ assert.equal(manifest.id, 'solana:mainnet-beta:FeMbDoX7R1Psc4GEcvJdsbNbZA3bfztcyDCatJVJpump');
+});
+
+test('init still rejects an owner that is neither an address nor CAIP-10', async () => {
+ const { code } = await captured(() =>
+ main(['init', '--owner', 'not an address', '--name', 'x', '--mesh', meshPath]),
+ );
+ assert.equal(code, 1);
+});
+
test('init with ENS name uses it as id', async () => {
const { code, stdout } = await captured(() =>
main(['init', '--owner', '0x742d35Cc6634C0532925a3b844Bc454e4438f44e', '--name', 'nicholas.eth', '--mesh', meshPath]),