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

# doesWalletExist

> Check if a wallet exists.

## Function Signature

```dart theme={null}
Future<bool> doesWalletExist([String? chainId])
```

## Description

Checks if a wallet exists for the client. Can optionally check for a specific chain.

## Parameters

| Parameter | Type     | Required | Description                                                 |
| --------- | -------- | -------- | ----------------------------------------------------------- |
| `chainId` | `String` | No       | Optional chain ID to check. If null, checks for any wallet. |

## Returns

**`bool`** - `true` if a wallet exists, `false` otherwise.

## Example

```dart theme={null}
import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

// Check if any wallet exists
final exists = await portal.doesWalletExist();

if (exists) {
  print('Wallet exists');
} else {
  print('No wallet found');
}
```

### Check Specific Chain

```dart theme={null}
// Check if EVM wallet exists
final evmExists = await portal.doesWalletExist('eip155:1');

// Check if Solana wallet exists
final solExists = await portal.doesWalletExist('solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp');
```

## Errors

| Code              | Description                |
| ----------------- | -------------------------- |
| `NOT_INITIALIZED` | Portal was not initialized |

## Related

* [Create a wallet guide](../guide/create-a-wallet)
* [createWallet](./createwallet)
* [getAddresses](./getaddresses)
* [isWalletOnDevice](./iswalletondevice)
