# getCapabilities

Extract capabilities (grouped by chain ID) that a connected wallet supports (e.g. paymasters, session keys, etc).

[Read more](https://github.com/ethereum/EIPs/blob/815028dc634463e1716fc5ce44c019a6040f0bef/EIPS/eip-5792.md#wallet_getcapabilities)

## Usage

:::code-group
```ts twoslash [example.ts]
import { account, walletClient } from './config'
 
const capabilities = await walletClient.getCapabilities({
  account,
})
// @log: {
// @log:   8453: {
// @log:      atomic: {
// @log:        status: 'supported',
// @log:      },
// @log:      paymasterService: {
// @log:        supported: true,
// @log:      },
// @log:    },
// @log:    84532: {
// @log:      atomic: {
// @log:        status: 'supported',
// @log:      },
// @log:    },
// @log: }
```

```ts twoslash [config.ts] filename="config.ts"
import 'viem/window'
// ---cut---
import { createWalletClient, custom } from 'viem'
import { mainnet } from 'viem/chains'

export const walletClient = createWalletClient({
  chain: mainnet,
  transport: custom(window.ethereum!),
})

export const [account] = await walletClient.getAddresses()
```
:::

### Account Hoisting

If you do not wish to pass an `account` to every `getCapabilities`, you can also hoist the Account on the Wallet Client (see `config.ts`).

[Learn more](/docs/clients/wallet#account).

:::code-group
```ts twoslash [example.ts]
import { walletClient } from './config'
 
const capabilities = await walletClient.getCapabilities()
```

```ts [config.ts] filename="config.ts"
import 'viem/window'
import { createWalletClient, custom } from 'viem'

// Retrieve Account from an EIP-1193 Provider.
const [account] = await window.ethereum!.request({ 
  method: 'eth_requestAccounts' 
})

export const walletClient = createWalletClient({
  account,
  transport: custom(window.ethereum!)
})
```
:::

## Returns

`WalletCapabilities`

Capabilities of the wallet.

## Parameters

### account

* **Type:** `Address`

The account to get capabilities for.

```ts twoslash [example.ts]
import { walletClient } from './config'
// ---cut---
const capabilities = await walletClient.getCapabilities({
  account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', // [!code focus]
})
```

### chainId

* **Type:** `number`

The chain ID to get capabilities for.

```ts twoslash [example.ts]
import { walletClient } from './config'
// ---cut---
const capabilities = await walletClient.getCapabilities({
  account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
  chainId: 8453, // [!code focus]
})
```
