get_sui_all_balances
Retrieve complete coin balance information for any Sui blockchain address across mainnet or testnet networks.
Instructions
Get all coin balances for a Sui address
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | Sui address | |
| network | No | Network type (defaults to mainnet) |
Implementation Reference
- src/handlers/sui-handlers.ts:34-52 (registration)Tool registration definition including name, description, and input schema for get_sui_all_balances.{ name: 'get_sui_all_balances', description: 'Get all coin balances for a Sui address', inputSchema: { type: 'object', properties: { address: { type: 'string', description: 'Sui address', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['address'], }, },
- src/handlers/sui-handlers.ts:320-335 (handler)Handler execution logic for the get_sui_all_balances tool. Extracts arguments, calls SuiService.getAllBalances, and returns formatted response.case 'get_sui_all_balances': { const address = args?.address as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await suiService.getAllBalances(address, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
- src/services/sui-service.ts:59-77 (helper)Core helper function implementing getAllBalances by invoking the Sui RPC method 'suix_getAllBalances' via blockchain service.async getAllBalances( address: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain('sui', network); if (!service) { return { success: false, error: `Sui service not found for ${network}`, }; } return this.blockchainService.callRPCMethod( service.id, 'suix_getAllBalances', [address] ); }