Merge branch 'CW-438-add-nano' of https://github.com/cake-tech/cake_wallet into CW-459-12-words-btc

This commit is contained in:
fosse 2023-08-24 11:20:41 -04:00
commit ee062148a3
63 changed files with 441 additions and 769 deletions

View file

@ -43,7 +43,9 @@ abstract class WalletBase<
set syncStatus(SyncStatus status);
String get seed;
String? get seed;
String? get privateKey => null;
Object get keys;

View file

@ -44,12 +44,14 @@ abstract class EthereumWalletBase
with Store {
EthereumWalletBase({
required WalletInfo walletInfo,
required String mnemonic,
String? mnemonic,
String? privateKey,
required String password,
ERC20Balance? initialBalance,
}) : syncStatus = NotConnectedSyncStatus(),
_password = password,
_mnemonic = mnemonic,
_hexPrivateKey = privateKey,
_isTransactionUpdating = false,
_client = EthereumClient(),
walletAddresses = EthereumWalletAddresses(walletInfo),
@ -66,12 +68,13 @@ abstract class EthereumWalletBase
_sharedPrefs.complete(SharedPreferences.getInstance());
}
final String _mnemonic;
final String? _mnemonic;
final String? _hexPrivateKey;
final String _password;
late final Box<Erc20Token> erc20TokensBox;
late final EthPrivateKey _privateKey;
late final EthPrivateKey _ethPrivateKey;
late EthereumClient _client;
@ -99,8 +102,12 @@ abstract class EthereumWalletBase
erc20TokensBox = await CakeHive.openBox<Erc20Token>(Erc20Token.boxName);
await walletAddresses.init();
await transactionHistory.init();
_privateKey = await getPrivateKey(_mnemonic, _password);
walletAddresses.address = _privateKey.address.toString();
_ethPrivateKey = await getPrivateKey(
mnemonic: _mnemonic,
privateKey: _hexPrivateKey,
password: _password,
);
walletAddresses.address = _ethPrivateKey.address.toString();
await save();
}
@ -108,8 +115,7 @@ abstract class EthereumWalletBase
int calculateEstimatedFee(TransactionPriority priority, int? amount) {
try {
if (priority is EthereumTransactionPriority) {
final priorityFee =
EtherAmount.fromUnitAndValue(EtherUnit.gwei, priority.tip).getInWei.toInt();
final priorityFee = EtherAmount.fromInt(EtherUnit.gwei, priority.tip).getInWei.toInt();
return (_gasPrice! + priorityFee) * (_estimatedGas ?? 0);
}
@ -142,7 +148,7 @@ abstract class EthereumWalletBase
throw Exception("Ethereum Node connection failed");
}
_client.setListeners(_privateKey.address, _onNewTransaction);
_client.setListeners(_ethPrivateKey.address, _onNewTransaction);
_setTransactionUpdateTimer();
@ -202,7 +208,7 @@ abstract class EthereumWalletBase
}
final pendingEthereumTransaction = await _client.signTransaction(
privateKey: _privateKey,
privateKey: _ethPrivateKey,
toAddress: _credentials.outputs.first.isParsedAddress
? _credentials.outputs.first.extractedAddress!
: _credentials.outputs.first.address,
@ -240,7 +246,7 @@ abstract class EthereumWalletBase
@override
Future<Map<String, EthereumTransactionInfo>> fetchTransactions() async {
final address = _privateKey.address.hex;
final address = _ethPrivateKey.address.hex;
final transactions = await _client.fetchTransactions(address);
final List<Future<List<EthereumTransactionModel>>> erc20TokensTransactions = [];
@ -300,7 +306,10 @@ abstract class EthereumWalletBase
}
@override
String get seed => _mnemonic;
String? get seed => _mnemonic;
@override
String get privateKey => HEX.encode(_ethPrivateKey.privateKey);
@action
@override
@ -327,6 +336,7 @@ abstract class EthereumWalletBase
String toJSON() => json.encode({
'mnemonic': _mnemonic,
'private_key': privateKey,
'balance': balance[currency]!.toJSON(),
});
@ -338,13 +348,15 @@ abstract class EthereumWalletBase
final path = await pathForWallet(name: name, type: walletInfo.type);
final jsonSource = await read(path: path, password: password);
final data = json.decode(jsonSource) as Map;
final mnemonic = data['mnemonic'] as String;
final mnemonic = data['mnemonic'] as String?;
final privateKey = data['private_key'] as String?;
final balance = ERC20Balance.fromJSON(data['balance'] as String) ?? ERC20Balance(BigInt.zero);
return EthereumWallet(
walletInfo: walletInfo,
password: password,
mnemonic: mnemonic,
privateKey: privateKey,
initialBalance: balance,
);
}
@ -357,7 +369,7 @@ abstract class EthereumWalletBase
}
Future<ERC20Balance> _fetchEthBalance() async {
final balance = await _client.getBalance(_privateKey.address);
final balance = await _client.getBalance(_ethPrivateKey.address);
return ERC20Balance(balance.getInWei);
}
@ -366,7 +378,7 @@ abstract class EthereumWalletBase
try {
if (token.enabled) {
balance[token] = await _client.fetchERC20Balances(
_privateKey.address,
_ethPrivateKey.address,
token.contractAddress,
);
} else {
@ -376,8 +388,15 @@ abstract class EthereumWalletBase
}
}
Future<EthPrivateKey> getPrivateKey(String mnemonic, String password) async {
final seed = bip39.mnemonicToSeed(mnemonic);
Future<EthPrivateKey> getPrivateKey(
{String? mnemonic, String? privateKey, required String password}) async {
assert(mnemonic != null || privateKey != null);
if (privateKey != null) {
return EthPrivateKey.fromHex(privateKey);
}
final seed = bip39.mnemonicToSeed(mnemonic!);
final root = bip32.BIP32.fromSeed(seed);
@ -413,7 +432,7 @@ abstract class EthereumWalletBase
if (_token.enabled) {
balance[_token] = await _client.fetchERC20Balances(
_privateKey.address,
_ethPrivateKey.address,
_token.contractAddress,
);
} else {

View file

@ -8,16 +8,22 @@ class EthereumNewWalletCredentials extends WalletCredentials {
class EthereumRestoreWalletFromSeedCredentials extends WalletCredentials {
EthereumRestoreWalletFromSeedCredentials(
{required String name, required String password, required this.mnemonic, WalletInfo? walletInfo})
{required String name,
required String password,
required this.mnemonic,
WalletInfo? walletInfo})
: super(name: name, password: password, walletInfo: walletInfo);
final String mnemonic;
}
class EthereumRestoreWalletFromWIFCredentials extends WalletCredentials {
EthereumRestoreWalletFromWIFCredentials(
{required String name, required String password, required this.wif, WalletInfo? walletInfo})
class EthereumRestoreWalletFromPrivateKey extends WalletCredentials {
EthereumRestoreWalletFromPrivateKey(
{required String name,
required String password,
required this.privateKey,
WalletInfo? walletInfo})
: super(name: name, password: password, walletInfo: walletInfo);
final String wif;
final String privateKey;
}

View file

@ -13,7 +13,7 @@ import 'package:bip39/bip39.dart' as bip39;
import 'package:collection/collection.dart';
class EthereumWalletService extends WalletService<EthereumNewWalletCredentials,
EthereumRestoreWalletFromSeedCredentials, EthereumRestoreWalletFromWIFCredentials> {
EthereumRestoreWalletFromSeedCredentials, EthereumRestoreWalletFromPrivateKey> {
EthereumWalletService(this.walletInfoSource);
final Box<WalletInfo> walletInfoSource;
@ -66,8 +66,18 @@ class EthereumWalletService extends WalletService<EthereumNewWalletCredentials,
}
@override
Future<EthereumWallet> restoreFromKeys(credentials) {
throw UnimplementedError();
Future<EthereumWallet> restoreFromKeys(EthereumRestoreWalletFromPrivateKey credentials) async {
final wallet = EthereumWallet(
password: credentials.password!,
privateKey: credentials.privateKey,
walletInfo: credentials.walletInfo!,
);
await wallet.init();
wallet.addInitialTokens();
await wallet.save();
return wallet;
}
@override

View file

@ -174,12 +174,12 @@ DEPENDENCIES:
- in_app_review (from `.symlinks/plugins/in_app_review/ios`)
- local_auth_ios (from `.symlinks/plugins/local_auth_ios/ios`)
- package_info (from `.symlinks/plugins/package_info/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- platform_device_id (from `.symlinks/plugins/platform_device_id/ios`)
- sensitive_clipboard (from `.symlinks/plugins/sensitive_clipboard/ios`)
- share_plus (from `.symlinks/plugins/share_plus/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- uni_links (from `.symlinks/plugins/uni_links/ios`)
- UnstoppableDomainsResolution (~> 4.0.0)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
@ -236,7 +236,7 @@ EXTERNAL SOURCES:
package_info:
:path: ".symlinks/plugins/package_info/ios"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/ios"
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
platform_device_id:
@ -246,7 +246,7 @@ EXTERNAL SOURCES:
share_plus:
:path: ".symlinks/plugins/share_plus/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/ios"
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
uni_links:
:path: ".symlinks/plugins/uni_links/ios"
url_launcher_ios:

View file

@ -1,8 +1,10 @@
import 'package:cake_wallet/.secrets.g.dart' as secrets;
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:flutter/material.dart';
class OnRamperBuyProvider {
OnRamperBuyProvider({required SettingsStore settingsStore, required WalletBase wallet})
@ -29,7 +31,11 @@ class OnRamperBuyProvider {
}
}
Uri requestUrl() {
String getColorStr(Color color) {
return color.value.toRadixString(16).replaceAll(RegExp(r'^ff'), "");
}
Uri requestUrl(BuildContext context) {
String primaryColor,
secondaryColor,
primaryTextColor,
@ -37,31 +43,16 @@ class OnRamperBuyProvider {
containerColor,
cardColor;
switch (_settingsStore.currentTheme.type) {
case ThemeType.bright:
primaryColor = '815dfbff';
secondaryColor = 'ffffff';
primaryTextColor = '141519';
secondaryTextColor = '6b6f80';
containerColor = 'ffffff';
cardColor = 'f2f0faff';
break;
case ThemeType.light:
primaryColor = '2194ffff';
secondaryColor = 'ffffff';
primaryTextColor = '141519';
secondaryTextColor = '6b6f80';
containerColor = 'ffffff';
cardColor = 'e5f7ff';
break;
case ThemeType.dark:
primaryColor = '456effff';
secondaryColor = '1b2747ff';
primaryTextColor = 'ffffff';
secondaryTextColor = 'ffffff';
containerColor = '19233C';
cardColor = '232f4fff';
break;
primaryColor = getColorStr(Theme.of(context).primaryColor);
secondaryColor = getColorStr(Theme.of(context).colorScheme.background);
primaryTextColor = getColorStr(Theme.of(context).extension<CakeTextTheme>()!.titleColor);
secondaryTextColor =
getColorStr(Theme.of(context).extension<CakeTextTheme>()!.secondaryTextColor);
containerColor = getColorStr(Theme.of(context).colorScheme.background);
cardColor = getColorStr(Theme.of(context).cardColor);
if (_settingsStore.currentTheme.title == S.current.high_contrast_theme) {
cardColor = getColorStr(Colors.white);
}
final networkName = _wallet.currency.fullName?.toUpperCase().replaceAll(" ", "");

View file

@ -191,8 +191,6 @@ import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart';
import 'package:cake_wallet/view_model/wallet_restoration_from_keys_vm.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:cw_core/wallet_type.dart';
@ -340,25 +338,6 @@ Future setup({
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
type: type));
getIt.registerFactoryParam<WalletRestorationFromSeedVM, List, void>((args, _) {
final type = args.first as WalletType;
final language = args[1] as String;
final mnemonic = args[2] as String;
return WalletRestorationFromSeedVM(
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
type: type, language: language, seed: mnemonic);
});
getIt.registerFactoryParam<WalletRestorationFromKeysVM, List, void>((args, _) {
final type = args.first as WalletType;
final language = args[1] as String;
return WalletRestorationFromKeysVM(
getIt.get<AppStore>(), getIt.get<WalletCreationService>(param1: type), _walletInfoSource,
type: type, language: language);
});
getIt.registerFactoryParam<WalletRestorationFromQRVM, WalletType, void>((WalletType type, _) {
return WalletRestorationFromQRVM(getIt.get<AppStore>(),
getIt.get<WalletCreationService>(param1: type), _walletInfoSource, type);

View file

@ -51,7 +51,7 @@ class MainActions {
case WalletType.banano:
case WalletType.monero:
if (viewModel.isEnabledBuyAction) {
final uri = getIt.get<OnRamperBuyProvider>().requestUrl();
final uri = getIt.get<OnRamperBuyProvider>().requestUrl(context);
if (DeviceInfo.instance.isMobile) {
Navigator.of(context)
.pushNamed(Routes.webViewPage, arguments: [S.of(context).buy, uri]);

View file

@ -22,6 +22,14 @@ class CWEthereum extends Ethereum {
}) =>
EthereumRestoreWalletFromSeedCredentials(name: name, password: password, mnemonic: mnemonic);
@override
WalletCredentials createEthereumRestoreWalletFromPrivateKey({
required String name,
required String privateKey,
required String password,
}) =>
EthereumRestoreWalletFromPrivateKey(name: name, password: password, privateKey: privateKey);
@override
String getAddress(WalletBase wallet) => (wallet as EthereumWallet).walletAddresses.address;

View file

@ -64,7 +64,6 @@ import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/view_model/wallet_new_vm.dart';
import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart';
import 'package:cake_wallet/exchange/trade.dart';
import 'package:cw_core/transaction_info.dart';
import 'package:cw_core/wallet_type.dart';
@ -87,7 +86,6 @@ import 'package:cake_wallet/src/screens/monero_accounts/monero_account_edit_or_c
import 'package:cake_wallet/src/screens/contact/contact_list_page.dart';
import 'package:cake_wallet/src/screens/contact/contact_page.dart';
import 'package:cake_wallet/src/screens/wallet_keys/wallet_keys_page.dart';
import 'package:cake_wallet/src/screens/restore/restore_wallet_from_seed_details.dart';
import 'package:cake_wallet/src/screens/exchange/exchange_page.dart';
import 'package:cake_wallet/src/screens/rescan/rescan_page.dart';
import 'package:cake_wallet/src/screens/faq/faq_page.dart';
@ -389,15 +387,6 @@ Route<dynamic> createRoute(RouteSettings settings) {
return MaterialPageRoute<void>(
fullscreenDialog: true, builder: (_) => getIt.get<BuyWebViewPage>(param1: args));
case Routes.restoreWalletFromSeedDetails:
final args = settings.arguments as List;
final walletRestorationFromSeedVM = getIt.get<WalletRestorationFromSeedVM>(param1: args);
return CupertinoPageRoute<void>(
fullscreenDialog: true,
builder: (_) => RestoreWalletFromSeedDetailsPage(
walletRestorationFromSeedVM: walletRestorationFromSeedVM));
case Routes.exchange:
return CupertinoPageRoute<void>(
fullscreenDialog: true, builder: (_) => getIt.get<ExchangePage>());

View file

@ -34,7 +34,6 @@ class Routes {
static const tradeDetails = '/trade_details';
static const exchangeFunds = '/exchange_funds';
static const exchangeTrade = '/exchange_trade';
static const restoreWalletFromSeedDetails = '/restore_from_seed_details';
static const exchange = '/exchange';
static const settings = '/settings';
static const desktop_settings_page = '/desktop_settings_page';

View file

@ -127,9 +127,9 @@ class BackupPage extends BasePage {
builder: (dialogContext) {
return AlertWithTwoActions(
alertTitle: S.of(context).export_backup,
alertContent: 'Please select destination for the backup file.',
rightButtonText: 'Save to Downloads',
leftButtonText: 'Share',
alertContent: S.of(context).select_destination,
rightButtonText: S.of(context).save_to_downloads,
leftButtonText:S.of(context).share,
actionRightButton: () async {
final permission = await Permission.storage.request();

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/core/auth_service.dart';
import 'package:cake_wallet/entities/contact_base.dart';
import 'package:cake_wallet/entities/contact_record.dart';
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
@ -39,7 +40,7 @@ class ContactListPage extends BasePage {
children: <Widget>[
Icon(
Icons.add,
color: Theme.of(context).dialogTheme.backgroundColor,
color: Theme.of(context).appBarTheme.titleTextStyle!.color,
size: 22.0,
),
ButtonTheme(
@ -71,7 +72,7 @@ class ContactListPage extends BasePage {
@override
Widget body(BuildContext context) {
return Container(
padding: EdgeInsets.only(top: 20.0, bottom: 20.0),
padding: EdgeInsets.all(20.0),
child: Observer(builder: (_) {
final contacts = contactListViewModel.contactsToShow;
final walletContacts = contactListViewModel.walletContactsToShow;
@ -131,7 +132,6 @@ class ContactListPage extends BasePage {
}
},
child: Container(
color: Colors.transparent,
padding: const EdgeInsets.only(top: 16, bottom: 16, right: 24),
child: Row(
mainAxisSize: MainAxisSize.min,
@ -146,7 +146,7 @@ class ContactListPage extends BasePage {
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.normal,
color: Theme.of(context).dialogTheme.backgroundColor,
color: Theme.of(context).extension<CakeTextTheme>()!.titleColor,
),
),
))

View file

@ -182,9 +182,8 @@ class AddressPage extends BasePage {
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(25)),
border: Border.all(
color: Theme.of(context)
.extension<ReceivePageTheme>()!
.iconsBackgroundColor,
color:
Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
width: 1),
color: Theme.of(context)
.extension<SyncIndicatorTheme>()!
@ -202,13 +201,12 @@ class AddressPage extends BasePage {
fontSize: 14,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.extension<DashboardPageTheme>()!
.textColor),
.extension<SyncIndicatorTheme>()!.textColor),
)),
Icon(
Icons.arrow_forward_ios,
size: 14,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
color: Theme.of(context).extension<SyncIndicatorTheme>()!.textColor,
)
],
),

View file

@ -2,7 +2,6 @@ import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
import 'package:cake_wallet/store/settings_store.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/feature_flag.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
@ -77,9 +76,7 @@ class BalancePage extends StatelessWidget {
return IntroducingCard(
title: S.of(context).introducing_cake_pay,
subTitle: S.of(context).cake_pay_learn_more,
borderColor: settingsStore.currentTheme.type == ThemeType.bright
? Color.fromRGBO(255, 255, 255, 0.2)
: Colors.transparent,
borderColor: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
closeCard: dashboardViewModel.balanceViewModel.disableIntroCakePayCard);
}
return Container();
@ -139,9 +136,7 @@ class BalancePage extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
border: Border.all(
color: settingsStore.currentTheme.type == ThemeType.bright
? Color.fromRGBO(255, 255, 255, 0.2)
: Colors.transparent,
color: Theme.of(context).extension<BalancePageTheme>()!.cardBorderColor,
width: 1,
),
color: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
@ -282,7 +277,7 @@ class BalancePage extends StatelessWidget {
fontSize: 20,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
color: Theme.of(context).extension<BalancePageTheme>()!.assetTitleColor,
height: 1,
),
maxLines: 1,
@ -296,7 +291,7 @@ class BalancePage extends StatelessWidget {
fontSize: 12,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
color: Theme.of(context).extension<BalancePageTheme>()!.textColor,
height: 1,
),
),

View file

@ -5,6 +5,7 @@ import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/desktop_exchange_cards_section.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/mobile_exchange_cards_section.dart';
import 'package:cake_wallet/src/widgets/add_template_button.dart';
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
import 'package:cake_wallet/themes/theme_base.dart';
import 'package:cake_wallet/utils/debounce.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
@ -629,7 +630,7 @@ class ExchangePage extends BasePage {
},
imageArrow: arrowBottomPurple,
currencyButtonColor: Colors.transparent,
addressButtonsColor: Theme.of(context).focusColor,
addressButtonsColor: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
borderColor: Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderTopPanelColor,
currencyValueValidator: (value) {
return !exchangeViewModel.isFixedRateMode
@ -677,7 +678,7 @@ class ExchangePage extends BasePage {
exchangeViewModel.changeReceiveCurrency(currency: currency),
imageArrow: arrowBottomCakeGreen,
currencyButtonColor: Colors.transparent,
addressButtonsColor: Theme.of(context).focusColor,
addressButtonsColor: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonColor,
borderColor: Theme.of(context).extension<ExchangePageTheme>()!.textFieldBorderBottomPanelColor,
currencyValueValidator: (value) {
return exchangeViewModel.isFixedRateMode

View file

@ -1,145 +0,0 @@
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:mobx/mobx.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/core/wallet_name_validator.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart';
class RestoreWalletFromSeedDetailsPage extends BasePage {
RestoreWalletFromSeedDetailsPage(
{required this.walletRestorationFromSeedVM});
final WalletRestorationFromSeedVM walletRestorationFromSeedVM;
@override
String get title => S.current.restore_wallet_restore_description;
@override
Widget body(BuildContext context) => RestoreFromSeedDetailsForm(
walletRestorationFromSeedVM: walletRestorationFromSeedVM);
}
class RestoreFromSeedDetailsForm extends StatefulWidget {
RestoreFromSeedDetailsForm({required this.walletRestorationFromSeedVM});
final WalletRestorationFromSeedVM walletRestorationFromSeedVM;
@override
_RestoreFromSeedDetailsFormState createState() =>
_RestoreFromSeedDetailsFormState();
}
class _RestoreFromSeedDetailsFormState
extends State<RestoreFromSeedDetailsForm> {
final _formKey = GlobalKey<FormState>();
final _blockchainHeightKey = GlobalKey<BlockchainHeightState>();
final _nameController = TextEditingController();
ReactionDisposer? _stateReaction;
@override
void initState() {
_stateReaction = reaction((_) => widget.walletRestorationFromSeedVM.state,
(ExecutionState state) {
if (state is ExecutedSuccessfullyState) {
Navigator.of(context).popUntil((route) => route.isFirst);
}
if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
alertTitle: S.current.restore_title_from_seed,
alertContent: state.error,
buttonText: S.of(context).ok,
buttonAction: () => Navigator.of(context).pop());
});
});
}
});
_nameController.addListener(
() => widget.walletRestorationFromSeedVM.name = _nameController.text);
super.initState();
}
@override
void dispose() {
_nameController.dispose();
_stateReaction?.reaction.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 24, right: 24),
child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(bottom: 24.0),
content: Form(
key: _formKey,
child: Column(children: <Widget>[
Row(
children: <Widget>[
Flexible(
child: Container(
padding: EdgeInsets.only(top: 20.0),
child: BaseTextFormField(
controller: _nameController,
hintText: S.of(context).restore_wallet_name,
validator: WalletNameValidator(),
),
))
],
),
if (widget.walletRestorationFromSeedVM.hasRestorationHeight) ... [
BlockchainHeightWidget(
key: _blockchainHeightKey,
onHeightChange: (height) {
widget.walletRestorationFromSeedVM.height = height;
print(height);
}),
Padding(
padding: EdgeInsets.only(left: 40, right: 40, top: 24),
child: Text(
S.of(context).restore_from_date_or_blockheight,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.normal,
color: Theme.of(context).hintColor
),
),
)
]
]),
),
bottomSectionPadding: EdgeInsets.only(bottom: 24),
bottomSection: Observer(builder: (_) {
return LoadingPrimaryButton(
onPressed: () {
if (_formKey.currentState != null && _formKey.currentState!.validate()) {
widget.walletRestorationFromSeedVM.create();
}
},
isLoading:
widget.walletRestorationFromSeedVM.state is IsExecutingState,
text: S.of(context).restore_recover,
color: Theme.of(context).primaryColor,
textColor: Colors.white,
isDisabled: _nameController.text.isNotEmpty,
);
}),
),
);
}
}

View file

@ -1,29 +1,28 @@
import 'package:cake_wallet/src/widgets/seed_widget.dart';
import 'package:cake_wallet/src/widgets/address_text_field.dart';
import 'package:cake_wallet/view_model/wallet_restore_view_model.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:flutter/services.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/core/wallet_name_validator.dart';
import 'package:cake_wallet/entities/generate_name.dart';
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
import 'package:flutter/services.dart';
class WalletRestoreFromKeysFrom extends StatefulWidget {
WalletRestoreFromKeysFrom({
required this.walletRestoreViewModel,
required this.onSpendKeyChange,
required this.onPrivateKeyChange,
required this.displayPrivateKeyField,
required this.onHeightOrDateEntered,
Key? key,
this.onHeightOrDateEntered,
}) : super(key: key);
final Function(bool)? onHeightOrDateEntered;
final Function(bool) onHeightOrDateEntered;
final WalletRestoreViewModel walletRestoreViewModel;
final void Function(String)? onSpendKeyChange;
final void Function(String)? onPrivateKeyChange;
final bool displayPrivateKeyField;
@override
WalletRestoreFromKeysFromState createState() => WalletRestoreFromKeysFromState();
@ -37,6 +36,7 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
addressController = TextEditingController(),
viewKeyController = TextEditingController(),
spendKeyController = TextEditingController(),
privateKeyController = TextEditingController(),
nameTextEditingController = TextEditingController();
final GlobalKey<FormState> formKey;
@ -46,13 +46,17 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
final TextEditingController viewKeyController;
final TextEditingController spendKeyController;
final TextEditingController nameTextEditingController;
final TextEditingController privateKeyController;
@override
void initState() {
super.initState();
spendKeyController.addListener(() {
widget.onSpendKeyChange?.call(spendKeyController.text);
privateKeyController.addListener(() {
if (privateKeyController.text.isNotEmpty) {
widget.onHeightOrDateEntered(true);
}
widget.onPrivateKeyChange?.call(privateKeyController.text);
});
}
@ -61,17 +65,18 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
nameController.dispose();
addressController.dispose();
viewKeyController.dispose();
spendKeyController.dispose();
privateKeyController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 24, right: 24),
child: Form(
key: formKey,
child: Column(children: <Widget>[
padding: EdgeInsets.only(left: 24, right: 24),
child: Form(
key: formKey,
child: Column(
children: <Widget>[
Stack(
alignment: Alignment.centerRight,
children: [
@ -100,7 +105,8 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
height: 34,
child: Image.asset(
'assets/images/refresh_icon.png',
color: Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
color:
Theme.of(context).extension<SendPageTheme>()!.textFieldButtonIconColor,
),
),
),
@ -108,37 +114,65 @@ class WalletRestoreFromKeysFromState extends State<WalletRestoreFromKeysFrom> {
],
),
Container(height: 20),
if (widget.walletRestoreViewModel.hasMultipleKeys) ...[
BaseTextFormField(
controller: addressController,
keyboardType: TextInputType.multiline,
maxLines: null,
hintText: S.of(context).restore_address),
Container(
padding: EdgeInsets.only(top: 20.0),
child: BaseTextFormField(
controller: viewKeyController,
hintText: S.of(context).restore_view_key_private,
maxLines: null)),
Container(
padding: EdgeInsets.only(top: 20.0),
child: BaseTextFormField(
controller: spendKeyController,
hintText: S.of(context).restore_spend_key_private,
maxLines: null)),
BlockchainHeightWidget(
key: blockchainHeightKey,
hasDatePicker: widget.walletRestoreViewModel.type != WalletType.haven,
onHeightChange: (_) => null,
onHeightOrDateEntered: widget.onHeightOrDateEntered)
] else
Container(
padding: EdgeInsets.only(top: 20.0),
child: BaseTextFormField(
controller: spendKeyController,
hintText: S.of(context).restore_spend_key_private,
maxLines: null)),
]),
));
_restoreFromKeysFormFields(),
],
),
),
);
}
Widget _restoreFromKeysFormFields() {
if (widget.displayPrivateKeyField) {
return AddressTextField(
controller: privateKeyController,
placeholder: S.of(context).private_key,
options: [AddressTextFieldOption.paste],
buttonColor: Theme.of(context).hintColor,
onPushPasteButton: (_) {
_pasteText();
},
);
}
return Column(
children: [
BaseTextFormField(
controller: addressController,
keyboardType: TextInputType.multiline,
maxLines: null,
hintText: S.of(context).restore_address,
),
Container(
padding: EdgeInsets.only(top: 20.0),
child: BaseTextFormField(
controller: viewKeyController,
hintText: S.of(context).restore_view_key_private,
maxLines: null,
),
),
Container(
padding: EdgeInsets.only(top: 20.0),
child: BaseTextFormField(
controller: spendKeyController,
hintText: S.of(context).restore_spend_key_private,
maxLines: null,
),
),
BlockchainHeightWidget(
key: blockchainHeightKey,
hasDatePicker: widget.walletRestoreViewModel.type != WalletType.haven,
onHeightChange: (_) => null,
onHeightOrDateEntered: widget.onHeightOrDateEntered,
),
],
);
}
Future<void> _pasteText() async {
final value = await Clipboard.getData('text/plain');
if (value?.text?.isNotEmpty ?? false) {
privateKeyController.text = value!.text!;
}
}
}

View file

@ -1,149 +0,0 @@
import 'package:cake_wallet/entities/generate_name.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/wallet_restore_view_model.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/src/screens/seed_language/widgets/seed_language_picker.dart';
import 'package:cake_wallet/src/widgets/seed_widget.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/core/wallet_name_validator.dart';
class WalletRestoreFromSeedKeyForm extends StatefulWidget {
WalletRestoreFromSeedKeyForm(
{Key? key,
required this.displayLanguageSelector,
required this.displayBlockHeightSelector,
required this.type,
this.blockHeightFocusNode,
this.onHeightOrDateEntered,
this.onSeedChange,
this.onLanguageChange})
: super(key: key);
final WalletType type;
final bool displayLanguageSelector;
final bool displayBlockHeightSelector;
final FocusNode? blockHeightFocusNode;
final Function(bool)? onHeightOrDateEntered;
final void Function(String)? onSeedChange;
final void Function(String)? onLanguageChange;
@override
WalletRestoreFromSeedKeyFormState createState() =>
WalletRestoreFromSeedKeyFormState('English');
}
class WalletRestoreFromSeedKeyFormState extends State<WalletRestoreFromSeedKeyForm> {
WalletRestoreFromSeedKeyFormState(this.language)
: seedWidgetStateKey = GlobalKey<SeedWidgetState>(),
blockchainHeightKey = GlobalKey<BlockchainHeightState>(),
formKey = GlobalKey<FormState>(),
languageController = TextEditingController(),
nameTextEditingController = TextEditingController();
final GlobalKey<SeedWidgetState> seedWidgetStateKey;
final GlobalKey<BlockchainHeightState> blockchainHeightKey;
final TextEditingController languageController;
final TextEditingController nameTextEditingController;
final GlobalKey<FormState> formKey;
String language;
@override
void initState() {
_setLanguageLabel(language);
super.initState();
}
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.only(left: 24, right: 24),
child: Column(children: [
Form(
key: formKey,
child: Stack(
alignment: Alignment.centerRight,
children: [
BaseTextFormField(
controller: nameTextEditingController,
hintText: S.of(context).wallet_name,
suffixIcon: IconButton(
onPressed: () async {
final rName = await generateName();
FocusManager.instance.primaryFocus?.unfocus();
setState(() {
nameTextEditingController.text = rName;
nameTextEditingController.selection =
TextSelection.fromPosition(TextPosition(
offset: nameTextEditingController.text.length));
});
},
icon: Container(
padding: const EdgeInsets.all(8),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context).hintColor,
),
width: 34,
height: 34,
child: Image.asset(
'assets/images/refresh_icon.png',
color: Theme.of(context)
.primaryTextTheme!
.headlineMedium!
.decorationColor!,
),
),
),
validator: WalletNameValidator(),
),
],
)),
Container(height: 20),
SeedWidget(
key: seedWidgetStateKey,
language: language,
type: widget.type,
onSeedChange: widget.onSeedChange),
if (widget.displayLanguageSelector)
GestureDetector(
onTap: () async {
await showPopUp<void>(
context: context,
builder: (_) => SeedLanguagePicker(
selected: language, onItemSelected: _changeLanguage));
},
child: Container(
color: Colors.transparent,
padding: EdgeInsets.only(top: 20.0),
child: IgnorePointer(
child: BaseTextFormField(
controller: languageController,
enableInteractiveSelection: false,
readOnly: true)))),
if (widget.displayBlockHeightSelector)
BlockchainHeightWidget(
focusNode: widget.blockHeightFocusNode,
key: blockchainHeightKey,
onHeightOrDateEntered: widget.onHeightOrDateEntered,
hasDatePicker: widget.type == WalletType.monero)
]));
}
void _changeLanguage(String language) {
setState(() {
this.language = language;
seedWidgetStateKey.currentState!.changeSeedLanguage(language);
_setLanguageLabel(language);
widget.onLanguageChange?.call(language);
});
}
void _setLanguageLabel(String language) =>
languageController.text = '$language (Seed language)';
}

View file

@ -1,5 +1,4 @@
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/restore/wallet_restore_from_seed_key_form.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/src/widgets/keyboard_done_button.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
@ -26,7 +25,6 @@ class WalletRestorePage extends BasePage {
WalletRestorePage(this.walletRestoreViewModel)
: walletRestoreFromSeedFormKey = GlobalKey<WalletRestoreFromSeedFormState>(),
walletRestoreFromKeysFormKey = GlobalKey<WalletRestoreFromKeysFromState>(),
walletRestoreFromSeedKeyFormKey = GlobalKey<WalletRestoreFromSeedKeyFormState>(),
_pages = [],
_blockHeightFocusNode = FocusNode(),
_controller = PageController(initialPage: 0) {
@ -73,9 +71,12 @@ class WalletRestorePage extends BasePage {
_pages.add(WalletRestoreFromKeysFrom(
key: walletRestoreFromKeysFormKey,
walletRestoreViewModel: walletRestoreViewModel,
onSpendKeyChange: (String seed) {
walletRestoreViewModel.isButtonEnabled = _isValidSeedKey();
onPrivateKeyChange: (String seed) {
if (walletRestoreViewModel.type == WalletType.nano || walletRestoreViewModel.type == WalletType.banano) {
walletRestoreViewModel.isButtonEnabled = _isValidSeedKey();
}
},
displayPrivateKeyField: walletRestoreViewModel.hasRestoreFromPrivateKey,
onHeightOrDateEntered: (value) => walletRestoreViewModel.isButtonEnabled = value));
break;
default:
@ -102,7 +103,6 @@ class WalletRestorePage extends BasePage {
final List<Widget> _pages;
final GlobalKey<WalletRestoreFromSeedFormState> walletRestoreFromSeedFormKey;
final GlobalKey<WalletRestoreFromKeysFromState> walletRestoreFromKeysFormKey;
final GlobalKey<WalletRestoreFromSeedKeyFormState> walletRestoreFromSeedKeyFormKey;
final FocusNode _blockHeightFocusNode;
DerivationType derivationType = DerivationType.unknown;
@ -197,8 +197,12 @@ class WalletRestorePage extends BasePage {
await _confirmForm(context);
},
text: S.of(context).restore_recover,
color: Theme.of(context).extension<WalletListTheme>()!.createNewWalletButtonBackgroundColor,
textColor: Theme.of(context).extension<WalletListTheme>()!.restoreWalletButtonTextColor,
color: Theme.of(context)
.extension<WalletListTheme>()!
.createNewWalletButtonBackgroundColor,
textColor: Theme.of(context)
.extension<WalletListTheme>()!
.restoreWalletButtonTextColor,
isLoading: walletRestoreViewModel.state is IsExecutingState,
isDisabled: !walletRestoreViewModel.isButtonEnabled,
);
@ -235,7 +239,7 @@ class WalletRestorePage extends BasePage {
}
bool _isValidSeedKey() {
final seedKey = walletRestoreFromKeysFormKey.currentState!.spendKeyController.text;
final seedKey = walletRestoreFromKeysFormKey.currentState!.privateKeyController.text;
if (seedKey.length != 64 && seedKey.length != 128) {
return false;
@ -259,10 +263,11 @@ class WalletRestorePage extends BasePage {
credentials['name'] =
walletRestoreFromSeedFormKey.currentState!.nameTextEditingController.text;
} else if (walletRestoreViewModel.mode == WalletRestoreMode.keys) {
if (!walletRestoreViewModel.hasMultipleKeys) {
if (walletRestoreViewModel.hasRestoreFromPrivateKey) {
credentials['private_key'] =
walletRestoreFromKeysFormKey.currentState!.privateKeyController.text;
credentials['name'] =
walletRestoreFromKeysFormKey.currentState!.nameTextEditingController.text;
credentials['seedKey'] = walletRestoreFromKeysFormKey.currentState!.spendKeyController.text;
} else {
credentials['address'] = walletRestoreFromKeysFormKey.currentState!.addressController.text;
credentials['viewKey'] = walletRestoreFromKeysFormKey.currentState!.viewKeyController.text;
@ -327,7 +332,7 @@ class WalletRestorePage extends BasePage {
}
walletRestoreViewModel.state = InitialExecutionState();
walletRestoreViewModel.create(options: _credentials());
}

View file

@ -17,24 +17,21 @@ class SearchBarWidget extends StatelessWidget {
Widget build(BuildContext context) {
return TextFormField(
controller: searchController,
style: TextStyle(
color: Theme.of(context).extension<PickerTheme>()!.searchTextColor),
style: TextStyle(color: Theme.of(context).extension<PickerTheme>()!.searchTextColor),
decoration: InputDecoration(
hintText: hintText ?? S.of(context).search_currency,
hintStyle: TextStyle(
color: Theme.of(context).extension<PickerTheme>()!.searchHintColor),
hintStyle: TextStyle(color: Theme.of(context).extension<PickerTheme>()!.searchHintColor),
prefixIcon: Image.asset("assets/images/search_icon.png",
color: Theme.of(context).extension<PickerTheme>()!.searchIconColor),
filled: true,
fillColor: Theme.of(context)
.extension<PickerTheme>()!
.searchBackgroundFillColor,
fillColor: Theme.of(context).extension<PickerTheme>()!.searchBackgroundFillColor,
alignLabelWithHint: false,
contentPadding: const EdgeInsets.symmetric(vertical: 4, horizontal: 16),
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(borderRadius),
borderSide: const BorderSide(
color: Colors.transparent,
borderSide: BorderSide(
color: Theme.of(context).extension<PickerTheme>()!.searchBorderColor ??
Colors.transparent,
)),
focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(borderRadius),

View file

@ -1,16 +1,9 @@
import 'package:cake_wallet/themes/extensions/cake_text_theme.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/src/widgets/validable_annotated_editable_text.dart';
import 'package:cake_wallet/src/widgets/blockchain_height_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/core/seed_validator.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/entities/mnemonic_item.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:flutter/widgets.dart';
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
class SeedWidget extends StatefulWidget {

View file

@ -6,13 +6,15 @@ class PickerTheme extends ThemeExtension<PickerTheme> {
final Color searchBackgroundFillColor;
final Color searchTextColor;
final Color? searchHintColor;
final Color? searchBorderColor;
PickerTheme(
{required this.dividerColor,
this.searchIconColor,
required this.searchBackgroundFillColor,
required this.searchTextColor,
this.searchHintColor});
this.searchHintColor,
this.searchBorderColor});
@override
PickerTheme copyWith(
@ -20,14 +22,15 @@ class PickerTheme extends ThemeExtension<PickerTheme> {
Color? searchIconColor,
Color? searchBackgroundFillColor,
Color? searchTextColor,
Color? searchHintColor}) =>
Color? searchHintColor,
Color? searchBorderColor}) =>
PickerTheme(
dividerColor: dividerColor ?? this.dividerColor,
searchIconColor: searchIconColor ?? this.searchIconColor,
searchBackgroundFillColor:
searchBackgroundFillColor ?? this.searchBackgroundFillColor,
searchBackgroundFillColor: searchBackgroundFillColor ?? this.searchBackgroundFillColor,
searchTextColor: searchTextColor ?? this.searchTextColor,
searchHintColor: searchHintColor ?? this.searchHintColor);
searchHintColor: searchHintColor ?? this.searchHintColor,
searchBorderColor: searchBorderColor ?? this.searchBorderColor);
@override
PickerTheme lerp(ThemeExtension<PickerTheme>? other, double t) {
@ -36,19 +39,14 @@ class PickerTheme extends ThemeExtension<PickerTheme> {
}
return PickerTheme(
dividerColor:
Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor,
searchIconColor:
Color.lerp(searchIconColor, other.searchIconColor, t) ??
searchIconColor,
searchBackgroundFillColor: Color.lerp(searchBackgroundFillColor,
other.searchBackgroundFillColor, t) ??
searchBackgroundFillColor,
searchTextColor:
Color.lerp(searchTextColor, other.searchTextColor, t) ??
searchTextColor,
searchHintColor:
Color.lerp(searchHintColor, other.searchHintColor, t) ??
searchHintColor);
dividerColor: Color.lerp(dividerColor, other.dividerColor, t) ?? dividerColor,
searchIconColor: Color.lerp(searchIconColor, other.searchIconColor, t) ?? searchIconColor,
searchBackgroundFillColor:
Color.lerp(searchBackgroundFillColor, other.searchBackgroundFillColor, t) ??
searchBackgroundFillColor,
searchTextColor: Color.lerp(searchTextColor, other.searchTextColor, t) ?? searchTextColor,
searchHintColor: Color.lerp(searchHintColor, other.searchHintColor, t) ?? searchHintColor,
searchBorderColor:
Color.lerp(searchBorderColor, other.searchBorderColor, t) ?? searchBorderColor);
}
}

View file

@ -39,14 +39,12 @@ class HighContrastTheme extends MoneroLightTheme {
@override
CakeTextTheme get cakeTextTheme => super.cakeTextTheme.copyWith(
buttonTextColor: Colors.white,
buttonSecondaryTextColor: Colors.white.withOpacity(0.5));
buttonTextColor: Colors.white, buttonSecondaryTextColor: Colors.white.withOpacity(0.5));
@override
SyncIndicatorTheme get syncIndicatorStyle =>
super.syncIndicatorStyle.copyWith(
textColor: colorScheme.background,
syncedBackgroundColor: containerColor);
SyncIndicatorTheme get syncIndicatorStyle => super
.syncIndicatorStyle
.copyWith(textColor: colorScheme.background, syncedBackgroundColor: containerColor);
@override
BalancePageTheme get balancePageTheme => super.balancePageTheme.copyWith(
@ -56,32 +54,28 @@ class HighContrastTheme extends MoneroLightTheme {
balanceAmountColor: Colors.white);
@override
DashboardPageTheme get dashboardPageTheme =>
super.dashboardPageTheme.copyWith(
textColor: Colors.black,
cardTextColor: Colors.white,
mainActionsIconColor: Colors.white,
indicatorDotTheme: IndicatorDotTheme(
indicatorColor: Colors.grey, activeIndicatorColor: Colors.black));
DashboardPageTheme get dashboardPageTheme => super.dashboardPageTheme.copyWith(
textColor: Colors.black,
cardTextColor: Colors.white,
mainActionsIconColor: Colors.white,
indicatorDotTheme:
IndicatorDotTheme(indicatorColor: Colors.grey, activeIndicatorColor: Colors.black));
@override
ExchangePageTheme get exchangePageTheme => super
.exchangePageTheme
.copyWith(firstGradientTopPanelColor: containerColor);
ExchangePageTheme get exchangePageTheme => super.exchangePageTheme.copyWith(
firstGradientTopPanelColor: primaryColor, firstGradientBottomPanelColor: containerColor);
@override
SendPageTheme get sendPageTheme => super.sendPageTheme.copyWith(
templateTitleColor: Colors.white,
templateBackgroundColor: Colors.black,
firstGradientColor: containerColor);
firstGradientColor: primaryColor);
@override
AddressTheme get addressTheme =>
super.addressTheme.copyWith(actionButtonColor: Colors.grey);
AddressTheme get addressTheme => super.addressTheme.copyWith(actionButtonColor: Colors.grey);
@override
FilterTheme get filterTheme =>
super.filterTheme.copyWith(iconColor: Colors.white);
FilterTheme get filterTheme => super.filterTheme.copyWith(iconColor: Colors.white);
@override
CakeMenuTheme get menuTheme => super.menuTheme.copyWith(
@ -91,10 +85,11 @@ class HighContrastTheme extends MoneroLightTheme {
@override
PickerTheme get pickerTheme => super.pickerTheme.copyWith(
searchIconColor: Colors.white,
searchHintColor: Colors.white,
searchTextColor: Colors.white,
searchBackgroundFillColor: Colors.grey);
searchIconColor: primaryColor,
searchHintColor: primaryColor,
searchTextColor: primaryColor,
searchBackgroundFillColor: Colors.white,
searchBorderColor: primaryColor);
@override
AccountListTheme get accountListTheme => super.accountListTheme.copyWith(
@ -106,13 +101,10 @@ class HighContrastTheme extends MoneroLightTheme {
@override
ReceivePageTheme get receivePageTheme => super.receivePageTheme.copyWith(
tilesTextColor: Colors.white,
iconsBackgroundColor: Colors.grey,
iconsColor: Colors.black);
tilesTextColor: Colors.white, iconsBackgroundColor: Colors.grey, iconsColor: Colors.black);
@override
ThemeData get themeData => super.themeData.copyWith(
disabledColor: Colors.grey,
dialogTheme:
super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white));
dialogTheme: super.themeData.dialogTheme.copyWith(backgroundColor: Colors.white));
}

View file

@ -26,7 +26,7 @@ import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
import 'package:flutter/material.dart';
enum ThemeType { bright, light, dark }
enum ThemeType { light, bright, dark }
abstract class ThemeBase {
ThemeBase({required this.raw}) {

View file

@ -148,6 +148,7 @@ class ExceptionHandler {
"CERTIFICATE_VERIFY_FAILED",
"Handshake error in client",
"Error while launching http",
"OS Error: Network is unreachable",
];
static Future<void> _addDeviceInfo(File file) async {

View file

@ -108,7 +108,7 @@ abstract class DashboardViewModelBase with Store {
name = wallet.name;
type = wallet.type;
isOutdatedElectrumWallet =
wallet.type == WalletType.bitcoin && wallet.seed.split(' ').length < 24;
wallet.type == WalletType.bitcoin && wallet.seed!.split(' ').length < 24;
isShowFirstYatIntroduction = false;
isShowSecondYatIntroduction = false;
isShowThirdYatIntroduction = false;
@ -334,7 +334,7 @@ abstract class DashboardViewModelBase with Store {
type = wallet.type;
name = wallet.name;
isOutdatedElectrumWallet =
wallet.type == WalletType.bitcoin && wallet.seed.split(' ').length < 24;
wallet.type == WalletType.bitcoin && wallet.seed!.split(' ').length < 24;
updateActions();
if (wallet.type == WalletType.monero) {

View file

@ -66,6 +66,9 @@ abstract class WalletRestorationFromQRVMBase extends WalletCreationVM with Store
case WalletType.litecoin:
return bitcoin!.createBitcoinRestoreWalletFromWIFCredentials(
name: name, password: password, wif: wif);
case WalletType.ethereum:
return ethereum!.createEthereumRestoreWalletFromPrivateKey(
name: name, password: password, privateKey: restoreWallet.privateKey!);
default:
throw Exception('Unexpected type: ${restoreWallet.type.toString()}');
}

View file

@ -13,7 +13,8 @@ class RestoredWallet {
this.txAmount,
this.txDescription,
this.recipientName,
this.height});
this.height,
this.privateKey});
final WalletRestoreMode restoreMode;
final WalletType type;
@ -26,6 +27,7 @@ class RestoredWallet {
final String? txDescription;
final String? recipientName;
final int? height;
final String? privateKey;
factory RestoredWallet.fromKey(Map<String, dynamic> json) {
final height = json['height'] as String?;
@ -36,6 +38,7 @@ class RestoredWallet {
spendKey: json['spend_key'] as String?,
viewKey: json['view_key'] as String?,
height: height != null ? int.parse(height) : 0,
privateKey: json['private_key'] as String?,
);
}

View file

@ -33,7 +33,10 @@ class WalletRestoreFromQRCode {
getSeedPhraseFromUrl(queryParameters.toString(), credentials['type'] as WalletType);
if (seed != null) {
credentials['seed'] = seed;
} else {
credentials['private_key'] = queryParameters['private_key'];
}
credentials.addAll(queryParameters);
credentials['mode'] = getWalletRestoreMode(credentials);
@ -69,6 +72,8 @@ class WalletRestoreFromQRCode {
case 'litecoin':
case 'litecoin-wallet':
return WalletType.litecoin;
case 'ethereum-wallet':
return WalletType.ethereum;
default:
throw Exception('Unexpected wallet type: ${scheme.toString()}');
}
@ -101,6 +106,7 @@ class WalletRestoreFromQRCode {
}
case WalletType.bitcoin:
case WalletType.litecoin:
case WalletType.ethereum:
RegExp regex24 = RegExp(r'\b(\S+\b\s+){23}\S+\b');
RegExp regex18 = RegExp(r'\b(\S+\b\s+){17}\S+\b');
RegExp regex12 = RegExp(r'\b(\S+\b\s+){11}\S+\b');
@ -152,6 +158,14 @@ class WalletRestoreFromQRCode {
: throw Exception('Unexpected restore mode: spend_key or view_key is invalid');
}
if (type == WalletType.ethereum && credentials.containsKey('private_key')) {
final privateKey = credentials['private_key'] as String;
if (privateKey.isEmpty) {
throw Exception('Unexpected restore mode: private_key');
}
return WalletRestoreMode.keys;
}
throw Exception('Unexpected restore mode: restore params are invalid');
}
}

View file

@ -96,9 +96,7 @@ abstract class Setup2FAViewModelBase with Store {
@action
void _setBase32SecretKey(String value) {
if (_settingsStore.totpSecretKey == '') {
_settingsStore.totpSecretKey = value;
}
_settingsStore.totpSecretKey = value;
}
@action

View file

@ -70,7 +70,7 @@ abstract class WalletKeysViewModelBase with Store {
StandartListItem(title: S.current.view_key_public, value: keys['publicViewKey']!),
if (keys['privateViewKey'] != null)
StandartListItem(title: S.current.view_key_private, value: keys['privateViewKey']!),
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed),
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed!),
]);
}
@ -86,15 +86,23 @@ abstract class WalletKeysViewModelBase with Store {
StandartListItem(title: S.current.view_key_public, value: keys['publicViewKey']!),
if (keys['privateViewKey'] != null)
StandartListItem(title: S.current.view_key_private, value: keys['privateViewKey']!),
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed),
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed!),
]);
}
if (_appStore.wallet!.type == WalletType.bitcoin ||
_appStore.wallet!.type == WalletType.litecoin ||
_appStore.wallet!.type == WalletType.ethereum) {
_appStore.wallet!.type == WalletType.litecoin) {
items.addAll([
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed),
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed!),
]);
}
if (_appStore.wallet!.type == WalletType.ethereum) {
items.addAll([
if (_appStore.wallet!.privateKey != null)
StandartListItem(title: S.current.private_key, value: _appStore.wallet!.privateKey!),
if (_appStore.wallet!.seed != null)
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed!),
]);
}
@ -104,14 +112,14 @@ abstract class WalletKeysViewModelBase with Store {
// we don't necessarily have the seed phrase for nano / banano:
if (_appStore.wallet!.seed != "") {
items.addAll([
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed),
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed!),
]);
}
// we always have the hex version of the seed:
items.addAll([
if (keys['seedKey'] != null)
StandartListItem(title: S.current.spend_key_private, value: keys['seedKey']!),
if (keys['private_key'] != null)
StandartListItem(title: S.current.spend_key_private, value: keys['private_key']!),
]);
}
}
@ -161,7 +169,8 @@ abstract class WalletKeysViewModelBase with Store {
Future<Map<String, String>> get _queryParams async {
final restoreHeightResult = await restoreHeight;
return {
'seed': _appStore.wallet!.seed,
if (_appStore.wallet!.seed != null) 'seed': _appStore.wallet!.seed!,
if (_appStore.wallet!.privateKey != null) 'private_key': _appStore.wallet!.privateKey!,
if (restoreHeightResult != null) ...{'height': restoreHeightResult}
};
}

View file

@ -1,76 +0,0 @@
import 'package:cake_wallet/view_model/restore/restore_wallet.dart';
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cake_wallet/core/generate_wallet_password.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
import 'package:cw_core/wallet_credentials.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/wallet_creation_vm.dart';
import 'package:cw_core/wallet_info.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
part 'wallet_restoration_from_keys_vm.g.dart';
class WalletRestorationFromKeysVM = WalletRestorationFromKeysVMBase
with _$WalletRestorationFromKeysVM;
abstract class WalletRestorationFromKeysVMBase extends WalletCreationVM with Store {
WalletRestorationFromKeysVMBase(AppStore appStore, WalletCreationService walletCreationService,
Box<WalletInfo> walletInfoSource,
{required WalletType type, required this.language})
: height = 0,
viewKey = '',
spendKey = '',
wif = '',
address = '',
super(appStore, walletInfoSource, walletCreationService, type: type, isRecovery: true);
@observable
int height;
@observable
String viewKey;
@observable
String spendKey;
@observable
String wif;
@observable
String address;
bool get hasRestorationHeight => type == WalletType.monero;
final String language;
@override
WalletCredentials getCredentials(dynamic options) {
final password = generateWalletPassword();
switch (type) {
case WalletType.monero:
return monero!.createMoneroRestoreWalletFromKeysCredentials(
name: name,
password: password,
language: language,
address: address,
viewKey: viewKey,
spendKey: spendKey,
height: height);
case WalletType.bitcoin:
return bitcoin!
.createBitcoinRestoreWalletFromWIFCredentials(name: name, password: password, wif: wif);
default:
throw Exception('Unexpected type: ${type.toString()}');
}
}
@override
Future<WalletBase> process(WalletCredentials credentials) async =>
walletCreationService.restoreFromKeys(credentials);
}

View file

@ -1,61 +0,0 @@
import 'package:cake_wallet/nano/nano.dart';
import 'package:cake_wallet/view_model/restore/restore_wallet.dart';
import 'package:flutter/foundation.dart';
import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
import 'package:cake_wallet/monero/monero.dart';
import 'package:cake_wallet/store/app_store.dart';
import 'package:cake_wallet/bitcoin/bitcoin.dart';
import 'package:cw_core/wallet_base.dart';
import 'package:cake_wallet/core/generate_wallet_password.dart';
import 'package:cake_wallet/core/wallet_creation_service.dart';
import 'package:cw_core/wallet_credentials.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/wallet_creation_vm.dart';
import 'package:cw_core/wallet_info.dart';
part 'wallet_restoration_from_seed_vm.g.dart';
class WalletRestorationFromSeedVM = WalletRestorationFromSeedVMBase
with _$WalletRestorationFromSeedVM;
abstract class WalletRestorationFromSeedVMBase extends WalletCreationVM with Store {
WalletRestorationFromSeedVMBase(AppStore appStore, WalletCreationService walletCreationService,
Box<WalletInfo> walletInfoSource,
{required WalletType type, required this.language, this.seed = ''})
: height = 0,
super(appStore, walletInfoSource, walletCreationService, type: type, isRecovery: true);
@observable
String seed;
@observable
int height;
bool get hasRestorationHeight => type == WalletType.monero;
final String language;
@override
WalletCredentials getCredentials(dynamic options) {
final password = generateWalletPassword();
switch (type) {
case WalletType.monero:
return monero!.createMoneroRestoreWalletFromSeedCredentials(
name: name, height: height, mnemonic: seed, password: password);
case WalletType.bitcoin:
return bitcoin!.createBitcoinRestoreWalletFromSeedCredentials(
name: name, mnemonic: seed, password: password);
// case WalletType.nano:
// return nano!.createNanoRestoreWalletFromSeedCredentials(
// name: name, mnemonic: seed, password: password, derivationType: );
default:
throw Exception('Unexpected type: ${type.toString()}');
}
}
@override
Future<WalletBase> process(WalletCredentials credentials) async =>
walletCreationService.restoreFromSeed(credentials);
}

View file

@ -60,7 +60,7 @@ abstract class WalletRestoreChooseDerivationViewModelBase with Store {
break;
case WalletType.nano:
String? mnemonic = credentials['seed'] as String?;
String? seedKey = credentials['seedKey'] as String?;
String? seedKey = credentials['private_key'] as String?;
var bip39Info = await NanoWalletService.getInfoFromSeedOrMnemonic(DerivationType.bip39,
mnemonic: mnemonic, seedKey: seedKey, node: node);
var standardInfo = await NanoWalletService.getInfoFromSeedOrMnemonic(

View file

@ -27,14 +27,16 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
WalletRestoreViewModelBase(AppStore appStore, WalletCreationService walletCreationService,
Box<WalletInfo> walletInfoSource,
{required WalletType type})
: availableModes = (type == WalletType.monero || type == WalletType.haven)
? [WalletRestoreMode.seed, WalletRestoreMode.keys, WalletRestoreMode.txids]
: (type == WalletType.nano || type == WalletType.banano)
? [WalletRestoreMode.seed, WalletRestoreMode.keys]
: [WalletRestoreMode.seed],
: availableModes =
(type == WalletType.monero || type == WalletType.haven || type == WalletType.ethereum)
? WalletRestoreMode.values
: (type == WalletType.nano || type == WalletType.banano)
? [WalletRestoreMode.seed, WalletRestoreMode.keys]
: [WalletRestoreMode.seed],
hasSeedLanguageSelector = type == WalletType.monero || type == WalletType.haven,
hasBlockchainHeightLanguageSelector = type == WalletType.monero || type == WalletType.haven,
hasMultipleKeys = type != WalletType.nano || type == WalletType.banano,
hasRestoreFromPrivateKey =
type == WalletType.ethereum || type == WalletType.nano || type == WalletType.banano,
isButtonEnabled = false,
mode = WalletRestoreMode.seed,
super(appStore, walletInfoSource, walletCreationService, type: type, isRecovery: true) {
@ -49,7 +51,7 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
final List<WalletRestoreMode> availableModes;
final bool hasSeedLanguageSelector;
final bool hasBlockchainHeightLanguageSelector;
final bool hasMultipleKeys;
final bool hasRestoreFromPrivateKey;
@observable
WalletRestoreMode mode;
@ -94,41 +96,47 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
}
if (mode == WalletRestoreMode.keys) {
if (hasMultipleKeys) {
final viewKey = options['viewKey'] as String;
final spendKey = options['spendKey'] as String;
final address = options['address'] as String;
final viewKey = options['viewKey'] as String?;
final spendKey = options['spendKey'] as String?;
final address = options['address'] as String?;
if (type == WalletType.monero) {
return monero!.createMoneroRestoreWalletFromKeysCredentials(
name: name,
height: height,
spendKey: spendKey,
viewKey: viewKey,
address: address,
password: password,
language: 'English');
}
if (type == WalletType.haven) {
return haven!.createHavenRestoreWalletFromKeysCredentials(
name: name,
height: height,
spendKey: spendKey,
viewKey: viewKey,
address: address,
password: password,
language: 'English');
}
} else {
if (type == WalletType.nano) {
return nano!.createNanoRestoreWalletFromKeysCredentials(
if (type == WalletType.monero) {
return monero!.createMoneroRestoreWalletFromKeysCredentials(
name: name,
height: height,
spendKey: spendKey!,
viewKey: viewKey!,
address: address!,
password: password,
seedKey: options['seedKey'] as String,
derivationType: options["derivationType"] as DerivationType,
);
}
language: 'English');
}
if (type == WalletType.haven) {
return haven!.createHavenRestoreWalletFromKeysCredentials(
name: name,
height: height,
spendKey: spendKey!,
viewKey: viewKey!,
address: address!,
password: password,
language: 'English');
}
if (type == WalletType.ethereum) {
return ethereum!.createEthereumRestoreWalletFromPrivateKey(
name: name,
privateKey: options['private_key'] as String,
password: password,
);
}
if (type == WalletType.nano) {
return nano!.createNanoRestoreWalletFromKeysCredentials(
name: name,
password: password,
seedKey: options['private_key'] as String,
derivationType: options["derivationType"] as DerivationType,
);
}
}
@ -137,7 +145,7 @@ abstract class WalletRestoreViewModelBase extends WalletCreationVM with Store {
@override
Future<List<DerivationType>> getDerivationType(dynamic options) async {
final seedKey = options['seedKey'] as String?;
final seedKey = options['private_key'] as String?;
final mnemonic = options['seed'] as String?;
WalletType walletType = options['walletType'] as WalletType;
var appStore = getIt.get<AppStore>();

View file

@ -8,7 +8,7 @@ class WalletSeedViewModel = WalletSeedViewModelBase with _$WalletSeedViewModel;
abstract class WalletSeedViewModelBase with Store {
WalletSeedViewModelBase(WalletBase wallet)
: name = wallet.name,
seed = wallet.seed;
seed = wallet.seed!;
@observable
String name;

View file

@ -686,5 +686,7 @@
"support_title_other_links": "روابط دعم أخرى",
"support_description_other_links": "انضم إلى مجتمعاتنا أو تصل إلينا شركائنا من خلال أساليب أخرى",
"choose_derivation": "اختر اشتقاق المحفظة",
"new_first_wallet_text": "حافظ بسهولة على أمان العملة المشفرة"
"new_first_wallet_text": "حافظ بسهولة على أمان العملة المشفرة",
"select_destination": ".ﻲﻃﺎﻴﺘﺣﻻﺍ ﺦﺴﻨﻟﺍ ﻒﻠﻣ ﺔﻬﺟﻭ ﺪﻳﺪﺤﺗ ءﺎﺟﺮﻟﺍ",
"save_to_downloads": "ﺕﻼﻳﺰﻨﺘﻟﺍ ﻲﻓ ﻆﻔﺣ"
}

View file

@ -682,5 +682,7 @@
"support_title_other_links": "Други връзки за поддръжка",
"support_description_other_links": "Присъединете се към нашите общности или се свържете с нас нашите партньори чрез други методи",
"choose_derivation": "Изберете производно на портфейла",
"new_first_wallet_text": "Лесно пазете криптовалутата си в безопасност"
}
"new_first_wallet_text": "Лесно пазете криптовалутата си в безопасност",
"select_destination": "Моля, изберете дестинация за архивния файл.",
"save_to_downloads": "Запазване в Изтегляния"
}

View file

@ -682,5 +682,7 @@
"support_title_other_links": "Další odkazy na podporu",
"support_description_other_links": "Připojte se k našim komunitám nebo se k nám oslovte další metody",
"choose_derivation": "Vyberte derivaci peněženky",
"new_first_wallet_text": "Snadno udržujte svou kryptoměnu v bezpečí"
}
"new_first_wallet_text": "Snadno udržujte svou kryptoměnu v bezpečí",
"select_destination": "Vyberte cíl pro záložní soubor.",
"save_to_downloads": "Uložit do Stažených souborů"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Andere Support-Links",
"support_description_other_links": "Treten Sie unseren Communities bei oder erreichen Sie uns oder unsere Partner über andere Methoden",
"choose_derivation": "Wählen Sie Brieftaschenableitung",
"new_first_wallet_text": "Bewahren Sie Ihre Kryptowährung einfach sicher auf"
}
"new_first_wallet_text": "Bewahren Sie Ihre Kryptowährung einfach sicher auf",
"select_destination": "Bitte wählen Sie das Ziel für die Sicherungsdatei aus.",
"save_to_downloads": "Unter „Downloads“ speichern"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Other support links",
"support_description_other_links": "Join our communities or reach us our our partners through other methods",
"choose_derivation": "Choose Wallet Derivation",
"new_first_wallet_text": "Keep your crypto safe, piece of cake"
}
"new_first_wallet_text": "Keep your crypto safe, piece of cake",
"select_destination": "Please select destination for the backup file.",
"save_to_downloads": "Save to Downloads"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Otros enlaces de soporte",
"support_description_other_links": "Únase a nuestras comunidades o comuníquese con nosotros nuestros socios a través de otros métodos",
"choose_derivation": "Elija la derivación de la billetera",
"new_first_wallet_text": "Mantenga fácilmente su criptomoneda segura"
}
"new_first_wallet_text": "Mantenga fácilmente su criptomoneda segura",
"select_destination": "Seleccione el destino del archivo de copia de seguridad.",
"save_to_downloads": "Guardar en Descargas"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Autres liens d'assistance",
"support_description_other_links": "Rejoignez nos communautés ou contactez-nous nos partenaires à travers d'autres méthodes",
"choose_derivation": "Choisissez la dérivation du portefeuille",
"new_first_wallet_text": "Gardez facilement votre crypto-monnaie en sécurité"
}
"new_first_wallet_text": "Gardez facilement votre crypto-monnaie en sécurité",
"select_destination": "Veuillez sélectionner la destination du fichier de sauvegarde.",
"save_to_downloads": "Enregistrer dans les téléchargements"
}

View file

@ -668,5 +668,7 @@
"support_title_other_links": "Sauran hanyoyin tallafi",
"support_description_other_links": "Kasance tare da al'ummominmu ko kuma ka kai mu abokanmu ta hanyar wasu hanyoyi",
"choose_derivation": "Zaɓi walatawa",
"new_first_wallet_text": "A sauƙaƙe kiyaye kuzarin ku"
}
"new_first_wallet_text": "A sauƙaƙe kiyaye kuzarin ku",
"select_destination": "Da fatan za a zaɓi wurin da za a yi wa madadin fayil ɗin.",
"save_to_downloads": "Ajiye zuwa Zazzagewa"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "अन्य समर्थन लिंक",
"support_description_other_links": "हमारे समुदायों में शामिल हों या अन्य तरीकों के माध्यम से हमारे साथी तक पहुंचें",
"choose_derivation": "वॉलेट व्युत्पत्ति चुनें",
"new_first_wallet_text": "आसानी से अपनी क्रिप्टोक्यूरेंसी को सुरक्षित रखें"
}
"new_first_wallet_text": "आसानी से अपनी क्रिप्टोक्यूरेंसी को सुरक्षित रखें",
"select_destination": "कृपया बैकअप फ़ाइल के लिए गंतव्य का चयन करें।",
"save_to_downloads": "डाउनलोड में सहेजें"
}

View file

@ -688,5 +688,7 @@
"support_title_other_links": "Ostale veze za podršku",
"support_description_other_links": "Pridružite se našim zajednicama ili nam dosegnu naše partnere drugim metodama",
"choose_derivation": "Odaberite izvedbu novčanika",
"new_first_wallet_text": "Jednostavno čuvajte svoju kripto valutu"
}
"new_first_wallet_text": "Jednostavno čuvajte svoju kripto valutu",
"select_destination": "Odaberite odredište za datoteku sigurnosne kopije.",
"save_to_downloads": "Spremi u Preuzimanja"
}

View file

@ -678,5 +678,7 @@
"support_title_other_links": "Tautan dukungan lainnya",
"support_description_other_links": "Bergabunglah dengan komunitas kami atau hubungi kami mitra kami melalui metode lain",
"choose_derivation": "Pilih dompet dompet",
"new_first_wallet_text": "Dengan mudah menjaga cryptocurrency Anda aman"
"new_first_wallet_text": "Dengan mudah menjaga cryptocurrency Anda aman",
"select_destination": "Silakan pilih tujuan untuk file cadangan.",
"save_to_downloads": "Simpan ke Unduhan"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Altri collegamenti di supporto",
"support_description_other_links": "Unisciti alle nostre comunità o raggiungici i nostri partner attraverso altri metodi",
"choose_derivation": "Scegli la derivazione del portafoglio",
"new_first_wallet_text": "Mantieni facilmente la tua criptovaluta al sicuro"
}
"new_first_wallet_text": "Mantieni facilmente la tua criptovaluta al sicuro",
"select_destination": "Seleziona la destinazione per il file di backup.",
"save_to_downloads": "Salva in Download"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "その他のサポートリンク",
"support_description_other_links": "私たちのコミュニティに参加するか、他の方法を通して私たちのパートナーに連絡してください",
"choose_derivation": "ウォレット派生を選択します",
"new_first_wallet_text": "暗号通貨を簡単に安全に保ちます"
"new_first_wallet_text": "暗号通貨を簡単に安全に保ちます",
"select_destination": "バックアップファイルの保存先を選択してください。",
"save_to_downloads": "ダウンロードに保存"
}

