multichain_balances
Fetch native and token balances for a single wallet across up to 10 EVM chains. Retrieve paginated spot or historical balances, specify networks, quote currency, and time filters with one API call.
Instructions
Fetch paginated spot & historical native and token balances for a single address on up to 10 EVM chains with one API call. Requires walletAddress. Optional parameters include chains array to specify networks, quoteCurrency for value conversion, limit (default 10), pagination (before), and cutoffTimestamp to filter by time. Use this to get a comprehensive view of token holdings across different blockchains.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| walletAddress | Yes | The wallet address to get token balances for. Must be a valid blockchain address. | |
| quoteCurrency | No | Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency. | |
| before | No | Pagination cursor to get balances before this point. Use the 'before' value from previous response. | |
| limit | No | Maximum number of token balances to return. Default is 10, maximum is 100. | |
| chains | No | Array of blockchain networks to query balances from. Can be chain names or chain IDs. If not specified, queries all supported chains. | |
| cutoffTimestamp | No | Unix timestamp to filter balances by last activity. Only returns tokens with activity after this time. |
Implementation Reference
- src/services/AllChainsService.ts:179-207 (handler)The async handler function for the multichain_balances tool. Calls goldRushClient.AllChainsService.getMultiChainBalances with walletAddress, quoteCurrency, before, limit, chains, and cutoffTimestamp. Returns the result via stringifyWithBigInt or an error.
async (params) => { try { const response = await goldRushClient.AllChainsService.getMultiChainBalances( params.walletAddress, { quoteCurrency: params.quoteCurrency as Quote, before: params.before, limit: params.limit, chains: params.chains as ChainID[] | ChainName[], cutoffTimestamp: params.cutoffTimestamp, } ); return { content: [ { type: "text", text: stringifyWithBigInt(response.data), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error}` }], isError: true, }; } } ); - Zod schema definitions for the multichain_balances tool inputs: walletAddress (string, required), quoteCurrency (enum from validQuoteValues, optional), before (string cursor, optional), limit (number, default 10, optional), chains (array of chain names or chain IDs, optional), cutoffTimestamp (number, optional).
{ walletAddress: z .string() .describe( "The wallet address to get token balances for. Must be a valid blockchain address." ), quoteCurrency: z .enum(Object.values(validQuoteValues) as [string, ...string[]]) .optional() .describe( "Currency to quote token values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency." ), before: z .string() .optional() .describe( "Pagination cursor to get balances before this point. Use the 'before' value from previous response." ), limit: z .number() .optional() .default(10) .describe( "Maximum number of token balances to return. Default is 10, maximum is 100." ), chains: z .array( z.union([ z.enum( Object.values(ChainName) as [string, ...string[]] ), z.number(), ]) ) .optional() .describe( "Array of blockchain networks to query balances from. Can be chain names or chain IDs. If not specified, queries all supported chains." ), cutoffTimestamp: z .number() .optional() .describe( "Unix timestamp to filter balances by last activity. Only returns tokens with activity after this time." ), }, - src/services/AllChainsService.ts:127-127 (registration)Registration of the tool named 'multichain_balances' via server.tool() call within addAllChainsServiceTools(). Also includes the description string.
server.tool( - src/server.ts:68-68 (registration)Top-level registration: addAllChainsServiceTools(server, goldRushClient) is called from createServer() to register all AllChainsService tools including multichain_balances.
addAllChainsServiceTools(server, goldRushClient); - src/utils/helpers.ts:7-13 (helper)Helper function stringifyWithBigInt used by the handler to serialize the response data, converting BigInt values to strings.
export function stringifyWithBigInt(value: any): string { return JSON.stringify( value, (_, val) => (typeof val === "bigint" ? val.toString() : val), 2 ); }