StateService.ListBalances
List balances through sui.rpc.v2.StateService/ListBalances on Inodra's Sui gRPC endpoint.
Endpoint
| Network | Host | Authentication |
|---|---|---|
| Mainnet | mainnet-grpc.inodra.com:443 | x-api-key metadata |
| Testnet | testnet-grpc.inodra.com:443 | x-api-key metadata |
Full method name: sui.rpc.v2.StateService/ListBalances. Unary: one request, one response. Get a key from the dashboard; the same key works on every protocol.
Request: ListBalancesRequest
Request message for LiveDataService.ListBalances.
| Field | Type | Description |
|---|---|---|
owner | string | Required. The owner's Sui address. |
page_size | uint32 | The maximum number of balance entries to return. The service may return fewer than this value. If unspecified, at most 50 entries will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000. |
page_token | bytes | A page token, received from a previous ListBalances call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to ListBalances must match the call that provided the page token. |
Response: ListBalancesResponse
Response message for LiveDataService.ListBalances. Return the total coin balance for all coin types, owned by the address owner.
| Field | Type | Description |
|---|---|---|
balances | repeated Balance | The list of coin types and their respective balances. |
next_page_token | bytes | A token, which can be sent as page_token to retrieve the next page. If this field is omitted, there are no subsequent pages. |
Balance
Balance information for a specific coin type.
| Field | Type | Description |
|---|---|---|
coin_type | string | The type of the coin (e.g., 0x2::sui::SUI). |
balance | uint64 | The total balance of coin_type in its smallest unit. This is the sum of all spendable amounts of coin_type (address_balance and coin_balance). |
address_balance | uint64 | The balance of Balance<T> in this address's Address Balance. |
coin_balance | uint64 | The balance of all Coin<T> objects owned by this address. |
grpcurl
grpcurl -H "x-api-key: YOUR_API_KEY" \
-d '{
"owner": "0x0000000000000000000000000000000000000000000000000000000000000002",
"page_size": 20
}' \
mainnet-grpc.inodra.com:443 \
sui.rpc.v2.StateService/ListBalancesServer reflection is enabled, so no proto files are needed for grpcurl. Field masks are written as {"paths": [...]}.
TypeScript
import { GrpcWebFetchTransport, SuiGrpcClient } from '@mysten/sui/grpc'
const transport = new GrpcWebFetchTransport({
baseUrl: 'https://mainnet-grpc.inodra.com',
meta: { 'x-api-key': process.env.INODRA_API_KEY! }
})
const client = new SuiGrpcClient({ network: 'mainnet', transport })
const { balances, cursor } = await client.listBalances({
owner: '0x0000000000000000000000000000000000000000000000000000000000000002'
})
console.log(balances, cursor)Uses the typed SuiGrpcClient method from @mysten/sui v2 that calls this RPC. Install with npm install @mysten/sui and set INODRA_API_KEY. The gRPC gateway guide covers native gRPC transport for backends.
Credits
1 credit per item actually returned; an empty page bills the 1-credit minimum. See credits and billing for the full table.
JSON-RPC equivalent
Replaces suix_getAllBalances. The JSON-RPC to gRPC migration guide has before and after code for the common calls.