View file

@ -688,5 +688,7 @@
"support_title_other_links": "다른 지원 링크",
"support_description_other_links": "다른 방법을 통해 커뮤니티에 가입하거나 파트너에게 연락하십시오.",
"choose_derivation": "지갑 파생을 선택하십시오",
"new_first_wallet_text": "cryptocurrency를 쉽게 안전하게 유지하십시오"
"new_first_wallet_text": "cryptocurrency를 쉽게 안전하게 유지하십시오",
"select_destination": "백업 파일의 대상을 선택하십시오.",
"save_to_downloads": "다운로드에 저장"
}

View file

@ -688,5 +688,7 @@
"support_title_other_links": "အခြားအထောက်အပံ့လင့်များ",
"support_description_other_links": "ကျွန်ုပ်တို့၏လူမှုအသိုင်းအဝိုင်းများသို့ 0 င်ရောက်ပါ",
"choose_derivation": "ပိုက်ဆံအိတ်ကိုရွေးချယ်ပါ",
"new_first_wallet_text": "သင့်ရဲ့ cryptocurrencrencres ကိုအလွယ်တကူလုံခြုံစွာထားရှိပါ"
"new_first_wallet_text": "သင့်ရဲ့ cryptocurrencrencres ကိုအလွယ်တကူလုံခြုံစွာထားရှိပါ",
"select_destination": "အရန်ဖိုင်အတွက် ဦးတည်ရာကို ရွေးပါ။",
"save_to_downloads": "ဒေါင်းလုဒ်များထံ သိမ်းဆည်းပါ။"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Andere ondersteuningslinks",
"support_description_other_links": "Word lid van onze gemeenschappen of bereik ons onze partners via andere methoden",
"choose_derivation": "Kies portemonnee -afleiding",
"new_first_wallet_text": "Houd uw cryptocurrency gemakkelijk veilig"
}
"new_first_wallet_text": "Houd uw cryptocurrency gemakkelijk veilig",
"select_destination": "Selecteer de bestemming voor het back-upbestand.",
"save_to_downloads": "Opslaan in downloads"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Inne linki wsparcia",
"support_description_other_links": "Dołącz do naszych społeczności lub skontaktuj się z nami naszymi partnerami za pomocą innych metod",
"choose_derivation": "Wybierz wyprowadzenie portfela",
"new_first_wallet_text": "Łatwo zapewnić bezpieczeństwo kryptowalut"
}
"new_first_wallet_text": "Łatwo zapewnić bezpieczeństwo kryptowalut",
"select_destination": "Wybierz miejsce docelowe dla pliku kopii zapasowej.",
"save_to_downloads": "Zapisz w Pobranych"
}

