Merge branch 'new-world' into CAKE-97-date-picker-for-ios

# Conflicts:
#	pubspec.lock
This commit is contained in:
OleksandrSobol 2020-10-05 21:10:41 +03:00
commit 0f9b509530
32 changed files with 430 additions and 362 deletions

View file

@ -175,6 +175,7 @@ extern "C"
Monero::SubaddressAccount *m_account; Monero::SubaddressAccount *m_account;
uint64_t m_last_known_wallet_height; uint64_t m_last_known_wallet_height;
uint64_t m_cached_syncing_blockchain_height = 0; uint64_t m_cached_syncing_blockchain_height = 0;
std::mutex store_mutex;
void change_current_wallet(Monero::Wallet *wallet) void change_current_wallet(Monero::Wallet *wallet)
@ -293,6 +294,7 @@ extern "C"
void load_wallet(char *path, char *password, int32_t nettype) void load_wallet(char *path, char *password, int32_t nettype)
{ {
nice(19);
Monero::NetworkType networkType = static_cast<Monero::NetworkType>(nettype); Monero::NetworkType networkType = static_cast<Monero::NetworkType>(nettype);
Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->openWallet(std::string(path), std::string(password), networkType); Monero::Wallet *wallet = Monero::WalletManagerFactory::getWalletManager()->openWallet(std::string(path), std::string(password), networkType);
change_current_wallet(wallet); change_current_wallet(wallet);
@ -429,7 +431,9 @@ extern "C"
void store(char *path) void store(char *path)
{ {
store_mutex.lock();
get_current_wallet()->store(std::string(path)); get_current_wallet()->store(std::string(path));
store_mutex.unlock();
} }
bool transaction_create(char *address, char *payment_id, char *amount, bool transaction_create(char *address, char *payment_id, char *amount,

View file

@ -1 +0,0 @@
4dc2ef1ba73deeed13cd85894dacb10b

View file

@ -354,7 +354,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 32J6BB6VUS; DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -493,7 +493,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 32J6BB6VUS; DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -526,7 +526,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 3; CURRENT_PROJECT_VERSION = 4;
DEVELOPMENT_TEAM = 32J6BB6VUS; DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (

View file

@ -61,6 +61,7 @@ import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'package:hive/hive.dart'; import 'package:hive/hive.dart';
import 'package:mobx/mobx.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart'; import 'package:cake_wallet/view_model/wallet_restoration_from_seed_vm.dart';
@ -177,11 +178,25 @@ Future setup(
BiometricAuth())); BiometricAuth()));
getIt.registerFactory<AuthPage>( getIt.registerFactory<AuthPage>(
() => AuthPage(getIt.get<AuthViewModel>(), () => AuthPage(getIt.get<AuthViewModel>(), onAuthenticationFinished:
onAuthenticationFinished: (isAuthenticated, __) { (isAuthenticated, AuthPageState authPageState) {
if (isAuthenticated) { if (!isAuthenticated) {
getIt.get<AuthenticationStore>().allowed(); return;
} }
final authStore = getIt.get<AuthenticationStore>();
final appStore = getIt.get<AppStore>();
if (appStore.wallet != null) {
authStore.allowed();
return;
}
authPageState.changeProcessText('Loading the wallet');
ReactionDisposer _reaction;
_reaction = reaction((_) => appStore.wallet, (Object _) {
_reaction?.reaction?.dispose();
authStore.allowed();
});
}, closable: false), }, closable: false),
instanceName: 'login'); instanceName: 'login');

View file

@ -97,7 +97,7 @@ class S implements WidgetsLocalizations {
String get faq => "FAQ"; String get faq => "FAQ";
String get fetching => "Fetching"; String get fetching => "Fetching";
String get filters => "Filter"; String get filters => "Filter";
String get first_wallet_text => "Awesome wallet for Monero"; String get first_wallet_text => "Awesome wallet for Monero and Bitcoin";
String get full_balance => "Full Balance"; String get full_balance => "Full Balance";
String get hidden_balance => "Hidden Balance"; String get hidden_balance => "Hidden Balance";
String get id => "ID: "; String get id => "ID: ";
@ -303,9 +303,9 @@ class S implements WidgetsLocalizations {
String get widgets_restore_from_blockheight => "Restore from blockheight"; String get widgets_restore_from_blockheight => "Restore from blockheight";
String get widgets_restore_from_date => "Restore from date"; String get widgets_restore_from_date => "Restore from date";
String get widgets_seed => "Seed"; String get widgets_seed => "Seed";
String get xmr_available_balance => "XMR Available Balance"; String get xmr_available_balance => "Available Balance";
String get xmr_full_balance => "XMR Full Balance"; String get xmr_full_balance => "Full Balance";
String get xmr_hidden => "XMR Hidden"; String get xmr_hidden => "Hidden";
String get yesterday => "Yesterday"; String get yesterday => "Yesterday";
String get you_will_get => "You will get"; String get you_will_get => "You will get";
String get you_will_send => "You will send"; String get you_will_send => "You will send";
@ -539,7 +539,7 @@ class $de extends S {
@override @override
String get restore_seed_keys_restore => "Seed / Schlüssel wiederherstellen"; String get restore_seed_keys_restore => "Seed / Schlüssel wiederherstellen";
@override @override
String get xmr_hidden => "XMR versteckt"; String get xmr_hidden => "Versteckt";
@override @override
String get send_xmr => "Senden XMR"; String get send_xmr => "Senden XMR";
@override @override
@ -635,7 +635,7 @@ class $de extends S {
@override @override
String get error_text_xmr => "Der XMR-Wert kann das verfügbare Guthaben nicht überschreiten.\nDie Anzahl der Nachkommastellen muss kleiner oder gleich 12 sein"; String get error_text_xmr => "Der XMR-Wert kann das verfügbare Guthaben nicht überschreiten.\nDie Anzahl der Nachkommastellen muss kleiner oder gleich 12 sein";
@override @override
String get xmr_available_balance => "XMR verfügbares Guthaben"; String get xmr_available_balance => "Verfügbares Guthaben";
@override @override
String get restore_bitcoin_description_from_keys => "Stellen Sie Ihre Brieftasche aus der generierten WIF-Zeichenfolge aus Ihren privaten Schlüsseln wieder her"; String get restore_bitcoin_description_from_keys => "Stellen Sie Ihre Brieftasche aus der generierten WIF-Zeichenfolge aus Ihren privaten Schlüsseln wieder her";
@override @override
@ -799,7 +799,7 @@ class $de extends S {
@override @override
String get all => "ALLE"; String get all => "ALLE";
@override @override
String get xmr_full_balance => "XMR Volle Balance"; String get xmr_full_balance => "Volle Balance";
@override @override
String get incoming => "Eingehend"; String get incoming => "Eingehend";
@override @override
@ -1181,7 +1181,7 @@ class $hi extends S {
@override @override
String get restore_seed_keys_restore => "बीज / कुंजी पुनर्स्थापित करें"; String get restore_seed_keys_restore => "बीज / कुंजी पुनर्स्थापित करें";
@override @override
String get xmr_hidden => "XMR छिपा हुआ"; String get xmr_hidden => "छिपा हुआ";
@override @override
String get send_xmr => "संदेश XMR"; String get send_xmr => "संदेश XMR";
@override @override
@ -1277,7 +1277,7 @@ class $hi extends S {
@override @override
String get error_text_xmr => "एक्सएमआर मूल्य उपलब्ध शेष राशि से अधिक नहीं हो सकता.\nअंश अंकों की संख्या 12 से कम या इसके बराबर होनी चाहिए"; String get error_text_xmr => "एक्सएमआर मूल्य उपलब्ध शेष राशि से अधिक नहीं हो सकता.\nअंश अंकों की संख्या 12 से कम या इसके बराबर होनी चाहिए";
@override @override
String get xmr_available_balance => "XMR उपलब्ध शेष राशि"; String get xmr_available_balance => "उपलब्ध शेष राशि";
@override @override
String get restore_bitcoin_description_from_keys => "अपने निजी कुंजी से उत्पन्न WIF स्ट्रिंग से अपने वॉलेट को पुनर्स्थापित करें"; String get restore_bitcoin_description_from_keys => "अपने निजी कुंजी से उत्पन्न WIF स्ट्रिंग से अपने वॉलेट को पुनर्स्थापित करें";
@override @override
@ -1441,7 +1441,7 @@ class $hi extends S {
@override @override
String get all => "सब"; String get all => "सब";
@override @override
String get xmr_full_balance => "XMR पूर्ण संतुलन"; String get xmr_full_balance => "पूरा संतुलन";
@override @override
String get incoming => "आने वाली"; String get incoming => "आने वाली";
@override @override
@ -1823,7 +1823,7 @@ class $ru extends S {
@override @override
String get restore_seed_keys_restore => "Восстановить из мнемонической фразы/ключей"; String get restore_seed_keys_restore => "Восстановить из мнемонической фразы/ключей";
@override @override
String get xmr_hidden => "XMR Скрыто"; String get xmr_hidden => "Скрыто";
@override @override
String get send_xmr => "Отправить XMR"; String get send_xmr => "Отправить XMR";
@override @override
@ -1919,7 +1919,7 @@ class $ru extends S {
@override @override
String get error_text_xmr => "Значение XMR не может превышать доступный баланс.\nКоличество цифр после запятой должно быть меньше или равно 12"; String get error_text_xmr => "Значение XMR не может превышать доступный баланс.\nКоличество цифр после запятой должно быть меньше или равно 12";
@override @override
String get xmr_available_balance => "Доступный XMR баланс"; String get xmr_available_balance => "Доступный баланс";
@override @override
String get restore_bitcoin_description_from_keys => "Вы можете восстановить кошелёк с помощью WIF"; String get restore_bitcoin_description_from_keys => "Вы можете восстановить кошелёк с помощью WIF";
@override @override
@ -2083,7 +2083,7 @@ class $ru extends S {
@override @override
String get all => "ВСЕ"; String get all => "ВСЕ";
@override @override
String get xmr_full_balance => "Весь XMR баланс"; String get xmr_full_balance => "Весь баланс";
@override @override
String get incoming => "Входящие"; String get incoming => "Входящие";
@override @override
@ -2465,7 +2465,7 @@ class $ko extends S {
@override @override
String get restore_seed_keys_restore => "종자 / 키 복원"; String get restore_seed_keys_restore => "종자 / 키 복원";
@override @override
String get xmr_hidden => "XMR 숨김"; String get xmr_hidden => "숨김";
@override @override
String get send_xmr => "보내다 XMR"; String get send_xmr => "보내다 XMR";
@override @override
@ -2561,7 +2561,7 @@ class $ko extends S {
@override @override
String get error_text_xmr => "XMR 값은 사용 가능한 잔액을 초과 할 수 없습니다.\n소수 자릿수는 12 이하 여야합니다"; String get error_text_xmr => "XMR 값은 사용 가능한 잔액을 초과 할 수 없습니다.\n소수 자릿수는 12 이하 여야합니다";
@override @override
String get xmr_available_balance => "XMR 사용 가능한 잔액"; String get xmr_available_balance => "사용 가능한 잔액";
@override @override
String get restore_bitcoin_description_from_keys => "개인 키에서 생성 된 WIF 문자열에서 지갑 복원"; String get restore_bitcoin_description_from_keys => "개인 키에서 생성 된 WIF 문자열에서 지갑 복원";
@override @override
@ -2725,7 +2725,7 @@ class $ko extends S {
@override @override
String get all => "모든"; String get all => "모든";
@override @override
String get xmr_full_balance => "XMR 풀 밸런스"; String get xmr_full_balance => "풀 밸런스";
@override @override
String get incoming => "들어오는"; String get incoming => "들어오는";
@override @override
@ -3203,7 +3203,7 @@ class $pt extends S {
@override @override
String get error_text_xmr => "A quantia em XMR não pode exceder o saldo disponível.\nTO número de dígitos decimais deve ser menor ou igual a 12"; String get error_text_xmr => "A quantia em XMR não pode exceder o saldo disponível.\nTO número de dígitos decimais deve ser menor ou igual a 12";
@override @override
String get xmr_available_balance => "Saldo XMR disponível"; String get xmr_available_balance => "Saldo disponível";
@override @override
String get restore_bitcoin_description_from_keys => "Restaure sua carteira a partir da string WIF gerada de suas chaves privadas"; String get restore_bitcoin_description_from_keys => "Restaure sua carteira a partir da string WIF gerada de suas chaves privadas";
@override @override
@ -3367,7 +3367,7 @@ class $pt extends S {
@override @override
String get all => "TUDO"; String get all => "TUDO";
@override @override
String get xmr_full_balance => "Saldo XMR total"; String get xmr_full_balance => "Saldo total";
@override @override
String get incoming => "Recebidas"; String get incoming => "Recebidas";
@override @override
@ -3749,7 +3749,7 @@ class $uk extends S {
@override @override
String get restore_seed_keys_restore => "Відновити за допомогою мнемонічної фрази/ключів"; String get restore_seed_keys_restore => "Відновити за допомогою мнемонічної фрази/ключів";
@override @override
String get xmr_hidden => "XMR Приховано"; String get xmr_hidden => "Приховано";
@override @override
String get send_xmr => "Відправити XMR"; String get send_xmr => "Відправити XMR";
@override @override
@ -3845,7 +3845,7 @@ class $uk extends S {
@override @override
String get error_text_xmr => "Значення XMR не може перевищувати доступний баланс.\nКількість цифр після коми повинно бути меншим або дорівнювати 12"; String get error_text_xmr => "Значення XMR не може перевищувати доступний баланс.\nКількість цифр після коми повинно бути меншим або дорівнювати 12";
@override @override
String get xmr_available_balance => "Доступний XMR баланс"; String get xmr_available_balance => "Доступний баланс";
@override @override
String get restore_bitcoin_description_from_keys => "Ви можете відновити гаманець за допомогою WIF"; String get restore_bitcoin_description_from_keys => "Ви можете відновити гаманець за допомогою WIF";
@override @override
@ -4009,7 +4009,7 @@ class $uk extends S {
@override @override
String get all => "ВСЕ"; String get all => "ВСЕ";
@override @override
String get xmr_full_balance => "Весь XMR баланс"; String get xmr_full_balance => "Весь баланс";
@override @override
String get incoming => "Вхідні"; String get incoming => "Вхідні";
@override @override
@ -4391,7 +4391,7 @@ class $ja extends S {
@override @override
String get restore_seed_keys_restore => "シード/キーの復元"; String get restore_seed_keys_restore => "シード/キーの復元";
@override @override
String get xmr_hidden => "XMR非表示"; String get xmr_hidden => "非表示";
@override @override
String get send_xmr => "送る XMR"; String get send_xmr => "送る XMR";
@override @override
@ -4487,7 +4487,7 @@ class $ja extends S {
@override @override
String get error_text_xmr => "XMR値は利用可能な残高を超えることはできません.\n小数桁数は12以下でなければなりません"; String get error_text_xmr => "XMR値は利用可能な残高を超えることはできません.\n小数桁数は12以下でなければなりません";
@override @override
String get xmr_available_balance => "XMR利用可能残高"; String get xmr_available_balance => "利用可能残高";
@override @override
String get restore_bitcoin_description_from_keys => "秘密鍵から生成されたWIF文字列からウォレットを復元します"; String get restore_bitcoin_description_from_keys => "秘密鍵から生成されたWIF文字列からウォレットを復元します";
@override @override
@ -4651,7 +4651,7 @@ class $ja extends S {
@override @override
String get all => "すべて"; String get all => "すべて";
@override @override
String get xmr_full_balance => "XMRフルバランス"; String get xmr_full_balance => "フルバランス";
@override @override
String get incoming => "着信"; String get incoming => "着信";
@override @override
@ -5037,7 +5037,7 @@ class $pl extends S {
@override @override
String get restore_seed_keys_restore => "Przywracanie nasion / kluczy"; String get restore_seed_keys_restore => "Przywracanie nasion / kluczy";
@override @override
String get xmr_hidden => "XMR Ukryty"; String get xmr_hidden => "Ukryty";
@override @override
String get send_xmr => "Wysłać XMR"; String get send_xmr => "Wysłać XMR";
@override @override
@ -5133,7 +5133,7 @@ class $pl extends S {
@override @override
String get error_text_xmr => "Wartość XMR nie może przekraczać dostępnego salda.\nLiczba cyfr ułamkowych musi być mniejsza lub równa 12"; String get error_text_xmr => "Wartość XMR nie może przekraczać dostępnego salda.\nLiczba cyfr ułamkowych musi być mniejsza lub równa 12";
@override @override
String get xmr_available_balance => "XMR Dostępne saldo"; String get xmr_available_balance => "Dostępne saldo";
@override @override
String get restore_bitcoin_description_from_keys => "Przywróć swój portfel z wygenerowanego ciągu WIF z kluczy prywatnych"; String get restore_bitcoin_description_from_keys => "Przywróć swój portfel z wygenerowanego ciągu WIF z kluczy prywatnych";
@override @override
@ -5297,7 +5297,7 @@ class $pl extends S {
@override @override
String get all => "WSZYSTKO"; String get all => "WSZYSTKO";
@override @override
String get xmr_full_balance => "XMR Pełna równowaga"; String get xmr_full_balance => "Pełna równowaga";
@override @override
String get incoming => "Przychodzące"; String get incoming => "Przychodzące";
@override @override
@ -5679,7 +5679,7 @@ class $es extends S {
@override @override
String get restore_seed_keys_restore => "Restauración de semillas / llaves"; String get restore_seed_keys_restore => "Restauración de semillas / llaves";
@override @override
String get xmr_hidden => "XMR Oculto"; String get xmr_hidden => "Oculto";
@override @override
String get send_xmr => "Enviar XMR"; String get send_xmr => "Enviar XMR";
@override @override
@ -5775,7 +5775,7 @@ class $es extends S {
@override @override
String get error_text_xmr => "El valor XMR no puede exceder el saldo disponible.\nTEl número de dígitos de fracción debe ser menor o igual a 12"; String get error_text_xmr => "El valor XMR no puede exceder el saldo disponible.\nTEl número de dígitos de fracción debe ser menor o igual a 12";
@override @override
String get xmr_available_balance => "XMR Available Balance"; String get xmr_available_balance => "Saldo disponible";
@override @override
String get restore_bitcoin_description_from_keys => "Restaure su billetera a partir de una cadena WIF generada a partir de sus claves privadas"; String get restore_bitcoin_description_from_keys => "Restaure su billetera a partir de una cadena WIF generada a partir de sus claves privadas";
@override @override
@ -5939,7 +5939,7 @@ class $es extends S {
@override @override
String get all => "TODOS"; String get all => "TODOS";
@override @override
String get xmr_full_balance => "XMR Saldo disponible"; String get xmr_full_balance => "Balance total";
@override @override
String get incoming => "Entrante"; String get incoming => "Entrante";
@override @override
@ -6321,7 +6321,7 @@ class $nl extends S {
@override @override
String get restore_seed_keys_restore => "Zaad / sleutels herstellen"; String get restore_seed_keys_restore => "Zaad / sleutels herstellen";
@override @override
String get xmr_hidden => "XMR Verborgen"; String get xmr_hidden => "Verborgen";
@override @override
String get send_xmr => "Sturen XMR"; String get send_xmr => "Sturen XMR";
@override @override
@ -6417,7 +6417,7 @@ class $nl extends S {
@override @override
String get error_text_xmr => "XMR-waarde kan het beschikbare saldo niet overschrijden.\nHet aantal breukcijfers moet kleiner zijn dan of gelijk zijn aan 12"; String get error_text_xmr => "XMR-waarde kan het beschikbare saldo niet overschrijden.\nHet aantal breukcijfers moet kleiner zijn dan of gelijk zijn aan 12";
@override @override
String get xmr_available_balance => "XMR Beschikbaar saldo"; String get xmr_available_balance => "Beschikbaar saldo";
@override @override
String get restore_bitcoin_description_from_keys => "Herstel uw portemonnee van de gegenereerde WIF-string van uw privésleutels"; String get restore_bitcoin_description_from_keys => "Herstel uw portemonnee van de gegenereerde WIF-string van uw privésleutels";
@override @override
@ -6581,7 +6581,7 @@ class $nl extends S {
@override @override
String get all => "ALLE"; String get all => "ALLE";
@override @override
String get xmr_full_balance => "XMR Volledig saldo"; String get xmr_full_balance => "Volledig saldo";
@override @override
String get incoming => "inkomend"; String get incoming => "inkomend";
@override @override
@ -6963,7 +6963,7 @@ class $zh extends S {
@override @override
String get restore_seed_keys_restore => "种子/密钥还原"; String get restore_seed_keys_restore => "种子/密钥还原";
@override @override
String get xmr_hidden => "XMR Hidden"; String get xmr_hidden => "";
@override @override
String get send_xmr => "发送 XMR"; String get send_xmr => "发送 XMR";
@override @override
@ -7059,7 +7059,7 @@ class $zh extends S {
@override @override
String get error_text_xmr => "XMR值不能超过可用余额.\n小数位数必须小于或等于12"; String get error_text_xmr => "XMR值不能超过可用余额.\n小数位数必须小于或等于12";
@override @override
String get xmr_available_balance => "XMR 可用余额 "; String get xmr_available_balance => "可用余额 ";
@override @override
String get restore_bitcoin_description_from_keys => "從私鑰中生成的WIF字符串還原您的錢包"; String get restore_bitcoin_description_from_keys => "從私鑰中生成的WIF字符串還原您的錢包";
@override @override
@ -7223,7 +7223,7 @@ class $zh extends S {
@override @override
String get all => "所有"; String get all => "所有";
@override @override
String get xmr_full_balance => "XMR 全部余额"; String get xmr_full_balance => "全部余额";
@override @override
String get incoming => "传入"; String get incoming => "传入";
@override @override

View file

@ -19,6 +19,7 @@ import 'package:cake_wallet/entities/wallet_info.dart';
import 'package:cake_wallet/entities/node.dart'; import 'package:cake_wallet/entities/node.dart';
import 'package:cake_wallet/entities/transaction_priority.dart'; import 'package:cake_wallet/entities/transaction_priority.dart';
part 'monero_wallet.g.dart'; part 'monero_wallet.g.dart';
const moneroBlockSize = 1000; const moneroBlockSize = 1000;
@ -40,6 +41,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
subaddress = subaddressList.subaddresses.first; subaddress = subaddressList.subaddresses.first;
address = subaddress.address; address = subaddress.address;
}); });
_cachedRefreshHeight = 0;
} }
@override @override
@ -80,6 +82,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
String _filename; String _filename;
SyncListner _listener; SyncListner _listener;
ReactionDisposer _onAccountChangeReaction; ReactionDisposer _onAccountChangeReaction;
int _cachedRefreshHeight;
Future<void> init() async { Future<void> init() async {
await accountList.update(); await accountList.update();
@ -191,12 +194,15 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
@override @override
Future<void> rescan({int height}) async { Future<void> rescan({int height}) async {
walletInfo.restoreHeight = height;
walletInfo.isRecovery = true;
monero_wallet.setRefreshFromBlockHeight(height: height); monero_wallet.setRefreshFromBlockHeight(height: height);
monero_wallet.rescanBlockchainAsync(); monero_wallet.rescanBlockchainAsync();
await startSync(); await startSync();
_askForUpdateBalance(); _askForUpdateBalance();
await _askForUpdateTransactionHistory(); await _askForUpdateTransactionHistory();
await save(); await save();
await walletInfo.save();
} }
void _setListeners() { void _setListeners() {
@ -284,8 +290,11 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
await setAsRecovered(); await setAsRecovered();
} }
if (currentHeight - _cachedRefreshHeight > moneroBlockSize) {
_cachedRefreshHeight = currentHeight;
await save(); await save();
} }
}
void _onNewTransaction() { void _onNewTransaction() {
_askForUpdateBalance(); _askForUpdateBalance();

View file

@ -14,8 +14,6 @@ void startAuthenticationStateChange(AuthenticationStore authenticationStore,
if (state == AuthenticationState.installed) { if (state == AuthenticationState.installed) {
await loadCurrentWallet(); await loadCurrentWallet();
// await navigatorKey.currentState
// .pushNamedAndRemoveUntil(Routes.login, (_) => false);
} }
if (state == AuthenticationState.allowed) { if (state == AuthenticationState.allowed) {

View file

@ -65,12 +65,12 @@ class ContactListPage extends BasePage {
? SectionStandardList( ? SectionStandardList(
sectionCount: 1, sectionCount: 1,
context: context, context: context,
itemCounter: (int sectionIndex) => contactListViewModel.contacts.length, itemCounter: (int sectionIndex) =>
contactListViewModel.contacts.length,
itemBuilder: (_, sectionIndex, index) { itemBuilder: (_, sectionIndex, index) {
final contact = contactListViewModel.contacts[index]; final contact = contactListViewModel.contacts[index];
final image = _getCurrencyImage(contact.type); final image = _getCurrencyImage(contact.type);
final content = Builder( final content = GestureDetector(
builder: (context) => GestureDetector(
onTap: () async { onTap: () async {
if (!isEditable) { if (!isEditable) {
Navigator.of(context).pop(contact); Navigator.of(context).pop(contact);
@ -83,22 +83,18 @@ class ContactListPage extends BasePage {
if (isCopied != null && isCopied) { if (isCopied != null && isCopied) {
await Clipboard.setData( await Clipboard.setData(
ClipboardData(text: contact.address)); ClipboardData(text: contact.address));
await showBar<void>(context, await showBar<void>(
S.of(context).copied_to_clipboard); context, S.of(context).copied_to_clipboard);
} }
}, },
child: Column( child: Container(
children: <Widget>[ color: Colors.transparent,
Container(
width: double.infinity,
child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(
left: 24, top: 16, bottom: 16, right: 24), left: 24, top: 16, bottom: 16, right: 24),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.center,
CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
image ?? Offstage(), image ?? Offstage(),
Padding( Padding(
@ -117,11 +113,8 @@ class ContactListPage extends BasePage {
), ),
) )
], ],
)),
), ),
],
), ),
)
); );
return !isEditable return !isEditable
@ -135,8 +128,9 @@ class ContactListPage extends BasePage {
caption: S.of(context).edit, caption: S.of(context).edit,
color: Colors.blue, color: Colors.blue,
icon: Icons.edit, icon: Icons.edit,
onTap: () async => await Navigator.of(context) onTap: () async =>
.pushNamed(Routes.addressBookAddContact, await Navigator.of(context).pushNamed(
Routes.addressBookAddContact,
arguments: contact), arguments: contact),
), ),
IconSlideAction( IconSlideAction(
@ -145,7 +139,8 @@ class ContactListPage extends BasePage {
icon: CupertinoIcons.delete, icon: CupertinoIcons.delete,
onTap: () async { onTap: () async {
final isDelete = final isDelete =
await showAlertDialog(context) ?? false; await showAlertDialog(context) ??
false;
if (isDelete) { if (isDelete) {
await contactListViewModel await contactListViewModel
@ -153,24 +148,14 @@ class ContactListPage extends BasePage {
} }
}, },
), ),
], ]);
dismissal: SlidableDismissal(
child: SlidableDrawerDismissal(),
onDismissed: (actionType) async => null,
// await contactListViewModel.delete(contact),
onWillDismiss: (actionType) async =>
showAlertDialog(context),
),
);
}, },
) )
: Center( : Center(
child: Text( child: Text(
S.of(context).placeholder_contacts, S.of(context).placeholder_contacts,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(color: Colors.grey, fontSize: 14),
color: Colors.grey,
fontSize: 14),
), ),
); );
}, },
@ -181,7 +166,8 @@ class ContactListPage extends BasePage {
Image image; Image image;
switch (currency) { switch (currency) {
case CryptoCurrency.xmr: case CryptoCurrency.xmr:
image = Image.asset('assets/images/monero_logo.png', height: 24, width: 24); image =
Image.asset('assets/images/monero_logo.png', height: 24, width: 24);
break; break;
case CryptoCurrency.ada: case CryptoCurrency.ada:
image = Image.asset('assets/images/ada.png', height: 24, width: 24); image = Image.asset('assets/images/ada.png', height: 24, width: 24);

View file

@ -87,8 +87,8 @@ class WalletMenu {
rightButtonText: S.of(context).ok, rightButtonText: S.of(context).ok,
leftButtonText: S.of(context).cancel, leftButtonText: S.of(context).cancel,
actionRightButton: () async { actionRightButton: () async {
await reconnect?.call();
Navigator.of(context).pop(); Navigator.of(context).pop();
await reconnect?.call();
}, },
actionLeftButton: () => Navigator.of(context).pop()); actionLeftButton: () => Navigator.of(context).pop());
}); });

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:auto_size_text/auto_size_text.dart';
class BalancePage extends StatelessWidget { class BalancePage extends StatelessWidget {
BalancePage({@required this.dashboardViewModel}); BalancePage({@required this.dashboardViewModel});
@ -11,6 +12,9 @@ class BalancePage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.all(24), padding: EdgeInsets.all(24),
child: GestureDetector(
onTapUp: (_) => dashboardViewModel.balanceViewModel.isReversing = false,
onTapDown: (_) => dashboardViewModel.balanceViewModel.isReversing = true,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -25,14 +29,25 @@ class BalancePage extends StatelessWidget {
height: 1), height: 1),
); );
}), }),
Observer(builder: (_) {
return Text(
dashboardViewModel.balanceViewModel.displayMode.toString(),
style: TextStyle(
fontSize: 12,
fontWeight: FontWeight.w600,
color: Theme.of(context).indicatorColor,
height: 1),
);
}),
SizedBox(height: 10), SizedBox(height: 10),
Observer(builder: (_) { Observer(builder: (_) {
return Text(dashboardViewModel.balanceViewModel.cryptoBalance, return AutoSizeText(dashboardViewModel.balanceViewModel.cryptoBalance,
style: TextStyle( style: TextStyle(
fontSize: 54, fontSize: 54,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: Colors.white, color: Colors.white,
height: 1), height: 1),
maxLines: 1,
textAlign: TextAlign.center); textAlign: TextAlign.center);
}), }),
SizedBox(height: 10), SizedBox(height: 10),
@ -47,6 +62,7 @@ class BalancePage extends StatelessWidget {
}), }),
], ],
), ),
)
); );
} }
} }

View file

@ -29,8 +29,21 @@ class TransactionRow extends StatelessWidget {
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container(
height: 36,
width: 36,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).textTheme.overline.decorationColor
),
child: Image.asset(
direction == TransactionDirection.incoming
? 'assets/images/down_arrow.png'
: 'assets/images/up_arrow.png'),
),
Expanded( Expanded(
child: Container( child: Container(
padding: const EdgeInsets.only(left: 12),
height: 56, height: 56,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
@ -48,25 +61,11 @@ class TransactionRow extends StatelessWidget {
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white)), color: Colors.white)),
Container( Text(formattedAmount,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
color: (direction ==
TransactionDirection.incoming
? Colors.green.withOpacity(0.8)
: Theme.of(context)
.accentTextTheme
.body2
.decorationColor
.withOpacity(0.8))),
padding: EdgeInsets.only(
top: 3, bottom: 3, left: 10, right: 10),
child: Text(formattedAmount,
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontWeight: FontWeight.w500, fontWeight: FontWeight.w500,
color: Colors.white))) color: Colors.white))
]), ]),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,

