mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-21 06:18:42 +02:00
CWA-175 | added seed language parameter to wallet manager and wallet list service, created seed_language_page and seed_language_store, applied seed language page before create and restore wallet, added mnemonics
This commit is contained in:
@@ -2,12 +2,12 @@ import 'package:cake_wallet/src/domain/common/wallet.dart';
|
||||
import 'package:cake_wallet/src/domain/common/wallet_description.dart';
|
||||
|
||||
abstract class WalletsManager {
|
||||
Future<Wallet> create(String name, String password);
|
||||
Future<Wallet> create(String name, String password, String language);
|
||||
|
||||
Future<Wallet> restoreFromSeed(
|
||||
String name, String password, String seed, int restoreHeight);
|
||||
|
||||
Future<Wallet> restoreFromKeys(String name, String password,
|
||||
Future<Wallet> restoreFromKeys(String name, String password, String language,
|
||||
int restoreHeight, String address, String viewKey, String spendKey);
|
||||
|
||||
Future<Wallet> openWallet(String name, String password);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -31,12 +31,12 @@ class MoneroWalletsManager extends WalletsManager {
|
||||
Box<WalletInfo> walletInfoSource;
|
||||
|
||||
@override
|
||||
Future<Wallet> create(String name, String password) async {
|
||||
Future<Wallet> create(String name, String password, String language) async {
|
||||
try {
|
||||
const isRecovery = false;
|
||||
final path = await pathForWallet(name: name);
|
||||
|
||||
await monero_wallet_manager.createWallet(path: path, password: password);
|
||||
await monero_wallet_manager.createWallet(path: path, password: password, language: language);
|
||||
|
||||
final wallet = await MoneroWallet.createdWallet(
|
||||
walletInfoSource: walletInfoSource,
|
||||
@@ -82,6 +82,7 @@ class MoneroWalletsManager extends WalletsManager {
|
||||
Future<Wallet> restoreFromKeys(
|
||||
String name,
|
||||
String password,
|
||||
String language,
|
||||
int restoreHeight,
|
||||
String address,
|
||||
String viewKey,
|
||||
@@ -93,6 +94,7 @@ class MoneroWalletsManager extends WalletsManager {
|
||||
await monero_wallet_manager.restoreFromKeys(
|
||||
path: path,
|
||||
password: password,
|
||||
language: language,
|
||||
restoreHeight: restoreHeight,
|
||||
address: address,
|
||||
viewKey: viewKey,
|
||||
|
||||
@@ -41,7 +41,7 @@ class WalletListService {
|
||||
.map((info) => WalletDescription(name: info.name, type: info.type))
|
||||
.toList();
|
||||
|
||||
Future create(String name) async {
|
||||
Future create(String name, String language) async {
|
||||
if (await walletsManager.isWalletExit(name)) {
|
||||
throw WalletIsExistException(name);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ class WalletListService {
|
||||
final password = Uuid().v4();
|
||||
await saveWalletPassword(password: password, walletName: name);
|
||||
|
||||
final wallet = await walletsManager.create(name, password);
|
||||
final wallet = await walletsManager.create(name, password, language);
|
||||
|
||||
await onWalletChange(wallet);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ class WalletListService {
|
||||
await onWalletChange(wallet);
|
||||
}
|
||||
|
||||
Future restoreFromKeys(String name, int restoreHeight, String address,
|
||||
Future restoreFromKeys(String name, String language, int restoreHeight, String address,
|
||||
String viewKey, String spendKey) async {
|
||||
if (await walletsManager.isWalletExit(name)) {
|
||||
throw WalletIsExistException(name);
|
||||
@@ -90,7 +90,7 @@ class WalletListService {
|
||||
await saveWalletPassword(password: password, walletName: name);
|
||||
|
||||
final wallet = await walletsManager.restoreFromKeys(
|
||||
name, password, restoreHeight, address, viewKey, spendKey);
|
||||
name, password, language, restoreHeight, address, viewKey, spendKey);
|
||||
|
||||
await onWalletChange(wallet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user