View file

@ -689,5 +689,7 @@
"support_title_other_links": "Outros links de suporte",
"support_description_other_links": "Junte -se às nossas comunidades ou chegue a nós nossos parceiros por meio de outros métodos",
"choose_derivation": "Escolha a derivação da carteira",
"new_first_wallet_text": "Mantenha sua criptomoeda facilmente segura"
}
"new_first_wallet_text": "Mantenha sua criptomoeda facilmente segura",
"select_destination": "Selecione o destino para o arquivo de backup.",
"save_to_downloads": "Salvar em Downloads"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Другие ссылки на поддержку",
"support_description_other_links": "Присоединяйтесь к нашим сообществам или охватите нас наших партнеров с помощью других методов",
"choose_derivation": "Выберите вывод кошелька",
"new_first_wallet_text": "Легко сохранить свою криптовалюту в безопасности"
"new_first_wallet_text": "Легко сохранить свою криптовалюту в безопасности",
"select_destination": "Пожалуйста, выберите место для файла резервной копии.",
"save_to_downloads": "Сохранить в загрузках"
}

View file

@ -688,5 +688,7 @@
"support_title_other_links": "ลิงค์สนับสนุนอื่น ๆ",
"support_description_other_links": "เข้าร่วมชุมชนของเราหรือเข้าถึงเราพันธมิตรของเราผ่านวิธีการอื่น ๆ",
"choose_derivation": "เลือก Wallet Derivation",
"new_first_wallet_text": "ทำให้สกุลเงินดิจิตอลของคุณปลอดภัยได้อย่างง่ายดาย"
"new_first_wallet_text": "ทำให้สกุลเงินดิจิตอลของคุณปลอดภัยได้อย่างง่ายดาย",
"select_destination": "โปรดเลือกปลายทางสำหรับไฟล์สำรอง",
"save_to_downloads": "บันทึกลงดาวน์โหลด"
}