View file

@ -10,6 +10,7 @@ import 'package:cake_wallet/src/screens/nodes/widgets/node_list_row.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart'; import 'package:cake_wallet/src/widgets/standard_list.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart'; import 'package:cake_wallet/view_model/node_list/node_list_view_model.dart';
import 'package:flutter_slidable/flutter_slidable.dart';
class NodeListPage extends BasePage { class NodeListPage extends BasePage {
NodeListPage(this.nodeListViewModel); NodeListPage(this.nodeListViewModel);
@ -59,15 +60,23 @@ class NodeListPage extends BasePage {
} }
@override @override
Widget body(context) { Widget body(BuildContext context) {
return Container( return Container(
padding: EdgeInsets.only(top: 10), padding: EdgeInsets.only(top: 10),
child: Observer( child: Observer(
builder: (_) => SectionStandardList( builder: (BuildContext context) {
return nodeListViewModel.nodes.isNotEmpty
? SectionStandardList(
sectionCount: 2, sectionCount: 2,
context: context, context: context,
itemCounter: (int sectionIndex) {
if (sectionIndex == 0) {
return 1;
}
return nodeListViewModel.nodes.length;
},
itemBuilder: (_, sectionIndex, index) { itemBuilder: (_, sectionIndex, index) {
return Observer(builder: (_) {
if (sectionIndex == 0) { if (sectionIndex == 0) {
return NodeHeaderListRow( return NodeHeaderListRow(
title: S.of(context).add_new_node, title: S.of(context).add_new_node,
@ -93,68 +102,62 @@ class NodeListPage extends BasePage {
// FIXME: Add translation. // FIXME: Add translation.
return AlertWithTwoActions( return AlertWithTwoActions(
alertTitle: 'Change current node', alertTitle: 'Change current node',
alertContent: alertContent: S
S.of(context).change_current_node(node.uri), .of(context)
.change_current_node(node.uri),
leftButtonText: S.of(context).cancel, leftButtonText: S.of(context).cancel,
rightButtonText: S.of(context).change, rightButtonText: S.of(context).change,
actionLeftButton: () => actionLeftButton: () =>
Navigator.of(context).pop(), Navigator.of(context).pop(),
actionRightButton: () async { actionRightButton: () async {
await nodeListViewModel.setAsCurrent(node); await nodeListViewModel
.setAsCurrent(node);
Navigator.of(context).pop(); Navigator.of(context).pop();
}); });
}); });
}); });
final dismissibleRow = Dismissible( final dismissibleRow = Slidable(
key: Key('${node.keyIndex}'), key: Key('${node.keyIndex}'),
confirmDismiss: (direction) async { actionPane: SlidableDrawerActionPane(),
return await showPopUp( child: nodeListRow,
secondaryActions: <Widget>[
IconSlideAction(
caption: S.of(context).delete,
color: Colors.red,
icon: CupertinoIcons.delete,
onTap: () async {
final confirmed = await showPopUp<bool>(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertWithTwoActions( return AlertWithTwoActions(
alertTitle: S.of(context).remove_node, alertTitle:
alertContent: S.of(context).remove_node_message, S.of(context).remove_node,
rightButtonText: S.of(context).remove, alertContent: S
leftButtonText: S.of(context).cancel, .of(context)
.remove_node_message,
rightButtonText:
S.of(context).remove,
leftButtonText:
S.of(context).cancel,
actionRightButton: () => actionRightButton: () =>
Navigator.pop(context, true), Navigator.pop(context, true),
actionLeftButton: () => actionLeftButton: () =>
Navigator.pop(context, false)); Navigator.pop(context, false));
}); }) ??
false;
if (confirmed) {
await nodeListViewModel.delete(node);
}
}, },
onDismissed: (direction) async =>
nodeListViewModel.delete(node),
direction: DismissDirection.endToStart,
background: Container(
padding: EdgeInsets.only(right: 10.0),
alignment: AlignmentDirectional.centerEnd,
color: Palette.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
const Icon(
CupertinoIcons.delete,
color: Colors.white,
), ),
Text( ]);
S.of(context).delete,
style: TextStyle(color: Colors.white),
)
],
)),
child: nodeListRow);
return isSelected ? nodeListRow : dismissibleRow; return isSelected ? nodeListRow : dismissibleRow;
}); })
: Container();
}, },
itemCounter: (int sectionIndex) {
if (sectionIndex == 0) {
return 1;
}
return nodeListViewModel.nodes.length;
}),
), ),
); );
} }

