# Account balance

The account balance events stream provides updates about account balance changes

## Properties

The `AccountBalance` entity has the following properties:

| Property               | Type         | Description                  |
| ---------------------- | ------------ | ---------------------------- |
| `account_hash`         | `string(64)` | Account hash                 |
| `liquid_balance`       | `uint64`     | Account liquid balance       |
| `staked_balance`       | `uint64`     | Account staked balance       |
| `undelegating_balance` | `uint64`     | Account undelegating balance |

## Optional properties

None

## Endpoint

```
GET /account-balances
```

## Query params

| Property       | Type     | Description                         |
| -------------- | -------- | ----------------------------------- |
| `account_hash` | `string` | Comma-separated account hashes      |
| `public_key`   | `string` | Comma-separated account public keys |

## Events

| Event     | Description                            |
| --------- | -------------------------------------- |
| `updated` | Notifies about account balance updates |

## Response

[`WebSocketMessage`](https://docs.cspr.cloud/1.0.x/reference#format)[`<AccountBalance>`](https://github.com/make-software/casper-middleware/blob/documentation-1.0.x/docs/public/streaming-api/account-balance/README.md#properties)

## Example

```bash
wscat -c 'wss://streaming.testnet.cspr.cloud/account-balances?account_hashes=d38f71a113bb46e2cb7d46cd1c14427a3e077f67d8dad15e9c0bb91b7b8a82d9' \
  -H 'authorization: 55f79117-fc4d-4d60-9956-65423f39a06a'
```

```json
{
  "data": {
    "account_hash": "d38f71a113bb46e2cb7d46cd1c14427a3e077f67d8dad15e9c0bb91b7b8a82d9",
    "liquid_balance": 18761763338560,
    "staked_balance": 0,
    "undelegated_balance": 0
  },
  "action": "updated",
  "extra": {
    "deploy_hash": "71d954db5263876d74d8553f92ba12d5dd2f0df8ad030b0f5aa5687d87da696e"
  },
  "timestamp": "2024-02-26T17:13:09.285952786Z"
}
```