View file

@ -688,5 +688,7 @@
"support_title_other_links": "Diğer destek bağlantıları",
"support_description_other_links": "Topluluklarımıza katılın veya ortaklarımıza diğer yöntemlerle bize ulaşın",
"choose_derivation": "Cüzdan türevini seçin",
"new_first_wallet_text": "Kripto para biriminizi kolayca güvende tutun"
}
"new_first_wallet_text": "Kripto para biriminizi kolayca güvende tutun",
"select_destination": "Lütfen yedekleme dosyası için hedef seçin.",
"save_to_downloads": "İndirilenlere Kaydet"
}

View file

@ -690,5 +690,7 @@
"support_title_other_links": "Інші посилання на підтримку",
"support_description_other_links": "Приєднуйтесь до наших спільнот або досягайте нас нашими партнерами іншими методами",
"choose_derivation": "Виберіть деривацію гаманця",
"new_first_wallet_text": "Легко зберігайте свою криптовалюту в безпеці"
}
"new_first_wallet_text": "Легко зберігайте свою криптовалюту в безпеці",
"select_destination": "Виберіть місце призначення для файлу резервної копії.",
"save_to_downloads": "Зберегти до завантажень"
}

View file

@ -682,5 +682,7 @@
"support_title_other_links": "دوسرے سپورٹ لنکس",
"support_description_other_links": "ہماری برادریوں میں شامل ہوں یا دوسرے طریقوں سے ہمارے شراکت داروں تک پہنچیں",
"choose_derivation": "پرس سے ماخوذ منتخب کریں",
"new_first_wallet_text": "آسانی سے اپنے cryptocurrency محفوظ رکھیں"
"new_first_wallet_text": "آسانی سے اپنے cryptocurrency محفوظ رکھیں",
"select_destination": "۔ﮟﯾﺮﮐ ﺏﺎﺨﺘﻧﺍ ﺎﮐ ﻝﺰﻨﻣ ﮯﯿﻟ ﮯﮐ ﻞﺋﺎﻓ ﭖﺍ ﮏﯿﺑ ﻡﺮﮐ ﮦﺍﺮﺑ",
"save_to_downloads": "۔ﮟﯾﺮﮐ ﻅﻮﻔﺤﻣ ﮟﯿﻣ ﺯﮈﻮﻟ ﻥﺅﺍﮈ"
}

