mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 20:39:51 +00:00
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:
parent
36361ef329
commit
8237b89d56
38 changed files with 137 additions and 14 deletions
|
@ -1,4 +1,5 @@
|
|||
import 'package:cake_wallet/di.dart';
|
||||
import 'package:cake_wallet/store/settings_store.dart';
|
||||
import 'package:cw_core/wallet_info.dart';
|
||||
import 'package:cake_wallet/entities/preferences_key.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
@ -18,6 +19,7 @@ class WalletCreationService {
|
|||
required this.secureStorage,
|
||||
required this.keyService,
|
||||
required this.sharedPreferences,
|
||||
required this.settingsStore,
|
||||
required this.walletInfoSource})
|
||||
: type = initialType {
|
||||
changeWalletType(type: type);
|
||||
|
@ -26,6 +28,7 @@ class WalletCreationService {
|
|||
WalletType type;
|
||||
final FlutterSecureStorage secureStorage;
|
||||
final SharedPreferences sharedPreferences;
|
||||
final SettingsStore settingsStore;
|
||||
final KeyService keyService;
|
||||
final Box<WalletInfo> walletInfoSource;
|
||||
WalletService? _service;
|
||||
|
@ -56,6 +59,9 @@ class WalletCreationService {
|
|||
checkIfExists(credentials.name);
|
||||
final password = generateWalletPassword();
|
||||
credentials.password = password;
|
||||
if (type == WalletType.bitcoinCash || type == WalletType.ethereum) {
|
||||
credentials.seedPhraseLength = settingsStore.seedPhraseLength.value;
|
||||
}
|
||||
await keyService.saveWalletPassword(password: password, walletName: credentials.name);
|
||||
final wallet = await _service!.create(credentials);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue