# Balances And History

## Balance

Reading balances using an instance of SDK is simply calling `getBalances()` a method of it.

```typescript
const balances = await veilnyx.getBalances();
```

The result `balances` In this case is a mapping of asset ID to the amount of that asset. E.g.

```typescript
// balances (assetId -> amount)
{
    65537: 5000n,
    65538: 4n, 
    65539: 10203n,
    .
    .
    .
}
```

## Transaction History

Reading the transaction history of a user is also as simple as calling `getHistory()` the method:

```typescript
const txHistory = await veilnyx.getHistory();
```

The `txHistory` is a list of historical items with multiple fields:

* `hash`: The transaction hash identifying the transaction.
* `action`: A string denoting the type of transaction, like `deposit`, `withdraw`, `receive`, etc.
* `assets`: The assets involved in the transaction.
* `timestamp`: The timestamp of the transaction.
