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.

test(market): cover holders and supply coming straight off the Tokens API row

nirholas0a69c763de97
diff --git a/tests/api/token-market-tokensxyz.test.js b/tests/api/token-market-tokensxyz.test.js
index 9d23cc716..683323858 100644
--- a/tests/api/token-market-tokensxyz.test.js
+++ b/tests/api/token-market-tokensxyz.test.js
@@ -44,7 +44,9 @@ const TOKENS_XYZ_OK = {
marketCap: 250_000,
priceChange24hPercent: 3.2,
decimals: 6,
- metricsSource: 'clickhouse_trades',
+ holder: 4_211,
+ circulatingSupply: 900_000,
+ metricsSource: 'birdeye',
},
executionQuality: null,
},
@@ -93,12 +95,25 @@ describe('tokens.xyz rung', () => {
volume_24h: 12_000,
liquidity: 90_000,
decimals: 6,
+ // The whole point of the rung: a Birdeye-grade row, holders included,
+ // on the reads where our own Birdeye quota is spent.
+ holders: 4_211,
+ supply: 900_000,
});
- // No supply field upstream; derived from cap / price like the DexScreener rung.
- expect(out.supply).toBe(1_000_000);
expect(fetchCalls.some((u) => u.includes('dexscreener'))).toBe(false);
});
+ it('derives supply from cap over price when the row omits circulating supply', async () => {
+ process.env.TOKENS_XYZ_API_KEY = 'test-key';
+ fetchResponses = [
+ { body: { variants: [{ mint: MINT, assetId: 'three', chain: 'solana', market: { price: 0.25, marketCap: 250_000 }, executionQuality: null }] } },
+ ];
+ const out = await fetchTokenMarketData(MINT, { fresh: true });
+
+ expect(out.supply).toBe(1_000_000);
+ expect(out.holders).toBeNull();
+ });
+
it('sits behind Birdeye and takes over when Birdeye is down', async () => {
process.env.BIRDEYE_API_KEY = 'birdeye-key';
process.env.TOKENS_XYZ_API_KEY = 'test-key';