CW-520-Enable-user-to-choose-12-or-24-seed-words-for-BCH-and-ETH (#1181)

* seed phrase option UI

* bch seed length option

* eth seed lengh option

* update preseed info

* update localization files
This commit is contained in:
Serhii 2023-11-17 15:45:42 +02:00 committed by GitHub
parent 36361ef329
commit 8237b89d56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 137 additions and 14 deletions

View file

@ -20,7 +20,14 @@ class EthereumWalletService extends WalletService<EthereumNewWalletCredentials,
@override
Future<EthereumWallet> create(EthereumNewWalletCredentials credentials) async {
final mnemonic = bip39.generateMnemonic();
final strength = (credentials.seedPhraseLength == 12)
? 128
: (credentials.seedPhraseLength == 24)
? 256
: 128;
final mnemonic = bip39.generateMnemonic(strength: strength);
final wallet = EthereumWallet(
walletInfo: credentials.walletInfo!,
mnemonic: mnemonic,