View file

@ -684,5 +684,7 @@
"bitcoin_light_theme": "Bitcoin Light Akori",
"high_contrast_theme": "Akori Iyatọ giga",
"matrix_green_dark_theme": "Matrix Green Dark Akori",
"monero_light_theme": "Monero Light Akori"
"monero_light_theme": "Monero Light Akori",
"select_destination": "Jọwọ yan ibi ti o nlo fun faili afẹyinti.",
"save_to_downloads": "Fipamọ si Awọn igbasilẹ"
}

View file

@ -689,5 +689,7 @@
"bitcoin_light_theme": "比特币浅色主题",
"high_contrast_theme": "高对比度主题",
"matrix_green_dark_theme": "矩阵绿暗主题",
"monero_light_theme": "门罗币浅色主题"
"monero_light_theme": "门罗币浅色主题",
"select_destination": "请选择备份文件的目的地。",
"save_to_downloads": "保存到下载"
}

View file

@ -526,6 +526,7 @@ abstract class Ethereum {
WalletService createEthereumWalletService(Box<WalletInfo> walletInfoSource);
WalletCredentials createEthereumNewWalletCredentials({required String name, WalletInfo? walletInfo});
WalletCredentials createEthereumRestoreWalletFromSeedCredentials({required String name, required String mnemonic, required String password});
WalletCredentials createEthereumRestoreWalletFromPrivateKey({required String name, required String privateKey, required String password});
String getAddress(WalletBase wallet);
TransactionPriority getDefaultTransactionPriority();
List<TransactionPriority> getTransactionPriorities();