Skip to main content

Function Signature

Future<bool> isWalletRecoverable([String? chainId])

Description

Checks if the wallet can be recovered. A wallet is recoverable if it has been backed up.

Parameters

ParameterTypeRequiredDescription
chainIdStringNoOptional chain ID to check. If null, checks for any wallet.

Returns

bool - true if the wallet can be recovered, false otherwise.

Example

import 'package:portal_flutter/portal_flutter.dart';

final portal = Portal();

final isRecoverable = await portal.isWalletRecoverable();

if (isRecoverable) {
  print('Wallet can be recovered');
  final methods = await portal.availableRecoveryMethods();
  print('Available methods: $methods');
} else {
  print('No recovery options available');
}

Errors

CodeDescription
NOT_INITIALIZEDPortal was not initialized