getDecryptedSeed method

Future<SeedBackupData?> getDecryptedSeed(
  1. KeyringEVM keyring,
  2. dynamic password
)

Decrypt and get the backup of seed.

Implementation

Future<SeedBackupData?> getDecryptedSeed(KeyringEVM keyring, password) async {
  final Map? data = await keyring.store
      .getDecryptedSeed(keyring.current.address!, password);
  if (data == null) {
    return null;
  }
  if (data['seed'] == null) {
    data['error'] = 'wrong password';
  }
  return SeedBackupData.fromJson(data as Map<String, dynamic>);
}