From b07235241e014f97d426f70c80c3ff534e3d29c0 Mon Sep 17 00:00:00 2001 From: Klaus Date: Tue, 1 Jan 2019 10:42:13 +0100 Subject: [PATCH 01/16] Update en.js Is that the intention? --- loc/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/loc/en.js b/loc/en.js index e19b057df..38a69106e 100644 --- a/loc/en.js +++ b/loc/en.js @@ -74,7 +74,7 @@ module.exports = { explanation: "Write here your mnemonic, private key, WIF, or anything you've got. BlueWallet will do its best to guess the correct format and import your wallet", imported: 'Imported', - error: 'Failed to import. Is it event valid?', + error: 'Failed to import. Is the event valid?', success: 'Success', do_import: 'Import', scan_qr: 'or scan QR code instead?', From 2fac00c0839d5e33c544af4bca2cd61c2876de15 Mon Sep 17 00:00:00 2001 From: Klaus Date: Sat, 5 Jan 2019 19:40:00 +0100 Subject: [PATCH 02/16] DK - Danish Language Support Here is my first stab at danish language support (as well as my first pull request) - comments and suggestions are appreciated. --- loc/dk.js | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 loc/dk.js diff --git a/loc/dk.js b/loc/dk.js new file mode 100644 index 000000000..575982383 --- /dev/null +++ b/loc/dk.js @@ -0,0 +1,212 @@ +module.exports = { + _: { + storage_is_encrypted: 'Lageret er krypteret. Indtast adgangskode for at dekryptere', + enter_password: 'Indtast adgangskode', + bad_password: 'Forkert adgangskode, prøv igen', + months_ago: 'måneder siden', + days_ago: 'dage siden', + hours_ago: 'timer siden', + minutes_ago: 'minutter siden', + never: 'aldrig', + }, + wallets: { + select_wallet: 'Vælg wallet', + options: 'valgmuligheder', + list: { + app_name: 'Blue Wallet', + title: 'wallets', + header: 'En wallet består af par af hemmelige (private nøgler) og en adresse' + 'som du kan dele med andre for at modtage coins.', + add: 'Tilføj Wallet', + create_a_wallet: 'Opret en wallet', + create_a_wallet1: "Det er helt gratis og du kan oprette", + create_a_wallet2: 'lige så mange du vil', + latest_transaction: 'seneste transaktion', + empty_txs1: 'Dine transaktioner vil blive vist her,', + empty_txs2: 'ingen endnu', + tap_here_to_buy: 'Tryk her for at købe Bitcoin', + }, + reorder: { + title: 'Ændre rækkefølgen af wallets', + }, + add: { + title: 'Tilføj wallet', + description: + 'Du kan enten scanne en backup papir wallet (i et WIF - Wallet Import Format), eller oprette en ny wallet. Segwit wallets er understøttet som standard.', + scan: 'Scan', + create: 'Opret', + label_new_segwit: 'Ny SegWit', + label_new_lightning: 'Ny Lightning', + wallet_name: 'wallet navn', + wallet_type: 'type', + or: 'eller', + import_wallet: 'Importer wallet', + imported: 'Importeret', + coming_soon: 'Kommer snart', + lightning: 'Lightning', + bitcoin: 'Bitcoin', + }, + details: { + title: 'Wallet', + address: 'Adresse', + type: 'Type', + label: 'Etiket', + destination: 'destination', + description: 'bskrivelse', + are_you_sure: 'Er du sikker?', + yes_delete: 'Ja, slet', + no_cancel: 'Nej, annuller', + delete: 'Slet', + save: 'Gem', + delete_this_wallet: 'Slet denne wallet', + export_backup: 'Eksporter / backup', + buy_bitcoin: 'Køb Bitcoin', + show_xpub: 'Vis wallet XPUB', + }, + export: { + title: 'wallet eksport', + }, + xpub: { + title: 'wallet XPUB', + copiedToClipboard: 'Kopieret til udklipsholder.', + }, + import: { + title: 'importer', + explanation: + "Indtast din huskeregel, private nøgle, WIF, eller hvad du end har. BlueWallet vil forsøge at gætte det rigtige format og importere din wallet", + imported: 'Importeret', + error: 'Importen lykkedes ikke. Er det en gyldig nøgle?', + success: 'Succes', + do_import: 'Importer', + scan_qr: 'eller scan QR kode istedet?', + }, + scanQrWif: { + go_back: 'Tilbage', + cancel: 'Annuller', + decoding: 'Afkoder', + input_password: 'Indtast adgangskode', + password_explain: 'Dette er en BIP38 krypteret privat nøgle', + bad_password: 'Forkert adgangkode', + wallet_already_exists: 'En sådan wallet eksisterer allerede', + bad_wif: 'Forkert WIF', + imported_wif: 'Importeret WIF ', + with_address: ' med adresse ', + imported_segwit: 'Importeret SegWit', + imported_legacy: 'Importeret Legacy', + imported_watchonly: 'Importeret Watch-only', + }, + }, + transactions: { + list: { + tabBarLabel: 'Transaktioner', + title: 'transaktioner', + description: 'En liste af indgåeende og udgående transaktioner i dine wallets', + conf: 'conf', + }, + details: { + title: 'Transaktion', + from: 'Fra', + to: 'Til', + copy: 'Kopier', + transaction_details: 'Transaktions detaljer', + show_in_block_explorer: 'Vis i block-explorer', + }, + }, + send: { + header: 'Send', + details: { + title: 'opret transaktion', + amount_field_is_not_valid: 'Beløbsfeltet er ikke gyldigt', + fee_field_is_not_valid: 'Gebyr feltet er ikke gyldigt', + address_field_is_not_valid: 'Adresse felt er ikke gyldigt', + total_exceeds_balance: 'Beløbet du prøver at sende er større end din kontosaldo.', + create_tx_error: 'Der skete en fejl ved oprettelse af transaktionen. Check om addressen er gyldig.', + address: 'adresse', + amount_placeholder: 'beløb der skal sendes (i BTC)', + fee_placeholder: 'plus transaktionsgebyr (i BTC)', + note_placeholder: 'Notat til eget brug', + cancel: 'Annuller', + scan: 'Scan', + send: 'Send', + create: 'Opret', + remaining_balance: 'Resterende saldo', + }, + confirm: { + header: 'Bekræft', + sendNow: 'Send nu', + }, + success: { + done: 'Udført', + }, + create: { + details: 'Detaljer', + title: 'opret transaktion', + error: 'Der skete en fejl ved oprettelse af transaktionen. Er addresssen og beløbet korrekt?', + go_back: 'Tilbage', + this_is_hex: 'Dette er transaktion hex, klar til at sende ud til netværket.', + to: 'Til', + amount: 'Beløb', + fee: 'Gebyr', + tx_size: 'TX størrelse', + satoshi_per_byte: 'Satoshi per byte', + memo: 'Notat', + broadcast: 'Transmitter', + not_enough_fee: 'Gebyret er ikke højt nok. Forhøj gebyret.', + }, + }, + receive: { + header: 'Modtag', + details: { + title: 'Del denne adresse med betaleren', + share: 'del', + copiedToClipboard: 'Kopieret til udklipsholder.', + label: 'Beskrivelse', + setAmount: 'Modtag med beløb', + }, + }, + buyBitcoin: { + header: 'Køb Bitcoin', + tap_your_address: 'Tryk på addressen og kopier den til udklipsholder:', + copied: 'Kopieret til udklipsholder!', + }, + settings: { + header: 'indstillinger', + plausible_deniability: 'Sandsynlig benægtelse...', + storage_not_encrypted: 'Lager: ikke krypteret', + storage_encrypted: 'Lager: krypteret', + password: 'Adgangskode', + password_explain: 'Indtast den adgangskode du vil bruge til at kryptere lageret', + retype_password: 'Gentag adgangskoden', + passwords_do_not_match: 'Adgangskoden er ikke den samme', + encrypt_storage: 'Krypter lager', + about: 'Andet', + language: 'Sprog', + currency: 'Valuta', + }, + plausibledeniability: { + title: 'Sandsynlig benægtelse', + help: + 'Under visse omstændighder, kan du blive tvunget til at give din ' + + 'adgangskode. For at beskytte dine coins kan du med Bluewallet lave ' + + 'et falsk krypteret lager, med en anden kode. I en presset situation, ' + + 'kan du give denne adgangskode istedet. Hvis denne kode indtastes i ' + + "BlueWallet, vil brugeren se den alternative wallet. Det vil se helt" + + 'legitimt ud for andre, og dermed beskytte din originale wallet og ' + + 'dine coins.', + help2: 'Det nye lager vil være fuldt funktionsdygtigt, og du kan evt have nogle ' + 'småbeløb så det ser troværdigt ud.', + create_fake_storage: 'Opret falsk kryopteret lager', + go_back: 'tilbage', + create_password: 'Opret adgangskode', + create_password_explanation: 'Adgangskoden til det falske lager må ikke være den samme som den du bruger til det rigtige lager', + password_should_not_match: 'Adgangskoden til det falske lager må ikke være den samme som den du bruger til det rigtige lager', + retype_password: 'Indtast adgangskoden igen', + passwords_do_not_match: 'Adgangskoden er ikke den samme, prøv igen', + success: 'Succes', + }, + lnd: { + title: 'Administration', + choose_source_wallet: 'Vælge en wallet', + refill_lnd_balance: 'Genopfyld Lightning wallet', + refill: 'Genopfyld', + withdraw: 'Træk coins tilbage', + }, +}; \ No newline at end of file From e73b4f68671bf5eb5d3a308a374eeb5eb22280fd Mon Sep 17 00:00:00 2001 From: Benjamin Favre Date: Sun, 6 Jan 2019 17:10:25 +0100 Subject: [PATCH 03/16] Languages: Add French --- loc/fr_FR.js | 215 ++++++++++++++++++++++++++++++++++++ loc/index.js | 2 + screen/settings/language.js | 1 + 3 files changed, 218 insertions(+) create mode 100644 loc/fr_FR.js diff --git a/loc/fr_FR.js b/loc/fr_FR.js new file mode 100644 index 000000000..b588109f3 --- /dev/null +++ b/loc/fr_FR.js @@ -0,0 +1,215 @@ +module.exports = { + _: { + storage_is_encrypted: 'L\'espace de stockage est chiffré. Mot de passe requis pour le déchiffrer.', + enter_password: 'Saisir mot de passe', + bad_password: 'Mauvais mot de passe, ré-essayer', + months_ago: 'mois', + days_ago: 'jours', + hours_ago: 'heures', + minutes_ago: 'minutes', + never: 'jamais', + }, + wallets: { + select_wallet: 'Choix du portefeuille', + options: 'options', + list: { + app_name: 'Blue Wallet', + title: 'portefeuilles', + header: 'Un portefeuille represente une paire de clées (publique/privée) et une adresse que vous pouvez partager pour recevoir des transactions.', + add: 'Ajouter un portefeuille', + create_a_wallet: 'Créer un portefeuille', + create_a_wallet1: "C\'est gratuit et vous pouvez en créer", + create_a_wallet2: 'autant que vous souhaitez', + latest_transaction: 'dernière transaction', + empty_txs1: 'Vos transactions apparaîtront ici,', + empty_txs2: 'Aucune pour le moment', + tap_here_to_buy: 'Cliquez ici pour acheter du Bitcoin', + }, + reorder: { + title: 'Trier vos portefeuilles', + }, + add: { + title: 'ajouter un portefeuille', + description: + 'Vous pouvez soit scanner et importer un paper wallet (au format WIF - Wallet Import Format), ou créer un nouveau portefeuille. Compatible avec Segwit par defaut.', + scan: 'Scanner', + create: 'Créer', + label_new_segwit: 'Nouveau SegWit', + label_new_lightning: 'Nouveau Lightning', + wallet_name: 'nom du portefeuille', + wallet_type: 'type', + or: 'ou', + import_wallet: 'Importer un portefeuille', + imported: 'Importé', + coming_soon: 'Bientôt', + lightning: 'Lightning', + bitcoin: 'Bitcoin', + }, + details: { + title: 'Portefeuille', + address: 'Adresse', + type: 'Type', + label: 'Libelé', + destination: 'destination', + description: 'description', + are_you_sure: 'Êtes vous sur?', + yes_delete: 'Oui, supprimer', + no_cancel: 'Non, annuler', + delete: 'Supprimer', + save: 'Sauvegarder', + delete_this_wallet: 'Supprimer ce portefeuille', + export_backup: 'Exporter / sauvegarder', + buy_bitcoin: 'Acheter du Bitcoin', + show_xpub: 'Afficher XPUB du portefeuille', + }, + export: { + title: 'export du portefeuille', + }, + xpub: { + title: 'XPUB portefeuille', + copiedToClipboard: 'Copié dans le presse-papiers.', + }, + import: { + title: 'importer', + explanation: + "Write here your mnemonic, private key, WIF, or anything you've got. BlueWallet will do its best to guess the correct format and import your wallet", + imported: 'Importé', + error: 'Échec de l\'import. Merci, de vérifier que les données saisies sont valides.', + success: 'Succès', + do_import: 'Importer', + scan_qr: 'ou scaner un QR code', + }, + scanQrWif: { + go_back: 'Retour', + cancel: 'Annuler', + decoding: 'Déchiffrage', + input_password: 'Saisir mot de passe', + password_explain: 'Ceci est une clée privée chiffrée avec BIP38', + bad_password: 'Mauvais mot de passe', + wallet_already_exists: 'Ce portefeuille existe déjà', + bad_wif: 'Mauvais WIF', + imported_wif: 'WIF Importé', + with_address: ' avec adresse ', + imported_segwit: 'SegWit Importé', + imported_legacy: 'Legacy Importé', + imported_watchonly: 'Monitoring Importé', + }, + }, + transactions: { + list: { + tabBarLabel: 'Transactions', + title: 'transactions', + description: 'Une liste des transactions entrentes et sortantes de vos portefeuilles', + conf: 'conf', + }, + details: { + title: 'Transaction', + from: 'De', + to: 'À', + copy: 'Copier', + transaction_details: 'Détails de la transaction', + show_in_block_explorer: 'Afficher dans le "block explorer"', + }, + }, + send: { + header: 'Envoyer', + details: { + title: 'créer une transaction', + amount_field_is_not_valid: 'Champ montant invalide', + fee_field_is_not_valid: 'Champ frais invalide', + address_field_is_not_valid: 'Champ adresse invalide', + total_exceeds_balance: 'Le montant à envoyer excède le montant disponible.', + create_tx_error: 'There was an error creating the transaction. Please, make sure the address is valid.', + address: 'adresse', + amount_placeholder: 'montant à envoyer (en BTC)', + fee_placeholder: 'plus frais de transaction (en BTC)', + note_placeholder: 'note (optionnelle)', + cancel: 'Annuler', + scan: 'Scanner', + send: 'Envoyer', + create: 'Créer', + remaining_balance: 'Balance restante', + }, + confirm: { + header: 'Confirmer', + sendNow: 'Envoyer maintenant', + }, + success: { + done: 'Terminé', + }, + create: { + details: 'Details', + title: 'créer une transaction', + error: 'Erreur creating transaction. Invalid address or send amount?', + go_back: 'Retour', + this_is_hex: 'This is transaction hex, signed and ready to be broadcast to the network.', + to: 'À', + amount: 'Montant', + fee: 'Frais', + tx_size: 'Taille de la Transaction (TX size)', + satoshi_per_byte: 'Satoshi par byte', + memo: 'Memo', + broadcast: 'Broadcast', + not_enough_fee: 'Frais insufisants. Veuillez augmenter les frais', + }, + }, + receive: { + header: 'Recevoir', + details: { + title: 'Partager cette adresse avec le destinataire', + share: 'partager', + copiedToClipboard: 'Copier dans le presse-papiers.', + label: 'Description', + setAmount: 'Revevoir avec montant', + }, + }, + buyBitcoin: { + header: 'Acheter du Bitcoin', + tap_your_address: 'Cliquez votre adresse pour la copier:', + copied: 'Copié dans le presse-papiers!', + }, + settings: { + header: 'réglages', + plausible_deniability: 'Déni plausible...', + storage_not_encrypted: 'Stockage: non chiffré', + storage_encrypted: 'Stockage: chiffré', + password: 'Mot de passe', + password_explain: 'Créer le mot de passe utilisé pour déchiffrer l\'espace de stockage principal', + retype_password: 'Re-saisir votre mot de passe', + passwords_do_not_match: 'Les mots de passe ne correspondent pas', + encrypt_storage: 'Chiffrer le stockage', + about: 'À propos', + language: 'Langue', + currency: 'Devise', + }, + plausibledeniability: { + title: 'Déni plausible', + help: + 'Dans certaines circonstances, vous serez peut-être forcé par un tiers à communiquer ' + + 'votre mot de passe. Pour protéger vos biens, BlueWallet permet de créer un autre ' + + 'espace de stockage, avec un mot de passe différent. Sous la contrainte, ' + + 'vous pourrez divulger ce mot de passe au tier. Quand il est saisi ' + + "BlueWallet, débloquera se 'faux' espace de stockage. Le tiers pourra " + + 'confondre ces données avec des données légitimes, votre espace de stockage ' + + 'principal restera sécurisé et hors d\'atteinte.', + help2: 'New storage will be fully functional, and you can store some ' + 'minimum amounts there so it looks more believable.', + create_fake_storage: 'Créer un faux espace de stockage chiffré', + go_back: 'Retour', + create_password: 'Créer un mot de passe', + create_password_explanation: 'Le mot de passe pour le faux espace de stockage ne doit pas être le même que celui du stockage principal', + password_should_not_match: 'Le mot de passe pour le faux espace de stockage ne doit pas être le même que celui du stockage principal', + retype_password: 'Confirmation du mot de passe', + passwords_do_not_match: 'Vos mot de passe ne sont pas identiques, veillez ré-essayer', + success: 'Succès', + }, + lnd: { + title: 'gérer vos fonds', + choose_source_wallet: 'Choisir un portefeuille source', + refill_lnd_balance: 'Déposer des fonds dans votre portfeuille Lightning', + refill: 'Déposer des fonds', + withdraw: 'Retirer des fonds', + expired: 'Expiré', + sameWalletAsInvoiceError: 'Vous ne pouvez pas payer une facture avec le même portefeuille utilisé pour la créer.', + }, + }; + \ No newline at end of file diff --git a/loc/index.js b/loc/index.js index 677fcd4ef..7e46ae5d8 100644 --- a/loc/index.js +++ b/loc/index.js @@ -26,6 +26,7 @@ let strings; locale === 'ru' || locale === 'ua' || locale === 'es' || + locale === 'fr-fr' || locale === 'pt-br' || locale === 'pt-pt' || locale === 'de-de' || @@ -53,6 +54,7 @@ strings = new Localization({ cs_cz: require('./cs_CZ.js'), th_th: require('./th_TH.js'), nl_nl: require('./nl_NL.js'), + fr_fr: require('./fr_FR.js'), }); strings.saveLanguage = lang => AsyncStorage.setItem(AppStorage.LANG, lang); diff --git a/screen/settings/language.js b/screen/settings/language.js index 106e96a2c..0330b0003 100644 --- a/screen/settings/language.js +++ b/screen/settings/language.js @@ -27,6 +27,7 @@ export default class Language extends Component { { label: 'Česky (CZ)', value: 'cs_cz' }, { label: 'Thai (TH)', value: 'th_th' }, { label: 'Dutch (NL)', value: 'nl_nl' }, + { label: 'Français (FR)', value: 'fr_fr' }, ], }; } From 88379c7e51154fe662a5df61780ece7dd64aa623 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 11:32:14 -0500 Subject: [PATCH 04/16] FIX: Don't override existing tx information when scanning invalid QR --- ios/BlueWallet/Info.plist | 2 +- screen/lnd/scanLndInvoice.js | 1 - screen/send/details.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index 98de2dfd2..53f7b135e 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 215 + 216 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/screen/lnd/scanLndInvoice.js b/screen/lnd/scanLndInvoice.js index 806a3ca99..ea931b460 100644 --- a/screen/lnd/scanLndInvoice.js +++ b/screen/lnd/scanLndInvoice.js @@ -109,7 +109,6 @@ export default class ScanLndInvoice extends React.Component { isAmountInitiallyEmpty: decoded.num_satoshis === '0', }); } catch (Err) { - this.setState({ destination: '' }); alert(Err.message); } } diff --git a/screen/send/details.js b/screen/send/details.js index c14149aa9..2f2b341c7 100644 --- a/screen/send/details.js +++ b/screen/send/details.js @@ -229,7 +229,7 @@ export default class SendDetails extends Component { }) .catch(error => { alert(error.errorMessage); - this.setState({ address: text.replace(' ', ''), isLoading: false, bip70TransactionExpiration: null, amount: 0 }); + this.setState({ isLoading: false, bip70TransactionExpiration: null }); }); }, ); From f2ba903fc3dd32b65c52858be0b62eea630e9f68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 11:46:31 -0500 Subject: [PATCH 05/16] ADD: Added Danish (DK) into settings screen --- loc/{dk.js => da_DK.js} | 0 loc/index.js | 2 ++ screen/settings/language.js | 15 ++++++++------- 3 files changed, 10 insertions(+), 7 deletions(-) rename loc/{dk.js => da_DK.js} (100%) diff --git a/loc/dk.js b/loc/da_DK.js similarity index 100% rename from loc/dk.js rename to loc/da_DK.js diff --git a/loc/index.js b/loc/index.js index 7e46ae5d8..2c9b9038d 100644 --- a/loc/index.js +++ b/loc/index.js @@ -32,6 +32,7 @@ let strings; locale === 'de-de' || locale === 'cs-cz' || locale === 'th-th' || + locale === 'da-dk' || locale === 'nl-nl' ) { locale = locale.replace('-', '_'); @@ -51,6 +52,7 @@ strings = new Localization({ es: require('./es.js'), ua: require('./ua.js'), de_de: require('./de_DE.js'), + da_dk: require('./da_DK.js'), cs_cz: require('./cs_CZ.js'), th_th: require('./th_TH.js'), nl_nl: require('./nl_NL.js'), diff --git a/screen/settings/language.js b/screen/settings/language.js index 0330b0003..09e4fe258 100644 --- a/screen/settings/language.js +++ b/screen/settings/language.js @@ -18,16 +18,17 @@ export default class Language extends Component { language: loc.getLanguage(), availableLanguages: [ { label: 'English', value: 'en' }, - { label: 'Русский', value: 'ru' }, - { label: 'Українська', value: 'ua' }, - { label: 'Spanish', value: 'es' }, - { label: 'Portuguese (BR)', value: 'pt_br' }, - { label: 'Portuguese (PT)', value: 'pt_pt' }, - { label: 'Deutsch (DE)', value: 'de_de' }, { label: 'Česky (CZ)', value: 'cs_cz' }, - { label: 'Thai (TH)', value: 'th_th' }, + { label: 'Danish (DK)', value: 'da_dk' }, + { label: 'Deutsch (DE)', value: 'de_de' }, { label: 'Dutch (NL)', value: 'nl_nl' }, { label: 'Français (FR)', value: 'fr_fr' }, + { label: 'Portuguese (BR)', value: 'pt_br' }, + { label: 'Portuguese (PT)', value: 'pt_pt' }, + { label: 'Русский', value: 'ru' }, + { label: 'Spanish', value: 'es' }, + { label: 'Thai (TH)', value: 'th_th' }, + { label: 'Українська', value: 'ua' }, ], }; } From a78abf551a9b6f127c19a7e97bff7dc841b9a045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 11:48:58 -0500 Subject: [PATCH 06/16] lint --- loc/da_DK.js | 8 +- loc/fr_FR.js | 410 ++++++++++++++++----------------- screen/wallets/list.js | 4 +- screen/wallets/transactions.js | 4 +- 4 files changed, 213 insertions(+), 213 deletions(-) diff --git a/loc/da_DK.js b/loc/da_DK.js index 575982383..7e1a19360 100644 --- a/loc/da_DK.js +++ b/loc/da_DK.js @@ -18,7 +18,7 @@ module.exports = { header: 'En wallet består af par af hemmelige (private nøgler) og en adresse' + 'som du kan dele med andre for at modtage coins.', add: 'Tilføj Wallet', create_a_wallet: 'Opret en wallet', - create_a_wallet1: "Det er helt gratis og du kan oprette", + create_a_wallet1: 'Det er helt gratis og du kan oprette', create_a_wallet2: 'lige så mange du vil', latest_transaction: 'seneste transaktion', empty_txs1: 'Dine transaktioner vil blive vist her,', @@ -72,7 +72,7 @@ module.exports = { import: { title: 'importer', explanation: - "Indtast din huskeregel, private nøgle, WIF, eller hvad du end har. BlueWallet vil forsøge at gætte det rigtige format og importere din wallet", + 'Indtast din huskeregel, private nøgle, WIF, eller hvad du end har. BlueWallet vil forsøge at gætte det rigtige format og importere din wallet', imported: 'Importeret', error: 'Importen lykkedes ikke. Er det en gyldig nøgle?', success: 'Succes', @@ -189,7 +189,7 @@ module.exports = { 'adgangskode. For at beskytte dine coins kan du med Bluewallet lave ' + 'et falsk krypteret lager, med en anden kode. I en presset situation, ' + 'kan du give denne adgangskode istedet. Hvis denne kode indtastes i ' + - "BlueWallet, vil brugeren se den alternative wallet. Det vil se helt" + + 'BlueWallet, vil brugeren se den alternative wallet. Det vil se helt' + 'legitimt ud for andre, og dermed beskytte din originale wallet og ' + 'dine coins.', help2: 'Det nye lager vil være fuldt funktionsdygtigt, og du kan evt have nogle ' + 'småbeløb så det ser troværdigt ud.', @@ -209,4 +209,4 @@ module.exports = { refill: 'Genopfyld', withdraw: 'Træk coins tilbage', }, -}; \ No newline at end of file +}; diff --git a/loc/fr_FR.js b/loc/fr_FR.js index b588109f3..2aacd81a6 100644 --- a/loc/fr_FR.js +++ b/loc/fr_FR.js @@ -1,215 +1,215 @@ module.exports = { - _: { - storage_is_encrypted: 'L\'espace de stockage est chiffré. Mot de passe requis pour le déchiffrer.', - enter_password: 'Saisir mot de passe', - bad_password: 'Mauvais mot de passe, ré-essayer', - months_ago: 'mois', - days_ago: 'jours', - hours_ago: 'heures', - minutes_ago: 'minutes', - never: 'jamais', + _: { + storage_is_encrypted: "L'espace de stockage est chiffré. Mot de passe requis pour le déchiffrer.", + enter_password: 'Saisir mot de passe', + bad_password: 'Mauvais mot de passe, ré-essayer', + months_ago: 'mois', + days_ago: 'jours', + hours_ago: 'heures', + minutes_ago: 'minutes', + never: 'jamais', + }, + wallets: { + select_wallet: 'Choix du portefeuille', + options: 'options', + list: { + app_name: 'Blue Wallet', + title: 'portefeuilles', + header: + 'Un portefeuille represente une paire de clées (publique/privée) et une adresse que vous pouvez partager pour recevoir des transactions.', + add: 'Ajouter un portefeuille', + create_a_wallet: 'Créer un portefeuille', + create_a_wallet1: "C'est gratuit et vous pouvez en créer", + create_a_wallet2: 'autant que vous souhaitez', + latest_transaction: 'dernière transaction', + empty_txs1: 'Vos transactions apparaîtront ici,', + empty_txs2: 'Aucune pour le moment', + tap_here_to_buy: 'Cliquez ici pour acheter du Bitcoin', }, - wallets: { - select_wallet: 'Choix du portefeuille', - options: 'options', - list: { - app_name: 'Blue Wallet', - title: 'portefeuilles', - header: 'Un portefeuille represente une paire de clées (publique/privée) et une adresse que vous pouvez partager pour recevoir des transactions.', - add: 'Ajouter un portefeuille', - create_a_wallet: 'Créer un portefeuille', - create_a_wallet1: "C\'est gratuit et vous pouvez en créer", - create_a_wallet2: 'autant que vous souhaitez', - latest_transaction: 'dernière transaction', - empty_txs1: 'Vos transactions apparaîtront ici,', - empty_txs2: 'Aucune pour le moment', - tap_here_to_buy: 'Cliquez ici pour acheter du Bitcoin', - }, - reorder: { - title: 'Trier vos portefeuilles', - }, - add: { - title: 'ajouter un portefeuille', - description: - 'Vous pouvez soit scanner et importer un paper wallet (au format WIF - Wallet Import Format), ou créer un nouveau portefeuille. Compatible avec Segwit par defaut.', - scan: 'Scanner', - create: 'Créer', - label_new_segwit: 'Nouveau SegWit', - label_new_lightning: 'Nouveau Lightning', - wallet_name: 'nom du portefeuille', - wallet_type: 'type', - or: 'ou', - import_wallet: 'Importer un portefeuille', - imported: 'Importé', - coming_soon: 'Bientôt', - lightning: 'Lightning', - bitcoin: 'Bitcoin', - }, - details: { - title: 'Portefeuille', - address: 'Adresse', - type: 'Type', - label: 'Libelé', - destination: 'destination', - description: 'description', - are_you_sure: 'Êtes vous sur?', - yes_delete: 'Oui, supprimer', - no_cancel: 'Non, annuler', - delete: 'Supprimer', - save: 'Sauvegarder', - delete_this_wallet: 'Supprimer ce portefeuille', - export_backup: 'Exporter / sauvegarder', - buy_bitcoin: 'Acheter du Bitcoin', - show_xpub: 'Afficher XPUB du portefeuille', - }, - export: { - title: 'export du portefeuille', - }, - xpub: { - title: 'XPUB portefeuille', - copiedToClipboard: 'Copié dans le presse-papiers.', - }, - import: { - title: 'importer', - explanation: - "Write here your mnemonic, private key, WIF, or anything you've got. BlueWallet will do its best to guess the correct format and import your wallet", - imported: 'Importé', - error: 'Échec de l\'import. Merci, de vérifier que les données saisies sont valides.', - success: 'Succès', - do_import: 'Importer', - scan_qr: 'ou scaner un QR code', - }, - scanQrWif: { - go_back: 'Retour', - cancel: 'Annuler', - decoding: 'Déchiffrage', - input_password: 'Saisir mot de passe', - password_explain: 'Ceci est une clée privée chiffrée avec BIP38', - bad_password: 'Mauvais mot de passe', - wallet_already_exists: 'Ce portefeuille existe déjà', - bad_wif: 'Mauvais WIF', - imported_wif: 'WIF Importé', - with_address: ' avec adresse ', - imported_segwit: 'SegWit Importé', - imported_legacy: 'Legacy Importé', - imported_watchonly: 'Monitoring Importé', - }, + reorder: { + title: 'Trier vos portefeuilles', }, - transactions: { - list: { - tabBarLabel: 'Transactions', - title: 'transactions', - description: 'Une liste des transactions entrentes et sortantes de vos portefeuilles', - conf: 'conf', - }, - details: { - title: 'Transaction', - from: 'De', - to: 'À', - copy: 'Copier', - transaction_details: 'Détails de la transaction', - show_in_block_explorer: 'Afficher dans le "block explorer"', - }, + add: { + title: 'ajouter un portefeuille', + description: + 'Vous pouvez soit scanner et importer un paper wallet (au format WIF - Wallet Import Format), ou créer un nouveau portefeuille. Compatible avec Segwit par defaut.', + scan: 'Scanner', + create: 'Créer', + label_new_segwit: 'Nouveau SegWit', + label_new_lightning: 'Nouveau Lightning', + wallet_name: 'nom du portefeuille', + wallet_type: 'type', + or: 'ou', + import_wallet: 'Importer un portefeuille', + imported: 'Importé', + coming_soon: 'Bientôt', + lightning: 'Lightning', + bitcoin: 'Bitcoin', }, - send: { - header: 'Envoyer', - details: { - title: 'créer une transaction', - amount_field_is_not_valid: 'Champ montant invalide', - fee_field_is_not_valid: 'Champ frais invalide', - address_field_is_not_valid: 'Champ adresse invalide', - total_exceeds_balance: 'Le montant à envoyer excède le montant disponible.', - create_tx_error: 'There was an error creating the transaction. Please, make sure the address is valid.', - address: 'adresse', - amount_placeholder: 'montant à envoyer (en BTC)', - fee_placeholder: 'plus frais de transaction (en BTC)', - note_placeholder: 'note (optionnelle)', - cancel: 'Annuler', - scan: 'Scanner', - send: 'Envoyer', - create: 'Créer', - remaining_balance: 'Balance restante', - }, - confirm: { - header: 'Confirmer', - sendNow: 'Envoyer maintenant', - }, - success: { - done: 'Terminé', - }, - create: { - details: 'Details', - title: 'créer une transaction', - error: 'Erreur creating transaction. Invalid address or send amount?', - go_back: 'Retour', - this_is_hex: 'This is transaction hex, signed and ready to be broadcast to the network.', - to: 'À', - amount: 'Montant', - fee: 'Frais', - tx_size: 'Taille de la Transaction (TX size)', - satoshi_per_byte: 'Satoshi par byte', - memo: 'Memo', - broadcast: 'Broadcast', - not_enough_fee: 'Frais insufisants. Veuillez augmenter les frais', - }, + details: { + title: 'Portefeuille', + address: 'Adresse', + type: 'Type', + label: 'Libelé', + destination: 'destination', + description: 'description', + are_you_sure: 'Êtes vous sur?', + yes_delete: 'Oui, supprimer', + no_cancel: 'Non, annuler', + delete: 'Supprimer', + save: 'Sauvegarder', + delete_this_wallet: 'Supprimer ce portefeuille', + export_backup: 'Exporter / sauvegarder', + buy_bitcoin: 'Acheter du Bitcoin', + show_xpub: 'Afficher XPUB du portefeuille', }, - receive: { - header: 'Recevoir', - details: { - title: 'Partager cette adresse avec le destinataire', - share: 'partager', - copiedToClipboard: 'Copier dans le presse-papiers.', - label: 'Description', - setAmount: 'Revevoir avec montant', - }, + export: { + title: 'export du portefeuille', }, - buyBitcoin: { - header: 'Acheter du Bitcoin', - tap_your_address: 'Cliquez votre adresse pour la copier:', - copied: 'Copié dans le presse-papiers!', + xpub: { + title: 'XPUB portefeuille', + copiedToClipboard: 'Copié dans le presse-papiers.', }, - settings: { - header: 'réglages', - plausible_deniability: 'Déni plausible...', - storage_not_encrypted: 'Stockage: non chiffré', - storage_encrypted: 'Stockage: chiffré', - password: 'Mot de passe', - password_explain: 'Créer le mot de passe utilisé pour déchiffrer l\'espace de stockage principal', - retype_password: 'Re-saisir votre mot de passe', - passwords_do_not_match: 'Les mots de passe ne correspondent pas', - encrypt_storage: 'Chiffrer le stockage', - about: 'À propos', - language: 'Langue', - currency: 'Devise', - }, - plausibledeniability: { - title: 'Déni plausible', - help: - 'Dans certaines circonstances, vous serez peut-être forcé par un tiers à communiquer ' + - 'votre mot de passe. Pour protéger vos biens, BlueWallet permet de créer un autre ' + - 'espace de stockage, avec un mot de passe différent. Sous la contrainte, ' + - 'vous pourrez divulger ce mot de passe au tier. Quand il est saisi ' + - "BlueWallet, débloquera se 'faux' espace de stockage. Le tiers pourra " + - 'confondre ces données avec des données légitimes, votre espace de stockage ' + - 'principal restera sécurisé et hors d\'atteinte.', - help2: 'New storage will be fully functional, and you can store some ' + 'minimum amounts there so it looks more believable.', - create_fake_storage: 'Créer un faux espace de stockage chiffré', - go_back: 'Retour', - create_password: 'Créer un mot de passe', - create_password_explanation: 'Le mot de passe pour le faux espace de stockage ne doit pas être le même que celui du stockage principal', - password_should_not_match: 'Le mot de passe pour le faux espace de stockage ne doit pas être le même que celui du stockage principal', - retype_password: 'Confirmation du mot de passe', - passwords_do_not_match: 'Vos mot de passe ne sont pas identiques, veillez ré-essayer', + import: { + title: 'importer', + explanation: + "Write here your mnemonic, private key, WIF, or anything you've got. BlueWallet will do its best to guess the correct format and import your wallet", + imported: 'Importé', + error: "Échec de l'import. Merci, de vérifier que les données saisies sont valides.", success: 'Succès', + do_import: 'Importer', + scan_qr: 'ou scaner un QR code', }, - lnd: { - title: 'gérer vos fonds', - choose_source_wallet: 'Choisir un portefeuille source', - refill_lnd_balance: 'Déposer des fonds dans votre portfeuille Lightning', - refill: 'Déposer des fonds', - withdraw: 'Retirer des fonds', - expired: 'Expiré', - sameWalletAsInvoiceError: 'Vous ne pouvez pas payer une facture avec le même portefeuille utilisé pour la créer.', + scanQrWif: { + go_back: 'Retour', + cancel: 'Annuler', + decoding: 'Déchiffrage', + input_password: 'Saisir mot de passe', + password_explain: 'Ceci est une clée privée chiffrée avec BIP38', + bad_password: 'Mauvais mot de passe', + wallet_already_exists: 'Ce portefeuille existe déjà', + bad_wif: 'Mauvais WIF', + imported_wif: 'WIF Importé', + with_address: ' avec adresse ', + imported_segwit: 'SegWit Importé', + imported_legacy: 'Legacy Importé', + imported_watchonly: 'Monitoring Importé', }, - }; - \ No newline at end of file + }, + transactions: { + list: { + tabBarLabel: 'Transactions', + title: 'transactions', + description: 'Une liste des transactions entrentes et sortantes de vos portefeuilles', + conf: 'conf', + }, + details: { + title: 'Transaction', + from: 'De', + to: 'À', + copy: 'Copier', + transaction_details: 'Détails de la transaction', + show_in_block_explorer: 'Afficher dans le "block explorer"', + }, + }, + send: { + header: 'Envoyer', + details: { + title: 'créer une transaction', + amount_field_is_not_valid: 'Champ montant invalide', + fee_field_is_not_valid: 'Champ frais invalide', + address_field_is_not_valid: 'Champ adresse invalide', + total_exceeds_balance: 'Le montant à envoyer excède le montant disponible.', + create_tx_error: 'There was an error creating the transaction. Please, make sure the address is valid.', + address: 'adresse', + amount_placeholder: 'montant à envoyer (en BTC)', + fee_placeholder: 'plus frais de transaction (en BTC)', + note_placeholder: 'note (optionnelle)', + cancel: 'Annuler', + scan: 'Scanner', + send: 'Envoyer', + create: 'Créer', + remaining_balance: 'Balance restante', + }, + confirm: { + header: 'Confirmer', + sendNow: 'Envoyer maintenant', + }, + success: { + done: 'Terminé', + }, + create: { + details: 'Details', + title: 'créer une transaction', + error: 'Erreur creating transaction. Invalid address or send amount?', + go_back: 'Retour', + this_is_hex: 'This is transaction hex, signed and ready to be broadcast to the network.', + to: 'À', + amount: 'Montant', + fee: 'Frais', + tx_size: 'Taille de la Transaction (TX size)', + satoshi_per_byte: 'Satoshi par byte', + memo: 'Memo', + broadcast: 'Broadcast', + not_enough_fee: 'Frais insufisants. Veuillez augmenter les frais', + }, + }, + receive: { + header: 'Recevoir', + details: { + title: 'Partager cette adresse avec le destinataire', + share: 'partager', + copiedToClipboard: 'Copier dans le presse-papiers.', + label: 'Description', + setAmount: 'Revevoir avec montant', + }, + }, + buyBitcoin: { + header: 'Acheter du Bitcoin', + tap_your_address: 'Cliquez votre adresse pour la copier:', + copied: 'Copié dans le presse-papiers!', + }, + settings: { + header: 'réglages', + plausible_deniability: 'Déni plausible...', + storage_not_encrypted: 'Stockage: non chiffré', + storage_encrypted: 'Stockage: chiffré', + password: 'Mot de passe', + password_explain: "Créer le mot de passe utilisé pour déchiffrer l'espace de stockage principal", + retype_password: 'Re-saisir votre mot de passe', + passwords_do_not_match: 'Les mots de passe ne correspondent pas', + encrypt_storage: 'Chiffrer le stockage', + about: 'À propos', + language: 'Langue', + currency: 'Devise', + }, + plausibledeniability: { + title: 'Déni plausible', + help: + 'Dans certaines circonstances, vous serez peut-être forcé par un tiers à communiquer ' + + 'votre mot de passe. Pour protéger vos biens, BlueWallet permet de créer un autre ' + + 'espace de stockage, avec un mot de passe différent. Sous la contrainte, ' + + 'vous pourrez divulger ce mot de passe au tier. Quand il est saisi ' + + "BlueWallet, débloquera se 'faux' espace de stockage. Le tiers pourra " + + 'confondre ces données avec des données légitimes, votre espace de stockage ' + + "principal restera sécurisé et hors d'atteinte.", + help2: 'New storage will be fully functional, and you can store some ' + 'minimum amounts there so it looks more believable.', + create_fake_storage: 'Créer un faux espace de stockage chiffré', + go_back: 'Retour', + create_password: 'Créer un mot de passe', + create_password_explanation: 'Le mot de passe pour le faux espace de stockage ne doit pas être le même que celui du stockage principal', + password_should_not_match: 'Le mot de passe pour le faux espace de stockage ne doit pas être le même que celui du stockage principal', + retype_password: 'Confirmation du mot de passe', + passwords_do_not_match: 'Vos mot de passe ne sont pas identiques, veillez ré-essayer', + success: 'Succès', + }, + lnd: { + title: 'gérer vos fonds', + choose_source_wallet: 'Choisir un portefeuille source', + refill_lnd_balance: 'Déposer des fonds dans votre portfeuille Lightning', + refill: 'Déposer des fonds', + withdraw: 'Retirer des fonds', + expired: 'Expiré', + sameWalletAsInvoiceError: 'Vous ne pouvez pas payer une facture avec le même portefeuille utilisé pour la créer.', + }, +}; diff --git a/screen/wallets/list.js b/screen/wallets/list.js index 66cb8867a..90f148070 100644 --- a/screen/wallets/list.js +++ b/screen/wallets/list.js @@ -232,8 +232,8 @@ export default class WalletsList extends Component { rowTitle = item => { if (item.type === 'user_invoice' || item.type === 'payment_request') { - if (isNaN(item.value)) { - item.value = "0" + if (isNaN(item.value)) { + item.value = '0'; } const currentDate = new Date(); const now = (currentDate.getTime() / 1000) | 0; diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 29bf4e856..1892fbd66 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -304,12 +304,12 @@ export default class WalletTransactions extends Component { rowTitle = item => { if (item.type === 'user_invoice' || item.type === 'payment_request') { if (isNaN(item.value)) { - item.value = 0 + item.value = 0; } const currentDate = new Date(); const now = (currentDate.getTime() / 1000) | 0; const invoiceExpiration = item.timestamp + item.expire_time; - + if (invoiceExpiration > now) { return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit()).toString(); } else if (invoiceExpiration < now) { From 00845ef838386c693eb12291a0d0308101fcb3bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 14:28:02 -0500 Subject: [PATCH 07/16] FIX: Export QRCode was too big on iPad --- screen/wallets/export.js | 40 ++++++++++++++-------------------------- screen/wallets/xpub.js | 36 ++++++++++++++---------------------- 2 files changed, 28 insertions(+), 48 deletions(-) diff --git a/screen/wallets/export.js b/screen/wallets/export.js index 7e26e20e3..e99401aa2 100644 --- a/screen/wallets/export.js +++ b/screen/wallets/export.js @@ -1,20 +1,13 @@ import React, { Component } from 'react'; import { Dimensions, Platform, ActivityIndicator, View } from 'react-native'; import { QRCode as QRSlow } from 'react-native-custom-qr-codes'; -import { BlueSpacing40, SafeBlueArea, BlueNavigationStyle, BlueCard, BlueText } from '../../BlueComponents'; +import { BlueSpacing20, SafeBlueArea, BlueNavigationStyle, BlueText } from '../../BlueComponents'; import PropTypes from 'prop-types'; const QRFast = require('react-native-qrcode'); /** @type {AppStorage} */ let BlueApp = require('../../BlueApp'); let loc = require('../../loc'); const { height, width } = Dimensions.get('window'); -const aspectRatio = height / width; -let isIpad; -if (aspectRatio > 1.6) { - isIpad = false; -} else { - isIpad = true; -} export default class WalletExport extends Component { static navigationOptions = ({ navigation }) => ({ @@ -38,11 +31,12 @@ export default class WalletExport extends Component { this.state = { isLoading: true, + qrCodeHeight: height > width ? height / 2.5 : width / 2, wallet, }; } - async componentDidMount() { + componentDidMount() { this.setState({ isLoading: false, showQr: false, @@ -54,17 +48,15 @@ export default class WalletExport extends Component { }, 1000); } - determineSize = () => { - if (width > 312) { - return width - 48; - } - return 312; + onLayout = () => { + const { height } = Dimensions.get('window'); + this.setState({ qrCodeHeight: height > width ? height / 2.5 : width / 2 }); }; render() { if (this.state.isLoading) { return ( - + ); @@ -82,12 +74,7 @@ export default class WalletExport extends Component { return ( - {(() => { - if (isIpad) { - return ; - } - })()} - + {this.state.wallet.typeReadable} @@ -101,14 +88,14 @@ export default class WalletExport extends Component { ); } })()} - + {(() => { if (this.state.showQr) { if (Platform.OS === 'ios' || this.state.wallet.getSecret().length < 54) { return ( @@ -133,9 +120,10 @@ export default class WalletExport extends Component { ); } })()} + - {this.state.wallet.getSecret()} - + {this.state.wallet.getSecret()} + ); } diff --git a/screen/wallets/xpub.js b/screen/wallets/xpub.js index cb5b3aa8e..edd0ba0c4 100644 --- a/screen/wallets/xpub.js +++ b/screen/wallets/xpub.js @@ -1,20 +1,13 @@ import React, { Component } from 'react'; import { Dimensions, Platform, ActivityIndicator, View, Clipboard, Animated, TouchableOpacity } from 'react-native'; import { QRCode as QRSlow } from 'react-native-custom-qr-codes'; -import { BlueSpacing40, SafeBlueArea, BlueCard, BlueText, BlueNavigationStyle } from '../../BlueComponents'; +import { BlueSpacing20, SafeBlueArea, BlueText, BlueNavigationStyle } from '../../BlueComponents'; import PropTypes from 'prop-types'; const QRFast = require('react-native-qrcode'); /** @type {AppStorage} */ let BlueApp = require('../../BlueApp'); let loc = require('../../loc'); const { height, width } = Dimensions.get('window'); -const aspectRatio = height / width; -let isIpad; -if (aspectRatio > 1.6) { - isIpad = false; -} else { - isIpad = true; -} export default class WalletXpub extends Component { static navigationOptions = ({ navigation }) => ({ @@ -41,6 +34,7 @@ export default class WalletXpub extends Component { wallet, xpub: wallet.getXpub(), xpubText: wallet.getXpub(), + qrCodeHeight: height > width ? height / 2.5 : width / 2, }; } @@ -55,13 +49,6 @@ export default class WalletXpub extends Component { }, 1000); } - determineSize = () => { - if (width > 312) { - return width - 48; - } - return 312; - }; - copyToClipboard = () => { this.setState({ xpubText: loc.wallets.xpub.copiedToClipboard }, () => { Clipboard.setString(this.state.xpub); @@ -69,6 +56,11 @@ export default class WalletXpub extends Component { }); }; + onLayout = () => { + const { height } = Dimensions.get('window'); + this.setState({ qrCodeHeight: height > width ? height / 2.5 : width / 2 }); + }; + render() { if (this.state.isLoading) { return ( @@ -80,11 +72,11 @@ export default class WalletXpub extends Component { return ( - {isIpad && } - + {this.state.wallet.typeReadable} + {(() => { if (this.state.showQr) { @@ -92,10 +84,10 @@ export default class WalletXpub extends Component { return ( ); @@ -103,9 +95,9 @@ export default class WalletXpub extends Component { return ( ); } @@ -117,13 +109,13 @@ export default class WalletXpub extends Component { ); } })()} - + - + {this.state.xpubText} - + ); } From 5876b9e9ef3b71eb85772afebffb9561ce33a325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 14:34:01 -0500 Subject: [PATCH 08/16] FIX: Added withFormatting option --- BlueComponents.js | 3 ++- ios/BlueWallet/Info.plist | 2 +- loc/index.js | 8 ++++---- screen/send/details.js | 2 +- screen/wallets/transactions.js | 6 +++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index 3badbbebe..c1d3da6e4 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1168,8 +1168,9 @@ export class BlueBitcoinAmount extends Component { {loc.formatBalance( - this.props.unit === BitcoinUnit.BTC ? amount || 0 : loc.formatBalanceWithoutSuffix(amount || 0, BitcoinUnit.BTC), + this.props.unit === BitcoinUnit.BTC ? amount || 0 : loc.formatBalanceWithoutSuffix(amount || 0, BitcoinUnit.BTC, false), BitcoinUnit.LOCAL_CURRENCY, + false, )} diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index 53f7b135e..79f32994d 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 216 + 217 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/loc/index.js b/loc/index.js index 2c9b9038d..fb16ecdad 100644 --- a/loc/index.js +++ b/loc/index.js @@ -100,7 +100,7 @@ function removeTrailingZeros(value) { * @param toUnit {String} Value from models/bitcoinUnits.js * @returns {string} */ -strings.formatBalance = (balance, toUnit) => { +strings.formatBalance = (balance, toUnit, withFormatting = false) => { if (toUnit === undefined) { return balance + ' ' + BitcoinUnit.BTC; } @@ -108,7 +108,7 @@ strings.formatBalance = (balance, toUnit) => { return balance + ' ' + BitcoinUnit.BTC; } else if (toUnit === BitcoinUnit.SATS) { const value = new BigNumber(balance).multipliedBy(100000000); - return new Intl.NumberFormat().format(value.toString()) + ' ' + BitcoinUnit.SATS; + return withFormatting ? new Intl.NumberFormat().format(value.toString()) : balance + ' ' + BitcoinUnit.SATS; } else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) { return currency.BTCToLocalCurrency(balance); } @@ -120,7 +120,7 @@ strings.formatBalance = (balance, toUnit) => { * @param toUnit {String} Value from models/bitcoinUnits.js * @returns {string} */ -strings.formatBalanceWithoutSuffix = (balance, toUnit) => { +strings.formatBalanceWithoutSuffix = (balance, toUnit, withFormatting = false) => { if (toUnit === undefined) { return balance; } @@ -129,7 +129,7 @@ strings.formatBalanceWithoutSuffix = (balance, toUnit) => { const value = new BigNumber(balance).dividedBy(100000000).toFixed(8); return removeTrailingZeros(value); } else if (toUnit === BitcoinUnit.SATS) { - return new Intl.NumberFormat().format(balance); + return withFormatting ? new Intl.NumberFormat().format(balance) : balance; } else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) { return currency.satoshiToLocalCurrency(balance); } diff --git a/screen/send/details.js b/screen/send/details.js index 2f2b341c7..777881e7f 100644 --- a/screen/send/details.js +++ b/screen/send/details.js @@ -220,7 +220,7 @@ export default class SendDetails extends Component { .then(response => { this.setState({ address: response.address, - amount: loc.formatBalanceWithoutSuffix(response.amount, BitcoinUnit.BTC), + amount: loc.formatBalanceWithoutSuffix(response.amount, BitcoinUnit.BTC, false), memo: response.memo, fee: response.fee, bip70TransactionExpiration: response.expires, diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 1892fbd66..5c19f2342 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -311,16 +311,16 @@ export default class WalletTransactions extends Component { const invoiceExpiration = item.timestamp + item.expire_time; if (invoiceExpiration > now) { - return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit()).toString(); + return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit(), true).toString(); } else if (invoiceExpiration < now) { if (item.ispaid) { - return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit()).toString(); + return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit(), true).toString(); } else { return loc.lnd.expired; } } } else { - return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit()).toString(); + return loc.formatBalanceWithoutSuffix(item.value && item.value, this.state.wallet.getPreferredBalanceUnit(), true).toString(); } }; From c0a137a965379fadb6d3859e822f02b5618ef0d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 15:21:04 -0500 Subject: [PATCH 09/16] FIX: Fix issue with typing amounts --- BlueComponents.js | 13 +++--- ios/BlueWallet/Info.plist | 2 +- screen/lnd/scanLndInvoice.js | 82 +++++++++++++++++++----------------- 3 files changed, 49 insertions(+), 48 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index c1d3da6e4..8e7f972f0 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1131,14 +1131,12 @@ export class BlueBitcoinAmount extends Component { - this.props.onChangeText( - this.props.unit === BitcoinUnit.BTC - ? text.replace(new RegExp('[^0-9.]'), '', '.') - : text.replace(new RegExp('[^0-9]'), ''), - ) - } + onChangeText={text => { + text = this.props.unit === BitcoinUnit.BTC ? text.replace(/[^0-9.]/g, '') : text.replace(/[^0-9]/g, ''); + this.props.onChangeText(text); + }} placeholder="0" maxLength={10} ref={textInput => (this.textInput = textInput)} @@ -1150,7 +1148,6 @@ export class BlueBitcoinAmount extends Component { fontSize: 36, fontWeight: '600', }} - {...this.props} /> CFBundleVersion - 217 + 218 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/screen/lnd/scanLndInvoice.js b/screen/lnd/scanLndInvoice.js index ea931b460..e8b8b0ea6 100644 --- a/screen/lnd/scanLndInvoice.js +++ b/screen/lnd/scanLndInvoice.js @@ -71,46 +71,50 @@ export default class ScanLndInvoice extends React.Component { } } - async processInvoice(data) { - if (this.ignoreRead) return; - this.ignoreRead = true; - setTimeout(() => { - this.ignoreRead = false; - }, 6000); + processInvoice(data) { + this.setState({ isLoading: true }, async () => { + if (this.ignoreRead) return; + this.ignoreRead = true; + setTimeout(() => { + this.ignoreRead = false; + }, 6000); - if (!this.state.fromWallet) { - alert('Before paying a Lightning invoice, you must first add a Lightning wallet.'); - return this.props.navigation.goBack(); - } - - data = data.replace('LIGHTNING:', '').replace('lightning:', ''); - console.log(data); - - /** - * @type {LightningCustodianWallet} - */ - let w = this.state.fromWallet; - let decoded; - try { - decoded = await w.decodeInvoice(data); - - let expiresIn = (decoded.timestamp * 1 + decoded.expiry * 1) * 1000; // ms - if (+new Date() > expiresIn) { - expiresIn = 'expired'; - } else { - expiresIn = Math.round((expiresIn - +new Date()) / (60 * 1000)) + ' min'; + if (!this.state.fromWallet) { + alert('Before paying a Lightning invoice, you must first add a Lightning wallet.'); + return this.props.navigation.goBack(); } - Keyboard.dismiss(); - this.setState({ - invoice: data, - decoded, - expiresIn, - destination: data, - isAmountInitiallyEmpty: decoded.num_satoshis === '0', - }); - } catch (Err) { - alert(Err.message); - } + + data = data.replace('LIGHTNING:', '').replace('lightning:', ''); + console.log(data); + + /** + * @type {LightningCustodianWallet} + */ + let w = this.state.fromWallet; + let decoded; + try { + decoded = await w.decodeInvoice(data); + + let expiresIn = (decoded.timestamp * 1 + decoded.expiry * 1) * 1000; // ms + if (+new Date() > expiresIn) { + expiresIn = 'expired'; + } else { + expiresIn = Math.round((expiresIn - +new Date()) / (60 * 1000)) + ' min'; + } + Keyboard.dismiss(); + this.setState({ + invoice: data, + decoded, + expiresIn, + destination: data, + isAmountInitiallyEmpty: decoded.num_satoshis === '0', + isLoading: false, + }); + } catch (Err) { + this.setState({ isLoading: false }); + alert(Err.message); + } + }); } async pay() { @@ -190,7 +194,7 @@ export default class ScanLndInvoice extends React.Component { amount={typeof this.state.decoded === 'object' ? this.state.decoded.num_satoshis : 0} onChangeText={text => { if (typeof this.state.decoded === 'object') { - text = parseInt(text); + text = parseInt(text || 0); let decoded = this.state.decoded; decoded.num_satoshis = text; this.setState({ decoded: decoded }); From 950d9ac8ffae47acb6e33230c7b3e869dc8f81ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 15:55:50 -0500 Subject: [PATCH 10/16] FIX: Error when paying invoice --- BlueComponents.js | 1 + ios/BlueWallet/Info.plist | 2 +- loc/index.js | 2 +- screen/lnd/scanLndInvoice.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index 8e7f972f0..066ff0fa6 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1134,6 +1134,7 @@ export class BlueBitcoinAmount extends Component { {...this.props} keyboardType="numeric" onChangeText={text => { + text = text.replace(',', '.'); text = this.props.unit === BitcoinUnit.BTC ? text.replace(/[^0-9.]/g, '') : text.replace(/[^0-9]/g, ''); this.props.onChangeText(text); }} diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index 9b1c352ec..0edbf2ade 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 218 + 219 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/loc/index.js b/loc/index.js index fb16ecdad..44f68186a 100644 --- a/loc/index.js +++ b/loc/index.js @@ -108,7 +108,7 @@ strings.formatBalance = (balance, toUnit, withFormatting = false) => { return balance + ' ' + BitcoinUnit.BTC; } else if (toUnit === BitcoinUnit.SATS) { const value = new BigNumber(balance).multipliedBy(100000000); - return withFormatting ? new Intl.NumberFormat().format(value.toString()) : balance + ' ' + BitcoinUnit.SATS; + return withFormatting ? new Intl.NumberFormat().format(value.toString()) : value + ' ' + BitcoinUnit.SATS; } else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) { return currency.BTCToLocalCurrency(balance); } diff --git a/screen/lnd/scanLndInvoice.js b/screen/lnd/scanLndInvoice.js index e8b8b0ea6..f3b01f4b8 100644 --- a/screen/lnd/scanLndInvoice.js +++ b/screen/lnd/scanLndInvoice.js @@ -147,7 +147,7 @@ export default class ScanLndInvoice extends React.Component { let start = +new Date(); let end; try { - await fromWallet.payInvoice(this.state.invoice, this.state.invoice.num_satoshis); + await fromWallet.payInvoice(this.state.invoice, this.state.decoded.num_satoshis); end = +new Date(); } catch (Err) { console.log(Err.message); From 604581c93fd02f65aad4bae3cf27caecba81e4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 16:23:14 -0500 Subject: [PATCH 11/16] FIX: Replace comas with spaces --- BlueComponents.js | 2 +- ios/BlueWallet/Info.plist | 2 +- loc/index.js | 4 ++-- screen/wallets/reorderWallets.js | 2 +- screen/wallets/selectWallet.js | 2 +- screen/wallets/transactions.js | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index 066ff0fa6..1745e45f7 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1055,7 +1055,7 @@ export class WalletsCarousel extends Component { color: '#fff', }} > - {loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit())} + {loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit(), true)} CFBundleVersion - 219 + 220 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/loc/index.js b/loc/index.js index 44f68186a..d43355f94 100644 --- a/loc/index.js +++ b/loc/index.js @@ -108,7 +108,7 @@ strings.formatBalance = (balance, toUnit, withFormatting = false) => { return balance + ' ' + BitcoinUnit.BTC; } else if (toUnit === BitcoinUnit.SATS) { const value = new BigNumber(balance).multipliedBy(100000000); - return withFormatting ? new Intl.NumberFormat().format(value.toString()) : value + ' ' + BitcoinUnit.SATS; + return withFormatting ? new Intl.NumberFormat().format(value.toString()).replace(',', ' ') : value + ' ' + BitcoinUnit.SATS; } else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) { return currency.BTCToLocalCurrency(balance); } @@ -129,7 +129,7 @@ strings.formatBalanceWithoutSuffix = (balance, toUnit, withFormatting = false) = const value = new BigNumber(balance).dividedBy(100000000).toFixed(8); return removeTrailingZeros(value); } else if (toUnit === BitcoinUnit.SATS) { - return withFormatting ? new Intl.NumberFormat().format(balance) : balance; + return withFormatting ? new Intl.NumberFormat().format(balance).replace(',', ' ') : balance; } else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) { return currency.satoshiToLocalCurrency(balance); } diff --git a/screen/wallets/reorderWallets.js b/screen/wallets/reorderWallets.js index 1931fffd8..b517b5ce6 100644 --- a/screen/wallets/reorderWallets.js +++ b/screen/wallets/reorderWallets.js @@ -151,7 +151,7 @@ export default class ReorderWallets extends Component { color: '#fff', }} > - {loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit())} + {loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit(), true)} - {loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit())} + {loc.formatBalance(Number(item.getBalance()), item.getPreferredBalanceUnit(), true)} - {loc.formatBalance(this.state.wallet.getBalance(), this.state.wallet.getPreferredBalanceUnit()).toString()} + {loc.formatBalance(this.state.wallet.getBalance(), this.state.wallet.getPreferredBalanceUnit(), true).toString()} From 05d63ff3f6a02c4ef91f3d42ace2c66d9574e334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 17:48:06 -0500 Subject: [PATCH 12/16] FIX: Only allow one dot on BTC --- BlueComponents.js | 1 + 1 file changed, 1 insertion(+) diff --git a/BlueComponents.js b/BlueComponents.js index 1745e45f7..dae9de9ca 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1136,6 +1136,7 @@ export class BlueBitcoinAmount extends Component { onChangeText={text => { text = text.replace(',', '.'); text = this.props.unit === BitcoinUnit.BTC ? text.replace(/[^0-9.]/g, '') : text.replace(/[^0-9]/g, ''); + text = text.replace(/(\..*)\./g, '$1') this.props.onChangeText(text); }} placeholder="0" From 802fadc08d6ed66df63e5d12f1f8fae506d8aae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 19:41:25 -0500 Subject: [PATCH 13/16] FIX: If period is the initial character, place a zero in front --- BlueComponents.js | 5 ++++- ios/BlueWallet/Info.plist | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index dae9de9ca..ea176b61e 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -1136,7 +1136,10 @@ export class BlueBitcoinAmount extends Component { onChangeText={text => { text = text.replace(',', '.'); text = this.props.unit === BitcoinUnit.BTC ? text.replace(/[^0-9.]/g, '') : text.replace(/[^0-9]/g, ''); - text = text.replace(/(\..*)\./g, '$1') + text = text.replace(/(\..*)\./g, '$1'); + if (text.startsWith('.')) { + text = '0.'; + } this.props.onChangeText(text); }} placeholder="0" diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index c93753d5d..c3c58ad0f 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 220 + 221 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS From 5a751617d30ee2e3841e7f40f42872cd382f3ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 22:50:33 -0500 Subject: [PATCH 14/16] ADD: Alert user if they are trying to create a lightning wallet without a bitcoin wallet --- BlueComponents.js | 5 +++ loc/cs_CZ.js | 3 ++ loc/da_DK.js | 3 ++ loc/de_DE.js | 4 ++ loc/en.js | 3 ++ loc/es.js | 4 ++ loc/fr_FR.js | 4 ++ loc/nl_NL.js | 3 ++ loc/pt_BR.js | 4 ++ loc/pt_PT.js | 4 ++ loc/ru.js | 4 ++ loc/th_TH.js | 4 ++ loc/ua.js | 4 ++ screen/wallets/add.js | 89 +++++++++++++++++++++++++++++++------------ 14 files changed, 113 insertions(+), 25 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index ea176b61e..dbf8d4792 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -106,6 +106,7 @@ export class LightningButton extends Component { render() { return ( { // eslint-disable-next-line if (this.props.onPress) this.props.onPress(); @@ -136,6 +137,10 @@ export class LightningButton extends Component { } } +LightningButton.propTypes = { + disabled: PropTypes.bool, +}; + export class BlueButtonLink extends Component { render() { // eslint-disable-next-line diff --git a/loc/cs_CZ.js b/loc/cs_CZ.js index 1f302a118..e554fa501 100644 --- a/loc/cs_CZ.js +++ b/loc/cs_CZ.js @@ -8,10 +8,13 @@ module.exports = { hours_ago: 'hodin', minutes_ago: 'minut', never: 'nikdy', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'Vyberte peněženku', options: 'možnosti', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', list: { app_name: 'Blue Wallet', title: 'peněženky', diff --git a/loc/da_DK.js b/loc/da_DK.js index 7e1a19360..a9ba4157f 100644 --- a/loc/da_DK.js +++ b/loc/da_DK.js @@ -8,10 +8,13 @@ module.exports = { hours_ago: 'timer siden', minutes_ago: 'minutter siden', never: 'aldrig', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'Vælg wallet', options: 'valgmuligheder', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', list: { app_name: 'Blue Wallet', title: 'wallets', diff --git a/loc/de_DE.js b/loc/de_DE.js index aea5def9a..f1efb20a5 100644 --- a/loc/de_DE.js +++ b/loc/de_DE.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'Stunden zurück', minutes_ago: 'Minuten zurück', never: 'nie', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'Wähle Wallet', options: 'Einstellungen', + createBitcoinWallet: + 'In order to use a Lightning wallet, a Bitcoin wallet is needed in order to fund it. Please, create or import a Bitcoin wallet.', list: { app_name: 'Blue Wallet', title: 'Wallets', diff --git a/loc/en.js b/loc/en.js index b8dcf696a..f65014e3f 100644 --- a/loc/en.js +++ b/loc/en.js @@ -8,10 +8,13 @@ module.exports = { hours_ago: 'hours ago', minutes_ago: 'minutes ago', never: 'never', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'Select Wallet', options: 'options', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', list: { app_name: 'Blue Wallet', title: 'wallets', diff --git a/loc/es.js b/loc/es.js index 164613634..77741ea31 100644 --- a/loc/es.js +++ b/loc/es.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'horas atras', minutes_ago: 'minutos atras', never: 'nunca', + continue: 'Continua', + ok: 'OK', }, wallets: { options: 'opciones', select_wallet: 'Selecciona billetera', + createBitcoinWallet: + 'In order to use a Lightning wallet, a Bitcoin wallet is needed in order to fund it. Would you like to continue anyway?', list: { app_name: 'Blue Wallet', title: 'billeteras', diff --git a/loc/fr_FR.js b/loc/fr_FR.js index 2aacd81a6..c05c4590e 100644 --- a/loc/fr_FR.js +++ b/loc/fr_FR.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'heures', minutes_ago: 'minutes', never: 'jamais', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'Choix du portefeuille', options: 'options', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', + list: { app_name: 'Blue Wallet', title: 'portefeuilles', diff --git a/loc/nl_NL.js b/loc/nl_NL.js index fece8cae0..0badccb48 100644 --- a/loc/nl_NL.js +++ b/loc/nl_NL.js @@ -8,10 +8,13 @@ module.exports = { hours_ago: 'uur geleden', minutes_ago: 'minuten geleden', never: 'nooit', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'Selecteer portemonnee', options: 'opties', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', list: { app_name: 'Blue Wallet', title: 'portemonnees', diff --git a/loc/pt_BR.js b/loc/pt_BR.js index d57185f00..786a36e52 100644 --- a/loc/pt_BR.js +++ b/loc/pt_BR.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'horas atrás', minutes_ago: 'minutos atrás', never: 'nunca', + continue: 'Continue', + ok: 'OK', }, wallets: { options: 'opções', select_wallet: 'Escolher carteira', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', + list: { tabBarLabel: 'Carteiras', app_name: 'Blue Wallet', diff --git a/loc/pt_PT.js b/loc/pt_PT.js index 9e77c6836..f5d799779 100644 --- a/loc/pt_PT.js +++ b/loc/pt_PT.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'hours ago', minutes_ago: 'minutes ago', never: 'never', + continue: 'Continue', + ok: 'OK', }, wallets: { options: 'options', select_wallet: 'Select Wallet', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', + list: { app_name: 'Blue Wallet', title: 'wallets', diff --git a/loc/ru.js b/loc/ru.js index eeeac1c9e..34c3d8e48 100644 --- a/loc/ru.js +++ b/loc/ru.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'часов назад', minutes_ago: 'минут назад', never: 'никогда', + continue: 'Continue', + ok: 'OK', }, wallets: { options: 'options', select_wallet: 'Select Wallet', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', + list: { app_name: 'BlueWallet', title: 'кошельки', diff --git a/loc/th_TH.js b/loc/th_TH.js index c83c217a8..afe36e77a 100644 --- a/loc/th_TH.js +++ b/loc/th_TH.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'ชั่วโมงที่แล้ว', minutes_ago: 'นาทีที่แล้ว', never: 'ไม่เคย', + continue: 'Continue', + ok: 'OK', }, wallets: { select_wallet: 'เลือกกระเป๋าสตางค์', options: 'ทางเลือก', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', + list: { app_name: 'บูลวอลเล็ต', title: 'กระเป๋าสตางค์', diff --git a/loc/ua.js b/loc/ua.js index b5c6d51e2..28283d1a0 100644 --- a/loc/ua.js +++ b/loc/ua.js @@ -8,10 +8,14 @@ module.exports = { hours_ago: 'часів тому', minutes_ago: 'мінут тому', never: 'ніколи', + continue: 'Continue', + ok: 'OK', }, wallets: { options: 'options', select_wallet: 'Select Wallet', + createBitcoinWallet: 'In order to use a Lightning wallet, a Bitcoin wallet is needed to fund it. Would you like to continue anyway?', + list: { app_name: 'BlueWallet', title: 'гаманці', diff --git a/screen/wallets/add.js b/screen/wallets/add.js index efb38c5f7..9058844b3 100644 --- a/screen/wallets/add.js +++ b/screen/wallets/add.js @@ -1,6 +1,6 @@ /* global alert */ import React, { Component } from 'react'; -import { AsyncStorage, ActivityIndicator, Keyboard, Dimensions, View, TextInput, TouchableWithoutFeedback } from 'react-native'; +import { Alert, AsyncStorage, ActivityIndicator, Keyboard, Dimensions, View, TextInput, TouchableWithoutFeedback } from 'react-native'; import { BlueTextCentered, BlueText, @@ -140,6 +140,7 @@ export default class WalletsAdd extends Component { height: (width - 60) / 3, }} title={loc.wallets.add.create} + disabled={BlueApp.getWallets().some(wallet => wallet.type === LightningCustodianWallet.type)} /> @@ -193,33 +194,70 @@ export default class WalletsAdd extends Component { let w; if (this.state.activeLightning) { - // lightning was selected // eslint-disable-next-line -for (let t of BlueApp.getWallets()) { + let hasBitcoinWallet = false; + for (let t of BlueApp.getWallets()) { if (t.type === LightningCustodianWallet.type) { // already exist this.setState({ isLoading: false }); return alert('Only 1 Lightning wallet allowed for now'); + } else if (t.type !== LightningCustodianWallet.type) { + hasBitcoinWallet = true; } } - w = new LightningCustodianWallet(); - w.setLabel(this.state.label || w.typeReadable); + this.createLightningWallet = async () => { + w = new LightningCustodianWallet(); + w.setLabel(this.state.label || w.typeReadable); - try { - let lndhub = await AsyncStorage.getItem(AppStorage.LNDHUB); - if (lndhub) { - w.setBaseURI(lndhub); - w.init(); + try { + let lndhub = await AsyncStorage.getItem(AppStorage.LNDHUB); + if (lndhub) { + w.setBaseURI(lndhub); + w.init(); + } + await w.createAccount(); + await w.authorize(); + } catch (Err) { + this.setState({ isLoading: false }); + console.warn('lnd create failure', Err); + // giving app, not adding anything } - await w.createAccount(); - await w.authorize(); - } catch (Err) { - this.setState({ isLoading: false }); - console.warn('lnd create failure', Err); - // giving app, not adding anything + A(A.ENUM.CREATED_LIGHTNING_WALLET); + await w.generate(); + BlueApp.wallets.push(w); + await BlueApp.saveToDisk(); + EV(EV.enum.WALLETS_COUNT_CHANGED); + A(A.ENUM.CREATED_WALLET); + ReactNativeHapticFeedback.trigger('notificationSuccess', false); + this.props.navigation.dismiss(); + }; + + if (!hasBitcoinWallet) { + Alert.alert( + loc.wallets.add.lightning, + loc.wallets.createBitcoinWallet, + [ + { + text: loc.send.details.cancel, + style: 'cancel', + onPress: () => { + this.setState({ isLoading: false }); + }, + }, + { + text: loc._.ok, + style: 'default', + onPress: () => { + this.createLightningWallet(); + }, + }, + ], + { cancelable: false }, + ); + } else { + this.createLightningWallet(); } - A(A.ENUM.CREATED_LIGHTNING_WALLET); } else if (this.state.selectedIndex === 1) { // btc was selected // index 1 radio - segwit single address @@ -230,14 +268,15 @@ for (let t of BlueApp.getWallets()) { w = new HDSegwitP2SHWallet(); w.setLabel((this.state.label || loc.wallets.add.label_new_segwit) + ' HD'); } - - await w.generate(); - BlueApp.wallets.push(w); - await BlueApp.saveToDisk(); - EV(EV.enum.WALLETS_COUNT_CHANGED); - A(A.ENUM.CREATED_WALLET); - ReactNativeHapticFeedback.trigger('notificationSuccess', false); - this.props.navigation.dismiss(); + if (this.state.activeBitcoin) { + await w.generate(); + BlueApp.wallets.push(w); + await BlueApp.saveToDisk(); + EV(EV.enum.WALLETS_COUNT_CHANGED); + A(A.ENUM.CREATED_WALLET); + ReactNativeHapticFeedback.trigger('notificationSuccess', false); + this.props.navigation.dismiss(); + } }, 1, ); From 5d3de177636a6d56ca5f6f4f7125b87d332f6ea9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 22:53:29 -0500 Subject: [PATCH 15/16] FIX: Restore satoshi suffix --- ios/BlueWallet/Info.plist | 2 +- loc/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index c3c58ad0f..03f126a14 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 221 + 222 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/loc/index.js b/loc/index.js index d43355f94..f08d7a0a4 100644 --- a/loc/index.js +++ b/loc/index.js @@ -108,7 +108,7 @@ strings.formatBalance = (balance, toUnit, withFormatting = false) => { return balance + ' ' + BitcoinUnit.BTC; } else if (toUnit === BitcoinUnit.SATS) { const value = new BigNumber(balance).multipliedBy(100000000); - return withFormatting ? new Intl.NumberFormat().format(value.toString()).replace(',', ' ') : value + ' ' + BitcoinUnit.SATS; + return (withFormatting ? new Intl.NumberFormat().format(value.toString()).replace(',', ' ') : value) + ' ' + BitcoinUnit.SATS; } else if (toUnit === BitcoinUnit.LOCAL_CURRENCY) { return currency.BTCToLocalCurrency(balance); } From 312bcf8ec0347adfd12e33b18d6e4b032353343f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcos=20Rodriguez=20Ve=CC=81lez?= Date: Sun, 6 Jan 2019 23:54:22 -0500 Subject: [PATCH 16/16] ADD: Loading indicator for wallet name change and wallet delete ADD: Added CZK fiat FIX: Main wallet list shows transaction unit that is preferred by wallet --- class/app-storage.js | 6 ++++- ios/BlueWallet/Info.plist | 2 +- models/fiatUnit.js | 11 +++++---- screen/wallets/details.js | 44 +++++++++++++++------------------- screen/wallets/list.js | 7 +++--- screen/wallets/transactions.js | 3 +-- 6 files changed, 35 insertions(+), 38 deletions(-) diff --git a/class/app-storage.js b/class/app-storage.js index ad9d9c62f..2d7dc24ac 100644 --- a/class/app-storage.js +++ b/class/app-storage.js @@ -342,7 +342,11 @@ export class AppStorage { let txs = []; for (let wallet of this.wallets) { - txs = txs.concat(wallet.getTransactions()); + let walletTransactions = wallet.getTransactions(); + for (let t of walletTransactions) { + t.walletPreferredBalanceUnit = wallet.getPreferredBalanceUnit(); + } + txs = txs.concat(walletTransactions); } for (let t of txs) { diff --git a/ios/BlueWallet/Info.plist b/ios/BlueWallet/Info.plist index 03f126a14..986d56842 100644 --- a/ios/BlueWallet/Info.plist +++ b/ios/BlueWallet/Info.plist @@ -33,7 +33,7 @@ CFBundleVersion - 222 + 223 ITSAppUsesNonExemptEncryption LSRequiresIPhoneOS diff --git a/models/fiatUnit.js b/models/fiatUnit.js index 780a00ef7..d6e8ceb5a 100644 --- a/models/fiatUnit.js +++ b/models/fiatUnit.js @@ -1,14 +1,15 @@ export const FiatUnit = Object.freeze({ USD: { endPointKey: 'USD', symbol: '$', locale: 'en-US' }, AUD: { endPointKey: 'AUD', symbol: '$', locale: 'en-AU' }, + CAD: { endPointKey: 'CAD', symbol: '$', locale: 'en-CA' }, + CZK: { endPointKey: 'CZK', symbol: 'Kč', locale: 'cs-CZ' }, + CNY: { endPointKey: 'CNY', symbol: '¥', locale: 'zh-CN' }, EUR: { endPointKey: 'EUR', symbol: '€', locale: 'en-EN' }, GBP: { endPointKey: 'GBP', symbol: '£', locale: 'en-GB' }, - RUB: { endPointKey: 'RUB', symbol: '₽', locale: 'ru-RU' }, - CAD: { endPointKey: 'CAD', symbol: '$', locale: 'en-CA' }, - CNY: { endPointKey: 'CNY', symbol: '¥', locale: 'zh-CN' }, - JPY: { endPointKey: 'JPY', symbol: '¥', locale: 'ja-JP' }, INR: { endPointKey: 'INR', symbol: '₹', locale: 'hi-HN' }, - VEF: { endPointKey: 'VEF', symbol: 'Bs.', locale: 'es-VE' }, + JPY: { endPointKey: 'JPY', symbol: '¥', locale: 'ja-JP' }, + RUB: { endPointKey: 'RUB', symbol: '₽', locale: 'ru-RU' }, SGD: { endPointKey: 'SGD', symbol: 'S$', locale: 'zh-SG' }, + VEF: { endPointKey: 'VEF', symbol: 'Bs.', locale: 'es-VE' }, ZAR: { endPointKey: 'ZAR', symbol: 'R', locale: 'en-ZA' }, }); diff --git a/screen/wallets/details.js b/screen/wallets/details.js index 309840973..dfbf2ecfa 100644 --- a/screen/wallets/details.js +++ b/screen/wallets/details.js @@ -32,18 +32,8 @@ export default class WalletDetails extends Component { constructor(props) { super(props); - let address = props.navigation.state.params.address; - let secret = props.navigation.state.params.secret; - - /** @type {AbstractWallet} */ - let wallet; - - for (let w of BlueApp.getWallets()) { - if ((address && w.getAddress() === address) || w.getSecret() === secret) { - // found our wallet - wallet = w; - } - } + const wallet = props.navigation.getParam('wallet'); + const address = wallet.getAddress(); this.state = { isLoading: true, @@ -54,18 +44,19 @@ export default class WalletDetails extends Component { this.props.navigation.setParams({ saveAction: () => this.setLabel() }); } - async componentDidMount() { + componentDidMount() { this.setState({ isLoading: false, }); } - async setLabel() { - this.state.wallet.setLabel(this.state.walletName); - BlueApp.saveToDisk(); - alert('Wallet updated.'); - - this.props.navigation.goBack(null); + setLabel() { + this.setState({ isLoading: true }, () => { + this.state.wallet.setLabel(this.state.walletName); + BlueApp.saveToDisk(); + alert('Wallet updated.'); + this.props.navigation.goBack(null); + }); } render() { @@ -187,12 +178,14 @@ export default class WalletDetails extends Component { { text: loc.wallets.details.yes_delete, onPress: async () => { - BlueApp.deleteWallet(this.state.wallet); - ReactNativeHapticFeedback.trigger('notificationSuccess', false); - await BlueApp.saveToDisk(); - EV(EV.enum.TRANSACTIONS_COUNT_CHANGED); - EV(EV.enum.WALLETS_COUNT_CHANGED); - this.props.navigation.navigate('Wallets'); + this.setState({ isLoading: true }, async () => { + BlueApp.deleteWallet(this.state.wallet); + ReactNativeHapticFeedback.trigger('notificationSuccess', false); + await BlueApp.saveToDisk(); + EV(EV.enum.TRANSACTIONS_COUNT_CHANGED); + EV(EV.enum.WALLETS_COUNT_CHANGED); + this.props.navigation.navigate('Wallets'); + }); }, style: 'destructive', }, @@ -222,6 +215,7 @@ WalletDetails.propTypes = { }), navigate: PropTypes.func, goBack: PropTypes.func, + getParam: PropTypes.func, setParams: PropTypes.func, }), }; diff --git a/screen/wallets/list.js b/screen/wallets/list.js index 90f148070..507db0038 100644 --- a/screen/wallets/list.js +++ b/screen/wallets/list.js @@ -19,7 +19,6 @@ import { Icon } from 'react-native-elements'; import { NavigationEvents } from 'react-navigation'; import ReactNativeHapticFeedback from 'react-native-haptic-feedback'; import PropTypes from 'prop-types'; -import { BitcoinUnit } from '../../models/bitcoinUnits'; import { LightningCustodianWallet } from '../../class'; let EV = require('../../events'); let A = require('../../analytics'); @@ -240,16 +239,16 @@ export default class WalletsList extends Component { const invoiceExpiration = item.timestamp + item.expire_time; if (invoiceExpiration > now) { - return loc.formatBalanceWithoutSuffix(item.value && item.value, BitcoinUnit.BTC).toString(); + return loc.formatBalanceWithoutSuffix(item.value && item.value, item.walletPreferredBalanceUnit, true).toString(); } else if (invoiceExpiration < now) { if (item.ispaid) { - return loc.formatBalanceWithoutSuffix(item.value && item.value, BitcoinUnit.BTC).toString(); + return loc.formatBalanceWithoutSuffix(item.value && item.value, item.walletPreferredBalanceUnit, true).toString(); } else { return loc.lnd.expired; } } } else { - return loc.formatBalanceWithoutSuffix(item.value && item.value, BitcoinUnit.BTC).toString(); + return loc.formatBalanceWithoutSuffix(item.value && item.value, item.walletPreferredBalanceUnit, true).toString(); } }; diff --git a/screen/wallets/transactions.js b/screen/wallets/transactions.js index 7ad60385a..ab39987b4 100644 --- a/screen/wallets/transactions.js +++ b/screen/wallets/transactions.js @@ -33,8 +33,7 @@ export default class WalletTransactions extends Component { style={{ marginHorizontal: 8, minWidth: 150 }} onPress={() => navigation.navigate('WalletDetails', { - address: navigation.state.params.wallet.getAddress(), - secret: navigation.state.params.wallet.getSecret(), + wallet: navigation.state.params.wallet, }) } >