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.

bonfida: use CJS dist path in all dynamic imports

nirholasb1e8a2a137a1
diff --git a/api/agents/sns.js b/api/agents/sns.js
index 85e255adc..24ca7b37f 100644
--- a/api/agents/sns.js
+++ b/api/agents/sns.js
@@ -70,7 +70,7 @@ async function fetchFavoriteDomain(address) {
}
async function getRegistryOwner(connection, domain) {
- const sns = await import('@bonfida/spl-name-service');
+ const sns = await import('@bonfida/spl-name-service/dist/cjs/index.js');
const { pubkey } = sns.getDomainKeySync(domain);
const { registry } = await sns.NameRegistryState.retrieve(connection, pubkey);
return registry.owner.toBase58();
@@ -79,7 +79,7 @@ async function getRegistryOwner(connection, domain) {
async function buildRegisterIxs({ connection, domain, buyer, space }) {
const { PublicKey } = await import('@solana/web3.js');
const { getAssociatedTokenAddressSync } = await import('@solana/spl-token');
- const sns = await import('@bonfida/spl-name-service');
+ const sns = await import('@bonfida/spl-name-service/dist/cjs/index.js');
const usdcMint = new PublicKey(USDC_MINT);
const buyerAta = getAssociatedTokenAddressSync(usdcMint, buyer, true);
return sns.registerDomainNameV2(connection, domain, space || 1000, buyer, buyerAta, usdcMint);
diff --git a/api/x402/pay-by-name.js b/api/x402/pay-by-name.js
index 6af1df4dd..6bffce850 100644
--- a/api/x402/pay-by-name.js
+++ b/api/x402/pay-by-name.js
@@ -94,7 +94,7 @@ async function resolveName(rawName) {
}
}
try {
- const sns = await import('@bonfida/spl-name-service');
+ const sns = await import('@bonfida/spl-name-service/dist/cjs/index.js');
const conn = solanaConnection('mainnet');
const pk = await sns.resolve(conn, bare);
return {
diff --git a/vercel.json b/vercel.json
index 3c49855ec..e8a77fa66 100644
--- a/vercel.json
+++ b/vercel.json
@@ -8,19 +8,19 @@
},
"functions": {
"api/club/tips-stream.js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/cjs/node_modules/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 300
},
"api/avatars/[id].js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/cjs/node_modules/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 300
},
"api/tts/speak.js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/cjs/node_modules/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 60
},
"api/**/*.js": {
- "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
+ "includeFiles": "node_modules/@zauthx402/sdk/dist/**,node_modules/@bonfida/spl-name-service/dist/cjs/node_modules/**,node_modules/@bonfida/spl-name-service/dist/esm/node_modules/**,examples/skills/pump-fun-strategy/**,data/archives/**,data/rss/**,data/_generated/**",
"maxDuration": 30
}
},
@@ -1273,10 +1273,18 @@
"src": "/api/widgets/([A-Za-z0-9_-]+)/knowledge",
"dest": "/api/widgets/[id]/knowledge?id=$1"
},
+ {
+ "src": "/api/agent-strategy",
+ "dest": "/api/agent-strategy"
+ },
{
"src": "/api/widgets",
"dest": "/api/widgets"
},
+ {
+ "src": "/api/widgets/index",
+ "dest": "/api/widgets"
+ },
{
"src": "/api/widgets/([A-Za-z0-9_-]+)",
"dest": "/api/widgets/[id]?id=$1"