> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dzap.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet hooks

> useAccount, useRefetchBalance, and Wagmi / Solana re-exports.

All hooks require `WalletProviders` (or `DZapWidgetProvider`). `useAccount` is also re-exported from `@dzapio/widget`.

## useAccount

```tsx theme={null}
import { useAccount } from '@dzapio/wallet';

const { account, accounts, isConnecting, isUnsupportedChain, isAnyWalletConnecting, getAccount } =
  useAccount();

// Optional: pin to an ecosystem
const { account: evmAccount } = useAccount({ chainType: 'evm' });
```

`account` includes `address`, `chainId`, `chainType`, `isConnected`, `status`, and `ensName` when available. `chainType` is one of `evm`, `svm`, `bvm`, `bvmTestnet`, `suivm`, and other values in `ChainTypes`.

| Return                  | Description                                              |
| ----------------------- | -------------------------------------------------------- |
| `account`               | Active account for the requested (or current) chain type |
| `accounts`              | All connected accounts                                   |
| `getAccount(args?)`     | Look up an account by `chainType`                        |
| `isConnecting`          | Active account is connecting                             |
| `isAnyWalletConnecting` | Any connector is connecting                              |
| `isUnsupportedChain`    | Connected chain is not in `chainsData`                   |

## useRefetchBalance

Reads on-chain balances over RPC (EVM multicall, SPL, BTC, Sui). This does **not** hit the DZap `balance-of` API.

```tsx theme={null}
import { useRefetchBalance } from '@dzapio/wallet';

const { refetchTokenBalance } = useRefetchBalance();
const balances = await refetchTokenBalance(
  ['0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'],
  1,
);
// { contract, balance }[]
```

## Other hooks

| Hook              | Package                             | Description                            |
| ----------------- | ----------------------------------- | -------------------------------------- |
| `useWalletConfig` | `@dzapio/wallet`                    | Resolved `WalletConfig`                |
| `useEvmConfig`    | `@dzapio/wallet`                    | Wagmi config for the current EVM setup |
| `useConnection`   | re-export of Solana `useConnection` | Solana connection                      |
| `useWallet`       | re-export of Solana `useWallet`     | Solana wallet adapter                  |
