ethora-wallet-get-balance
Retrieve the authenticated user’s cryptocurrency wallet balance directly within the Ethora platform. Simplify balance checking for integrated applications and services.
Instructions
Retrieve the cryptocurrency wallet balance of the authenticated user
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools.ts:295-308 (handler)The main handler function for the 'ethora-wallet-get-balance' tool. It asynchronously calls walletGetBalance(), formats the response as a CallToolResult with JSON content, or returns an error message on failure.async function () { try { let result = await walletGetBalance() let toolRes: CallToolResult = { content: [{ type: "text", text: JSON.stringify(result.data) }] } return toolRes } catch (error) { let toolRes: CallToolResult = { content: [{ type: "text", text: "error: network error" }] } return toolRes } }
- src/tools.ts:289-310 (registration)Registers the 'ethora-wallet-get-balance' tool on the MCP server using server.registerTool, specifying the tool name, description (no input schema), and the handler function.function walletGetBalanceTool(server: McpServer) { server.registerTool( 'ethora-wallet-get-balance', { description: 'Retrieve the cryptocurrency wallet balance of the authenticated user' }, async function () { try { let result = await walletGetBalance() let toolRes: CallToolResult = { content: [{ type: "text", text: JSON.stringify(result.data) }] } return toolRes } catch (error) { let toolRes: CallToolResult = { content: [{ type: "text", text: "error: network error" }] } return toolRes } } ) }
- src/apiClientDappros.ts:174-178 (helper)Helper function that performs the actual API call to retrieve the wallet balance via GET /wallets/balance using the configured axios client.export function walletGetBalance() { return httpClientDappros.get( `/wallets/balance` ) }