bitcoin_hd_wallet_balances
Fetch Bitcoin HD wallet balances and transaction summaries using an xpub key. Convert balances to various currencies and view detailed balance data for all derived addresses.
Instructions
Fetch balances for each active child address derived from a Bitcoin HD wallet. This tool provides detailed balance data for Bitcoin wallets identified by an xpub key. Required: walletAddress - The xpub key of the HD wallet. Optional: quoteCurrency - The currency for price conversion (USD, EUR, etc). Returns complete balance details including total balance, available balance, and transaction history summary.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| walletAddress | Yes | The xpub key of the Bitcoin HD wallet to get balances for. Must be a valid extended public key. | |
| quoteCurrency | No | Currency to quote Bitcoin values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency. |
Implementation Reference
- src/services/BitcoinService.ts:24-68 (registration)Registration and implementation of the "bitcoin_hd_wallet_balances" tool.
server.tool( "bitcoin_hd_wallet_balances", "Fetch balances for each active child address derived from a Bitcoin HD wallet.\n" + "This tool provides detailed balance data for Bitcoin wallets identified by an xpub key.\n" + "Required: walletAddress - The xpub key of the HD wallet.\n" + "Optional: quoteCurrency - The currency for price conversion (USD, EUR, etc).\n" + "Returns complete balance details including total balance, available balance, and transaction history summary.", { walletAddress: z .string() .describe( "The xpub key of the Bitcoin HD wallet to get balances for. Must be a valid extended public key." ), quoteCurrency: z .enum(Object.values(validQuoteValues) as [string, ...string[]]) .optional() .describe( "Currency to quote Bitcoin values in (e.g., 'USD', 'EUR'). If not specified, uses default quote currency." ), }, async (params) => { try { const response = await goldRushClient.BitcoinService.getBitcoinHdWalletBalances( params.walletAddress, { quoteCurrency: params.quoteCurrency as Quote, } ); return { content: [ { type: "text", text: stringifyWithBigInt(response.data), }, ], }; } catch (error) { return { content: [{ type: "text", text: `Error: ${error}` }], isError: true, }; } } );