View file

@ -81,8 +81,8 @@ class PinCodeState<T extends PinCodeWidget> extends State<T> {
} }
@override @override
Widget build(BuildContext context) => Widget build(BuildContext context) => Scaffold(
Scaffold(key: _key, body: body(context)); key: _key, body: body(context), resizeToAvoidBottomPadding: false);
Widget body(BuildContext context) { Widget body(BuildContext context) {
final deleteIconImage = Image.asset( final deleteIconImage = Image.asset(

View file

@ -25,15 +25,29 @@ import 'package:cake_wallet/src/screens/send/widgets/confirm_sending_alert.dart'
import 'package:cake_wallet/src/widgets/base_text_form_field.dart'; import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
class SendPage extends BasePage { class SendPage extends BasePage {
SendPage({@required this.sendViewModel}); SendPage({@required this.sendViewModel})
: _addressController = TextEditingController(),
_cryptoAmountController = TextEditingController(),
_fiatAmountController = TextEditingController(),
_formKey = GlobalKey<FormState>(),
_cryptoAmountFocus = FocusNode(),
_fiatAmountFocus = FocusNode(),
_addressFocusNode = FocusNode() {
_addressFocusNode.addListener(() {
if (!_addressFocusNode.hasFocus && _addressController.text.isNotEmpty) {
getOpenaliasRecord(_addressFocusNode.context);
}
});
}
final SendViewModel sendViewModel; final SendViewModel sendViewModel;
final _addressController = TextEditingController(); final TextEditingController _addressController;
final _cryptoAmountController = TextEditingController(); final TextEditingController _cryptoAmountController;
final _fiatAmountController = TextEditingController(); final TextEditingController _fiatAmountController;
final _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey;
final _cryptoAmountFocus = FocusNode(); final FocusNode _cryptoAmountFocus;
final _fiatAmountFocus = FocusNode(); final FocusNode _fiatAmountFocus;
final FocusNode _addressFocusNode;
bool _effectsInstalled = false; bool _effectsInstalled = false;
@ -105,6 +119,7 @@ class SendPage extends BasePage {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
AddressTextField( AddressTextField(
focusNode: _addressFocusNode,
controller: _addressController, controller: _addressController,
onURIScanned: (uri) { onURIScanned: (uri) {
var address = ''; var address = '';
@ -672,24 +687,23 @@ class SendPage extends BasePage {
} }
Future<void> getOpenaliasRecord(BuildContext context) async { Future<void> getOpenaliasRecord(BuildContext context) async {
// final isOpenalias = final record =
// await sendViewModel.isOpenaliasRecord(_addressController.text); await sendViewModel.decodeOpenaliasRecord(_addressController.text);
// if (isOpenalias) { if (record != null) {
// _addressController.text = sendViewModel.recordAddress; _addressController.text = record.address;
// await showPopUp<void>( await showPopUp<void>(
// context: context, context: context,
// builder: (BuildContext context) { builder: (BuildContext context) {
// return AlertWithOneAction( return AlertWithOneAction(
// alertTitle: S.of(context).openalias_alert_title, alertTitle: S.of(context).openalias_alert_title,
// alertContent: S alertContent:
// .of(context) S.of(context).openalias_alert_content(record.name),
// .openalias_alert_content(sendViewModel.recordName), buttonText: S.of(context).ok,
// buttonText: S.of(context).ok, buttonAction: () => Navigator.of(context).pop());
// buttonAction: () => Navigator.of(context).pop()); });
// }); }
// }
} }
Future<void> _setTransactionPriority(BuildContext context) async { Future<void> _setTransactionPriority(BuildContext context) async {

View file

@ -131,7 +131,7 @@ class WalletListBodyState extends State<WalletListBody> {
wallet.name, wallet.name,
style: TextStyle( style: TextStyle(
fontSize: 22, fontSize: 22,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w500,
color: Theme.of(context) color: Theme.of(context)
.primaryTextTheme .primaryTextTheme
.title .title

View file

@ -61,7 +61,7 @@ extension MobxBindable<T extends Keyable> on Box<T> {
} }
return watch().listen((event) { return watch().listen((event) {
if (filter != null && !filter(event.value as T)) { if (filter != null && event.value != null && !filter(event.value as T)) {
return; return;
} }
@ -80,7 +80,7 @@ extension MobxBindable<T extends Keyable> on Box<T> {
} }
return watch().listen((event) { return watch().listen((event) {
if (filter != null && !filter(event.value as T)) { if (filter != null && event.value != null && !filter(event.value as T)) {
return; return;
} }
@ -124,15 +124,13 @@ extension HiveBindable<T extends Keyable> on ObservableList<T> {
listen().listen((event) => dest.acceptEntityChange(event)); listen().listen((event) => dest.acceptEntityChange(event));
void acceptBoxChange(BoxEvent event, {T transformed}) { void acceptBoxChange(BoxEvent event, {T transformed}) {
print('---------------------');
print('event.key: ${event.key}; event.deleted: ${event.deleted};');
if (event.deleted) { if (event.deleted) {
removeWhere((el) { removeWhere((el) {
print('el.keyIndex ${el.keyIndex}'); return el.keyIndex == event.key;
return el.keyIndex == event.key; }); });
}
print('---------------------'); return;
}
final dynamic value = transformed ?? event.value; final dynamic value = transformed ?? event.value;
@ -150,6 +148,7 @@ extension HiveBindable<T extends Keyable> on ObservableList<T> {
void acceptEntityChange(EntityChange<T> event) { void acceptEntityChange(EntityChange<T> event) {
if (event.type == ChangeType.delete) { if (event.type == ChangeType.delete) {
removeWhere((el) => el.keyIndex == event.key); removeWhere((el) => el.keyIndex == event.key);
return;
} }
final dynamic value = event.value; final dynamic value = event.value;

View file

@ -1,5 +1,4 @@
import 'package:cake_wallet/bitcoin/bitcoin_wallet.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/crypto_currency.dart';
import 'package:cake_wallet/monero/monero_wallet.dart'; import 'package:cake_wallet/monero/monero_wallet.dart';
import 'package:cake_wallet/entities/balance_display_mode.dart'; import 'package:cake_wallet/entities/balance_display_mode.dart';
@ -20,19 +19,31 @@ abstract class BalanceViewModelBase with Store {
@required this.appStore, @required this.appStore,
@required this.settingsStore, @required this.settingsStore,
@required this.fiatConvertationStore @required this.fiatConvertationStore
}); }) : isReversing = false;
final AppStore appStore; final AppStore appStore;
final SettingsStore settingsStore; final SettingsStore settingsStore;
final FiatConversionStore fiatConvertationStore; final FiatConversionStore fiatConvertationStore;
@observable
bool isReversing;
@computed
BalanceDisplayMode get savedDisplayMode => settingsStore.balanceDisplayMode;
@computed
BalanceDisplayMode get displayMode => isReversing
? (savedDisplayMode == BalanceDisplayMode.availableBalance
? BalanceDisplayMode.fullBalance
: BalanceDisplayMode.availableBalance)
: savedDisplayMode;
@computed @computed
double get price => fiatConvertationStore.price; double get price => fiatConvertationStore.price;
@computed @computed
String get cryptoBalance { String get cryptoBalance {
final walletBalance = _walletBalance; final walletBalance = _walletBalance;
final displayMode = settingsStore.balanceDisplayMode;
var balance = '---'; var balance = '---';
if (displayMode == BalanceDisplayMode.availableBalance) { if (displayMode == BalanceDisplayMode.availableBalance) {
@ -49,7 +60,6 @@ abstract class BalanceViewModelBase with Store {
@computed @computed
String get fiatBalance { String get fiatBalance {
final walletBalance = _walletBalance; final walletBalance = _walletBalance;
final displayMode = settingsStore.balanceDisplayMode;
final fiatCurrency = settingsStore.fiatCurrency; final fiatCurrency = settingsStore.fiatCurrency;
var balance = '---'; var balance = '---';

View file

@ -16,7 +16,7 @@ abstract class NodeListViewModelBase with Store {
NodeListViewModelBase(this._nodeSource, this._wallet, this.settingsStore) NodeListViewModelBase(this._nodeSource, this._wallet, this.settingsStore)
: nodes = ObservableList<Node>() { : nodes = ObservableList<Node>() {
_nodeSource.bindToList(nodes, _nodeSource.bindToList(nodes,
filter: (Node val) => val.type == _wallet.type, initialFire: true); filter: (Node val) => val?.type == _wallet.type, initialFire: true);
} }
final ObservableList<Node> nodes; final ObservableList<Node> nodes;
@ -46,7 +46,8 @@ abstract class NodeListViewModelBase with Store {
await setAsCurrent(node); await setAsCurrent(node);
} }
Future<void> delete(Node node) async => _nodeSource.delete(node.key); @action
Future<void> delete(Node node) async => node.delete();
Future<void> setAsCurrent(Node node) async => Future<void> setAsCurrent(Node node) async =>
settingsStore.currentNode = node; settingsStore.currentNode = node;

View file

@ -1,3 +1,4 @@
import 'package:cake_wallet/entities/openalias_record.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:mobx/mobx.dart'; import 'package:mobx/mobx.dart';
import 'package:cake_wallet/core/template_validator.dart'; import 'package:cake_wallet/core/template_validator.dart';
@ -144,6 +145,13 @@ abstract class SendViewModelBase with Store {
void setTransactionPriority(TransactionPriority priority) => void setTransactionPriority(TransactionPriority priority) =>
_settingsStore.transactionPriority = priority; _settingsStore.transactionPriority = priority;
Future<OpenaliasRecord> decodeOpenaliasRecord(String name) async {
final record = await OpenaliasRecord
.fetchAddressAndName(OpenaliasRecord.formatDomainName(name));
return record.name != name ? record : null;
}
@action @action
void _updateFiatAmount() { void _updateFiatAmount() {
try { try {

View file

@ -42,7 +42,7 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.1" version: "2.4.2"
auto_size_text: auto_size_text:
dependency: "direct main" dependency: "direct main"
description: description:
@ -210,7 +210,7 @@ packages:
name: collection name: collection
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.14.12" version: "1.14.13"
connectivity: connectivity:
dependency: "direct main" dependency: "direct main"
description: description:
@ -252,7 +252,7 @@ packages:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
csslib: csslib:
dependency: transitive dependency: transitive
description: description:
@ -330,6 +330,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.2"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
ffi: ffi:
dependency: transitive dependency: transitive
description: description:
@ -505,7 +512,7 @@ packages:
name: image name: image
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.12" version: "2.1.18"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -561,7 +568,7 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.6" version: "0.12.8"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -631,7 +638,7 @@ packages:
name: path name: path
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.6.4" version: "1.7.0"
path_drawing: path_drawing:
dependency: transitive dependency: transitive
description: description:
@ -694,7 +701,7 @@ packages:
name: petitparser name: petitparser
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.0" version: "3.0.4"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -874,7 +881,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.3" version: "1.9.5"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -909,7 +916,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.15" version: "0.2.17"
time: time:
dependency: transitive dependency: transitive
description: description:
@ -930,7 +937,7 @@ packages:
name: typed_data name: typed_data
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.6" version: "1.2.0"
url_launcher: url_launcher:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1021,7 +1028,7 @@ packages:
name: xml name: xml
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.6.1" version: "4.5.1"
yaml: yaml:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1030,5 +1037,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.7.2 <3.0.0" dart: ">=2.9.0-14.0.dev <3.0.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0" flutter: ">=1.12.13+hotfix.5 <2.0.0"

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Brieftaschen-Menü", "wallet_menu" : "Brieftaschen-Menü",
"Blocks_remaining" : "${status} Verbleibende Blöcke", "Blocks_remaining" : "${status} Verbleibende Blöcke",
"please_try_to_connect_to_another_node" : "Bitte versuchen Sie, eine Verbindung zu einem anderen Knoten herzustellen", "please_try_to_connect_to_another_node" : "Bitte versuchen Sie, eine Verbindung zu einem anderen Knoten herzustellen",
"xmr_hidden" : "XMR versteckt", "xmr_hidden" : "Versteckt",
"xmr_available_balance" : "XMR verfügbares Guthaben", "xmr_available_balance" : "Verfügbares Guthaben",
"xmr_full_balance" : "XMR Volle Balance", "xmr_full_balance" : "Volle Balance",
"send" : "Senden", "send" : "Senden",
"receive" : "Erhalten", "receive" : "Erhalten",
"transactions" : "Transaktionen", "transactions" : "Transaktionen",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Menu", "wallet_menu" : "Menu",
"Blocks_remaining" : "${status} Blocks Remaining", "Blocks_remaining" : "${status} Blocks Remaining",
"please_try_to_connect_to_another_node" : "Please try to connect to another node", "please_try_to_connect_to_another_node" : "Please try to connect to another node",
"xmr_hidden" : "XMR Hidden", "xmr_hidden" : "Hidden",
"xmr_available_balance" : "XMR Available Balance", "xmr_available_balance" : "Available Balance",
"xmr_full_balance" : "XMR Full Balance", "xmr_full_balance" : "Full Balance",
"send" : "Send", "send" : "Send",
"receive" : "Receive", "receive" : "Receive",
"transactions" : "Transactions", "transactions" : "Transactions",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Menú de billetera", "wallet_menu" : "Menú de billetera",
"Blocks_remaining" : "${status} Bloques restantes", "Blocks_remaining" : "${status} Bloques restantes",
"please_try_to_connect_to_another_node" : "Intenta conectarte a otro nodo", "please_try_to_connect_to_another_node" : "Intenta conectarte a otro nodo",
"xmr_hidden" : "XMR Oculto", "xmr_hidden" : "Oculto",
"xmr_available_balance" : "XMR Available Balance", "xmr_available_balance" : "Saldo disponible",
"xmr_full_balance" : "XMR Saldo disponible", "xmr_full_balance" : "Balance total",
"send" : "Enviar", "send" : "Enviar",
"receive" : "Recibir", "receive" : "Recibir",
"transactions" : "Actas", "transactions" : "Actas",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "बटुआ मेनू", "wallet_menu" : "बटुआ मेनू",
"Blocks_remaining" : "${status} शेष रहते हैं", "Blocks_remaining" : "${status} शेष रहते हैं",
"please_try_to_connect_to_another_node" : "कृपया दूसरे नोड से कनेक्ट करने का प्रयास करें", "please_try_to_connect_to_another_node" : "कृपया दूसरे नोड से कनेक्ट करने का प्रयास करें",
"xmr_hidden" : "XMR छिपा हुआ", "xmr_hidden" : "छिपा हुआ",
"xmr_available_balance" : "XMR उपलब्ध शेष राशि", "xmr_available_balance" : "उपलब्ध शेष राशि",
"xmr_full_balance" : "XMR पूर्ण संतुलन", "xmr_full_balance" : "पूरा संतुलन",
"send" : "संदेश", "send" : "संदेश",
"receive" : "प्राप्त करना", "receive" : "प्राप्त करना",
"transactions" : "लेन-देन", "transactions" : "लेन-देन",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "ウォレットメニュー", "wallet_menu" : "ウォレットメニュー",
"Blocks_remaining" : "${status} 残りのブロック", "Blocks_remaining" : "${status} 残りのブロック",
"please_try_to_connect_to_another_node" : "別のノードに接続してみてください", "please_try_to_connect_to_another_node" : "別のノードに接続してみてください",
"xmr_hidden" : "XMR非表示", "xmr_hidden" : "非表示",
"xmr_available_balance" : "XMR利用可能残高", "xmr_available_balance" : "利用可能残高",
"xmr_full_balance" : "XMRフルバランス", "xmr_full_balance" : "フルバランス",
"send" : "送る", "send" : "送る",
"receive" : "受け取る", "receive" : "受け取る",
"transactions" : "取引", "transactions" : "取引",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "월렛 메뉴", "wallet_menu" : "월렛 메뉴",
"Blocks_remaining" : "${status} 남은 블록", "Blocks_remaining" : "${status} 남은 블록",
"please_try_to_connect_to_another_node" : "다른 노드에 연결을 시도하십시오", "please_try_to_connect_to_another_node" : "다른 노드에 연결을 시도하십시오",
"xmr_hidden" : "XMR 숨김", "xmr_hidden" : "숨김",
"xmr_available_balance" : "XMR 사용 가능한 잔액", "xmr_available_balance" : "사용 가능한 잔액",
"xmr_full_balance" : "XMR 풀 밸런스", "xmr_full_balance" : "풀 밸런스",
"send" : "보내다", "send" : "보내다",
"receive" : "받다", "receive" : "받다",
"transactions" : "업무", "transactions" : "업무",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Portemonnee-menu", "wallet_menu" : "Portemonnee-menu",
"Blocks_remaining" : "${status} Resterende blokken", "Blocks_remaining" : "${status} Resterende blokken",
"please_try_to_connect_to_another_node" : "Probeer verbinding te maken met een ander knooppunt", "please_try_to_connect_to_another_node" : "Probeer verbinding te maken met een ander knooppunt",
"xmr_hidden" : "XMR Verborgen", "xmr_hidden" : "Verborgen",
"xmr_available_balance" : "XMR Beschikbaar saldo", "xmr_available_balance" : "Beschikbaar saldo",
"xmr_full_balance" : "XMR Volledig saldo", "xmr_full_balance" : "Volledig saldo",
"send" : "Sturen", "send" : "Sturen",
"receive" : "Krijgen", "receive" : "Krijgen",
"transactions" : "Transacties", "transactions" : "Transacties",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Menu portfela", "wallet_menu" : "Menu portfela",
"Blocks_remaining" : "${status} Bloki pozostałe", "Blocks_remaining" : "${status} Bloki pozostałe",
"please_try_to_connect_to_another_node" : "Spróbuj połączyć się z innym węzłem", "please_try_to_connect_to_another_node" : "Spróbuj połączyć się z innym węzłem",
"xmr_hidden" : "XMR Ukryty", "xmr_hidden" : "Ukryty",
"xmr_available_balance" : "XMR Dostępne saldo", "xmr_available_balance" : "Dostępne saldo",
"xmr_full_balance" : "XMR Pełna równowaga", "xmr_full_balance" : "Pełna równowaga",
"send" : "Wysłać", "send" : "Wysłać",
"receive" : "Otrzymać", "receive" : "Otrzymać",
"transactions" : "Transakcje", "transactions" : "Transakcje",

View file

@ -34,8 +34,8 @@
"Blocks_remaining" : "${status} blocos restantes", "Blocks_remaining" : "${status} blocos restantes",
"please_try_to_connect_to_another_node" : "Por favor, tente conectar-se a outro nó", "please_try_to_connect_to_another_node" : "Por favor, tente conectar-se a outro nó",
"xmr_hidden" : "Esconder saldo", "xmr_hidden" : "Esconder saldo",
"xmr_available_balance" : "Saldo XMR disponível", "xmr_available_balance" : "Saldo disponível",
"xmr_full_balance" : "Saldo XMR total", "xmr_full_balance" : "Saldo total",
"send" : "Enviar", "send" : "Enviar",
"receive" : "Receber", "receive" : "Receber",
"transactions" : "Transações", "transactions" : "Transações",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Меню кошелька", "wallet_menu" : "Меню кошелька",
"Blocks_remaining" : "${status} Осталось блоков", "Blocks_remaining" : "${status} Осталось блоков",
"please_try_to_connect_to_another_node" : "Пожалуйста, попробуйте подключиться к другой ноде", "please_try_to_connect_to_another_node" : "Пожалуйста, попробуйте подключиться к другой ноде",
"xmr_hidden" : "XMR Скрыто", "xmr_hidden" : "Скрыто",
"xmr_available_balance" : "Доступный XMR баланс", "xmr_available_balance" : "Доступный баланс",
"xmr_full_balance" : "Весь XMR баланс", "xmr_full_balance" : "Весь баланс",
"send" : "Отправить", "send" : "Отправить",
"receive" : "Получить", "receive" : "Получить",
"transactions" : "Транзакции", "transactions" : "Транзакции",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "Меню гаманця", "wallet_menu" : "Меню гаманця",
"Blocks_remaining" : "${status} Залишилось блоків", "Blocks_remaining" : "${status} Залишилось блоків",
"please_try_to_connect_to_another_node" : "Будь ласка, спробуйте підключитися до іншого вузлу", "please_try_to_connect_to_another_node" : "Будь ласка, спробуйте підключитися до іншого вузлу",
"xmr_hidden" : "XMR Приховано", "xmr_hidden" : "Приховано",
"xmr_available_balance" : "Доступний XMR баланс", "xmr_available_balance" : "Доступний баланс",
"xmr_full_balance" : "Весь XMR баланс", "xmr_full_balance" : "Весь баланс",
"send" : "Відправити", "send" : "Відправити",
"receive" : "Отримати", "receive" : "Отримати",
"transactions" : "Транзакції", "transactions" : "Транзакції",

View file

@ -33,9 +33,9 @@
"wallet_menu" : "钱包菜单", "wallet_menu" : "钱包菜单",
"Blocks_remaining" : "${status} 剩余的块", "Blocks_remaining" : "${status} 剩余的块",
"please_try_to_connect_to_another_node" : "请尝试连接到另一个节点", "please_try_to_connect_to_another_node" : "请尝试连接到另一个节点",
"xmr_hidden" : "XMR Hidden", "xmr_hidden" : "",
"xmr_available_balance" : "XMR 可用余额 ", "xmr_available_balance" : "可用余额 ",
"xmr_full_balance" : "XMR 全部余额", "xmr_full_balance" : "全部余额",
"send" : "发送", "send" : "发送",
"receive" : "接收", "receive" : "接收",
"transactions" : "交易次数", "transactions" : "交易次数",