getDecryptedSeed method

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

Decrypt and get the backup of seed.

Implementation

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