> For the complete documentation index, see [llms.txt](https://phoenixchain-sdk.phoenix.global/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://phoenixchain-sdk.phoenix.global/accounts/querying-balances.md).

# Querying Balances

Import the `common` package:

```go
import (
    "github.com/PhoenixGlobal/Phoenix-Chain-SDK/libs/common"
)
```

Query the balance of an account at the latest block:

```go
account := common.HexToAddress("0xF35F4545fa03416C4ABb9FC9c743EDa6e35c5592")
latestBalance, err := client.BalanceAt(context.Background(), account, nil)
if err != nil {
    log.Fatal(err)
}
fmt.Println(latestBalance)
```

You can also query the balance of an account at a certain block height:

```go
blockNumber := big.NewInt(21879393)
account := common.HexToAddress("0xF35F4545fa03416C4ABb9FC9c743EDa6e35c5592")
balance, err := client.BalanceAt(context.Background(), account, blockNumber)
if err != nil {
    log.Fatal(err)
}
fmt.Println(balance)
```
