> ## 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.

# isWalletOnDevice

> Check if the wallet is stored on the device.

## Function Signature

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

## Description

Checks if the wallet signing shares are stored on the current device.

## Parameters

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

## Returns

**`bool`** - `true` if the wallet is on device, `false` otherwise.

## Example

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

final portal = Portal();

final isOnDevice = await portal.isWalletOnDevice();

if (isOnDevice) {
  print('Wallet is on this device');
} else {
  print('Wallet needs to be recovered');
}
```

## Use Case

This is useful for determining if a user needs to recover their wallet:

```dart theme={null}
final exists = await portal.doesWalletExist();
final onDevice = await portal.isWalletOnDevice();

if (exists && !onDevice) {
  // Wallet exists but needs to be recovered to this device
  print('Please recover your wallet');
}
```

## Errors

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

## Related

* [doesWalletExist](./doeswalletexist)
* [isWalletRecoverable](./iswalletrecoverable)
* [recoverWallet](./recoverwallet)
