Home

Get balance

POST
https://sui-grpc.nownodes.io/sui.rpc.v2.StateService/GetBalance

Authorizations

ApiKeyAuthApiKeyAuth

api-key string

NOWNodes API key passed in the api-key header.

Returns the total balance for one coin type owned by an address.

gRPC method: sui.rpc.v2.StateService.GetBalance (unary).

This is a gRPC method (HTTP/2, Protocol Buffers), not a REST endpoint. The request and response bodies below are shown in the proto3 JSON form that tools such as grpcurl and Postman accept and print. Pass your NOWNodes API key as the api-key gRPC metadata header. Proto files: sui/rpc/v2/state_service.proto.

Example grpcurl request:

Copied!
grpcurl \
  -insecure \
  -H 'api-key: YOUR_API_KEY' \
  -emit-defaults \
  -proto './sui-apis-grpc/proto/sui/rpc/v2/state_service.proto' \
  -import-path './sui-apis-grpc/proto' \
  -d '{"owner": "0xOWNER_ADDRESS", "coinType": "0x2::sui::SUI"}' \
  'sui-grpc.nownodes.io' \
  sui.rpc.v2.StateService.GetBalance

Body

application/json

Request message for LiveDataService.GetBalance.

ownerstring

Required. The owner's Sui address.

coinTypestring

Required. The type names for the coin (e.g., 0x2::sui::SUI).

Response

200OK

Successful response.

default

gRPC error. The status code (e.g. UNAUTHENTICATED, INVALID_ARGUMENT, NOT_FOUND) is returned in the grpc-status trailer, details in grpc-message.