mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-18 16:55:58 +00:00
[skip ci] Merge branch 'main' of https://github.com/cake-tech/cake_wallet into CW-600-password-manager
This commit is contained in:
commit
fec945e9f7
2 changed files with 22 additions and 3 deletions
|
@ -58,7 +58,7 @@ class WalletCreationService {
|
||||||
checkIfExists(credentials.name);
|
checkIfExists(credentials.name);
|
||||||
final password = generateWalletPassword();
|
final password = generateWalletPassword();
|
||||||
credentials.password = password;
|
credentials.password = password;
|
||||||
if (type == WalletType.bitcoinCash || type == WalletType.ethereum) {
|
if (_hasSeedPhraseLengthOption) {
|
||||||
credentials.seedPhraseLength = settingsStore.seedPhraseLength.value;
|
credentials.seedPhraseLength = settingsStore.seedPhraseLength.value;
|
||||||
}
|
}
|
||||||
await keyService.saveWalletPassword(password: password, walletName: credentials.name);
|
await keyService.saveWalletPassword(password: password, walletName: credentials.name);
|
||||||
|
@ -72,6 +72,25 @@ class WalletCreationService {
|
||||||
return wallet;
|
return wallet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool get _hasSeedPhraseLengthOption {
|
||||||
|
switch (type) {
|
||||||
|
case WalletType.ethereum:
|
||||||
|
case WalletType.bitcoinCash:
|
||||||
|
case WalletType.polygon:
|
||||||
|
case WalletType.solana:
|
||||||
|
case WalletType.tron:
|
||||||
|
return true;
|
||||||
|
case WalletType.monero:
|
||||||
|
case WalletType.none:
|
||||||
|
case WalletType.bitcoin:
|
||||||
|
case WalletType.litecoin:
|
||||||
|
case WalletType.haven:
|
||||||
|
case WalletType.nano:
|
||||||
|
case WalletType.banano:
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Future<WalletBase> restoreFromKeys(WalletCredentials credentials, {bool? isTestnet}) async {
|
Future<WalletBase> restoreFromKeys(WalletCredentials credentials, {bool? isTestnet}) async {
|
||||||
checkIfExists(credentials.name);
|
checkIfExists(credentials.name);
|
||||||
final password = generateWalletPassword();
|
final password = generateWalletPassword();
|
||||||
|
|
|
@ -154,11 +154,11 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||||
ChangeNowExchangeProvider(settingsStore: _settingsStore),
|
ChangeNowExchangeProvider(settingsStore: _settingsStore),
|
||||||
SideShiftExchangeProvider(),
|
SideShiftExchangeProvider(),
|
||||||
SimpleSwapExchangeProvider(),
|
SimpleSwapExchangeProvider(),
|
||||||
TrocadorExchangeProvider(
|
|
||||||
useTorOnly: _useTorOnly, providerStates: _settingsStore.trocadorProviderStates),
|
|
||||||
ThorChainExchangeProvider(tradesStore: trades),
|
ThorChainExchangeProvider(tradesStore: trades),
|
||||||
if (FeatureFlag.isExolixEnabled) ExolixExchangeProvider(),
|
if (FeatureFlag.isExolixEnabled) ExolixExchangeProvider(),
|
||||||
QuantexExchangeProvider(),
|
QuantexExchangeProvider(),
|
||||||
|
TrocadorExchangeProvider(
|
||||||
|
useTorOnly: _useTorOnly, providerStates: _settingsStore.trocadorProviderStates),
|
||||||
];
|
];
|
||||||
|
|
||||||
@observable
|
@observable
|
||||||
|
|
Loading…
Reference in a new issue