encryptSeedAndSave method
Future<void>
encryptSeedAndSave(
- String? address,
- dynamic seed,
- dynamic seedType,
- dynamic password,
Implementation
Future<void> encryptSeedAndSave(
String? address, seed, seedType, password) async {
final String key = Encrypt.passwordToEncryptKey(password);
final encrypted = await FlutterAesEcbPkcs5.encryptString(seed, key);
if (seedType == EVMKeyType.mnemonic.toString().split('.')[1]) {
final mnemonics = Map.from(_storage.encryptedMnemonics.val);
mnemonics.addAll({address: encrypted});
_storage.encryptedMnemonics.val = mnemonics;
return;
}
if (seedType == EVMKeyType.privateKey.toString().split('.')[1]) {
final seeds = Map.from(_storage.encryptedPrivateKeys.val);
seeds.addAll({address: encrypted});
_storage.encryptedPrivateKeys.val = seeds;
}
}