get_sui_all_balances
Retrieve all coin balances for a Sui blockchain address to monitor assets 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 defining 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)Executes the tool by calling suiService.getAllBalances and returning formatted JSON 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)Helper method implementing getAllBalances via RPC call to suix_getAllBalances.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] ); }