Merge branch '4.0.9' of github.com:cake-tech/cake_wallet_private into 4.0.9

This commit is contained in:
M 2020-12-03 19:31:19 +02:00
commit 1b7ffb735e
22 changed files with 434 additions and 39 deletions

View file

@ -4,7 +4,11 @@ class InitialExecutionState extends ExecutionState {}
class IsExecutingState extends ExecutionState {}
class ExecutedSuccessfullyState extends ExecutionState {}
class ExecutedSuccessfullyState extends ExecutionState {
ExecutedSuccessfullyState({this.payload});
final dynamic payload;
}
class FailureState extends ExecutionState {
FailureState(this.error);

View file

@ -14,7 +14,8 @@ class Node extends HiveObject with Keyable {
{@required this.uri,
@required WalletType type,
this.login,
this.password}) {
this.password,
this.useSSL}) {
this.type = type;
}
@ -22,7 +23,8 @@ class Node extends HiveObject with Keyable {
: uri = map['uri'] as String ?? '',
login = map['login'] as String,
password = map['password'] as String,
typeRaw = map['typeRaw'] as int;
typeRaw = map['typeRaw'] as int,
useSSL = map['useSSL'] as bool;
static const boxName = 'Nodes';
@ -38,6 +40,11 @@ class Node extends HiveObject with Keyable {
@HiveField(3)
int typeRaw;
@HiveField(4)
bool useSSL;
bool get isSSL => useSSL ?? false;
@override
dynamic get keyIndex {
_keyIndex ??= key;

View file

@ -50,6 +50,7 @@ class S implements WidgetsLocalizations {
String get card_address => "Address:";
String get change => "Change";
String get change_currency => "Change Currency";
String get change_current_node_title => "Change current node";
String get change_exchange_provider => "Change Exchange Provider";
String get change_language => "Change language";
String get change_wallet_alert_title => "Change current wallet";
@ -108,14 +109,18 @@ class S implements WidgetsLocalizations {
String get incorrect_seed => "The text entered is not valid.";
String get loading_your_wallet => "Loading your wallet";
String get login => "Login";
String get new_node_testing => "New node testing";
String get new_subaddress_create => "Create";
String get new_subaddress_label_name => "Label name";
String get new_subaddress_title => "New address";
String get new_wallet => "New Wallet";
String get node_address => "Node Address";
String get node_connection_failed => "Connection was failed";
String get node_connection_successful => "Connection was successful";
String get node_new => "New Node";
String get node_port => "Node port";
String get node_reset_settings_title => "Reset settings";
String get node_test => "Test";
String get nodes => "Nodes";
String get nodes_list_reset_to_default_message => "Are you sure that you want to reset settings to default?";
String get offer_expires_in => "Offer expires in: ";
@ -298,6 +303,7 @@ class S implements WidgetsLocalizations {
String get transactions => "Transactions";
String get transactions_by_date => "Transactions by date";
String get use => "Switch to ";
String get use_ssl => "Use SSL";
String get view_key_private => "View key (private)";
String get view_key_public => "View key (public)";
String get wallet_keys => "Wallet seed/keys";
@ -495,10 +501,14 @@ class $de extends S {
@override
String get trade_details_pair => "Paar";
@override
String get use_ssl => "Verwenden Sie SSL";
@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.";
@override
String get node_connection_successful => "Die Verbindung war erfolgreich";
@override
String get confirm => "Bestätigen";
@override
String get settings_display_balance_as => "Kontostand anzeigen als";
@ -541,6 +551,8 @@ class $de extends S {
@override
String get contact => "Kontakt";
@override
String get change_current_node_title => "Ändern Sie den aktuellen Knoten";
@override
String get openalias_alert_title => "XMR-Empfänger erkannt";
@override
String get auth_store_incorrect_password => "Falsches PIN";
@ -573,6 +585,8 @@ class $de extends S {
@override
String get xmr_hidden => "Versteckt";
@override
String get node_connection_failed => "Verbindung fehlgeschlagen";
@override
String get send_xmr => "Senden XMR";
@override
String get exchange => "Austausch";
@ -649,6 +663,8 @@ class $de extends S {
@override
String get widgets_restore_from_blockheight => "Aus Blockhöhe wiederherstellen";
@override
String get new_node_testing => "Neuer Knotentest";
@override
String get seed_language_chinese => "Chinesisch";
@override
String get new_subaddress_label_name => "Markenname";
@ -781,6 +797,8 @@ class $de extends S {
@override
String get change => "Veränderung";
@override
String get node_test => "Test";
@override
String get trade_state_finished => "Fertig";
@override
String get pin_is_incorrect => "PIN ist falsch";
@ -1169,10 +1187,14 @@ class $hi extends S {
@override
String get trade_details_pair => "जोड़ा";
@override
String get use_ssl => "उपयोग SSL";
@override
String get choose_wallet_currency => "कृपया बटुआ मुद्रा चुनें:";
@override
String get pre_seed_description => "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।";
@override
String get node_connection_successful => "कनेक्शन सफल रहा";
@override
String get confirm => "की पुष्टि करें";
@override
String get settings_display_balance_as => "के रूप में संतुलन प्रदर्शित करें";
@ -1215,6 +1237,8 @@ class $hi extends S {
@override
String get contact => "संपर्क करें";
@override
String get change_current_node_title => "वर्तमान नोड बदलें";
@override
String get openalias_alert_title => "XMR प्राप्तकर्ता का पता लगाया";
@override
String get auth_store_incorrect_password => "गलत पिन";
@ -1247,6 +1271,8 @@ class $hi extends S {
@override
String get xmr_hidden => "छिपा हुआ";
@override
String get node_connection_failed => "कनेक्शन विफल रहा";
@override
String get send_xmr => "संदेश XMR";
@override
String get exchange => "अदला बदली";
@ -1323,6 +1349,8 @@ class $hi extends S {
@override
String get widgets_restore_from_blockheight => "ब्लॉकचेन से पुनर्स्थापित करें";
@override
String get new_node_testing => "नई नोड परीक्षण";
@override
String get seed_language_chinese => "चीनी";
@override
String get new_subaddress_label_name => "लेबल का नाम";
@ -1455,6 +1483,8 @@ class $hi extends S {
@override
String get change => "परिवर्तन";
@override
String get node_test => "परीक्षा";
@override
String get trade_state_finished => "ख़त्म होना";
@override
String get pin_is_incorrect => "पिन गलत है";
@ -1843,10 +1873,14 @@ class $ru extends S {
@override
String get trade_details_pair => "Пара";
@override
String get use_ssl => "Использовать SSL";
@override
String get choose_wallet_currency => "Пожалуйста, выберите валюту кошелька:";
@override
String get pre_seed_description => "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet.";
@override
String get node_connection_successful => "Подключение прошло успешно";
@override
String get confirm => "Подтвердить";
@override
String get settings_display_balance_as => "Отображать баланс как";
@ -1889,6 +1923,8 @@ class $ru extends S {
@override
String get contact => "Контакт";
@override
String get change_current_node_title => "Изменить текущую ноду";
@override
String get openalias_alert_title => "Получатель XMR обнаружен";
@override
String get auth_store_incorrect_password => "Некорректный PIN";
@ -1921,6 +1957,8 @@ class $ru extends S {
@override
String get xmr_hidden => "Скрыто";
@override
String get node_connection_failed => "Подключение не удалось";
@override
String get send_xmr => "Отправить XMR";
@override
String get exchange => "Обмен";
@ -1997,6 +2035,8 @@ class $ru extends S {
@override
String get widgets_restore_from_blockheight => "Восстановить на высоте блока";
@override
String get new_node_testing => "Тестирование новой ноды";
@override
String get seed_language_chinese => "Китайский";
@override
String get new_subaddress_label_name => "Имя";
@ -2129,6 +2169,8 @@ class $ru extends S {
@override
String get change => "Изменить";
@override
String get node_test => "Тест";
@override
String get trade_state_finished => "Завершена";
@override
String get pin_is_incorrect => "Некорректный PIN";
@ -2517,10 +2559,14 @@ class $ko extends S {
@override
String get trade_details_pair => "";
@override
String get use_ssl => "SSL 사용";
@override
String get choose_wallet_currency => "지갑 통화를 선택하십시오:";
@override
String get pre_seed_description => "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다.";
@override
String get node_connection_successful => "성공적으로 연결되었습니다.";
@override
String get confirm => "확인";
@override
String get settings_display_balance_as => "잔액 표시";
@ -2563,6 +2609,8 @@ class $ko extends S {
@override
String get contact => "접촉";
@override
String get change_current_node_title => "현재 노드 변경";
@override
String get openalias_alert_title => "XMR 수신자 감지";
@override
String get auth_store_incorrect_password => "잘못된 PIN";
@ -2595,6 +2643,8 @@ class $ko extends S {
@override
String get xmr_hidden => "숨김";
@override
String get node_connection_failed => "연결 실패";
@override
String get send_xmr => "보내다 XMR";
@override
String get exchange => "교환";
@ -2671,6 +2721,8 @@ class $ko extends S {
@override
String get widgets_restore_from_blockheight => "블록 높이에서 복원";
@override
String get new_node_testing => "새로운 노드 테스트";
@override
String get seed_language_chinese => "중국말";
@override
String get new_subaddress_label_name => "라벨 이름";
@ -2803,6 +2855,8 @@ class $ko extends S {
@override
String get change => "변화";
@override
String get node_test => "테스트";
@override
String get trade_state_finished => "끝마친";
@override
String get pin_is_incorrect => "PIN이 잘못되었습니다";
@ -3191,10 +3245,14 @@ class $pt extends S {
@override
String get trade_details_pair => "Par";
@override
String get use_ssl => "Use SSL";
@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.";
@override
String get node_connection_successful => "A conexão foi bem sucedida";
@override
String get confirm => "Confirmar";
@override
String get settings_display_balance_as => "Saldo a exibir";
@ -3237,6 +3295,8 @@ class $pt extends S {
@override
String get contact => "Contato";
@override
String get change_current_node_title => "Mudar o nó atual";
@override
String get openalias_alert_title => "Destinatário XMR detectado";
@override
String get auth_store_incorrect_password => "PIN incorreto";
@ -3269,6 +3329,8 @@ class $pt extends S {
@override
String get xmr_hidden => "Esconder saldo";
@override
String get node_connection_failed => "A conexão falhou";
@override
String get send_xmr => "Enviar XMR";
@override
String get exchange => "Trocar";
@ -3345,6 +3407,8 @@ class $pt extends S {
@override
String get widgets_restore_from_blockheight => "Restaurar a partir de altura do bloco";
@override
String get new_node_testing => "Teste de novo nó";
@override
String get seed_language_chinese => "Chinesa";
@override
String get new_subaddress_label_name => "Nome";
@ -3477,6 +3541,8 @@ class $pt extends S {
@override
String get change => "Mudar";
@override
String get node_test => "Teste";
@override
String get trade_state_finished => "Finalizada";
@override
String get pin_is_incorrect => "PIN incorreto";
@ -3865,10 +3931,14 @@ class $uk extends S {
@override
String get trade_details_pair => "Пара";
@override
String get use_ssl => "Використати SSL";
@override
String get choose_wallet_currency => "Будь ласка, виберіть валюту гаманця:";
@override
String get pre_seed_description => "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet.";
@override
String get node_connection_successful => "З'єднання було успішним";
@override
String get confirm => "Підтвердити";
@override
String get settings_display_balance_as => "Відображати баланс як";
@ -3911,6 +3981,8 @@ class $uk extends S {
@override
String get contact => "Контакт";
@override
String get change_current_node_title => "Змінити поточний вузол";
@override
String get openalias_alert_title => "Отримувача XMR виявлено";
@override
String get auth_store_incorrect_password => "Некоректний PIN";
@ -3943,6 +4015,8 @@ class $uk extends S {
@override
String get xmr_hidden => "Приховано";
@override
String get node_connection_failed => "Помилка з’єднання";
@override
String get send_xmr => "Відправити XMR";
@override
String get exchange => "Обмін";
@ -4019,6 +4093,8 @@ class $uk extends S {
@override
String get widgets_restore_from_blockheight => "Відновити на висоті блоку";
@override
String get new_node_testing => "Тестування нового вузла";
@override
String get seed_language_chinese => "Китайська";
@override
String get new_subaddress_label_name => "Ім'я";
@ -4151,6 +4227,8 @@ class $uk extends S {
@override
String get change => "Змінити";
@override
String get node_test => "Тест";
@override
String get trade_state_finished => "Завершена";
@override
String get pin_is_incorrect => "Некоректний PIN";
@ -4539,10 +4617,14 @@ class $ja extends S {
@override
String get trade_details_pair => "ペア";
@override
String get use_ssl => "SSLを使用する";
@override
String get choose_wallet_currency => "ウォレット通貨を選択してください:";
@override
String get pre_seed_description => "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。";
@override
String get node_connection_successful => "接続に成功しました";
@override
String get confirm => "確認する";
@override
String get settings_display_balance_as => "残高を表示";
@ -4585,6 +4667,8 @@ class $ja extends S {
@override
String get contact => "接触";
@override
String get change_current_node_title => "現在のノードを変更する";
@override
String get openalias_alert_title => "XMR受信者が検出されました";
@override
String get auth_store_incorrect_password => "間違ったPIN";
@ -4617,6 +4701,8 @@ class $ja extends S {
@override
String get xmr_hidden => "非表示";
@override
String get node_connection_failed => "接続に失敗しました";
@override
String get send_xmr => "送る XMR";
@override
String get exchange => "交換する";
@ -4693,6 +4779,8 @@ class $ja extends S {
@override
String get widgets_restore_from_blockheight => "ブロックの高さから復元";
@override
String get new_node_testing => "新しいノードのテスト";
@override
String get seed_language_chinese => "中国語";
@override
String get new_subaddress_label_name => "ラベル名";
@ -4825,6 +4913,8 @@ class $ja extends S {
@override
String get change => "変化する";
@override
String get node_test => "テスト";
@override
String get trade_state_finished => "完成した";
@override
String get pin_is_incorrect => "PINが間違っています";
@ -5217,10 +5307,14 @@ class $pl extends S {
@override
String get trade_details_pair => "Para";
@override
String get use_ssl => "Użyj SSL";
@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.";
@override
String get node_connection_successful => "Połączenie powiodło się";
@override
String get confirm => "Potwierdzać";
@override
String get settings_display_balance_as => "Wyświetl saldo jako";
@ -5263,6 +5357,8 @@ class $pl extends S {
@override
String get contact => "Kontakt";
@override
String get change_current_node_title => "Zmień bieżący węzeł";
@override
String get openalias_alert_title => "Wykryto odbiorcę XMR";
@override
String get auth_store_incorrect_password => "Niepoprawny PIN";
@ -5295,6 +5391,8 @@ class $pl extends S {
@override
String get xmr_hidden => "Ukryty";
@override
String get node_connection_failed => "Połączenie nie powiodło się";
@override
String get send_xmr => "Wysłać XMR";
@override
String get exchange => "Wymieniać się";
@ -5371,6 +5469,8 @@ class $pl extends S {
@override
String get widgets_restore_from_blockheight => "Przywróć z wysokości bloku";
@override
String get new_node_testing => "Testowanie nowych węzłów";
@override
String get seed_language_chinese => "Chiński";
@override
String get new_subaddress_label_name => "Nazwa etykiety";
@ -5503,6 +5603,8 @@ class $pl extends S {
@override
String get change => "Zmiana";
@override
String get node_test => "Test";
@override
String get trade_state_finished => "Skończone";
@override
String get pin_is_incorrect => "PPIN jest niepoprawny";
@ -5891,10 +5993,14 @@ class $es extends S {
@override
String get trade_details_pair => "Par";
@override
String get use_ssl => "Utilice SSL";
@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.";
@override
String get node_connection_successful => "La conexión fue exitosa";
@override
String get confirm => "Confirmar";
@override
String get settings_display_balance_as => "Mostrar saldo como";
@ -5937,6 +6043,8 @@ class $es extends S {
@override
String get contact => "Contacto";
@override
String get change_current_node_title => "Cambiar el nodo actual";
@override
String get openalias_alert_title => "Destinatario XMR detectado";
@override
String get auth_store_incorrect_password => "Contraseña PIN";
@ -5969,6 +6077,8 @@ class $es extends S {
@override
String get xmr_hidden => "Oculto";
@override
String get node_connection_failed => "La conexión falló";
@override
String get send_xmr => "Enviar XMR";
@override
String get exchange => "Intercambiar";
@ -6045,6 +6155,8 @@ class $es extends S {
@override
String get widgets_restore_from_blockheight => "Restaurar desde blockheight";
@override
String get new_node_testing => "Prueba de nuevos nodos";
@override
String get seed_language_chinese => "Chino";
@override
String get new_subaddress_label_name => "Nombre de etiqueta";
@ -6177,6 +6289,8 @@ class $es extends S {
@override
String get change => "Cambio";
@override
String get node_test => "Prueba";
@override
String get trade_state_finished => "Terminado";
@override
String get pin_is_incorrect => "PIN es incorrecto";
@ -6565,10 +6679,14 @@ class $nl extends S {
@override
String get trade_details_pair => "Paar";
@override
String get use_ssl => "Gebruik SSL";
@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.";
@override
String get node_connection_successful => "Verbinding is gelukt";
@override
String get confirm => "Bevestigen";
@override
String get settings_display_balance_as => "Toon saldo als";
@ -6611,6 +6729,8 @@ class $nl extends S {
@override
String get contact => "Contact";
@override
String get change_current_node_title => "Wijzig het huidige knooppunt";
@override
String get openalias_alert_title => "XMR-ontvanger gedetecteerd";
@override
String get auth_store_incorrect_password => "Incorrect PIN";
@ -6643,6 +6763,8 @@ class $nl extends S {
@override
String get xmr_hidden => "Verborgen";
@override
String get node_connection_failed => "De verbinding is mislukt";
@override
String get send_xmr => "Sturen XMR";
@override
String get exchange => "Uitwisseling";
@ -6719,6 +6841,8 @@ class $nl extends S {
@override
String get widgets_restore_from_blockheight => "Herstel vanaf blockheight";
@override
String get new_node_testing => "Nieuwe knooppunttest";
@override
String get seed_language_chinese => "Chinese";
@override
String get new_subaddress_label_name => "Label naam";
@ -6851,6 +6975,8 @@ class $nl extends S {
@override
String get change => "Verandering";
@override
String get node_test => "Test";
@override
String get trade_state_finished => "Afgewerkt";
@override
String get pin_is_incorrect => "PIN is onjuist";
@ -7239,10 +7365,14 @@ class $zh extends S {
@override
String get trade_details_pair => "";
@override
String get use_ssl => "使用SSL";
@override
String get choose_wallet_currency => "請選擇錢包貨幣:";
@override
String get pre_seed_description => "在下一頁上您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。";
@override
String get node_connection_successful => "連接成功";
@override
String get confirm => "确认";
@override
String get settings_display_balance_as => "将余额显示为";
@ -7285,6 +7415,8 @@ class $zh extends S {
@override
String get contact => "联系";
@override
String get change_current_node_title => "更改當前節點";
@override
String get openalias_alert_title => "檢測到XMR收件人";
@override
String get auth_store_incorrect_password => "PIN码错误";
@ -7317,6 +7449,8 @@ class $zh extends S {
@override
String get xmr_hidden => "";
@override
String get node_connection_failed => "連接失敗";
@override
String get send_xmr => "发送 XMR";
@override
String get exchange => "交换";
@ -7393,6 +7527,8 @@ class $zh extends S {
@override
String get widgets_restore_from_blockheight => "从块高还原";
@override
String get new_node_testing => "新節點測試";
@override
String get seed_language_chinese => "中文";
@override
String get new_subaddress_label_name => "标签名称";
@ -7525,6 +7661,8 @@ class $zh extends S {
@override
String get change => "更改";
@override
String get node_test => "測試";
@override
String get trade_state_finished => "已完成";
@override
String get pin_is_incorrect => "PIN码不正确";

View file

@ -147,8 +147,7 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance> with Store {
address: node.uri,
login: node.login,
password: node.password,
useSSL: false,
// FIXME: hardcoded value
useSSL: node.isSSL,
isLightWallet: false); // FIXME: hardcoded value
syncStatus = ConnectedSyncStatus();
} catch (e) {

View file

@ -555,6 +555,7 @@ class ExchangePage extends BasePage {
});
}
if (state is TradeIsCreatedSuccessfully) {
exchangeViewModel.reset();
Navigator.of(context).pushNamed(Routes.exchangeConfirm);
}
});

View file

@ -1,3 +1,7 @@
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/src/widgets/standard_checkbox.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@ -67,6 +71,39 @@ class NodeCreateOrEditPage extends BasePage {
@override
Widget body(BuildContext context) {
reaction((_) => nodeCreateOrEditViewModel.connectionState,
(ExecutionState state) {
if (state is ExecutedSuccessfullyState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showPopUp<void>(
context: context,
builder: (BuildContext context) =>
AlertWithOneAction(
alertTitle: S.of(context).new_node_testing,
alertContent: state.payload as bool
? S.of(context).node_connection_successful
: S.of(context).node_connection_failed,
buttonText: S.of(context).ok,
buttonAction: () => Navigator.of(context).pop()));
});
}
if (state is FailureState) {
WidgetsBinding.instance.addPostFrameCallback((_) {
showPopUp<void>(
context: context,
builder: (BuildContext context) {
return AlertWithOneAction(
alertTitle: S.of(context).error,
alertContent: state.error,
buttonText: S.of(context).ok,
buttonAction: () => Navigator.of(context).pop());
});
});
}
});
return Container(
padding: EdgeInsets.only(left: 24, right: 24),
child: ScrollableWithBottomSection(
@ -122,7 +159,22 @@ class NodeCreateOrEditPage extends BasePage {
)
)
],
)
),
Padding(
padding: EdgeInsets.only(top: 20),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: [
Observer(
builder: (_) => StandardCheckbox(
value: nodeCreateOrEditViewModel.useSSL,
onChanged: (value) =>
nodeCreateOrEditViewModel.useSSL = value,
caption: S.of(context).use_ssl,
))
],
))
]
],
)),
@ -133,9 +185,18 @@ class NodeCreateOrEditPage extends BasePage {
Flexible(
child: Container(
padding: EdgeInsets.only(right: 8.0),
child: PrimaryButton(
onPressed: () => nodeCreateOrEditViewModel.reset(),
text: S.of(context).reset,
child: LoadingPrimaryButton(
onPressed: () async {
if (!_formKey.currentState.validate()) {
return;
}
await nodeCreateOrEditViewModel.connect();
},
isLoading: nodeCreateOrEditViewModel
.connectionState is IsExecutingState,
text: S.of(context).node_test,
isDisabled: !nodeCreateOrEditViewModel.isReady,
color: Colors.orange,
textColor: Colors.white),
)),
@ -154,7 +215,9 @@ class NodeCreateOrEditPage extends BasePage {
text: S.of(context).save,
color: Theme.of(context).accentTextTheme.body2.color,
textColor: Colors.white,
isDisabled: !nodeCreateOrEditViewModel.isReady,
isDisabled: (!nodeCreateOrEditViewModel.isReady)||
(nodeCreateOrEditViewModel
.connectionState is IsExecutingState),
),
)),
],

View file

@ -99,9 +99,9 @@ class NodeListPage extends BasePage {
await showPopUp<void>(
context: context,
builder: (BuildContext context) {
// FIXME: Add translation.
return AlertWithTwoActions(
alertTitle: 'Change current node',
alertTitle: S.of(context)
.change_current_node_title,
alertContent: S
.of(context)
.change_current_node(node.uri),

View file

@ -0,0 +1,76 @@
import 'dart:ui';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class StandardCheckbox extends StatefulWidget {
StandardCheckbox({
@required this.value,
this.caption = '',
@required this.onChanged});
final bool value;
final String caption;
final Function(bool) onChanged;
@override
StandardCheckboxState createState() =>
StandardCheckboxState(value, caption, onChanged);
}
class StandardCheckboxState extends State<StandardCheckbox> {
StandardCheckboxState(this.value, this.caption, this.onChanged);
bool value;
String caption;
Function(bool) onChanged;
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
value = !value;
onChanged(value);
setState(() {});
},
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
height: 24.0,
width: 24.0,
margin: EdgeInsets.only(
right: 10.0,
),
decoration: BoxDecoration(
border: Border.all(
color: Theme.of(context)
.primaryTextTheme
.caption
.color,
width: 1.0),
borderRadius: BorderRadius.all(
Radius.circular(8.0)),
color: Theme.of(context).backgroundColor),
child: value
? Icon(
Icons.check,
color: Colors.blue,
size: 20.0,
)
: Offstage(),
),
Text(
caption,
style: TextStyle(
fontSize: 16.0,
color: Theme.of(context)
.primaryTextTheme
.title
.color),
)
],
),
);
}
}

View file

@ -3,7 +3,7 @@ import 'package:mobx/mobx.dart';
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/view_model/dashboard/trade_list_item.dart';
part 'trade_filter_store.g.dart';
part'trade_filter_store.g.dart';
class TradeFilterStore = TradeFilterStoreBase with _$TradeFilterStore;

View file

@ -12,7 +12,9 @@ class NodeCreateOrEditViewModel = NodeCreateOrEditViewModelBase
abstract class NodeCreateOrEditViewModelBase with Store {
NodeCreateOrEditViewModelBase(this._nodeSource, this._wallet)
: state = InitialExecutionState();
: state = InitialExecutionState(),
connectionState = InitialExecutionState(),
useSSL = false;
@observable
ExecutionState state;
@ -29,6 +31,12 @@ abstract class NodeCreateOrEditViewModelBase with Store {
@observable
String password;
@observable
ExecutionState connectionState;
@observable
bool useSSL;
@computed
bool get isReady =>
(address?.isNotEmpty ?? false) && (port?.isNotEmpty ?? false);
@ -54,6 +62,7 @@ abstract class NodeCreateOrEditViewModelBase with Store {
port = '';
login = '';
password = '';
useSSL = false;
}
@action
@ -61,11 +70,25 @@ abstract class NodeCreateOrEditViewModelBase with Store {
try {
state = IsExecutingState();
final node =
Node(uri: uri, type: _wallet.type, login: login, password: password);
Node(uri: uri, type: _wallet.type, login: login, password: password,
useSSL: useSSL);
await _nodeSource.add(node);
state = ExecutedSuccessfullyState();
} catch (e) {
state = FailureState(e.toString());
}
}
@action
Future<void> connect() async {
try {
connectionState = IsExecutingState();
final node =
Node(uri: uri, type: _wallet.type, login: login, password: password);
final isAlive = await node.requestNode();
connectionState = ExecutedSuccessfullyState(payload: isAlive);
} catch (e) {
connectionState = FailureState(e.toString());
}
}
}

View file

@ -129,6 +129,11 @@
"remove" : "Löschen",
"delete" : "Löschen",
"add_new_node" : "Neuen Knoten hinzufügen",
"change_current_node_title" : "Ändern Sie den aktuellen Knoten",
"node_test" : "Test",
"node_connection_successful" : "Die Verbindung war erfolgreich",
"node_connection_failed" : "Verbindung fehlgeschlagen",
"new_node_testing" : "Neuer Knotentest",
"use" : "Verwenden Sie ",
@ -409,8 +414,10 @@
"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_button_text" : "Ich verstehe. Zeig mir meinen Samen"
"pre_seed_button_text" : "Ich verstehe. Zeig mir meinen Samen",
"use_ssl" : "Verwenden Sie SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "Remove",
"delete" : "Delete",
"add_new_node" : "Add new node",
"change_current_node_title" : "Change current node",
"node_test" : "Test",
"node_connection_successful" : "Connection was successful",
"node_connection_failed" : "Connection was failed",
"new_node_testing" : "New node testing",
"use" : "Switch to ",
@ -409,8 +414,10 @@
"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_button_text" : "I understand. Show me my seed"
"pre_seed_button_text" : "I understand. Show me my seed",
"use_ssl" : "Use SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "Retirar",
"delete" : "Borrar",
"add_new_node" : "Agregar nuevo nodo",
"change_current_node_title" : "Cambiar el nodo actual",
"node_test" : "Prueba",
"node_connection_successful" : "La conexión fue exitosa",
"node_connection_failed" : "La conexión falló",
"new_node_testing" : "Prueba de nuevos nodos",
"use" : "Utilizar a ",
@ -409,8 +414,10 @@
"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_button_text" : "Entiendo. Muéstrame mi semilla"
"pre_seed_button_text" : "Entiendo. Muéstrame mi semilla",
"use_ssl" : "Utilice SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "हटाना",
"delete" : "हटाएं",
"add_new_node" : "नया नोड जोड़ें",
"change_current_node_title" : "वर्तमान नोड बदलें",
"node_test" : "परीक्षा",
"node_connection_successful" : "कनेक्शन सफल रहा",
"node_connection_failed" : "कनेक्शन विफल रहा",
"new_node_testing" : "नई नोड परीक्षण",
"use" : "उपयोग ",
@ -409,8 +414,10 @@
"exchange_sync_alert_content" : "कृपया प्रतीक्षा करें जब तक आपका बटुआ सिंक्रनाइज़ नहीं किया जाता है",
"pre_seed_title" : "महत्वपूर्ण",
"pre_seed_description" : "अगले पेज पर आपको 25 शब्दों की एक श्रृंखला दिखाई देगी। यह आपका अद्वितीय और निजी बीज है और नुकसान या खराबी के मामले में अपने बटुए को पुनर्प्राप्त करने का एकमात्र तरीका है। यह आपकी जिम्मेदारी है कि इसे नीचे लिखें और इसे Cake Wallet ऐप के बाहर सुरक्षित स्थान पर संग्रहीत करें।",
"pre_seed_button_text" : "मै समझता हुँ। मुझे अपना बीज दिखाओ"
"pre_seed_button_text" : "मै समझता हुँ। मुझे अपना बीज दिखाओ",
"use_ssl" : "उपयोग SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "削除する",
"delete" : "削除する",
"add_new_node" : "新しいノードを追加",
"change_current_node_title" : "現在のノードを変更する",
"node_test" : "テスト",
"node_connection_successful" : "接続に成功しました",
"node_connection_failed" : "接続に失敗しました",
"new_node_testing" : "新しいノードのテスト",
"use" : "使用する ",
@ -409,8 +414,10 @@
"exchange_sync_alert_content" : "ウォレットが同期されるまでお待ちください",
"pre_seed_title" : "重要",
"pre_seed_description" : "次のページでは、一連の25語が表示されます。 これはあなたのユニークでプライベートなシードであり、紛失や誤動作が発生した場合にウォレットを回復する唯一の方法です。 それを書き留めて、Cake Wallet アプリの外の安全な場所に保管するのはあなたの責任です。",
"pre_seed_button_text" : "わかります。 種を見せて"
"pre_seed_button_text" : "わかります。 種を見せて",
"use_ssl" : "SSLを使用する"
}

View file

@ -129,6 +129,11 @@
"remove" : "없애다",
"delete" : "지우다",
"add_new_node" : "새 노드 추가",
"change_current_node_title" : "현재 노드 변경",
"node_test" : "테스트",
"node_connection_successful" : "성공적으로 연결되었습니다.",
"node_connection_failed" : "연결 실패",
"new_node_testing" : "새로운 노드 테스트",
"use" : "사용하다 ",
@ -409,8 +414,10 @@
"exchange_sync_alert_content" : "지갑이 동기화 될 때까지 기다리십시오",
"pre_seed_title" : "중대한",
"pre_seed_description" : "다음 페이지에서 25 개의 단어를 볼 수 있습니다. 이것은 귀하의 고유하고 개인적인 시드이며 분실 또는 오작동시 지갑을 복구하는 유일한 방법입니다. 기록해두고 Cake Wallet 앱 외부의 안전한 장소에 보관하는 것은 귀하의 책임입니다.",
"pre_seed_button_text" : "이해 했어요. 내 씨앗을 보여줘"
"pre_seed_button_text" : "이해 했어요. 내 씨앗을 보여줘",
"use_ssl" : "SSL 사용"
}

View file

@ -129,6 +129,11 @@
"remove" : "Verwijderen",
"delete" : "Delete",
"add_new_node" : "Voeg een nieuw knooppunt toe",
"change_current_node_title" : "Wijzig het huidige knooppunt",
"node_test" : "Test",
"node_connection_successful" : "Verbinding is gelukt",
"node_connection_failed" : "De verbinding is mislukt",
"new_node_testing" : "Nieuwe knooppunttest",
"use" : "Gebruik ",
@ -409,8 +414,10 @@
"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_button_text" : "Ik begrijp het. Laat me mijn zaad zien"
"pre_seed_button_text" : "Ik begrijp het. Laat me mijn zaad zien",
"use_ssl" : "Gebruik SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "Usunąć",
"delete" : "Kasować",
"add_new_node" : "Dodaj nowy węzeł",
"change_current_node_title" : "Zmień bieżący węzeł",
"node_test" : "Test",
"node_connection_successful" : "Połączenie powiodło się",
"node_connection_failed" : "Połączenie nie powiodło się",
"new_node_testing" : "Testowanie nowych węzłów",
"use" : "Używać ",
@ -409,8 +414,10 @@
"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_button_text" : "Rozumiem. Pokaż mi moje nasienie"
"pre_seed_button_text" : "Rozumiem. Pokaż mi moje nasienie",
"use_ssl" : "Użyj SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "Remover",
"delete" : "Excluir",
"add_new_node" : "Adicionar novo nó",
"change_current_node_title" : "Mudar o nó atual",
"node_test" : "Teste",
"node_connection_successful" : "A conexão foi bem sucedida",
"node_connection_failed" : "A conexão falhou",
"new_node_testing" : "Teste de novo nó",
"use" : "Use PIN de ",
@ -409,8 +414,10 @@
"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_button_text" : "Compreendo. Me mostre minha semente"
"pre_seed_button_text" : "Compreendo. Me mostre minha semente",
"use_ssl" : "Use SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "Удалить",
"delete" : "Удалить",
"add_new_node" : "Добавить новую ноду",
"change_current_node_title" : "Изменить текущую ноду",
"node_test" : "Тест",
"node_connection_successful" : "Подключение прошло успешно",
"node_connection_failed" : "Подключение не удалось",
"new_node_testing" : "Тестирование новой ноды",
"use" : "Использовать ",
@ -409,8 +414,10 @@
"exchange_sync_alert_content" : "Подождите, пока ваш кошелек синхронизируется",
"pre_seed_title" : "ВАЖНО",
"pre_seed_description" : "На следующей странице вы увидите серию из 25 слов. Это ваша уникальная и личная мнемоническая фраза, и это ЕДИНСТВЕННЫЙ способ восстановить свой кошелек в случае потери или неисправности. ВАМ необходимо записать ее и хранить в надежном месте вне приложения Cake Wallet.",
"pre_seed_button_text" : "Понятно. Покажите мнемоническую фразу"
"pre_seed_button_text" : "Понятно. Покажите мнемоническую фразу",
"use_ssl" : "Использовать SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "Видалити",
"delete" : "Видалити",
"add_new_node" : "Додати новий вузол",
"change_current_node_title" : "Змінити поточний вузол",
"node_test" : "Тест",
"node_connection_successful" : "З'єднання було успішним",
"node_connection_failed" : "Помилка з’єднання",
"new_node_testing" : "Тестування нового вузла",
"use" : "Використати ",
@ -409,8 +414,10 @@
"exchange_sync_alert_content" : "Зачекайте, поки ваш гаманець не синхронізується",
"pre_seed_title" : "ВАЖЛИВО",
"pre_seed_description" : "На наступній сторінці ви побачите серію з 25 слів. Це ваша унікальна та приватна мнемонічна фраза, і це ЄДИНИЙ спосіб відновити ваш гаманець на випадок втрати або несправності. ВАМ необхідно записати її та зберігати в безпечному місці поза програмою Cake Wallet.",
"pre_seed_button_text" : "Зрозуміло. Покажіть мнемонічну фразу"
"pre_seed_button_text" : "Зрозуміло. Покажіть мнемонічну фразу",
"use_ssl" : "Використати SSL"
}

View file

@ -129,6 +129,11 @@
"remove" : "去掉",
"delete" : "删除",
"add_new_node" : "添加新節點",
"change_current_node_title" : "更改當前節點",
"node_test" : "測試",
"node_connection_successful" : "連接成功",
"node_connection_failed" : "連接失敗",
"new_node_testing" : "新節點測試",
"use" : "採用 ",
@ -409,8 +414,10 @@
"exchange_sync_alert_content" : "請等待,直到您的錢包同步",
"pre_seed_title" : "重要",
"pre_seed_description" : "在下一頁上您將看到一系列25個單詞。 這是您獨特的私人種子,是丟失或出現故障時恢復錢包的唯一方法。 您有責任將其寫下並存儲在Cake Wallet應用程序外部的安全地方。",
"pre_seed_button_text" : "我明白。 給我看我的種子"
"pre_seed_button_text" : "我明白。 給我看我的種子",
"use_ssl" : "使用SSL"
}