GetBalance - Sui
GetBalance. Returns the balance of one coin type owned by an address.
GetBalance - sui [Value: 20CU]
Returns the total balance of one coin type owned by an address.
gRPC: sui.rpc.v2.StateService/GetBalance
Use cases
- Show wallet SUI balance
- Check token balance before transfer
- Monitor treasury balances
Constraints
- Owner and coin_type are required
- Amounts are in smallest units
- Includes coins and address balance
Unlock Access to 100+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
grpcurl \
-H "x-drpc-key: {API-KEY}" \
-H "x-drpc-chain: sui" \
-d '{
"owner": "0x94096a6a54129234237759c66e6ef1037224fb3102a0ae29d33b490281c8e4d5",
"coin_type": "0x2::sui::SUI"
}' \
grpc.drpc.live:443 \
sui.rpc.v2.StateService/GetBalanceResponse
200
{
"balance": {
"coin_type": "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI",
"balance": "1035000074",
"address_balance": "0",
"coin_balance": "1035000074"
}
}Request params
object
ownerstring
Required. The owner's Sui address.
coin_typestring
Required. The coin type, for example `0x2::sui::SUI`.
Response
200
Returns the total balance of one coin type owned by an address.Response params
object
balanceobject
Balance of the requested coin type.
object
coin_typestring
The coin type, for example `0x2::sui::SUI`.
balancestring
Total balance in the smallest unit: `address_balance` + `coin_balance`.
address_balancestring
Balance held in the address balance (`Balance<T>`).
coin_balancestring
Balance of all `Coin<T>` objects owned by the address.