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

# availableRecoveryMethods

> Get available recovery methods for a wallet.

## Function Signature

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

## Description

Returns a list of backup methods that can be used to recover the wallet.

## Parameters

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

## Returns

**`List<String>`** - A list of method names (e.g., `["Password", "GoogleDrive"]`).

## Example

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

final portal = Portal();

final methods = await portal.availableRecoveryMethods();

print('Available recovery methods:');
for (final method in methods) {
  print('  - $method');
}

// Use the first available method
if (methods.isNotEmpty) {
  final methodName = methods.first;

  switch (methodName) {
    case 'Password':
      await portal.recoverWallet(
        method: PortalBackupMethod.password,
        password: 'user-password',
      );
      break;
    case 'GoogleDrive':
      await portal.configureGoogleStorage(clientId: 'your-client-id');
      await portal.recoverWallet(method: PortalBackupMethod.googleDrive);
      break;
    // ... other methods
  }
}
```

## Errors

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

## Related

* [Recover a wallet guide](../guide/recover-a-wallet)
* [recoverWallet](./recoverwallet)
* [isWalletRecoverable](./iswalletrecoverable)
