From d370c912bb94bca3f0c4bb1cd726c159959e53bc Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Wed, 16 Dec 2020 20:39:53 +0200 Subject: [PATCH 01/16] CAKE-208 | added current balance display mode saving to shared preferences (settings_store.dart); added moneroBalance property, reactions and _onWalletChange() method to balance_view_model.dart --- lib/store/settings_store.dart | 5 ++ .../dashboard/balance_view_model.dart | 49 +++++++++++++++++-- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index b4b76bb8d..321bbe23e 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -87,6 +87,11 @@ abstract class SettingsStoreBase with Store { (_) => languageCode, (String languageCode) => sharedPreferences.setString( PreferencesKey.currentLanguageCode, languageCode)); + + reaction((_) => balanceDisplayMode, + (BalanceDisplayMode mode) => sharedPreferences.setInt( + PreferencesKey.currentBalanceDisplayModeKey, + mode.serialize())); } static const defaultPinLength = 4; diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index 37f6e5247..ace6a470b 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -1,5 +1,7 @@ import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; +import 'package:cake_wallet/core/wallet_base.dart'; import 'package:cake_wallet/entities/crypto_currency.dart'; +import 'package:cake_wallet/monero/monero_balance.dart'; import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/calculate_fiat_amount.dart'; @@ -19,7 +21,22 @@ abstract class BalanceViewModelBase with Store { @required this.appStore, @required this.settingsStore, @required this.fiatConvertationStore - }) : isReversing = false; + }) { + isReversing = false; + + wallet ??= appStore.wallet; + + _reaction = reaction((_) => appStore.wallet, _onWalletChange); + + final _wallet = wallet; + + if (_wallet is MoneroWallet) { + moneroBalance = _wallet.balance; + + _onMoneroBalanceChangeReaction = reaction((_) => _wallet.balance, + (MoneroBalance balance) => moneroBalance = balance); + } + } final AppStore appStore; final SettingsStore settingsStore; @@ -28,6 +45,12 @@ abstract class BalanceViewModelBase with Store { @observable bool isReversing; + @observable + MoneroBalance moneroBalance; + + @observable + WalletBase wallet; + @computed BalanceDisplayMode get savedDisplayMode => settingsStore.balanceDisplayMode; @@ -86,12 +109,12 @@ abstract class BalanceViewModelBase with Store { @computed WalletBalance get _walletBalance { - final _wallet = appStore.wallet; + final _wallet = wallet; if (_wallet is MoneroWallet) { return WalletBalance( - unlockedBalance: _wallet.balance.formattedUnlockedBalance, - totalBalance: _wallet.balance.formattedFullBalance); + unlockedBalance: moneroBalance.formattedUnlockedBalance, + totalBalance: moneroBalance.formattedFullBalance); } if (_wallet is BitcoinWallet) { @@ -106,6 +129,24 @@ abstract class BalanceViewModelBase with Store { @computed CryptoCurrency get currency => appStore.wallet.currency; + @action + void _onWalletChange(WalletBase wallet) { + this.wallet = wallet; + + if (wallet is MoneroWallet) { + moneroBalance = wallet.balance; + + _onMoneroBalanceChangeReaction?.reaction?.dispose(); + + _onMoneroBalanceChangeReaction = reaction((_) => wallet.balance, + (MoneroBalance balance) => moneroBalance = balance); + } + } + + ReactionDisposer _onMoneroBalanceChangeReaction; + + ReactionDisposer _reaction; + String _getFiatBalance({double price, String cryptoAmount}) { if (cryptoAmount == null) { return '0.00'; From b1e0bf0edd56ce364eec325cdd30c75fe71c449f Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Fri, 18 Dec 2020 21:42:00 +0200 Subject: [PATCH 02/16] CAKE-208 | merged 4.1.0 branch into current and resolved problems --- lib/store/settings_store.dart | 10 +++++----- lib/view_model/dashboard/balance_view_model.dart | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index f4c80b883..cc8f8acce 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -85,14 +85,14 @@ abstract class SettingsStoreBase with Store { (String languageCode) => sharedPreferences.setString( PreferencesKey.currentLanguageCode, languageCode)); + reaction((_) => balanceDisplayMode, + (BalanceDisplayMode mode) => sharedPreferences.setInt( + PreferencesKey.currentBalanceDisplayModeKey, + mode.serialize())); + this .nodes .observe((change) => _saveCurrentNode(change.newValue, change.key)); - - reaction((_) => balanceDisplayMode, - (BalanceDisplayMode mode) => sharedPreferences.setInt( - PreferencesKey.currentBalanceDisplayModeKey, - mode.serialize())); } static const defaultPinLength = 4; diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index 66d719771..a7bc575bd 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -20,8 +20,8 @@ abstract class BalanceViewModelBase with Store { BalanceViewModelBase( {@required this.appStore, @required this.settingsStore, - @required this.fiatConvertationStore}){ - + @required this.fiatConvertationStore + }){ isReversing = false; wallet ??= appStore.wallet; From 7f2b1093817a720b3edb449f6957a93fa40e2ab6 Mon Sep 17 00:00:00 2001 From: M Date: Mon, 21 Dec 2020 22:20:46 +0200 Subject: [PATCH 03/16] Fixed balance dispaying. Changed updating of balance after sending. Changed text for pre seed screen for btc wallet type. --- lib/bitcoin/bitcoin_balance.dart | 3 ++- lib/bitcoin/bitcoin_wallet.dart | 5 +++- lib/di.dart | 3 ++- lib/generated/i18n.dart | 24 +++++++++---------- lib/router.dart | 17 +++++++------ .../dashboard/widgets/balance_page.dart | 5 ++-- lib/src/screens/seed/pre_seed_page.dart | 16 ++++++++++--- 7 files changed, 46 insertions(+), 27 deletions(-) diff --git a/lib/bitcoin/bitcoin_balance.dart b/lib/bitcoin/bitcoin_balance.dart index 1f5a70b72..3cc66bfe8 100644 --- a/lib/bitcoin/bitcoin_balance.dart +++ b/lib/bitcoin/bitcoin_balance.dart @@ -27,7 +27,8 @@ class BitcoinBalance extends Balance { final int confirmed; final int unconfirmed; - int get total => confirmed + unconfirmed; + int get total => + confirmed + (unconfirmed < 0 ? unconfirmed * -1 : unconfirmed); int get availableBalance => confirmed + (unconfirmed < 0 ? unconfirmed : 0); diff --git a/lib/bitcoin/bitcoin_wallet.dart b/lib/bitcoin/bitcoin_wallet.dart index eaf5d2864..052440f1e 100644 --- a/lib/bitcoin/bitcoin_wallet.dart +++ b/lib/bitcoin/bitcoin_wallet.dart @@ -319,7 +319,10 @@ abstract class BitcoinWalletBase extends WalletBase with Store { return PendingBitcoinTransaction(txb.build(), eclient: eclient, amount: amount, fee: fee) - ..addListener((transaction) => transactionHistory.addOne(transaction)); + ..addListener((transaction) async { + transactionHistory.addOne(transaction); + await _updateBalance(); + }); } String toJSON() => json.encode({ diff --git a/lib/di.dart b/lib/di.dart index 12828300d..0a6646e5d 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -426,5 +426,6 @@ Future setup( (para1, param2) => NewWalletTypePage(getIt.get(), onTypeSelected: para1, isNewWallet: param2)); - getIt.registerFactory(() => PreSeedPage()); + getIt.registerFactoryParam( + (WalletType type, _) => PreSeedPage(type)); } diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 2abfd2a18..59799342b 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -143,7 +143,7 @@ class S implements WidgetsLocalizations { String get please_select => "Please select:"; String get please_try_to_connect_to_another_node => "Please try to connect to another node"; String get pre_seed_button_text => "I understand. Show me my seed"; - String get pre_seed_description => "On the next page you will see a series of 25 words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; + String pre_seed_description(int words) => "On the next page you will see a series of ${words} words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; String get pre_seed_title => "IMPORTANT"; String get private_key => "Private key"; String get public_key => "Public key"; @@ -514,7 +514,7 @@ class $de extends S { @override String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:"; @override - String get pre_seed_description => "Auf der nächsten Seite sehen Sie eine Reihe von 25 Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; + String pre_seed_description(int words) => "Auf der nächsten Seite sehen Sie eine Reihe von ${words} Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; @override String get node_connection_successful => "Die Verbindung war erfolgreich"; @override @@ -1214,7 +1214,7 @@ class $hi extends S { @override String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:"; @override - String get pre_seed_description => "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; + String pre_seed_description(int words) => "अगले पेज पर आपको ${words} शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; @override String get node_connection_successful => "कनेक्शन सफल रहा"; @override @@ -1914,7 +1914,7 @@ class $ru extends S { @override String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:"; @override - String get pre_seed_description => "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; + String pre_seed_description(int words) => "На следующей странице вы увидите серию из ${words} слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; @override String get node_connection_successful => "Подключение прошло успешно"; @override @@ -2614,7 +2614,7 @@ class $ko extends S { @override String get choose_wallet_currency => "지갑 통화를 선택하십시오:"; @override - String get pre_seed_description => "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; + String pre_seed_description(int words) => "다음 페이지에서 ${words} 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; @override String get node_connection_successful => "성공적으로 연결되었습니다."; @override @@ -3314,7 +3314,7 @@ class $pt extends S { @override String get choose_wallet_currency => "Escolha a moeda da carteira:"; @override - String get pre_seed_description => "Na próxima página, você verá uma série de 25 palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; + String pre_seed_description(int words) => "Na próxima página, você verá uma série de ${words} palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; @override String get node_connection_successful => "A conexão foi bem sucedida"; @override @@ -4014,7 +4014,7 @@ class $uk extends S { @override String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:"; @override - String get pre_seed_description => "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; + String pre_seed_description(int words) => "На наступній сторінці ви побачите серію з ${words} слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; @override String get node_connection_successful => "З'єднання було успішним"; @override @@ -4714,7 +4714,7 @@ class $ja extends S { @override String get choose_wallet_currency => "ウォレット通貨を選択してください:"; @override - String get pre_seed_description => "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; + String pre_seed_description(int words) => "次のページでは、一連の${words}語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; @override String get node_connection_successful => "接続に成功しました"; @override @@ -5418,7 +5418,7 @@ class $pl extends S { @override String get choose_wallet_currency => "Wybierz walutę portfela:"; @override - String get pre_seed_description => "Na następnej stronie zobaczysz serię 25 słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; + String pre_seed_description(int words) => "Na następnej stronie zobaczysz serię ${words} słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; @override String get node_connection_successful => "Połączenie powiodło się"; @override @@ -6118,7 +6118,7 @@ class $es extends S { @override String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:"; @override - String get pre_seed_description => "En la página siguiente verá una serie de 25 palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; + String pre_seed_description(int words) => "En la página siguiente verá una serie de ${words} palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; @override String get node_connection_successful => "La conexión fue exitosa"; @override @@ -6818,7 +6818,7 @@ class $nl extends S { @override String get choose_wallet_currency => "Kies een portemonnee-valuta:"; @override - String get pre_seed_description => "Op de volgende pagina ziet u een reeks van 25 woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; + String pre_seed_description(int words) => "Op de volgende pagina ziet u een reeks van ${words} woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; @override String get node_connection_successful => "Verbinding is gelukt"; @override @@ -7518,7 +7518,7 @@ class $zh extends S { @override String get choose_wallet_currency => "請選擇錢包貨幣:"; @override - String get pre_seed_description => "在下一頁上,您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; + String pre_seed_description(int words) => "在下一頁上,您將看到一系列${words}個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; @override String get node_connection_successful => "連接成功"; @override diff --git a/lib/router.dart b/lib/router.dart index d2122a031..93b56071b 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -71,8 +71,9 @@ Route createRoute(RouteSettings settings) { case Routes.newWalletType: return CupertinoPageRoute( builder: (_) => getIt.get( - param1: (BuildContext context, WalletType _) => - Navigator.of(context).pushNamed(Routes.preSeed, arguments: true), + param1: (BuildContext context, WalletType type) => + Navigator.of(context) + .pushNamed(Routes.preSeed, arguments: type), param2: true)); case Routes.newWallet: @@ -137,7 +138,8 @@ Route createRoute(RouteSettings settings) { return CupertinoPageRoute( builder: (_) => getIt.get( param1: (PinCodeState context, dynamic _) => - Navigator.pushNamed(context.context, Routes.restoreWalletType)), + Navigator.pushNamed( + context.context, Routes.restoreWalletType)), fullscreenDialog: true); case Routes.seed: @@ -147,8 +149,8 @@ Route createRoute(RouteSettings settings) { case Routes.restoreWallet: return MaterialPageRoute( - builder: (_) => - getIt.get(param1: settings.arguments as WalletType)); + builder: (_) => getIt.get( + param1: settings.arguments as WalletType)); case Routes.restoreWalletFromSeed: final type = settings.arguments as WalletType; @@ -248,7 +250,7 @@ Route createRoute(RouteSettings settings) { case Routes.accountCreation: return CupertinoPageRoute( builder: (_) => getIt.get( - param1: settings.arguments as AccountListItem)); + param1: settings.arguments as AccountListItem)); case Routes.addressBook: return MaterialPageRoute( @@ -311,7 +313,8 @@ Route createRoute(RouteSettings settings) { case Routes.preSeed: return MaterialPageRoute( - builder: (_) => getIt.get()); + builder: (_) => + getIt.get(param1: settings.arguments as WalletType)); default: return MaterialPageRoute( diff --git a/lib/src/screens/dashboard/widgets/balance_page.dart b/lib/src/screens/dashboard/widgets/balance_page.dart index 7409a78ef..01fb42495 100644 --- a/lib/src/screens/dashboard/widgets/balance_page.dart +++ b/lib/src/screens/dashboard/widgets/balance_page.dart @@ -59,14 +59,15 @@ class BalancePage extends StatelessWidget { return AutoSizeText( dashboardViewModel.balanceViewModel.cryptoBalance, style: TextStyle( - fontSize: 40, + fontSize: 54, fontWeight: FontWeight.bold, color: Theme.of(context) .accentTextTheme .display3 .backgroundColor, height: 1), - ); + maxLines: 1, + textAlign: TextAlign.center); }), SizedBox(height: 10), Observer(builder: (_) { diff --git a/lib/src/screens/seed/pre_seed_page.dart b/lib/src/screens/seed/pre_seed_page.dart index 0a2bc0161..babbf33ec 100644 --- a/lib/src/screens/seed/pre_seed_page.dart +++ b/lib/src/screens/seed/pre_seed_page.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/entities/wallet_type.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/cupertino.dart'; @@ -7,8 +8,17 @@ import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; class PreSeedPage extends BasePage { - final imageLight = Image.asset('assets/images/pre_seed_light.png'); - final imageDark = Image.asset('assets/images/pre_seed_dark.png'); + PreSeedPage(this.type) + : imageLight = Image.asset('assets/images/pre_seed_light.png'), + imageDark = Image.asset('assets/images/pre_seed_dark.png'), + wordsCount = type == WalletType.monero + ? 25 + : 12; // FIXME: Stupid fast implementation + + final Image imageDark; + final Image imageLight; + final WalletType type; + final int wordsCount; @override Widget leading(BuildContext context) => null; @@ -39,7 +49,7 @@ class PreSeedPage extends BasePage { Padding( padding: EdgeInsets.only(top: 70, left: 16, right: 16), child: Text( - S.of(context).pre_seed_description, + S.of(context).pre_seed_description(wordsCount), textAlign: TextAlign.center, style: TextStyle( fontSize: 14, From 8067c07e9410ae13561f2b8d8930906a3ece226f Mon Sep 17 00:00:00 2001 From: M Date: Mon, 21 Dec 2020 22:21:41 +0200 Subject: [PATCH 04/16] Changed iOS project version to 4.1.0 (9). --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index ab6767c8d..b89f48572 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -354,7 +354,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -494,7 +494,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -528,7 +528,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 7; + CURRENT_PROJECT_VERSION = 9; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( From fd4efd46ea00a247759f2dcb6cd86555b57f79fd Mon Sep 17 00:00:00 2001 From: M Date: Wed, 23 Dec 2020 14:48:04 +0200 Subject: [PATCH 05/16] Fixes for 'std::bad_alloc' issue. --- cw_monero/ios/Classes/monero_api.cpp | 16 ++++++++++++++-- .../exceptions/wallet_loading_exception.dart | 8 ++++++++ cw_monero/lib/signatures.dart | 4 +++- cw_monero/lib/types.dart | 4 +++- cw_monero/lib/wallet_manager.dart | 13 +++++++++++-- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- lib/monero/monero_wallet_service.dart | 17 ++++++++++++++++- 7 files changed, 58 insertions(+), 10 deletions(-) create mode 100644 cw_monero/lib/exceptions/wallet_loading_exception.dart diff --git a/cw_monero/ios/Classes/monero_api.cpp b/cw_monero/ios/Classes/monero_api.cpp index 2dfd8a0ae..efe8c49f1 100644 --- a/cw_monero/ios/Classes/monero_api.cpp +++ b/cw_monero/ios/Classes/monero_api.cpp @@ -294,14 +294,26 @@ extern "C" return true; } - void load_wallet(char *path, char *password, int32_t nettype) + bool load_wallet(char *path, char *password, int32_t nettype) { nice(19); Monero::NetworkType networkType = static_cast(nettype); - Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->openWallet(std::string(path), std::string(password), networkType); + Monero::WalletManager *walletManager = Monero::WalletManagerFactory::getWalletManager(); + Monero::Wallet *wallet = walletManager->openWallet(std::string(path), std::string(password), networkType); + int status; + std::string errorString; + + wallet->statusWithErrorString(status, errorString); change_current_wallet(wallet); + + return !(status != Monero::Wallet::Status_Ok || !errorString.empty()); } + char *error_string() { + return strdup(get_current_wallet()->errorString().c_str()); + } + + bool is_wallet_exist(char *path) { return Monero::WalletManagerFactory::getWalletManager()->walletExists(std::string(path)); diff --git a/cw_monero/lib/exceptions/wallet_loading_exception.dart b/cw_monero/lib/exceptions/wallet_loading_exception.dart new file mode 100644 index 000000000..b0594c6e5 --- /dev/null +++ b/cw_monero/lib/exceptions/wallet_loading_exception.dart @@ -0,0 +1,8 @@ +class WalletLoadingException implements Exception { + WalletLoadingException({this.message}); + + final String message; + + @override + String toString() => message; +} \ No newline at end of file diff --git a/cw_monero/lib/signatures.dart b/cw_monero/lib/signatures.dart index 5e9c4fa9d..0f75288e7 100644 --- a/cw_monero/lib/signatures.dart +++ b/cw_monero/lib/signatures.dart @@ -14,7 +14,9 @@ typedef restore_wallet_from_keys = Int8 Function(Pointer, Pointer, typedef is_wallet_exist = Int8 Function(Pointer); -typedef load_wallet = Void Function(Pointer, Pointer, Int8); +typedef load_wallet = Int8 Function(Pointer, Pointer, Int8); + +typedef error_string = Pointer Function(); typedef get_filename = Pointer Function(); diff --git a/cw_monero/lib/types.dart b/cw_monero/lib/types.dart index 602a33572..1cc1a6055 100644 --- a/cw_monero/lib/types.dart +++ b/cw_monero/lib/types.dart @@ -14,7 +14,9 @@ typedef RestoreWalletFromKeys = int Function(Pointer, Pointer, typedef IsWalletExist = int Function(Pointer); -typedef LoadWallet = void Function(Pointer, Pointer, int); +typedef LoadWallet = int Function(Pointer, Pointer, int); + +typedef ErrorString = Pointer Function(); typedef GetFilename = Pointer Function(); diff --git a/cw_monero/lib/wallet_manager.dart b/cw_monero/lib/wallet_manager.dart index 07f534c97..ad2087361 100644 --- a/cw_monero/lib/wallet_manager.dart +++ b/cw_monero/lib/wallet_manager.dart @@ -7,6 +7,7 @@ import 'package:cw_monero/signatures.dart'; import 'package:cw_monero/types.dart'; import 'package:cw_monero/monero_api.dart'; import 'package:cw_monero/exceptions/wallet_creation_exception.dart'; +import 'package:cw_monero/exceptions/wallet_loading_exception.dart'; import 'package:cw_monero/exceptions/wallet_restore_from_keys_exception.dart'; import 'package:cw_monero/exceptions/wallet_restore_from_seed_exception.dart'; @@ -32,6 +33,10 @@ final loadWalletNative = moneroApi .lookup>('load_wallet') .asFunction(); +final errorStringNative = moneroApi + .lookup>('error_string') + .asFunction(); + void createWalletSync( {String path, String password, String language, int nettype = 0}) { final pathPointer = Utf8.toUtf8(path); @@ -136,10 +141,14 @@ void restoreWalletFromKeysSync( void loadWallet({String path, String password, int nettype = 0}) { final pathPointer = Utf8.toUtf8(path); final passwordPointer = Utf8.toUtf8(password); - - loadWalletNative(pathPointer, passwordPointer, nettype); + final loaded = loadWalletNative(pathPointer, passwordPointer, nettype) != 0; free(pathPointer); free(passwordPointer); + + if (!loaded) { + throw WalletLoadingException( + message: convertUTF8ToString(pointer: errorStringNative())); + } } void _createWallet(Map args) { diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 99a1c5f3c..a77e4e4c8 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -371,7 +371,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.0.91; + MARKETING_VERSION = 4.0.92; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -511,7 +511,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.0.91; + MARKETING_VERSION = 4.0.92; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -545,7 +545,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.0.91; + MARKETING_VERSION = 4.0.92; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; diff --git a/lib/monero/monero_wallet_service.dart b/lib/monero/monero_wallet_service.dart index 191b340e4..fb1bdb4c4 100644 --- a/lib/monero/monero_wallet_service.dart +++ b/lib/monero/monero_wallet_service.dart @@ -3,6 +3,7 @@ import 'package:cake_wallet/core/wallet_base.dart'; import 'package:hive/hive.dart'; import 'package:cw_monero/wallet_manager.dart' as monero_wallet_manager; import 'package:cw_monero/wallet.dart' as monero_wallet; +import 'package:cw_monero/exceptions/wallet_loading_exception.dart'; import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/core/wallet_credentials.dart'; import 'package:cake_wallet/core/wallet_service.dart'; @@ -55,6 +56,15 @@ class MoneroWalletService extends WalletService< final Box walletInfoSource; + static void _removeCache(String name) async { + final path = await pathForWallet(name: name, type: WalletType.monero); + final cacheFile = File(path); + + if (cacheFile.existsSync()) { + cacheFile.deleteSync(); + } + } + @override Future create(MoneroNewWalletCredentials credentials) async { try { @@ -126,7 +136,12 @@ class MoneroWalletService extends WalletService< return wallet; } catch (e) { // TODO: Implement Exception for wallet list service. - print('MoneroWalletsManager Error: $e'); + + if (e.message == 'std::bad_alloc') { + _removeCache(name); + return openWallet(name, password); + } + rethrow; } } From 647577497d819fddeffa8b1834fa067ffd399e61 Mon Sep 17 00:00:00 2001 From: M Date: Wed, 23 Dec 2020 14:51:58 +0200 Subject: [PATCH 06/16] Changed android project version to 4.0.92 (23). --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 656f9b6b2..3e680b605 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Cake Wallet. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.0.91+22 +version: 4.0.92+23 environment: sdk: ">=2.7.0 <3.0.0" From d93c706997031ac9b18a3be4ccc0c00bb77e5664 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Thu, 24 Dec 2020 22:57:32 +0200 Subject: [PATCH 07/16] CAKE-208 | changed MoneroBalance to Balance property and handled BitcoinBalance case in the balance_view_model.dart --- .../dashboard/balance_view_model.dart | 60 ++++++++++++------- 1 file changed, 39 insertions(+), 21 deletions(-) diff --git a/lib/view_model/dashboard/balance_view_model.dart b/lib/view_model/dashboard/balance_view_model.dart index a7bc575bd..0c4272343 100644 --- a/lib/view_model/dashboard/balance_view_model.dart +++ b/lib/view_model/dashboard/balance_view_model.dart @@ -1,5 +1,7 @@ +import 'package:cake_wallet/bitcoin/bitcoin_balance.dart'; import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; import 'package:cake_wallet/core/wallet_base.dart'; +import 'package:cake_wallet/entities/balance.dart'; import 'package:cake_wallet/entities/crypto_currency.dart'; import 'package:cake_wallet/monero/monero_balance.dart'; import 'package:cake_wallet/monero/monero_wallet.dart'; @@ -31,10 +33,17 @@ abstract class BalanceViewModelBase with Store { final _wallet = wallet; if (_wallet is MoneroWallet) { - moneroBalance = _wallet.balance; + balance = _wallet.balance; _onMoneroBalanceChangeReaction = reaction((_) => _wallet.balance, - (MoneroBalance balance) => moneroBalance = balance); + (MoneroBalance moneroBalance) => balance = moneroBalance); + } + + if (_wallet is BitcoinWallet) { + balance = _wallet.balance; + + _onBitcoinBalanceChangeReaction = reaction((_) => _wallet.balance, + (BitcoinBalance bitcoinBalance) => balance = bitcoinBalance); } } @@ -49,7 +58,7 @@ abstract class BalanceViewModelBase with Store { bool isReversing; @observable - MoneroBalance moneroBalance; + Balance balance; @observable WalletBase wallet; @@ -70,24 +79,24 @@ abstract class BalanceViewModelBase with Store { @computed String get cryptoBalance { final walletBalance = _walletBalance; - var balance = '---'; + var _balance = '---'; if (displayMode == BalanceDisplayMode.availableBalance) { - balance = walletBalance.unlockedBalance ?? '0.0'; + _balance = walletBalance.unlockedBalance ?? '0.0'; } if (displayMode == BalanceDisplayMode.fullBalance) { - balance = walletBalance.totalBalance ?? '0.0'; + _balance = walletBalance.totalBalance ?? '0.0'; } - return balance; + return _balance; } @computed String get fiatBalance { final walletBalance = _walletBalance; final fiatCurrency = settingsStore.fiatCurrency; - var balance = '---'; + var _balance = '---'; final totalBalance = _getFiatBalance(price: price, cryptoAmount: walletBalance.totalBalance); @@ -96,30 +105,30 @@ abstract class BalanceViewModelBase with Store { price: price, cryptoAmount: walletBalance.unlockedBalance); if (displayMode == BalanceDisplayMode.availableBalance) { - balance = fiatCurrency.toString() + ' ' + unlockedBalance ?? '0.00'; + _balance = fiatCurrency.toString() + ' ' + unlockedBalance ?? '0.00'; } if (displayMode == BalanceDisplayMode.fullBalance) { - balance = fiatCurrency.toString() + ' ' + totalBalance ?? '0.00'; + _balance = fiatCurrency.toString() + ' ' + totalBalance ?? '0.00'; } - return balance; + return _balance; } @computed WalletBalance get _walletBalance { - final _wallet = wallet; + final _balance = balance; - if (_wallet is MoneroWallet) { + if (_balance is MoneroBalance) { return WalletBalance( - unlockedBalance: moneroBalance.formattedUnlockedBalance, - totalBalance: moneroBalance.formattedFullBalance); + unlockedBalance: _balance.formattedUnlockedBalance, + totalBalance: _balance.formattedFullBalance); } - if (_wallet is BitcoinWallet) { + if (_balance is BitcoinBalance) { return WalletBalance( - unlockedBalance: _wallet.balance.availableBalanceFormatted, - totalBalance: _wallet.balance.totalFormatted); + unlockedBalance: _balance.availableBalanceFormatted, + totalBalance: _balance.totalFormatted); } return null; @@ -133,17 +142,26 @@ abstract class BalanceViewModelBase with Store { this.wallet = wallet; if (wallet is MoneroWallet) { - moneroBalance = wallet.balance; + balance = wallet.balance; _onMoneroBalanceChangeReaction?.reaction?.dispose(); _onMoneroBalanceChangeReaction = reaction((_) => wallet.balance, - (MoneroBalance balance) => moneroBalance = balance); + (MoneroBalance moneroBalance) => balance = moneroBalance); + } + + if (wallet is BitcoinWallet) { + balance = wallet.balance; + + _onBitcoinBalanceChangeReaction?.reaction?.dispose(); + + _onBitcoinBalanceChangeReaction = reaction((_) => wallet.balance, + (BitcoinBalance bitcoinBalance) => balance = bitcoinBalance); } } ReactionDisposer _onMoneroBalanceChangeReaction; - + ReactionDisposer _onBitcoinBalanceChangeReaction; ReactionDisposer _reaction; String _getFiatBalance({double price, String cryptoAmount}) { From 84ad97c0b01b1da850d43f0f87edc11ee9ac2448 Mon Sep 17 00:00:00 2001 From: M Date: Tue, 29 Dec 2020 18:55:58 +0200 Subject: [PATCH 08/16] Fixes for 4.0.94. Changed version for 4.0.94. --- .../exceptions/wallet_loading_exception.dart | 8 ----- .../exceptions/wallet_opening_exception.dart | 8 +++++ cw_monero/lib/wallet_manager.dart | 4 +-- lib/monero/monero_wallet_service.dart | 33 +++++++++---------- pubspec.yaml | 2 +- 5 files changed, 26 insertions(+), 29 deletions(-) delete mode 100644 cw_monero/lib/exceptions/wallet_loading_exception.dart create mode 100644 cw_monero/lib/exceptions/wallet_opening_exception.dart diff --git a/cw_monero/lib/exceptions/wallet_loading_exception.dart b/cw_monero/lib/exceptions/wallet_loading_exception.dart deleted file mode 100644 index b0594c6e5..000000000 --- a/cw_monero/lib/exceptions/wallet_loading_exception.dart +++ /dev/null @@ -1,8 +0,0 @@ -class WalletLoadingException implements Exception { - WalletLoadingException({this.message}); - - final String message; - - @override - String toString() => message; -} \ No newline at end of file diff --git a/cw_monero/lib/exceptions/wallet_opening_exception.dart b/cw_monero/lib/exceptions/wallet_opening_exception.dart new file mode 100644 index 000000000..8d84b0f7e --- /dev/null +++ b/cw_monero/lib/exceptions/wallet_opening_exception.dart @@ -0,0 +1,8 @@ +class WalletOpeningException implements Exception { + WalletOpeningException({this.message}); + + final String message; + + @override + String toString() => message; +} \ No newline at end of file diff --git a/cw_monero/lib/wallet_manager.dart b/cw_monero/lib/wallet_manager.dart index ad2087361..e48055cf9 100644 --- a/cw_monero/lib/wallet_manager.dart +++ b/cw_monero/lib/wallet_manager.dart @@ -1,4 +1,5 @@ import 'dart:ffi'; +import 'package:cw_monero/exceptions/wallet_opening_exception.dart'; import 'package:cw_monero/wallet.dart'; import 'package:ffi/ffi.dart'; import 'package:flutter/foundation.dart'; @@ -7,7 +8,6 @@ import 'package:cw_monero/signatures.dart'; import 'package:cw_monero/types.dart'; import 'package:cw_monero/monero_api.dart'; import 'package:cw_monero/exceptions/wallet_creation_exception.dart'; -import 'package:cw_monero/exceptions/wallet_loading_exception.dart'; import 'package:cw_monero/exceptions/wallet_restore_from_keys_exception.dart'; import 'package:cw_monero/exceptions/wallet_restore_from_seed_exception.dart'; @@ -146,7 +146,7 @@ void loadWallet({String path, String password, int nettype = 0}) { free(passwordPointer); if (!loaded) { - throw WalletLoadingException( + throw WalletOpeningException( message: convertUTF8ToString(pointer: errorStringNative())); } } diff --git a/lib/monero/monero_wallet_service.dart b/lib/monero/monero_wallet_service.dart index fb1bdb4c4..d964f0232 100644 --- a/lib/monero/monero_wallet_service.dart +++ b/lib/monero/monero_wallet_service.dart @@ -3,7 +3,7 @@ import 'package:cake_wallet/core/wallet_base.dart'; import 'package:hive/hive.dart'; import 'package:cw_monero/wallet_manager.dart' as monero_wallet_manager; import 'package:cw_monero/wallet.dart' as monero_wallet; -import 'package:cw_monero/exceptions/wallet_loading_exception.dart'; +import 'package:cw_monero/exceptions/wallet_opening_exception.dart'; import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/core/wallet_credentials.dart'; import 'package:cake_wallet/core/wallet_service.dart'; @@ -56,7 +56,7 @@ class MoneroWalletService extends WalletService< final Box walletInfoSource; - static void _removeCache(String name) async { + static Future _removeCache(String name) async { final path = await pathForWallet(name: name, type: WalletType.monero); final cacheFile = File(path); @@ -65,6 +65,9 @@ class MoneroWalletService extends WalletService< } } + static bool walletFilesExist(String path) => + !File(path).existsSync() && !File('$path.keys').existsSync(); + @override Future create(MoneroNewWalletCredentials credentials) async { try { @@ -104,7 +107,7 @@ class MoneroWalletService extends WalletService< try { final path = await pathForWallet(name: name, type: WalletType.monero); - if (!File(path).existsSync()) { + if (walletFilesExist(path)) { await repairOldAndroidWallet(name); } @@ -118,17 +121,9 @@ class MoneroWalletService extends WalletService< final isValid = wallet.validate(); if (!isValid) { - // if (wallet.seed?.isNotEmpty ?? false) { - // let restore from seed in this case; - // final seed = wallet.seed; - // final credentials = MoneroRestoreWalletFromSeedCredentials( - // name: name, password: password, mnemonic: seed, height: 2000000) - // ..walletInfo = walletInfo; - // await remove(name); - // return restoreFromSeed(credentials); - // } - - throw MoneroWalletLoadingException(); + await _removeCache(name); + wallet.close(); + return openWallet(name, password); } await wallet.init(); @@ -137,8 +132,11 @@ class MoneroWalletService extends WalletService< } catch (e) { // TODO: Implement Exception for wallet list service. - if (e.message == 'std::bad_alloc') { - _removeCache(name); + if (e.toString().contains('bad_alloc') || + (e is WalletOpeningException && + (e.message == 'std::bad_alloc' || + e.message.contains('bad_alloc')))) { + await _removeCache(name); return openWallet(name, password); } @@ -219,7 +217,7 @@ class MoneroWalletService extends WalletService< final dir = Directory(oldAndroidWalletDirPath); if (!dir.existsSync()) { - throw MoneroWalletLoadingException(); + return; } final newWalletDirPath = @@ -238,7 +236,6 @@ class MoneroWalletService extends WalletService< }); } catch (e) { print(e.toString()); - throw MoneroWalletLoadingException(); } } } diff --git a/pubspec.yaml b/pubspec.yaml index 3e680b605..851dec206 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Cake Wallet. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.0.92+23 +version: 4.0.94+25 environment: sdk: ">=2.7.0 <3.0.0" From 1c2b8c20236db078d7e953e78cebb061b4b5ff5b Mon Sep 17 00:00:00 2001 From: M Date: Tue, 29 Dec 2020 19:22:22 +0200 Subject: [PATCH 09/16] Changed iOS project version to 4.0.94. --- ios/Runner.xcodeproj/project.pbxproj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index a77e4e4c8..4d74d0752 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -371,7 +371,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.0.92; + MARKETING_VERSION = 4.0.94; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -511,7 +511,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.0.92; + MARKETING_VERSION = 4.0.94; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; @@ -545,7 +545,7 @@ "$(inherited)", "$(PROJECT_DIR)/Flutter", ); - MARKETING_VERSION = 4.0.92; + MARKETING_VERSION = 4.0.94; PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; From ac1709bffb1d700318984d801ad9291b1def1ab4 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Tue, 29 Dec 2020 20:48:57 +0200 Subject: [PATCH 10/16] CAKE-221 | added fiat amount to estimated fee; reworked confirm_sending_alert.dart; applied alert when transaction was committed --- lib/src/screens/send/send_page.dart | 149 ++++++----------- .../send/widgets/confirm_sending_alert.dart | 150 ++++++++++++++---- lib/src/widgets/base_alert_dialog.dart | 31 ++-- lib/view_model/send/send_view_model.dart | 29 ++++ 4 files changed, 215 insertions(+), 144 deletions(-) diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 1a18b5ba6..2ca9372a5 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -313,6 +313,7 @@ class SendPage extends BasePage { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( S @@ -326,23 +327,50 @@ class SendPage extends BasePage { color: Colors.white)), Container( child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - sendViewModel + Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + sendViewModel .estimatedFee .toString() + - ' ' + - sendViewModel + ' ' + + sendViewModel .currency.title, - style: TextStyle( - fontSize: 12, - fontWeight: + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, - //color: Theme.of(context).primaryTextTheme.display2.color, - color: + //color: Theme.of(context).primaryTextTheme.display2.color, + color: Colors.white)), + Padding( + padding: + EdgeInsets.only(top: 5), + child: Text( + sendViewModel + .estimatedFeeFiatAmount + + ' ' + + sendViewModel + .fiat.title, + style: TextStyle( + fontSize: 12, + fontWeight: + FontWeight.w600, + color: Theme + .of(context) + .primaryTextTheme + .headline + .decorationColor)) + ), + ], + ), Padding( padding: EdgeInsets.only( + top: 2, left: 5), child: Icon( Icons.arrow_forward_ios, @@ -596,8 +624,14 @@ class SendPage extends BasePage { amount: S.of(context).send_amount, amountValue: sendViewModel.pendingTransaction.amountFormatted, + fiatAmountValue: sendViewModel.pendingTransactionFiatAmount + + ' ' + sendViewModel.fiat.title, fee: S.of(context).send_fee, feeValue: sendViewModel.pendingTransaction.feeFormatted, + transactionPriority: sendViewModel + .transactionPriority.toString(), + recipientTitle: 'Recipient address', + recipientAddress: sendViewModel.address, rightButtonText: S.of(context).ok, leftButtonText: S.of(context).cancel, actionRightButton: () { @@ -614,96 +648,17 @@ class SendPage extends BasePage { } if (state is TransactionCommitted) { - return Stack( - children: [ - Container( - color: Theme.of(context).backgroundColor, - child: Center( - child: Image.asset( - 'assets/images/birthday_cake.png'), - ), - ), - Center( - child: Padding( - padding: EdgeInsets.only( - top: 220, left: 24, right: 24), - child: Text( - S.of(context).send_success( - sendViewModel.currency - .toString()), - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme - .title - .color, - decoration: TextDecoration.none, - ), - ), - ), - ), - Positioned( - left: 24, - right: 24, - bottom: 24, - child: PrimaryButton( - onPressed: () => - Navigator.of(context).pop(), - text: S.of(context).send_got_it, - color: Theme.of(context) - .accentTextTheme - .body2 - .color, - textColor: Colors.white)) - ], - ); + return AlertWithOneAction( + alertTitle: '', + alertContent: S.of(context).send_success( + sendViewModel.currency + .toString()), + buttonText: S.of(context).ok, + buttonAction: () => + Navigator.of(context).pop()); } - if (state is TransactionCommitting) { - return Stack( - children: [ - Container( - color: Theme.of(context).backgroundColor, - child: Center( - child: Image.asset( - 'assets/images/birthday_cake.png'), - ), - ), - BackdropFilter( - filter: ImageFilter.blur( - sigmaX: 3.0, sigmaY: 3.0), - child: Container( - decoration: BoxDecoration( - color: Theme.of(context) - .backgroundColor - .withOpacity(0.25)), - child: Center( - child: Padding( - padding: EdgeInsets.only(top: 220), - child: Text( - S.of(context).send_sending, - textAlign: TextAlign.center, - style: TextStyle( - fontSize: 22, - fontWeight: FontWeight.bold, - color: Theme.of(context) - .primaryTextTheme - .title - .color, - decoration: TextDecoration.none, - ), - ), - ), - ), - ), - ) - ], - ); - } - - return Container(); + return Offstage(); }); }); }, diff --git a/lib/src/screens/send/widgets/confirm_sending_alert.dart b/lib/src/screens/send/widgets/confirm_sending_alert.dart index 07976ce12..3d0c8bf0a 100644 --- a/lib/src/screens/send/widgets/confirm_sending_alert.dart +++ b/lib/src/screens/send/widgets/confirm_sending_alert.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/palette.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/base_alert_dialog.dart'; @@ -6,8 +7,12 @@ class ConfirmSendingAlert extends BaseAlertDialog { @required this.alertTitle, @required this.amount, @required this.amountValue, + @required this.fiatAmountValue, @required this.fee, @required this.feeValue, + @required this.transactionPriority, + @required this.recipientTitle, + @required this.recipientAddress, @required this.leftButtonText, @required this.rightButtonText, @required this.actionLeftButton, @@ -18,8 +23,12 @@ class ConfirmSendingAlert extends BaseAlertDialog { final String alertTitle; final String amount; final String amountValue; + final String fiatAmountValue; final String fee; final String feeValue; + final String transactionPriority; + final String recipientTitle; + final String recipientAddress; final String leftButtonText; final String rightButtonText; final VoidCallback actionLeftButton; @@ -29,74 +38,145 @@ class ConfirmSendingAlert extends BaseAlertDialog { @override String get titleText => alertTitle; + @override + bool get isDividerExists => true; + @override String get leftActionButtonText => leftButtonText; + @override String get rightActionButtonText => rightButtonText; + @override VoidCallback get actionLeft => actionLeftButton; + @override VoidCallback get actionRight => actionRightButton; + @override bool get barrierDismissible => alertBarrierDismissible; @override Widget content(BuildContext context) { return Column( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( amount, style: TextStyle( fontSize: 16, - fontWeight: FontWeight.w600, + fontWeight: FontWeight.normal, fontFamily: 'Lato', color: Theme.of(context).primaryTextTheme.title.color, decoration: TextDecoration.none, ), ), - Text( - amountValue, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme.title.color, - decoration: TextDecoration.none, - ), + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + amountValue, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + fontFamily: 'Lato', + color: Theme.of(context).primaryTextTheme.title.color, + decoration: TextDecoration.none, + ), + ), + Text( + fiatAmountValue, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: 'Lato', + color: PaletteDark.pigeonBlue, + decoration: TextDecoration.none, + ), + ) + ], ) ], ), - Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - fee, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme.title.color, - decoration: TextDecoration.none, + Padding( + padding: EdgeInsets.only(top: 16), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + fee, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.normal, + fontFamily: 'Lato', + color: Theme.of(context).primaryTextTheme.title.color, + decoration: TextDecoration.none, + ), ), - ), - Text( - feeValue, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w600, - fontFamily: 'Lato', - color: Theme.of(context).primaryTextTheme.title.color, - decoration: TextDecoration.none, + Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Text( + feeValue, + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.w600, + fontFamily: 'Lato', + color: Theme.of(context).primaryTextTheme.title.color, + decoration: TextDecoration.none, + ), + ), + Text( + transactionPriority, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: 'Lato', + color: PaletteDark.pigeonBlue, + decoration: TextDecoration.none, + ), + ) + ], + ) + ], + ) + ), + Padding( + padding: EdgeInsets.fromLTRB(8, 16, 8, 0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Text( + recipientTitle, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.normal, + fontFamily: 'Lato', + color: Theme.of(context).primaryTextTheme.title.color, + decoration: TextDecoration.none, + ), ), - ) - ], + Padding( + padding: EdgeInsets.only(top: 8), + child: Text( + recipientAddress, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + fontFamily: 'Lato', + color: PaletteDark.pigeonBlue, + decoration: TextDecoration.none, + ), + ) + ) + ], + ), ) ], ); diff --git a/lib/src/widgets/base_alert_dialog.dart b/lib/src/widgets/base_alert_dialog.dart index 19c00ca43..b51eb0d69 100644 --- a/lib/src/widgets/base_alert_dialog.dart +++ b/lib/src/widgets/base_alert_dialog.dart @@ -7,6 +7,7 @@ class BaseAlertDialog extends StatelessWidget { String get contentText => ''; String get leftActionButtonText => ''; String get rightActionButtonText => ''; + bool get isDividerExists => false; VoidCallback get actionLeft => () {}; VoidCallback get actionRight => () {}; bool get barrierDismissible => true; @@ -127,18 +128,24 @@ class BaseAlertDialog extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ - Container( - padding: EdgeInsets.fromLTRB(24, 32, 24, 32), - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - title(context), - Padding( - padding: EdgeInsets.only(top: 8), - child: content(context), - ) - ], - ), + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.fromLTRB(24, 32, 24, 16), + child: title(context), + ), + isDividerExists + ? Container( + height: 1, + color: Theme.of(context).dividerColor, + ) + : Offstage(), + Padding( + padding: EdgeInsets.fromLTRB(24, 16, 24, 32), + child: content(context), + ) + ], ), Container( height: 1, diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index f3d46ccb3..363c42d17 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -1,4 +1,5 @@ import 'package:cake_wallet/entities/balance_display_mode.dart'; +import 'package:cake_wallet/entities/calculate_fiat_amount_raw.dart'; import 'package:cake_wallet/entities/transaction_description.dart'; import 'package:hive/hive.dart'; import 'package:intl/intl.dart'; @@ -60,6 +61,34 @@ abstract class SendViewModelBase with Store { double get estimatedFee => _wallet.calculateEstimatedFee(_settingsStore.transactionPriority); + @computed + String get estimatedFeeFiatAmount { + try { + final fiat = calculateFiatAmountRaw( + price: _fiatConversationStore.prices[_wallet.currency], + cryptoAmount: estimatedFee); + return fiat; + } catch (_) { + return '0.00'; + } + } + + @computed + String get pendingTransactionFiatAmount { + try { + if (pendingTransaction != null) { + final fiat = calculateFiatAmount( + price: _fiatConversationStore.prices[_wallet.currency], + cryptoAmount: pendingTransaction.amountFormatted); + return fiat; + } else { + return '0.00'; + } + } catch (_) { + return '0.00'; + } + } + FiatCurrency get fiat => _settingsStore.fiatCurrency; TransactionPriority get transactionPriority => From 823e9d11ae631c526d08aac8a5e13dabf234f5a3 Mon Sep 17 00:00:00 2001 From: OleksandrSobol Date: Wed, 30 Dec 2020 16:54:55 +0200 Subject: [PATCH 11/16] CAKE-221 | added pendingTransactionFeeFiatAmount getter to send_view_model.dart; applied feeFiatAmount property instead transactionPriority in the confirm_sending_alert.dart; fixed base_alert_dialog.dart --- lib/src/screens/send/send_page.dart | 4 ++-- .../send/widgets/confirm_sending_alert.dart | 6 +++--- lib/src/widgets/base_alert_dialog.dart | 13 ++++++++----- lib/view_model/send/send_view_model.dart | 16 ++++++++++++++++ 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index 2ca9372a5..cdcbb726f 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -628,8 +628,8 @@ class SendPage extends BasePage { + ' ' + sendViewModel.fiat.title, fee: S.of(context).send_fee, feeValue: sendViewModel.pendingTransaction.feeFormatted, - transactionPriority: sendViewModel - .transactionPriority.toString(), + feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmount + + ' ' + sendViewModel.fiat.title, recipientTitle: 'Recipient address', recipientAddress: sendViewModel.address, rightButtonText: S.of(context).ok, diff --git a/lib/src/screens/send/widgets/confirm_sending_alert.dart b/lib/src/screens/send/widgets/confirm_sending_alert.dart index 3d0c8bf0a..458c34432 100644 --- a/lib/src/screens/send/widgets/confirm_sending_alert.dart +++ b/lib/src/screens/send/widgets/confirm_sending_alert.dart @@ -10,7 +10,7 @@ class ConfirmSendingAlert extends BaseAlertDialog { @required this.fiatAmountValue, @required this.fee, @required this.feeValue, - @required this.transactionPriority, + @required this.feeFiatAmount, @required this.recipientTitle, @required this.recipientAddress, @required this.leftButtonText, @@ -26,7 +26,7 @@ class ConfirmSendingAlert extends BaseAlertDialog { final String fiatAmountValue; final String fee; final String feeValue; - final String transactionPriority; + final String feeFiatAmount; final String recipientTitle; final String recipientAddress; final String leftButtonText; @@ -133,7 +133,7 @@ class ConfirmSendingAlert extends BaseAlertDialog { ), ), Text( - transactionPriority, + feeFiatAmount, style: TextStyle( fontSize: 12, fontWeight: FontWeight.w600, diff --git a/lib/src/widgets/base_alert_dialog.dart b/lib/src/widgets/base_alert_dialog.dart index b51eb0d69..7d1551100 100644 --- a/lib/src/widgets/base_alert_dialog.dart +++ b/lib/src/widgets/base_alert_dialog.dart @@ -132,17 +132,20 @@ class BaseAlertDialog extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Padding( - padding: EdgeInsets.fromLTRB(24, 32, 24, 16), + padding: EdgeInsets.fromLTRB(24, 32, 24, 0), child: title(context), ), isDividerExists - ? Container( - height: 1, - color: Theme.of(context).dividerColor, + ? Padding( + padding: EdgeInsets.only(top: 16, bottom: 8), + child: Container( + height: 1, + color: Theme.of(context).dividerColor, + ), ) : Offstage(), Padding( - padding: EdgeInsets.fromLTRB(24, 16, 24, 32), + padding: EdgeInsets.fromLTRB(24, 8, 24, 32), child: content(context), ) ], diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index 363c42d17..b644dc618 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -89,6 +89,22 @@ abstract class SendViewModelBase with Store { } } + @computed + String get pendingTransactionFeeFiatAmount { + try { + if (pendingTransaction != null) { + final fiat = calculateFiatAmount( + price: _fiatConversationStore.prices[_wallet.currency], + cryptoAmount: pendingTransaction.feeFormatted); + return fiat; + } else { + return '0.00'; + } + } catch (_) { + return '0.00'; + } + } + FiatCurrency get fiat => _settingsStore.fiatCurrency; TransactionPriority get transactionPriority => From 18ba208e445fe17874c573b64ab34823903ce90f Mon Sep 17 00:00:00 2001 From: Oleksandr Sobol Date: Wed, 30 Dec 2020 18:19:16 +0200 Subject: [PATCH 12/16] CAKE-221 | fixed string resources --- lib/generated/i18n.dart | 137 ++++++++++++++---------- lib/src/screens/seed/pre_seed_page.dart | 2 +- lib/src/screens/send/send_page.dart | 2 +- res/values/strings_de.arb | 8 +- res/values/strings_en.arb | 8 +- res/values/strings_es.arb | 8 +- res/values/strings_hi.arb | 8 +- res/values/strings_ja.arb | 8 +- res/values/strings_ko.arb | 8 +- res/values/strings_nl.arb | 8 +- res/values/strings_pl.arb | 8 +- res/values/strings_pt.arb | 8 +- res/values/strings_ru.arb | 8 +- res/values/strings_uk.arb | 8 +- res/values/strings_zh.arb | 8 +- 15 files changed, 142 insertions(+), 95 deletions(-) diff --git a/lib/generated/i18n.dart b/lib/generated/i18n.dart index 59799342b..131831347 100644 --- a/lib/generated/i18n.dart +++ b/lib/generated/i18n.dart @@ -143,13 +143,13 @@ class S implements WidgetsLocalizations { String get please_select => "Please select:"; String get please_try_to_connect_to_another_node => "Please try to connect to another node"; String get pre_seed_button_text => "I understand. Show me my seed"; - String pre_seed_description(int words) => "On the next page you will see a series of ${words} words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; String get pre_seed_title => "IMPORTANT"; String get private_key => "Private key"; String get public_key => "Public key"; String get receive => "Receive"; String get receive_amount => "Amount"; String get received => "Received"; + String get recipient_address => "Recipient address"; String get reconnect => "Reconnect"; String get reconnect_alert_text => "Are you sure you want to reconnect?"; String get reconnection => "Reconnection"; @@ -212,13 +212,12 @@ class S implements WidgetsLocalizations { String get send_error_currency => "Currency can only contain numbers"; String get send_error_minimum_value => "Minimum value of amount is 0.01"; String get send_estimated_fee => "Estimated fee:"; - String get send_fee => "Fee"; + String get send_fee => "Fee:"; String get send_got_it => "Got it"; String get send_name => "Name"; String get send_new => "New"; String get send_payment_id => "Payment ID (optional)"; String get send_sending => "Sending..."; - String send_success(String crypto) => "Your ${crypto} was successfully sent"; String get send_templates => "Templates"; String get send_title => "Send"; String get send_xmr => "Send XMR"; @@ -352,10 +351,12 @@ class S implements WidgetsLocalizations { String min_value(String value, String currency) => "Min: ${value} ${currency}"; String openalias_alert_content(String recipient_name) => "You will be sending funds to\n${recipient_name}"; String powered_by(String title) => "Powered by ${title}"; + String pre_seed_description(String words) => "On the next page you will see a series of ${words} words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app."; String provider_error(String provider) => "${provider} error"; String router_no_route(String name) => "No route defined for ${name}"; String send_address(String cryptoCurrency) => "${cryptoCurrency} address"; String send_priority(String transactionPriority) => "Currently the fee is set at ${transactionPriority} priority.\nTransaction priority can be adjusted in the settings"; + String send_success(String crypto) => "Your ${crypto} was successfully sent"; String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; String trade_details_copied(String title) => "${title} copied to Clipboard"; String trade_for_not_created(String title) => "Trade for ${title} is not created."; @@ -402,7 +403,7 @@ class $de extends S { @override String get transaction_sent => "Transaktion gesendet!"; @override - String get send_fee => "Gebühr"; + String get send_fee => "Gebühr:"; @override String get password => "Passwort"; @override @@ -514,8 +515,6 @@ class $de extends S { @override String get choose_wallet_currency => "Bitte wählen Sie die Brieftaschenwährung:"; @override - String pre_seed_description(int words) => "Auf der nächsten Seite sehen Sie eine Reihe von ${words} Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; - @override String get node_connection_successful => "Die Verbindung war erfolgreich"; @override String get confirm => "Bestätigen"; @@ -642,8 +641,6 @@ class $de extends S { @override String get trade_details_created_at => "Hergestellt in"; @override - String send_success(String crypto) => "Ihr ${crypto} wurde erfolgreich gesendet"; - @override String get settings_wallets => "Brieftaschen"; @override String get settings_only_transactions => "Nur Transaktionen"; @@ -976,6 +973,8 @@ class $de extends S { @override String get trade_state_btc_sent => "geschickt"; @override + String get recipient_address => "Empfängeradresse"; + @override String get address_book => "Adressbuch"; @override String get enter_your_pin => "PIN eingeben"; @@ -1016,6 +1015,8 @@ class $de extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "Handel für ${provider} wird nicht erstellt. Menge ist weniger als minimal: ${min} ${currency}"; @override + String pre_seed_description(String words) => "Auf der nächsten Seite sehen Sie eine Reihe von ${words} Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren."; + @override String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} von ${title} nicht gefunden."; @override String transaction_details_copied(String title) => "${title} in die Zwischenablage kopiert"; @@ -1032,6 +1033,8 @@ class $de extends S { @override String change_wallet_alert_content(String wallet_name) => "Möchten Sie die aktuelle Brieftasche in ändern ${wallet_name}?"; @override + String send_success(String crypto) => "Ihr ${crypto} wurde erfolgreich gesendet"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "Max: ${value} ${currency}"; @@ -1214,8 +1217,6 @@ class $hi extends S { @override String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:"; @override - String pre_seed_description(int words) => "अगले पेज पर आपको ${words} शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; - @override String get node_connection_successful => "कनेक्शन सफल रहा"; @override String get confirm => "की पुष्टि करें"; @@ -1342,8 +1343,6 @@ class $hi extends S { @override String get trade_details_created_at => "पर बनाया गया"; @override - String send_success(String crypto) => "आपका ${crypto} सफलतापूर्वक भेजा गया"; - @override String get settings_wallets => "पर्स"; @override String get settings_only_transactions => "केवल लेन-देन"; @@ -1676,6 +1675,8 @@ class $hi extends S { @override String get trade_state_btc_sent => "भेज दिया"; @override + String get recipient_address => "प्राप्तकर्ता का पता"; + @override String get address_book => "पता पुस्तिका"; @override String get enter_your_pin => "अपना पिन दर्ज करो"; @@ -1716,6 +1717,8 @@ class $hi extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "व्यापार ${provider} के लिए नहीं बनाया गया है। राशि कम है तो न्यूनतम: ${min} ${currency}"; @override + String pre_seed_description(String words) => "अगले पेज पर आपको ${words} शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।"; + @override String trade_id_not_found(String tradeId, String title) => "व्यापार ${tradeId} of ${title} नहीं मिला."; @override String transaction_details_copied(String title) => "${title} क्लिपबोर्ड पर नकल"; @@ -1732,6 +1735,8 @@ class $hi extends S { @override String change_wallet_alert_content(String wallet_name) => "क्या आप करंट वॉलेट को बदलना चाहते हैं ${wallet_name}?"; @override + String send_success(String crypto) => "आपका ${crypto} सफलतापूर्वक भेजा गया"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "मैक्स: ${value} ${currency}"; @@ -1802,7 +1807,7 @@ class $ru extends S { @override String get transaction_sent => "Tранзакция отправлена!"; @override - String get send_fee => "Комиссия"; + String get send_fee => "Комиссия:"; @override String get password => "Пароль"; @override @@ -1914,8 +1919,6 @@ class $ru extends S { @override String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:"; @override - String pre_seed_description(int words) => "На следующей странице вы увидите серию из ${words} слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; - @override String get node_connection_successful => "Подключение прошло успешно"; @override String get confirm => "Подтвердить"; @@ -2042,8 +2045,6 @@ class $ru extends S { @override String get trade_details_created_at => "Создано"; @override - String send_success(String crypto) => "Ваш ${crypto} был успешно отправлен"; - @override String get settings_wallets => "Кошельки"; @override String get settings_only_transactions => "Транзакции"; @@ -2376,6 +2377,8 @@ class $ru extends S { @override String get trade_state_btc_sent => "BTC отправлены"; @override + String get recipient_address => "Адрес получателя"; + @override String get address_book => "Адресная книга"; @override String get enter_your_pin => "Введите ваш PIN"; @@ -2416,6 +2419,8 @@ class $ru extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "Сделка для ${provider} не создана. Сумма меньше минимальной: ${min} ${currency}"; @override + String pre_seed_description(String words) => "На следующей странице вы увидите серию из ${words} слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet."; + @override String trade_id_not_found(String tradeId, String title) => "Сделка ${tradeId} ${title} не найдена."; @override String transaction_details_copied(String title) => "${title} скопировано в буфер обмена"; @@ -2432,6 +2437,8 @@ class $ru extends S { @override String change_wallet_alert_content(String wallet_name) => "Вы хотите изменить текущий кошелек на ${wallet_name}?"; @override + String send_success(String crypto) => "Ваш ${crypto} был успешно отправлен"; + @override String time(String minutes, String seconds) => "${minutes}мин ${seconds}сек"; @override String max_value(String value, String currency) => "Макс: ${value} ${currency}"; @@ -2502,7 +2509,7 @@ class $ko extends S { @override String get transaction_sent => "거래가 전송되었습니다!"; @override - String get send_fee => "회비"; + String get send_fee => "회비:"; @override String get password => "암호"; @override @@ -2614,8 +2621,6 @@ class $ko extends S { @override String get choose_wallet_currency => "지갑 통화를 선택하십시오:"; @override - String pre_seed_description(int words) => "다음 페이지에서 ${words} 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; - @override String get node_connection_successful => "성공적으로 연결되었습니다."; @override String get confirm => "확인"; @@ -2742,8 +2747,6 @@ class $ko extends S { @override String get trade_details_created_at => "에 작성"; @override - String send_success(String crypto) => "${crypto}가 성공적으로 전송되었습니다"; - @override String get settings_wallets => "지갑"; @override String get settings_only_transactions => "거래 만"; @@ -3076,6 +3079,8 @@ class $ko extends S { @override String get trade_state_btc_sent => "보냄"; @override + String get recipient_address => "받는 사람 주소"; + @override String get address_book => "주소록"; @override String get enter_your_pin => "PIN을 입력하십시오"; @@ -3116,6 +3121,8 @@ class $ko extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "거래 ${provider} 가 생성되지 않습니다. 금액이 최소보다 적습니다. ${min} ${currency}"; @override + String pre_seed_description(String words) => "다음 페이지에서 ${words} 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다."; + @override String trade_id_not_found(String tradeId, String title) => "무역 ${tradeId} 의 ${title} 찾을 수 없습니다."; @override String transaction_details_copied(String title) => "${title} 클립 보드에 복사"; @@ -3132,6 +3139,8 @@ class $ko extends S { @override String change_wallet_alert_content(String wallet_name) => "현재 지갑을 다음으로 변경 하시겠습니까 ${wallet_name}?"; @override + String send_success(String crypto) => "${crypto}가 성공적으로 전송되었습니다"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "맥스: ${value} ${currency}"; @@ -3202,7 +3211,7 @@ class $pt extends S { @override String get transaction_sent => "Transação enviada!"; @override - String get send_fee => "Taxa"; + String get send_fee => "Taxa:"; @override String get password => "Senha"; @override @@ -3314,8 +3323,6 @@ class $pt extends S { @override String get choose_wallet_currency => "Escolha a moeda da carteira:"; @override - String pre_seed_description(int words) => "Na próxima página, você verá uma série de ${words} palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; - @override String get node_connection_successful => "A conexão foi bem sucedida"; @override String get confirm => "Confirmar"; @@ -3442,8 +3449,6 @@ class $pt extends S { @override String get trade_details_created_at => "Criada em"; @override - String send_success(String crypto) => "Seu ${crypto} foi enviado com sucesso"; - @override String get settings_wallets => "Carteiras"; @override String get settings_only_transactions => "Somente transações"; @@ -3776,6 +3781,8 @@ class $pt extends S { @override String get trade_state_btc_sent => "BTC enviado"; @override + String get recipient_address => "Endereço do destinatário"; + @override String get address_book => "Livro de endereços"; @override String get enter_your_pin => "Insira seu PIN"; @@ -3816,6 +3823,8 @@ class $pt extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "A troca por ${provider} não é criada. O valor é menor que o mínimo: ${min} ${currency}"; @override + String pre_seed_description(String words) => "Na próxima página, você verá uma série de ${words} palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet."; + @override String trade_id_not_found(String tradeId, String title) => "A troca ${tradeId} de ${title} não foi encontrada."; @override String transaction_details_copied(String title) => "${title} copiados para a área de transferência"; @@ -3832,6 +3841,8 @@ class $pt extends S { @override String change_wallet_alert_content(String wallet_name) => "Quer mudar a carteira atual para ${wallet_name}?"; @override + String send_success(String crypto) => "Seu ${crypto} foi enviado com sucesso"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "Máx: ${value} ${currency}"; @@ -3902,7 +3913,7 @@ class $uk extends S { @override String get transaction_sent => "Tранзакцію відправлено!"; @override - String get send_fee => "Комісія"; + String get send_fee => "Комісія:"; @override String get password => "Пароль"; @override @@ -4014,8 +4025,6 @@ class $uk extends S { @override String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:"; @override - String pre_seed_description(int words) => "На наступній сторінці ви побачите серію з ${words} слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; - @override String get node_connection_successful => "З'єднання було успішним"; @override String get confirm => "Підтвердити"; @@ -4142,8 +4151,6 @@ class $uk extends S { @override String get trade_details_created_at => "Створено"; @override - String send_success(String crypto) => "Ваш ${crypto} успішно надісланий"; - @override String get settings_wallets => "Гаманці"; @override String get settings_only_transactions => "Транзакції"; @@ -4476,6 +4483,8 @@ class $uk extends S { @override String get trade_state_btc_sent => "BTC надіслано"; @override + String get recipient_address => "Адреса одержувача"; + @override String get address_book => "Адресна книга"; @override String get enter_your_pin => "Введіть ваш PIN"; @@ -4516,6 +4525,8 @@ class $uk extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "Операція для ${provider} не створена. Сума менша мінімальної: ${min} ${currency}"; @override + String pre_seed_description(String words) => "На наступній сторінці ви побачите серію з ${words} слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet."; + @override String trade_id_not_found(String tradeId, String title) => "Операція ${tradeId} ${title} не знайдена."; @override String transaction_details_copied(String title) => "${title} скопійовано в буфер обміну"; @@ -4532,6 +4543,8 @@ class $uk extends S { @override String change_wallet_alert_content(String wallet_name) => "Ви хочете змінити поточний гаманець на ${wallet_name}?"; @override + String send_success(String crypto) => "Ваш ${crypto} успішно надісланий"; + @override String time(String minutes, String seconds) => "${minutes}хв ${seconds}сек"; @override String max_value(String value, String currency) => "Макс: ${value} ${currency}"; @@ -4602,7 +4615,7 @@ class $ja extends S { @override String get transaction_sent => "トランザクションが送信されました!"; @override - String get send_fee => "費用"; + String get send_fee => "費用:"; @override String get password => "パスワード"; @override @@ -4714,8 +4727,6 @@ class $ja extends S { @override String get choose_wallet_currency => "ウォレット通貨を選択してください:"; @override - String pre_seed_description(int words) => "次のページでは、一連の${words}語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; - @override String get node_connection_successful => "接続に成功しました"; @override String get confirm => "確認する"; @@ -4842,8 +4853,6 @@ class $ja extends S { @override String get trade_details_created_at => "で作成"; @override - String send_success(String crypto) => "${crypto}が送信されました"; - @override String get settings_wallets => "財布"; @override String get settings_only_transactions => "トランザクションのみ"; @@ -5176,6 +5185,8 @@ class $ja extends S { @override String get trade_state_btc_sent => "送った"; @override + String get recipient_address => "受信者のアドレス"; + @override String get address_book => "住所録"; @override String get enter_your_pin => "PINを入力してください"; @@ -5216,6 +5227,8 @@ class $ja extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "${provider} の取引は作成されません。 金額は最小額より少ない: ${min} ${currency}"; @override + String pre_seed_description(String words) => "次のページでは、一連の${words}語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。"; + @override String trade_id_not_found(String tradeId, String title) => "トレード ${tradeId} of ${title} 見つかりません"; @override String transaction_details_copied(String title) => "${title} クリップボードにコピーしました"; @@ -5232,6 +5245,8 @@ class $ja extends S { @override String change_wallet_alert_content(String wallet_name) => "現在のウォレットをに変更しますか ${wallet_name}?"; @override + String send_success(String crypto) => "${crypto}が送信されました"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "マックス: ${value} ${currency}"; @@ -5306,7 +5321,7 @@ class $pl extends S { @override String get transaction_sent => "Transakcja wysłana!"; @override - String get send_fee => "Opłata"; + String get send_fee => "Opłata:"; @override String get password => "Hasło"; @override @@ -5418,8 +5433,6 @@ class $pl extends S { @override String get choose_wallet_currency => "Wybierz walutę portfela:"; @override - String pre_seed_description(int words) => "Na następnej stronie zobaczysz serię ${words} słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; - @override String get node_connection_successful => "Połączenie powiodło się"; @override String get confirm => "Potwierdzać"; @@ -5546,8 +5559,6 @@ class $pl extends S { @override String get trade_details_created_at => "Utworzono w"; @override - String send_success(String crypto) => "Twoje ${crypto} zostało pomyślnie wysłane"; - @override String get settings_wallets => "Portfele"; @override String get settings_only_transactions => "Tylko transakcje"; @@ -5880,6 +5891,8 @@ class $pl extends S { @override String get trade_state_btc_sent => "Wysłane"; @override + String get recipient_address => "Adres odbiorcy"; + @override String get address_book => "Książka adresowa"; @override String get enter_your_pin => "Wpisz Twój kod PIN"; @@ -5920,6 +5933,8 @@ class $pl extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "Wymiana dla ${provider} nie została utworzona. Kwota jest mniejsza niż minimalna: ${min} ${currency}"; @override + String pre_seed_description(String words) => "Na następnej stronie zobaczysz serię ${words} słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet."; + @override String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} of ${title} nie znaleziono."; @override String transaction_details_copied(String title) => "${title} skopiowane do schowka"; @@ -5936,6 +5951,8 @@ class $pl extends S { @override String change_wallet_alert_content(String wallet_name) => "Czy chcesz zmienić obecny portfel na ${wallet_name}?"; @override + String send_success(String crypto) => "Twoje ${crypto} zostało pomyślnie wysłane"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "Max: ${value} ${currency}"; @@ -6006,7 +6023,7 @@ class $es extends S { @override String get transaction_sent => "Transacción enviada!"; @override - String get send_fee => "Cuota"; + String get send_fee => "Cuota:"; @override String get password => "Contraseña"; @override @@ -6118,8 +6135,6 @@ class $es extends S { @override String get choose_wallet_currency => "Por favor, elija la moneda de la billetera:"; @override - String pre_seed_description(int words) => "En la página siguiente verá una serie de ${words} palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; - @override String get node_connection_successful => "La conexión fue exitosa"; @override String get confirm => "Confirmar"; @@ -6246,8 +6261,6 @@ class $es extends S { @override String get trade_details_created_at => "Creado en"; @override - String send_success(String crypto) => "Su ${crypto} fue enviado con éxito"; - @override String get settings_wallets => "Carteras"; @override String get settings_only_transactions => "Solo transacciones"; @@ -6580,6 +6593,8 @@ class $es extends S { @override String get trade_state_btc_sent => "Btc expedido"; @override + String get recipient_address => "Dirección del receptor"; + @override String get address_book => "Libreta de direcciones"; @override String get enter_your_pin => "Introduce tu PIN"; @@ -6620,6 +6635,8 @@ class $es extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "El comercio por ${provider} no se crea. La cantidad es menos que mínima: ${min} ${currency}"; @override + String pre_seed_description(String words) => "En la página siguiente verá una serie de ${words} palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet."; + @override String trade_id_not_found(String tradeId, String title) => "Comercio ${tradeId} de ${title} no encontrado."; @override String transaction_details_copied(String title) => "${title} Copiado al portapapeles"; @@ -6636,6 +6653,8 @@ class $es extends S { @override String change_wallet_alert_content(String wallet_name) => "¿Quieres cambiar la billetera actual a ${wallet_name}?"; @override + String send_success(String crypto) => "Su ${crypto} fue enviado con éxito"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "Max: ${value} ${currency}"; @@ -6706,7 +6725,7 @@ class $nl extends S { @override String get transaction_sent => "Transactie verzonden!"; @override - String get send_fee => "Vergoeding"; + String get send_fee => "Vergoeding:"; @override String get password => "Wachtwoord"; @override @@ -6818,8 +6837,6 @@ class $nl extends S { @override String get choose_wallet_currency => "Kies een portemonnee-valuta:"; @override - String pre_seed_description(int words) => "Op de volgende pagina ziet u een reeks van ${words} woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; - @override String get node_connection_successful => "Verbinding is gelukt"; @override String get confirm => "Bevestigen"; @@ -6946,8 +6963,6 @@ class $nl extends S { @override String get trade_details_created_at => "Gemaakt bij"; @override - String send_success(String crypto) => "Uw ${crypto} is succesvol verzonden"; - @override String get settings_wallets => "Portemonnee"; @override String get settings_only_transactions => "Alleen transacties"; @@ -7280,6 +7295,8 @@ class $nl extends S { @override String get trade_state_btc_sent => "Verzonden"; @override + String get recipient_address => "Adres ontvanger"; + @override String get address_book => "Adresboek"; @override String get enter_your_pin => "Voer uw pincode in"; @@ -7320,6 +7337,8 @@ class $nl extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "Ruil voor ${provider} is niet gemaakt. Bedrag is minder dan minimaal: ${min} ${currency}"; @override + String pre_seed_description(String words) => "Op de volgende pagina ziet u een reeks van ${words} woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app."; + @override String trade_id_not_found(String tradeId, String title) => "Handel ${tradeId} van ${title} niet gevonden."; @override String transaction_details_copied(String title) => "${title} gekopieerd naar het klembord"; @@ -7336,6 +7355,8 @@ class $nl extends S { @override String change_wallet_alert_content(String wallet_name) => "Wilt u de huidige portemonnee wijzigen in ${wallet_name}?"; @override + String send_success(String crypto) => "Uw ${crypto} is succesvol verzonden"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "Max: ${value} ${currency}"; @@ -7406,7 +7427,7 @@ class $zh extends S { @override String get transaction_sent => "交易已发送"; @override - String get send_fee => "費用"; + String get send_fee => "費用:"; @override String get password => "密码"; @override @@ -7518,8 +7539,6 @@ class $zh extends S { @override String get choose_wallet_currency => "請選擇錢包貨幣:"; @override - String pre_seed_description(int words) => "在下一頁上,您將看到一系列${words}個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; - @override String get node_connection_successful => "連接成功"; @override String get confirm => "确认"; @@ -7646,8 +7665,6 @@ class $zh extends S { @override String get trade_details_created_at => "创建于"; @override - String send_success(String crypto) => "你${crypto}已成功發送"; - @override String get settings_wallets => "皮夹"; @override String get settings_only_transactions => "仅交易"; @@ -7980,6 +7997,8 @@ class $zh extends S { @override String get trade_state_btc_sent => "已发送"; @override + String get recipient_address => "收件人地址"; + @override String get address_book => "地址簿"; @override String get enter_your_pin => "输入密码"; @@ -8020,6 +8039,8 @@ class $zh extends S { @override String error_text_minimal_limit(String provider, String min, String currency) => "未創建 ${provider} 交易。 金額少於最小值:${min} ${currency}"; @override + String pre_seed_description(String words) => "在下一頁上,您將看到一系列${words}個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。"; + @override String trade_id_not_found(String tradeId, String title) => "贸易方式 ${tradeId} 的 ${title} 未找到."; @override String transaction_details_copied(String title) => "${title} 复制到剪贴板"; @@ -8036,6 +8057,8 @@ class $zh extends S { @override String change_wallet_alert_content(String wallet_name) => "您要將當前的錢包更改為 ${wallet_name}?"; @override + String send_success(String crypto) => "你${crypto}已成功發送"; + @override String time(String minutes, String seconds) => "${minutes}m ${seconds}s"; @override String max_value(String value, String currency) => "最高: ${value} ${currency}"; diff --git a/lib/src/screens/seed/pre_seed_page.dart b/lib/src/screens/seed/pre_seed_page.dart index babbf33ec..03fc17425 100644 --- a/lib/src/screens/seed/pre_seed_page.dart +++ b/lib/src/screens/seed/pre_seed_page.dart @@ -49,7 +49,7 @@ class PreSeedPage extends BasePage { Padding( padding: EdgeInsets.only(top: 70, left: 16, right: 16), child: Text( - S.of(context).pre_seed_description(wordsCount), + S.of(context).pre_seed_description(wordsCount.toString()), textAlign: TextAlign.center, style: TextStyle( fontSize: 14, diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index cdcbb726f..dccbe8aab 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -630,7 +630,7 @@ class SendPage extends BasePage { feeValue: sendViewModel.pendingTransaction.feeFormatted, feeFiatAmount: sendViewModel.pendingTransactionFeeFiatAmount + ' ' + sendViewModel.fiat.title, - recipientTitle: 'Recipient address', + recipientTitle: S.of(context).recipient_address, recipientAddress: sendViewModel.address, rightButtonText: S.of(context).ok, leftButtonText: S.of(context).cancel, diff --git a/res/values/strings_de.arb b/res/values/strings_de.arb index ee47ace4c..0136da28b 100644 --- a/res/values/strings_de.arb +++ b/res/values/strings_de.arb @@ -212,7 +212,7 @@ "send_name" : "Name", "send_got_it" : "Ich habs", "send_sending" : "Senden...", - "send_success" : "Ihr Monero wurde erfolgreich gesendet", + "send_success" : "Ihr ${crypto} wurde erfolgreich gesendet", "settings_title" : "die Einstellungen", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Bitte warten Sie, bis Ihre Brieftasche synchronisiert ist", "pre_seed_title" : "WICHTIG", - "pre_seed_description" : "Auf der nächsten Seite sehen Sie eine Reihe von 25 Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren.", + "pre_seed_description" : "Auf der nächsten Seite sehen Sie eine Reihe von ${words} Wörtern. Dies ist Ihr einzigartiger und privater Samen und der EINZIGE Weg, um Ihren Geldbeutel im Falle eines Verlusts oder einer Fehlfunktion wiederherzustellen. Es liegt in IHRER Verantwortung, es aufzuschreiben und an einem sicheren Ort außerhalb der Cake Wallet App aufzubewahren.", "pre_seed_button_text" : "Ich verstehe. Zeig mir meinen Samen", "xmr_to_error" : "XMR.TO-Fehler", @@ -428,5 +428,7 @@ "color_theme" : "Farbthema", "light_theme" : "Licht", "bright_theme" : "Hell", - "dark_theme" : "Dunkel" + "dark_theme" : "Dunkel", + + "recipient_address" : "Empfängeradresse" } \ No newline at end of file diff --git a/res/values/strings_en.arb b/res/values/strings_en.arb index ee6925cc0..94dc0a842 100644 --- a/res/values/strings_en.arb +++ b/res/values/strings_en.arb @@ -212,7 +212,7 @@ "send_name" : "Name", "send_got_it" : "Got it", "send_sending" : "Sending...", - "send_success" : "Your Monero was successfully sent", + "send_success" : "Your ${crypto} was successfully sent", "settings_title" : "Settings", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Please wait until your wallet is synchronized", "pre_seed_title" : "IMPORTANT", - "pre_seed_description" : "On the next page you will see a series of 25 words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app.", + "pre_seed_description" : "On the next page you will see a series of ${words} words. This is your unique and private seed and it is the ONLY way to recover your wallet in case of loss or malfunction. It is YOUR responsibility to write it down and store it in a safe place outside of the Cake Wallet app.", "pre_seed_button_text" : "I understand. Show me my seed", "xmr_to_error" : "XMR.TO error", @@ -428,5 +428,7 @@ "color_theme" : "Color theme", "light_theme" : "Light", "bright_theme" : "Bright", - "dark_theme" : "Dark" + "dark_theme" : "Dark", + + "recipient_address" : "Recipient address" } \ No newline at end of file diff --git a/res/values/strings_es.arb b/res/values/strings_es.arb index 7483b75e0..7cb5da26f 100644 --- a/res/values/strings_es.arb +++ b/res/values/strings_es.arb @@ -212,7 +212,7 @@ "send_name" : "Nombre", "send_got_it" : "Entendido", "send_sending" : "Enviando...", - "send_success" : "Su Monero fue enviado con éxito", + "send_success" : "Su ${crypto} fue enviado con éxito", "settings_title" : "Configuraciones", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Espere hasta que su billetera esté sincronizada", "pre_seed_title" : "IMPORTANTE", - "pre_seed_description" : "En la página siguiente verá una serie de 25 palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet.", + "pre_seed_description" : "En la página siguiente verá una serie de ${words} palabras. Esta es su semilla única y privada y es la ÚNICA forma de recuperar su billetera en caso de pérdida o mal funcionamiento. Es SU responsabilidad escribirlo y guardarlo en un lugar seguro fuera de la aplicación Cake Wallet.", "pre_seed_button_text" : "Entiendo. Muéstrame mi semilla", "xmr_to_error" : "Error de XMR.TO", @@ -428,5 +428,7 @@ "color_theme" : "Tema de color", "light_theme" : "Ligera", "bright_theme" : "Brillante", - "dark_theme" : "Oscura" + "dark_theme" : "Oscura", + + "recipient_address" : "Dirección del receptor" } \ No newline at end of file diff --git a/res/values/strings_hi.arb b/res/values/strings_hi.arb index 21caa7c77..ef84307ba 100644 --- a/res/values/strings_hi.arb +++ b/res/values/strings_hi.arb @@ -212,7 +212,7 @@ "send_name" : "नाम", "send_got_it" : "समझ गया", "send_sending" : "भेजना...", - "send_success" : "आपका Monero सफलतापूर्वक भेजा गया", + "send_success" : "आपका ${crypto} सफलतापूर्वक भेजा गया", "settings_title" : "सेटिंग्स", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "कृपया प्रतीक्षा करें जब तक आपका बटुआ सिंक्रनाइज़ नहीं किया जाता है", "pre_seed_title" : "महत्वपूर्ण", - "pre_seed_description" : "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।", + "pre_seed_description" : "अगले पेज पर आपको ${words} शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।", "pre_seed_button_text" : "मै समझता हुँ। मुझे अपना बीज दिखाओ", "xmr_to_error" : "XMR.TO त्रुटि", @@ -428,5 +428,7 @@ "color_theme" : "रंग विषय", "light_theme" : "रोशनी", "bright_theme" : "उज्ज्वल", - "dark_theme" : "अंधेरा" + "dark_theme" : "अंधेरा", + + "recipient_address" : "प्राप्तकर्ता का पता" } \ No newline at end of file diff --git a/res/values/strings_ja.arb b/res/values/strings_ja.arb index eff9adf68..f5dae8b59 100644 --- a/res/values/strings_ja.arb +++ b/res/values/strings_ja.arb @@ -212,7 +212,7 @@ "send_name" : "名前", "send_got_it" : "とった", "send_sending" : "送信...", - "send_success" : "Moneroが送信されました", + "send_success" : "${crypto}が送信されました", "settings_title" : "設定", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "ウォレットが同期されるまでお待ちください", "pre_seed_title" : "重要", - "pre_seed_description" : "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。", + "pre_seed_description" : "次のページでは、一連の${words}語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。", "pre_seed_button_text" : "わかります。 種を見せて", "xmr_to_error" : "XMR.TOエラー", @@ -428,5 +428,7 @@ "color_theme" : "カラーテーマ", "light_theme" : "光", "bright_theme" : "明るい", - "dark_theme" : "闇" + "dark_theme" : "闇", + + "recipient_address" : "受信者のアドレス" } \ No newline at end of file diff --git a/res/values/strings_ko.arb b/res/values/strings_ko.arb index ed0e78da6..ca274f677 100644 --- a/res/values/strings_ko.arb +++ b/res/values/strings_ko.arb @@ -212,7 +212,7 @@ "send_name" : "이름", "send_got_it" : "알았다", "send_sending" : "배상...", - "send_success" : "Monero가 성공적으로 전송되었습니다", + "send_success" : "${crypto}가 성공적으로 전송되었습니다", "settings_title" : "설정", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "지갑이 동기화 될 때까지 기다리십시오", "pre_seed_title" : "중대한", - "pre_seed_description" : "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다.", + "pre_seed_description" : "다음 페이지에서 ${words} 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다.", "pre_seed_button_text" : "이해 했어요. 내 씨앗을 보여줘", "xmr_to_error" : "XMR.TO 오류", @@ -428,5 +428,7 @@ "color_theme" : "색상 테마", "light_theme" : "빛", "bright_theme" : "선명한", - "dark_theme" : "어두운" + "dark_theme" : "어두운", + + "recipient_address" : "받는 사람 주소" } \ No newline at end of file diff --git a/res/values/strings_nl.arb b/res/values/strings_nl.arb index b8d6a9ab4..bdab4452c 100644 --- a/res/values/strings_nl.arb +++ b/res/values/strings_nl.arb @@ -212,7 +212,7 @@ "send_name" : "Naam", "send_got_it" : "Ik snap het", "send_sending" : "Bezig met verzenden...", - "send_success" : "Uw Monero is succesvol verzonden", + "send_success" : "Uw ${crypto} is succesvol verzonden", "settings_title" : "Instellingen", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Wacht tot uw portemonnee is gesynchroniseerd", "pre_seed_title" : "BELANGRIJK", - "pre_seed_description" : "Op de volgende pagina ziet u een reeks van 25 woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app.", + "pre_seed_description" : "Op de volgende pagina ziet u een reeks van ${words} woorden. Dit is uw unieke en persoonlijke zaadje en het is de ENIGE manier om uw portemonnee te herstellen in geval van verlies of storing. Het is JOUW verantwoordelijkheid om het op te schrijven en op een veilige plaats op te slaan buiten de Cake Wallet app.", "pre_seed_button_text" : "Ik begrijp het. Laat me mijn zaad zien", "xmr_to_error" : "XMR.TO-fout", @@ -428,5 +428,7 @@ "color_theme" : "Kleur thema", "light_theme" : "Licht", "bright_theme" : "Helder", - "dark_theme" : "Donker" + "dark_theme" : "Donker", + + "recipient_address" : "Adres ontvanger" } \ No newline at end of file diff --git a/res/values/strings_pl.arb b/res/values/strings_pl.arb index 1fe58d723..99873614c 100644 --- a/res/values/strings_pl.arb +++ b/res/values/strings_pl.arb @@ -212,7 +212,7 @@ "send_name" : "Imię", "send_got_it" : "Rozumiem", "send_sending" : "Wysyłanie...", - "send_success" : "Twoje Monero zostało pomyślnie wysłane", + "send_success" : "Twoje ${crypto} zostało pomyślnie wysłane", "settings_title" : "Ustawienia", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Poczekaj, aż portfel zostanie zsynchronizowany", "pre_seed_title" : "WAŻNY", - "pre_seed_description" : "Na następnej stronie zobaczysz serię 25 słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet.", + "pre_seed_description" : "Na następnej stronie zobaczysz serię ${words} słów. To jest Twoje unikalne i prywatne ziarno i jest to JEDYNY sposób na odzyskanie portfela w przypadku utraty lub awarii. Twoim obowiązkiem jest zapisanie go i przechowywanie w bezpiecznym miejscu poza aplikacją Cake Wallet.", "pre_seed_button_text" : "Rozumiem. Pokaż mi moje nasienie", "xmr_to_error" : "Pomyłka XMR.TO", @@ -428,5 +428,7 @@ "color_theme" : "Motyw kolorystyczny", "light_theme" : "Lekki", "bright_theme" : "Jasny", - "dark_theme" : "Ciemny" + "dark_theme" : "Ciemny", + + "recipient_address" : "Adres odbiorcy" } \ No newline at end of file diff --git a/res/values/strings_pt.arb b/res/values/strings_pt.arb index 9049b824e..b8d3ba99d 100644 --- a/res/values/strings_pt.arb +++ b/res/values/strings_pt.arb @@ -212,7 +212,7 @@ "send_name" : "Nome", "send_got_it" : "Entendi", "send_sending" : "Enviando...", - "send_success" : "Seu Monero foi enviado com sucesso", + "send_success" : "Seu ${crypto} foi enviado com sucesso", "settings_title" : "Configurações", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Por favor, espere até que sua carteira seja sincronizada", "pre_seed_title" : "IMPORTANTE", - "pre_seed_description" : "Na próxima página, você verá uma série de 25 palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet.", + "pre_seed_description" : "Na próxima página, você verá uma série de ${words} palavras. Esta é a sua semente única e privada e é a ÚNICA maneira de recuperar sua carteira em caso de perda ou mau funcionamento. É SUA responsabilidade anotá-lo e armazená-lo em um local seguro fora do aplicativo Cake Wallet.", "pre_seed_button_text" : "Compreendo. Me mostre minha semente", "xmr_to_error" : "Erro XMR.TO", @@ -428,5 +428,7 @@ "color_theme" : "Tema de cor", "light_theme" : "Luz", "bright_theme" : "Brilhante", - "dark_theme" : "Sombria" + "dark_theme" : "Sombria", + + "recipient_address" : "Endereço do destinatário" } diff --git a/res/values/strings_ru.arb b/res/values/strings_ru.arb index f3e633512..120bcd3ab 100644 --- a/res/values/strings_ru.arb +++ b/res/values/strings_ru.arb @@ -212,7 +212,7 @@ "send_name" : "Имя", "send_got_it" : "Понял", "send_sending" : "Отправка...", - "send_success" : "Ваш Monero был успешно отправлен", + "send_success" : "Ваш ${crypto} был успешно отправлен", "settings_title" : "Настройки", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Подождите, пока ваш кошелек синхронизируется", "pre_seed_title" : "ВАЖНО", - "pre_seed_description" : "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet.", + "pre_seed_description" : "На следующей странице вы увидите серию из ${words} слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet.", "pre_seed_button_text" : "Понятно. Покажите мнемоническую фразу", "xmr_to_error" : "Ошибка XMR.TO", @@ -428,5 +428,7 @@ "color_theme" : "Цветовая тема", "light_theme" : "Светлая", "bright_theme" : "Яркая", - "dark_theme" : "Темная" + "dark_theme" : "Темная", + + "recipient_address" : "Адрес получателя" } \ No newline at end of file diff --git a/res/values/strings_uk.arb b/res/values/strings_uk.arb index d0906da4b..37b6b7e20 100644 --- a/res/values/strings_uk.arb +++ b/res/values/strings_uk.arb @@ -212,7 +212,7 @@ "send_name" : "Ім'я", "send_got_it" : "Зрозумів", "send_sending" : "Відправлення...", - "send_success" : "Ваш Monero успішно надісланий", + "send_success" : "Ваш ${crypto} успішно надісланий", "settings_title" : "Налаштування", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "Зачекайте, поки ваш гаманець не синхронізується", "pre_seed_title" : "ВАЖЛИВО", - "pre_seed_description" : "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet.", + "pre_seed_description" : "На наступній сторінці ви побачите серію з ${words} слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet.", "pre_seed_button_text" : "Зрозуміло. Покажіть мнемонічну фразу", "xmr_to_error" : "Помилка XMR.TO", @@ -428,5 +428,7 @@ "color_theme" : "Кольорова тема", "light_theme" : "Світла", "bright_theme" : "Яскрава", - "dark_theme" : "Темна" + "dark_theme" : "Темна", + + "recipient_address" : "Адреса одержувача" } \ No newline at end of file diff --git a/res/values/strings_zh.arb b/res/values/strings_zh.arb index 890a3b502..30b1c2c27 100644 --- a/res/values/strings_zh.arb +++ b/res/values/strings_zh.arb @@ -212,7 +212,7 @@ "send_name" : "名稱", "send_got_it" : "得到它了", "send_sending" : "正在發送...", - "send_success" : "你Monero已成功發送", + "send_success" : "你${crypto}已成功發送", "settings_title" : "设定值", @@ -415,7 +415,7 @@ "exchange_sync_alert_content" : "請等待,直到您的錢包同步", "pre_seed_title" : "重要", - "pre_seed_description" : "在下一頁上,您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。", + "pre_seed_description" : "在下一頁上,您將看到一系列${words}個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。", "pre_seed_button_text" : "我明白。 給我看我的種子", "xmr_to_error" : "XMR.TO錯誤", @@ -428,5 +428,7 @@ "color_theme" : "顏色主題", "light_theme" : "光", "bright_theme" : "亮", - "dark_theme" : "黑暗" + "dark_theme" : "黑暗", + + "recipient_address" : "收件人地址" } \ No newline at end of file From 74cdf7cd7fed7d80b99ef6cc5d965ed58effbe08 Mon Sep 17 00:00:00 2001 From: M Date: Wed, 30 Dec 2020 20:35:34 +0200 Subject: [PATCH 13/16] Changed of electrum servers list. Changed default electrum server. --- assets/electrum_server_list.yml | 2 +- lib/entities/default_settings_migration.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/assets/electrum_server_list.yml b/assets/electrum_server_list.yml index 661cadc9c..2b6649271 100644 --- a/assets/electrum_server_list.yml +++ b/assets/electrum_server_list.yml @@ -1,2 +1,2 @@ - - uri: electrumx.cakewallet.com:50002 \ No newline at end of file + uri: electrum.cakewallet.com:50002 \ No newline at end of file diff --git a/lib/entities/default_settings_migration.dart b/lib/entities/default_settings_migration.dart index 11e9fa863..94860d661 100644 --- a/lib/entities/default_settings_migration.dart +++ b/lib/entities/default_settings_migration.dart @@ -120,7 +120,7 @@ Future changeMoneroCurrentNodeToDefault( } Node getBitcoinDefaultElectrumServer({@required Box nodes}) { - final uri = 'electrumx.cakewallet.com:50002'; + final uri = 'electrum.cakewallet.com:50002'; return nodes.values .firstWhere((Node node) => node.uri == uri, orElse: () => null) ?? From 6288d8e05f16dde5283ba40e1b744ca9b4624bf4 Mon Sep 17 00:00:00 2001 From: M Date: Wed, 30 Dec 2020 20:49:40 +0200 Subject: [PATCH 14/16] Changed iOS project version to 4.1. --- ios/Runner.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 1992353af..5ce246e34 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -17,7 +17,7 @@ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ - /* Begin PBXFileReference section */ +/* Begin PBXFileReference section */ 0C44A7192518EF8000B570ED /* decrypt.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = decrypt.swift; sourceTree = ""; }; 0C9986A3251A932F00D566FD /* CryptoSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = CryptoSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; @@ -354,7 +354,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -494,7 +494,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( @@ -528,7 +528,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = 9; + CURRENT_PROJECT_VERSION = 10; DEVELOPMENT_TEAM = 32J6BB6VUS; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( From 2dc5489a8e27f8890a68134ecca05976ef06ed9b Mon Sep 17 00:00:00 2001 From: M Date: Fri, 1 Jan 2021 10:57:12 +0200 Subject: [PATCH 15/16] Changed project version to 4.1.0 + 26. --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 25dd08953..8c94d2272 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: Cake Wallet. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 4.0.94+25 +version: 4.1.0+26 environment: sdk: ">=2.7.0 <3.0.0" From 798d9a1edf24af6cfd60c22f5370c47306ecc19f Mon Sep 17 00:00:00 2001 From: M Date: Tue, 5 Jan 2021 20:31:03 +0200 Subject: [PATCH 16/16] Fixes --- lib/bitcoin/bitcoin_amount_format.dart | 34 +++++++-- .../bitcoin_transaction_credentials.dart | 2 +- lib/bitcoin/bitcoin_transaction_info.dart | 4 +- lib/bitcoin/bitcoin_wallet.dart | 40 ++++++----- lib/di.dart | 3 +- lib/main.dart | 1 + lib/src/screens/exchange/exchange_page.dart | 67 ++++++++++-------- .../exchange/widgets/exchange_card.dart | 70 ++++++++++++++----- lib/store/settings_store.dart | 2 +- .../exchange/exchange_view_model.dart | 41 ++++++++--- lib/view_model/send/send_view_model.dart | 2 +- 11 files changed, 181 insertions(+), 85 deletions(-) diff --git a/lib/bitcoin/bitcoin_amount_format.dart b/lib/bitcoin/bitcoin_amount_format.dart index 75db6c314..fa00387f1 100644 --- a/lib/bitcoin/bitcoin_amount_format.dart +++ b/lib/bitcoin/bitcoin_amount_format.dart @@ -1,3 +1,5 @@ +import 'dart:math'; + import 'package:intl/intl.dart'; import 'package:cake_wallet/entities/crypto_amount_format.dart'; @@ -7,10 +9,32 @@ final bitcoinAmountFormat = NumberFormat() ..maximumFractionDigits = bitcoinAmountLength ..minimumFractionDigits = 1; -String bitcoinAmountToString({int amount}) => - bitcoinAmountFormat.format(cryptoAmountToDouble(amount: amount, divider: bitcoinAmountDivider)); +String bitcoinAmountToString({int amount}) => bitcoinAmountFormat.format( + cryptoAmountToDouble(amount: amount, divider: bitcoinAmountDivider)); -double bitcoinAmountToDouble({int amount}) => cryptoAmountToDouble(amount: amount, divider: bitcoinAmountDivider); +double bitcoinAmountToDouble({int amount}) => + cryptoAmountToDouble(amount: amount, divider: bitcoinAmountDivider); -int doubleToBitcoinAmount(double amount) => - (amount * bitcoinAmountDivider).toInt(); \ No newline at end of file +int stringDoubleToBitcoinAmount(String amount) { + final splitted = amount.split(''); + final dotIndex = amount.indexOf('.'); + int result = 0; + + + for (var i = 0; i < splitted.length; i++) { + try { + if (dotIndex == i) { + continue; + } + + final char = splitted[i]; + final multiplier = dotIndex < i + ? bitcoinAmountDivider ~/ pow(10, (i - dotIndex)) + : (bitcoinAmountDivider * pow(10, (dotIndex - i -1))).toInt(); + final num = int.parse(char) * multiplier; + result += num; + } catch (_) {} + } + + return result; +} diff --git a/lib/bitcoin/bitcoin_transaction_credentials.dart b/lib/bitcoin/bitcoin_transaction_credentials.dart index 9e64634b3..40f7a7aa7 100644 --- a/lib/bitcoin/bitcoin_transaction_credentials.dart +++ b/lib/bitcoin/bitcoin_transaction_credentials.dart @@ -4,6 +4,6 @@ class BitcoinTransactionCredentials { BitcoinTransactionCredentials(this.address, this.amount, this.priority); final String address; - final double amount; + final String amount; TransactionPriority priority; } diff --git a/lib/bitcoin/bitcoin_transaction_info.dart b/lib/bitcoin/bitcoin_transaction_info.dart index f9051a5e0..fb1400c5e 100644 --- a/lib/bitcoin/bitcoin_transaction_info.dart +++ b/lib/bitcoin/bitcoin_transaction_info.dart @@ -47,7 +47,7 @@ class BitcoinTransactionInfo extends TransactionInfo { final out = vin['tx']['vout'][vout] as Map; final outAddresses = (out['scriptPubKey']['addresses'] as List)?.toSet(); - inputsAmount += doubleToBitcoinAmount(out['value'] as double ?? 0); + inputsAmount += stringDoubleToBitcoinAmount((out['value'] as double ?? 0).toString()); if (outAddresses?.intersection(addressesSet)?.isNotEmpty ?? false) { direction = TransactionDirection.outgoing; @@ -58,7 +58,7 @@ class BitcoinTransactionInfo extends TransactionInfo { final outAddresses = out['scriptPubKey']['addresses'] as List ?? []; final ntrs = outAddresses.toSet().intersection(addressesSet); - final value = doubleToBitcoinAmount(out['value'] as double ?? 0.0); + final value = stringDoubleToBitcoinAmount((out['value'] as double ?? 0.0).toString()); totalOutAmount += value; if ((direction == TransactionDirection.incoming && ntrs.isNotEmpty) || diff --git a/lib/bitcoin/bitcoin_wallet.dart b/lib/bitcoin/bitcoin_wallet.dart index 052440f1e..de5ef2119 100644 --- a/lib/bitcoin/bitcoin_wallet.dart +++ b/lib/bitcoin/bitcoin_wallet.dart @@ -116,6 +116,19 @@ abstract class BitcoinWalletBase extends WalletBase with Store { walletInfo: walletInfo); } + static int feeAmountForPriority(TransactionPriority priority) { + switch (priority) { + case TransactionPriority.slow: + return 6000; + case TransactionPriority.regular: + return 22080; + case TransactionPriority.fast: + return 24000; + default: + return 0; + } + } + @override final BitcoinTransactionHistory transactionHistory; final String path; @@ -243,16 +256,20 @@ abstract class BitcoinWalletBase extends WalletBase with Store { Object credentials) async { final transactionCredentials = credentials as BitcoinTransactionCredentials; final inputs = []; - final fee = _feeMultiplier(transactionCredentials.priority); + final fee = feeAmountForPriority(transactionCredentials.priority); final amount = transactionCredentials.amount != null - ? doubleToBitcoinAmount(transactionCredentials.amount) - : balance.total - fee; + ? stringDoubleToBitcoinAmount(transactionCredentials.amount) + : balance.availableBalance - fee; final totalAmount = amount + fee; final txb = bitcoin.TransactionBuilder(network: bitcoin.bitcoin); - var leftAmount = totalAmount; final changeAddress = address; + var leftAmount = totalAmount; var totalInputAmount = 0; + if (totalAmount > balance.availableBalance) { + throw BitcoinTransactionWrongBalanceException(); + } + final unspent = addresses.map((address) => eclient .getListUnspentWithAddress(address.address) .then((unspent) => unspent @@ -334,7 +351,7 @@ abstract class BitcoinWalletBase extends WalletBase with Store { @override double calculateEstimatedFee(TransactionPriority priority) => - bitcoinAmountToDouble(amount: _feeMultiplier(priority)); + bitcoinAmountToDouble(amount: feeAmountForPriority(priority)); @override Future save() async { @@ -386,17 +403,4 @@ abstract class BitcoinWalletBase extends WalletBase with Store { String _getAddress({@required int index}) => generateAddress(hd: hd, index: index); - - int _feeMultiplier(TransactionPriority priority) { - switch (priority) { - case TransactionPriority.slow: - return 6000; - case TransactionPriority.regular: - return 22080; - case TransactionPriority.fast: - return 24000; - default: - return 0; - } - } } diff --git a/lib/di.dart b/lib/di.dart index 0a6646e5d..03038f8c5 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -355,7 +355,8 @@ Future setup( getIt.get().wallet, tradesSource, getIt.get(), - getIt.get())); + getIt.get(), + getIt.get().settingsStore)); getIt.registerFactory(() => ExchangeTradeViewModel( wallet: getIt.get().wallet, diff --git a/lib/main.dart b/lib/main.dart index 38460fcca..6c1c3127a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,3 +1,4 @@ +import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; import 'package:cake_wallet/themes/theme_base.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; diff --git a/lib/src/screens/exchange/exchange_page.dart b/lib/src/screens/exchange/exchange_page.dart index e085d7880..8cedc8c7e 100644 --- a/lib/src/screens/exchange/exchange_page.dart +++ b/lib/src/screens/exchange/exchange_page.dart @@ -62,10 +62,11 @@ class ExchangePage extends BasePage { @override Widget trailing(BuildContext context) => TrailButton( - caption: S.of(context).reset, onPressed: () { + caption: S.of(context).reset, + onPressed: () { _formKey.currentState.reset(); exchangeViewModel.reset(); - }); + }); @override Widget body(BuildContext context) { @@ -95,8 +96,8 @@ class ExchangePage extends BasePage { return KeyboardActions( config: KeyboardActionsConfig( keyboardActionsPlatform: KeyboardActionsPlatform.IOS, - keyboardBarColor: Theme.of(context).accentTextTheme.body2 - .backgroundColor, + keyboardBarColor: + Theme.of(context).accentTextTheme.body2.backgroundColor, nextFocus: false, actions: [ KeyboardActionsItem( @@ -160,6 +161,11 @@ class ExchangePage extends BasePage { padding: EdgeInsets.fromLTRB(24, 100, 24, 32), child: Observer( builder: (_) => ExchangeCard( + hasAllAmount: exchangeViewModel.hasAllAmount, + allAmount: exchangeViewModel.hasAllAmount + ? () => exchangeViewModel + .calculateDepositAllAmount() + : null, amountFocusNode: _depositAmountFocus, key: depositKey, title: S.of(context).you_will_send, @@ -394,30 +400,35 @@ class ExchangePage extends BasePage { }), ), Observer( - builder: (_) => LoadingPrimaryButton( - text: S.of(context).exchange, - onPressed: () { - if (_formKey.currentState.validate()) { - if ((exchangeViewModel.depositCurrency == CryptoCurrency.xmr) - &&(!(exchangeViewModel.status is SyncedSyncStatus))) { - showPopUp( - context: context, - builder: (BuildContext context) { - return AlertWithOneAction( - alertTitle: S.of(context).exchange, - alertContent: S.of(context).exchange_sync_alert_content, - buttonText: S.of(context).ok, - buttonAction: () => Navigator.of(context).pop()); - }); - } else { - exchangeViewModel.createTrade(); - } - } - }, - color: Theme.of(context).accentTextTheme.body2.color, - textColor: Colors.white, - isLoading: exchangeViewModel.tradeState - is TradeIsCreating)), + builder: (_) => LoadingPrimaryButton( + text: S.of(context).exchange, + onPressed: () { + if (_formKey.currentState.validate()) { + if ((exchangeViewModel.depositCurrency == + CryptoCurrency.xmr) && + (!(exchangeViewModel.status + is SyncedSyncStatus))) { + showPopUp( + context: context, + builder: (BuildContext context) { + return AlertWithOneAction( + alertTitle: S.of(context).exchange, + alertContent: S + .of(context) + .exchange_sync_alert_content, + buttonText: S.of(context).ok, + buttonAction: () => + Navigator.of(context).pop()); + }); + } else { + exchangeViewModel.createTrade(); + } + } + }, + color: Theme.of(context).accentTextTheme.body2.color, + textColor: Colors.white, + isLoading: + exchangeViewModel.tradeState is TradeIsCreating)), ]), )), )); diff --git a/lib/src/screens/exchange/widgets/exchange_card.dart b/lib/src/screens/exchange/widgets/exchange_card.dart index 45f6f475c..062e5a1c3 100644 --- a/lib/src/screens/exchange/widgets/exchange_card.dart +++ b/lib/src/screens/exchange/widgets/exchange_card.dart @@ -27,7 +27,9 @@ class ExchangeCard extends StatefulWidget { this.borderColor = Colors.transparent, this.currencyValueValidator, this.addressTextFieldValidator, - this.amountFocusNode}) + this.amountFocusNode, + this.hasAllAmount = false, + this.allAmount}) : super(key: key); final List currencies; @@ -47,6 +49,8 @@ class ExchangeCard extends StatefulWidget { final FormFieldValidator currencyValueValidator; final FormFieldValidator addressTextFieldValidator; final FocusNode amountFocusNode; + final bool hasAllAmount; + Function allAmount; @override ExchangeCardState createState() => ExchangeCardState(); @@ -197,7 +201,36 @@ class ExchangeCardState extends State { ]), ), ), - ) + ), + if (widget.hasAllAmount) + Positioned( + top: 5, + right: 55, + child: Container( + height: 32, + width: 32, + margin: EdgeInsets.only(left: 14, top: 4, bottom: 10), + decoration: BoxDecoration( + color: Theme.of(context) + .primaryTextTheme + .display1 + .color, + borderRadius: BorderRadius.all(Radius.circular(6))), + child: InkWell( + onTap: () => widget.allAmount?.call(), + child: Center( + child: Text(S.of(context).all, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.bold, + color: Theme.of(context) + .primaryTextTheme + .display1 + .decorationColor)), + ), + ), + )) ], )), Padding( @@ -232,18 +265,17 @@ class ExchangeCardState extends State { ), !_isAddressEditable && widget.hasRefundAddress ? Padding( - padding: EdgeInsets.only(top: 20), - child: Text( - S.of(context).refund_address, - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w500, - color: - Theme.of(context) - .accentTextTheme - .display4 - .decorationColor), - )) + padding: EdgeInsets.only(top: 20), + child: Text( + S.of(context).refund_address, + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.w500, + color: Theme.of(context) + .accentTextTheme + .display4 + .decorationColor), + )) : Offstage(), _isAddressEditable ? Padding( @@ -251,7 +283,8 @@ class ExchangeCardState extends State { child: AddressTextField( controller: addressController, placeholder: widget.hasRefundAddress - ? S.of(context).refund_address : null, + ? S.of(context).refund_address + : null, options: [ AddressTextFieldOption.paste, AddressTextFieldOption.qrCode, @@ -265,8 +298,7 @@ class ExchangeCardState extends State { hintStyle: TextStyle( fontSize: 16, fontWeight: FontWeight.w600, - color: - Theme.of(context) + color: Theme.of(context) .accentTextTheme .display4 .decorationColor), @@ -281,8 +313,8 @@ class ExchangeCardState extends State { onTap: () { Clipboard.setData( ClipboardData(text: addressController.text)); - showBar(context, - S.of(context).copied_to_clipboard); + showBar( + context, S.of(context).copied_to_clipboard); }, child: Row( mainAxisSize: MainAxisSize.max, diff --git a/lib/store/settings_store.dart b/lib/store/settings_store.dart index 30cf4f238..4d535228b 100644 --- a/lib/store/settings_store.dart +++ b/lib/store/settings_store.dart @@ -153,7 +153,7 @@ abstract class SettingsStoreBase with Store { .getBool(PreferencesKey.allowBiometricalAuthenticationKey) ?? false; final legacyTheme = - sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy) + (sharedPreferences.getBool(PreferencesKey.isDarkThemeLegacy) ?? false) ? ThemeType.dark.index : ThemeType.bright.index; final savedTheme = ThemeList.deserialize( diff --git a/lib/view_model/exchange/exchange_view_model.dart b/lib/view_model/exchange/exchange_view_model.dart index e533e1e93..d2ac05048 100644 --- a/lib/view_model/exchange/exchange_view_model.dart +++ b/lib/view_model/exchange/exchange_view_model.dart @@ -1,3 +1,5 @@ +import 'package:cake_wallet/bitcoin/bitcoin_amount_format.dart'; +import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart'; import 'package:cake_wallet/core/wallet_base.dart'; import 'package:cake_wallet/entities/crypto_currency.dart'; import 'package:cake_wallet/entities/sync_status.dart'; @@ -7,6 +9,7 @@ import 'package:cake_wallet/exchange/limits.dart'; import 'package:cake_wallet/exchange/trade.dart'; import 'package:cake_wallet/exchange/limits_state.dart'; import 'package:cake_wallet/store/dashboard/trades_store.dart'; +import 'package:cake_wallet/store/settings_store.dart'; import 'package:intl/intl.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/generated/i18n.dart'; @@ -27,8 +30,8 @@ part 'exchange_view_model.g.dart'; class ExchangeViewModel = ExchangeViewModelBase with _$ExchangeViewModel; abstract class ExchangeViewModelBase with Store { - ExchangeViewModelBase( - this.wallet, this.trades, this._exchangeTemplateStore, this.tradesStore) { + ExchangeViewModelBase(this.wallet, this.trades, this._exchangeTemplateStore, + this.tradesStore, this._settingsStore) { providerList = [ XMRTOExchangeProvider(), ChangeNowExchangeProvider(), @@ -104,10 +107,6 @@ abstract class ExchangeViewModelBase with Store { @observable bool isReceiveAmountEntered; - Limits limits; - - NumberFormat _cryptoNumberFormat; - @computed SyncStatus get status => wallet.syncStatus; @@ -115,6 +114,15 @@ abstract class ExchangeViewModelBase with Store { ObservableList get templates => _exchangeTemplateStore.templates; + bool get hasAllAmount => + wallet.type == WalletType.bitcoin && depositCurrency == wallet.currency; + + Limits limits; + + NumberFormat _cryptoNumberFormat; + + SettingsStore _settingsStore; + @action void changeProvider({ExchangeProvider provider}) { this.provider = provider; @@ -264,9 +272,8 @@ abstract class ExchangeViewModelBase with Store { await trades.add(trade); tradeState = TradeIsCreatedSuccessfully(trade: trade); } catch (e) { - tradeState = TradeIsCreatedFailure( - title: provider.title, - error: e.toString()); + tradeState = + TradeIsCreatedFailure(title: provider.title, error: e.toString()); } } } else { @@ -291,6 +298,22 @@ abstract class ExchangeViewModelBase with Store { _onPairChange(); } + @action + void calculateDepositAllAmount() { + if (wallet is BitcoinWallet) { + final availableBalance = wallet.balance.availableBalance as int; + final fee = BitcoinWalletBase.feeAmountForPriority( + _settingsStore.transactionPriority); + + if (availableBalance < fee || availableBalance == 0) { + return; + } + + final amount = availableBalance - fee; + depositAmount = bitcoinAmountToString(amount: amount); + } + } + void updateTemplate() => _exchangeTemplateStore.update(); void addTemplate( diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index f3d46ccb3..4fec6aade 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -197,7 +197,7 @@ abstract class SendViewModelBase with Store { switch (_wallet.type) { case WalletType.bitcoin: - final amount = !sendAll ? double.parse(_amount) : null; + final amount = !sendAll ? _amount : null; return BitcoinTransactionCredentials( address, amount, _settingsStore.transactionPriority);