suix_getBalance

Coin Query API

Return the total coin balance for one coin type, owned by the address owner.

Parameters

KeyRequiredTypeDetail
ownerSuiAddressthe owner's Sui address
coin_typeStringtype name for the coin
  "params": [
    "0x04658c48392301596b700ec6799dbbb333097b300c164a491fee0522fc6f5ddd",
    "0x2::sui::SUI"
  ]

Result

Balance : <Balance> - get balance of the coin for the address in the request.

  • coinObjectCount : <uint>
  • coinType : <string>
  • lockedBalance : <object>
  • totalBalance : <BigInt_for_uint128>

Example

Request

curl <your-endpoint> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "suix_getBalance",
  "params": [
    "0x04658c48392301596b700ec6799dbbb333097b300c164a491fee0522fc6f5ddd",
    "0x2::sui::SUI"
  ]
}
'

Response

{
    "jsonrpc": "2.0",
    "result": {
        "coinType": "0x2::sui::SUI",
        "coinObjectCount": 1,
        "totalBalance": "500477723525",
        "lockedBalance": {}
    },
    "id": 1
}
Language
Click Try It! to start a request and see the response here!