diff --git a/.eslintrc b/.eslintrc index e22c8543..8dc74d37 100644 --- a/.eslintrc +++ b/.eslintrc @@ -38,6 +38,7 @@ "jsx-a11y/label-has-for": 0, "prefer-destructuring": 0, "new-cap": 0, + "no-continue": 0, "no-await-in-loop": 0, "no-restricted-globals": 0, "no-unused-expressions": 0, @@ -48,7 +49,10 @@ "no-shadow": 0, "no-underscore-dangle": 0, "no-console": 2, - "no-unused-vars": ["error", { "argsIgnorePattern": "^_", "vars": "all", "args": "after-used", "ignoreRestSiblings": true }], + "no-unused-vars": [ + "error", + { "argsIgnorePattern": "^_", "vars": "all", "args": "after-used", "ignoreRestSiblings": true } + ], "no-use-before-define": 0, "no-restricted-syntax": 0, "no-prototype-builtins": 0, @@ -57,31 +61,31 @@ "react/jsx-curly-brace-presence": 0, "react/jsx-filename-extension": 0, "react/jsx-no-target-blank": 0, - "react/jsx-no-literals": [1, {"noStrings": false}], + "react/jsx-no-literals": [1, { "noStrings": false }], "react/prefer-stateless-function": 0, "react/require-default-props": 0, "react/no-multi-comp": 0, - "react/sort-comp": [1, { - order: [ - 'static-methods', - 'lifecycle', - 'everything-else', - 'render' - ] - }] + "react/sort-comp": [ + 1, + { + "order": ["static-methods", "lifecycle", "everything-else", "render"] + } + ] }, "settings": { "import/resolver": { - "babel-module": {}, + "babel-module": {} }, "flowtype": { - "onlyFilesWithFlowAnnotation": true, + "onlyFilesWithFlowAnnotation": true } }, - "overrides": [{ - "files": [ "*stories.js" ], - "rules": { - "react/jsx-no-literals": 0 + "overrides": [ + { + "files": ["*stories.js"], + "rules": { + "react/jsx-no-literals": 0 + } } - }] + ] } diff --git a/package.json b/package.json index e342f101..54659a1a 100644 --- a/package.json +++ b/package.json @@ -35,13 +35,13 @@ } }, "dependencies": { - "@ledgerhq/hw-app-btc": "^4.32.0", + "@ledgerhq/hw-app-btc": "^4.34.0", "@ledgerhq/hw-app-eth": "^4.32.0", "@ledgerhq/hw-app-xrp": "^4.32.0", "@ledgerhq/hw-transport": "^4.32.0", "@ledgerhq/hw-transport-node-hid": "^4.32.0", - "@ledgerhq/ledger-core": "2.0.0-rc.14", - "@ledgerhq/live-common": "4.13.0", + "@ledgerhq/ledger-core": "2.0.0-rc.16", + "@ledgerhq/live-common": "4.14.0", "animated": "^0.2.2", "async": "^2.6.1", "axios": "^0.18.0", diff --git a/src/bridge/EthereumJSBridge.js b/src/bridge/EthereumJSBridge.js index 1eeeca8f..3282d1b4 100644 --- a/src/bridge/EthereumJSBridge.js +++ b/src/bridge/EthereumJSBridge.js @@ -13,6 +13,7 @@ import { getDerivationScheme, runDerivationScheme, isIterableDerivationMode, + derivationModeSupportsIndex, getMandatoryEmptyAccountSkip, } from '@ledgerhq/live-common/lib/derivation' import { @@ -314,6 +315,7 @@ const EthereumBridge: WalletBridge = { const derivationScheme = getDerivationScheme({ derivationMode, currency }) const stopAt = isIterableDerivationMode(derivationMode) ? 255 : 1 for (let index = 0; index < stopAt; index++) { + if (!derivationModeSupportsIndex(derivationMode, index)) continue const freshAddressPath = runDerivationScheme(derivationScheme, currency, { account: index, }) diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js index 88f83531..eff799e6 100644 --- a/src/bridge/RippleJSBridge.js +++ b/src/bridge/RippleJSBridge.js @@ -12,6 +12,7 @@ import { getDerivationScheme, runDerivationScheme, isIterableDerivationMode, + derivationModeSupportsIndex, } from '@ledgerhq/live-common/lib/derivation' import { getAccountPlaceholderName, @@ -314,6 +315,7 @@ const RippleJSBridge: WalletBridge = { const derivationScheme = getDerivationScheme({ derivationMode, currency }) const stopAt = isIterableDerivationMode(derivationMode) ? 255 : 1 for (let index = 0; index < stopAt; index++) { + if (!derivationModeSupportsIndex(derivationMode, index)) continue const freshAddressPath = runDerivationScheme(derivationScheme, currency, { account: index, }) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index b683a58b..a5847864 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -110,7 +110,7 @@ async function signTransaction({ const additionals = [] let expiryHeight if (currency.id === 'bitcoin_cash' || currency.id === 'bitcoin_gold') additionals.push('bip143') - if (currency.id === 'zcash') { + if (currency.id === 'zcash' || currency.id === 'komodo') { expiryHeight = Buffer.from([0x00, 0x00, 0x00, 0x00]) if (blockHeight >= 419200) { additionals.push('sapling') @@ -121,7 +121,7 @@ async function signTransaction({ } const rawInputs = transaction.getInputs() - const hasExtraData = currency.id === 'zcash' + const hasExtraData = currency.id === 'zcash' || currency.id === 'komodo' const inputs = await Promise.all( rawInputs.map(async input => { diff --git a/src/config/cryptocurrencies.js b/src/config/cryptocurrencies.js index c29ccbc7..4c29f7b3 100644 --- a/src/config/cryptocurrencies.js +++ b/src/config/cryptocurrencies.js @@ -24,6 +24,7 @@ const supported: CryptoCurrencyIds[] = [ 'vertcoin', 'peercoin', 'viacoin', + 'stakenet', 'stealthcoin', 'poswallet', 'clubcoin', diff --git a/src/helpers/libcore.js b/src/helpers/libcore.js index 6e05e7fb..29a209dd 100644 --- a/src/helpers/libcore.js +++ b/src/helpers/libcore.js @@ -13,6 +13,7 @@ import { isSegwitDerivationMode, isUnsplitDerivationMode, isIterableDerivationMode, + derivationModeSupportsIndex, } from '@ledgerhq/live-common/lib/derivation' import { getCryptoCurrencyById } from '@ledgerhq/live-common/lib/currencies' import { @@ -258,8 +259,9 @@ async function scanNextAccount(props: { if (isUnsubscribed()) return [] const isLast = ops.length === 0 || !isIterableDerivationMode(derivationMode) + const skipIndex = !derivationModeSupportsIndex(derivationMode, accountIndex) - if (!isLast || showNewAccount) { + if ((!isLast || showNewAccount) && !skipIndex) { onAccountScanned(account) accounts.push(account) } diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 9b7e69c9..e19b4482 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -271,7 +271,7 @@ "identifier": "Identifier", "mcuTitle": "Updating MCU", "mcuFirst": "Disconnect the USB cable from your device", - "mcuSecond": "Press the left button and hold it while you reconnect the USB cable until the processing screen appears", + "mcuSecond": "Press the left button and hold it while you reconnect the USB cable until the bootloader screen appears", "mcuPin": "If asked on device, please enter your pin code to finish the process", "successTitle": "Firmware updated", "successText": "You may re-install the apps on your device" diff --git a/static/i18n/es/app.json b/static/i18n/es/app.json index 923863d2..0b8a461a 100644 --- a/static/i18n/es/app.json +++ b/static/i18n/es/app.json @@ -451,8 +451,12 @@ }, "repairDevice": { "title": "Repair your Ledger device", - "desc": "If you encountered some issue while updating your device and cannot resume the update process, you can try this option to repair your device.", - "button": "Repair" + "descSettings": "Use this tool to restore your Ledger device if it has become stuck during a firmware update.", + "desc": "Please select the state of your Ledger device.", + "button": "Repair", + "generic": "Bootloader", + "mcuNotGenuine": "MCU not genuine", + "followDeviceRepair": "Follow device repair instructions" }, "exportLogs": { "title": "Exportar registros", @@ -851,7 +855,7 @@ "description": "{{message}}" }, "UnexpectedBootloader": { - "title": "Opps, your device should not be in Bootloader mode", + "title": "Oops, your device should not be in Bootloader mode", "description": "Please restart your device or contact us" }, "UserRefusedFirmwareUpdate": { @@ -870,6 +874,10 @@ "title": "Se requiere la actualización de la aplicación.", "description": "Desinstala y vuelve a instalar la aplicación {{managerAppName}} en el Gestor." }, + "DeviceOnDashboardExpected": { + "title": "Return to Dashboard", + "description": "Please navigate back to Dashboard on your device" + }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error)", "description": null @@ -902,6 +910,10 @@ }, "FeeNotLoaded": { "title": "Couldn’t load fee rates, please set manual fees" + }, + "UnknownMCU": { + "title": "Unknown MCU version", + "description": "Please contact Ledger Support" } } -} \ No newline at end of file +} diff --git a/static/i18n/fr/app.json b/static/i18n/fr/app.json index 254fddc4..17eeea58 100644 --- a/static/i18n/fr/app.json +++ b/static/i18n/fr/app.json @@ -451,8 +451,12 @@ }, "repairDevice": { "title": "Repair your Ledger device", - "desc": "If you encountered some issue while updating your device and cannot resume the update process, you can try this option to repair your device.", - "button": "Repair" + "descSettings": "Use this tool to restore your Ledger device if it has become stuck during a firmware update.", + "desc": "Please select the state of your Ledger device.", + "button": "Repair", + "generic": "Bootloader", + "mcuNotGenuine": "MCU not genuine", + "followDeviceRepair": "Follow device repair instructions" }, "exportLogs": { "title": "Export logs", @@ -851,7 +855,7 @@ "description": "{{message}}" }, "UnexpectedBootloader": { - "title": "Opps, your device should not be in Bootloader mode", + "title": "Oops, your device should not be in Bootloader mode", "description": "Please restart your device or contact us" }, "UserRefusedFirmwareUpdate": { @@ -870,6 +874,10 @@ "title": "Mise à jour de l’application requise", "description": "Désinstallez et réinstallez l’application {{managerAppName}} dans le gestionnaire." }, + "DeviceOnDashboardExpected": { + "title": "Return to Dashboard", + "description": "Please navigate back to Dashboard on your device" + }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error)", "description": null @@ -902,6 +910,10 @@ }, "FeeNotLoaded": { "title": "Couldn’t load fee rates, please set manual fees" + }, + "UnknownMCU": { + "title": "Unknown MCU version", + "description": "Please contact Ledger Support" } } -} \ No newline at end of file +} diff --git a/static/i18n/ja/app.json b/static/i18n/ja/app.json index 2333e40f..54603407 100644 --- a/static/i18n/ja/app.json +++ b/static/i18n/ja/app.json @@ -451,8 +451,12 @@ }, "repairDevice": { "title": "Repair your Ledger device", - "desc": "If you encountered some issue while updating your device and cannot resume the update process, you can try this option to repair your device.", - "button": "Repair" + "descSettings": "Use this tool to restore your Ledger device if it has become stuck during a firmware update.", + "desc": "Please select the state of your Ledger device.", + "button": "Repair", + "generic": "Bootloader", + "mcuNotGenuine": "MCU not genuine", + "followDeviceRepair": "Follow device repair instructions" }, "exportLogs": { "title": "ログのエクスポート", @@ -851,7 +855,7 @@ "description": "{{message}}" }, "UnexpectedBootloader": { - "title": "Opps, your device should not be in Bootloader mode", + "title": "Oops, your device should not be in Bootloader mode", "description": "Please restart your device or contact us" }, "UserRefusedFirmwareUpdate": { @@ -870,6 +874,10 @@ "title": "アプリの更新が必要です", "description": "マネージャーに{{managerAppName}}アプリをアンインストールし、再インストールします" }, + "DeviceOnDashboardExpected": { + "title": "Return to Dashboard", + "description": "Please navigate back to Dashboard on your device" + }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error)", "description": null @@ -902,6 +910,10 @@ }, "FeeNotLoaded": { "title": "Couldn’t load fee rates, please set manual fees" + }, + "UnknownMCU": { + "title": "Unknown MCU version", + "description": "Please contact Ledger Support" } } -} \ No newline at end of file +} diff --git a/static/i18n/ko/app.json b/static/i18n/ko/app.json index 2fbf6e5d..c7323495 100644 --- a/static/i18n/ko/app.json +++ b/static/i18n/ko/app.json @@ -451,8 +451,12 @@ }, "repairDevice": { "title": "Repair your Ledger device", - "desc": "If you encountered some issue while updating your device and cannot resume the update process, you can try this option to repair your device.", - "button": "Repair" + "descSettings": "Use this tool to restore your Ledger device if it has become stuck during a firmware update.", + "desc": "Please select the state of your Ledger device.", + "button": "Repair", + "generic": "Bootloader", + "mcuNotGenuine": "MCU not genuine", + "followDeviceRepair": "Follow device repair instructions" }, "exportLogs": { "title": "로그 내보내기", @@ -851,7 +855,7 @@ "description": "{{message}}" }, "UnexpectedBootloader": { - "title": "Opps, your device should not be in Bootloader mode", + "title": "Oops, your device should not be in Bootloader mode", "description": "Please restart your device or contact us" }, "UserRefusedFirmwareUpdate": { @@ -870,6 +874,10 @@ "title": "앱 업데이트가 필요합니다.", "description": "Manager에서 {{managerAppName}} 앱을 제거한 후 다시 설치하십시오." }, + "DeviceOnDashboardExpected": { + "title": "Return to Dashboard", + "description": "Please navigate back to Dashboard on your device" + }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error)", "description": null @@ -902,6 +910,10 @@ }, "FeeNotLoaded": { "title": "Couldn’t load fee rates, please set manual fees" + }, + "UnknownMCU": { + "title": "Unknown MCU version", + "description": "Please contact Ledger Support" } } -} \ No newline at end of file +} diff --git a/static/i18n/ru/app.json b/static/i18n/ru/app.json index db9bcb7a..18f3a8fc 100644 --- a/static/i18n/ru/app.json +++ b/static/i18n/ru/app.json @@ -451,8 +451,12 @@ }, "repairDevice": { "title": "Repair your Ledger device", - "desc": "If you encountered some issue while updating your device and cannot resume the update process, you can try this option to repair your device.", - "button": "Repair" + "descSettings": "Use this tool to restore your Ledger device if it has become stuck during a firmware update.", + "desc": "Please select the state of your Ledger device.", + "button": "Repair", + "generic": "Bootloader", + "mcuNotGenuine": "MCU not genuine", + "followDeviceRepair": "Follow device repair instructions" }, "exportLogs": { "title": "Экспортировать журналы", @@ -851,7 +855,7 @@ "description": "{{message}}" }, "UnexpectedBootloader": { - "title": "Opps, your device should not be in Bootloader mode", + "title": "Oops, your device should not be in Bootloader mode", "description": "Please restart your device or contact us" }, "UserRefusedFirmwareUpdate": { @@ -870,6 +874,10 @@ "title": "Требуется обновить приложение.", "description": "Удалите и повторно установите приложение {{managerAppName}} через диспетчер." }, + "DeviceOnDashboardExpected": { + "title": "Return to Dashboard", + "description": "Please navigate back to Dashboard on your device" + }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error)", "description": null @@ -902,6 +910,10 @@ }, "FeeNotLoaded": { "title": "Couldn’t load fee rates, please set manual fees" + }, + "UnknownMCU": { + "title": "Unknown MCU version", + "description": "Please contact Ledger Support" } } -} \ No newline at end of file +} diff --git a/static/i18n/zh/app.json b/static/i18n/zh/app.json index bcf8fb40..505d2b23 100644 --- a/static/i18n/zh/app.json +++ b/static/i18n/zh/app.json @@ -451,8 +451,12 @@ }, "repairDevice": { "title": "Repair your Ledger device", - "desc": "If you encountered some issue while updating your device and cannot resume the update process, you can try this option to repair your device.", - "button": "Repair" + "descSettings": "Use this tool to restore your Ledger device if it has become stuck during a firmware update.", + "desc": "Please select the state of your Ledger device.", + "button": "Repair", + "generic": "Bootloader", + "mcuNotGenuine": "MCU not genuine", + "followDeviceRepair": "Follow device repair instructions" }, "exportLogs": { "title": "导出记录", @@ -851,7 +855,7 @@ "description": "{{message}}" }, "UnexpectedBootloader": { - "title": "Opps, your device should not be in Bootloader mode", + "title": "Oops, your device should not be in Bootloader mode", "description": "Please restart your device or contact us" }, "UserRefusedFirmwareUpdate": { @@ -870,6 +874,10 @@ "title": "需要更新应用程序", "description": "在管理器中卸载并重新安装 {{managerAppName}} 应用程序" }, + "DeviceOnDashboardExpected": { + "title": "Return to Dashboard", + "description": "Please navigate back to Dashboard on your device" + }, "WebsocketConnectionError": { "title": "Sorry, try again (websocket error)", "description": null @@ -902,6 +910,10 @@ }, "FeeNotLoaded": { "title": "Couldn’t load fee rates, please set manual fees" + }, + "UnknownMCU": { + "title": "Unknown MCU version", + "description": "Please contact Ledger Support" } } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 1716e7bf..5de18eda 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1690,6 +1690,14 @@ "@ledgerhq/hw-transport" "^4.32.0" create-hash "^1.1.3" +"@ledgerhq/hw-app-btc@^4.34.0": + version "4.34.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-4.34.0.tgz#0bbc46afd29de04ac6a73582fbf9a09fcf5ed117" + integrity sha512-xR4rH8o8YRvyhnTvb8g89NAJQQqXJkApiFtCvduBamu5V+rDvhHYlFu2B+CU6g8lzLFACMDIqJqXbmwT80AGjw== + dependencies: + "@ledgerhq/hw-transport" "^4.32.0" + create-hash "^1.1.3" + "@ledgerhq/hw-app-eth@^4.32.0": version "4.32.0" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-eth/-/hw-app-eth-4.32.0.tgz#7d43ca2c7952f1fb726e02c3b4485be10af481a2" @@ -1722,18 +1730,18 @@ dependencies: events "^3.0.0" -"@ledgerhq/ledger-core@2.0.0-rc.14": - version "2.0.0-rc.14" - resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.14.tgz#538b771e9d837ce1d26aabaa1dfe58a6b882e3cd" - integrity sha512-WIq6DyOoqtPPt+pS8K6NQ8EJD9GIn/VD1HLehWvJYqZhUf1IOIEIaOqxCnayHMQ/7b4c68xANgmKggUBdQ0M+A== +"@ledgerhq/ledger-core@2.0.0-rc.16": + version "2.0.0-rc.16" + resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.16.tgz#51f141c0143edb020e38855bf2e2619e3446e74f" + integrity sha512-gmbeXRBg4NSqzH6+EajYTzaQlwN5ugaN1nH0SI6BvRqMfcorxNRE8byfh3F2u+7TNchBW72vOZnKPDShaR9/pQ== dependencies: bindings "^1.3.0" nan "^2.6.2" -"@ledgerhq/live-common@4.13.0": - version "4.13.0" - resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.13.0.tgz#7e5eeaf8af2937cd30649b3f6e2094878980f557" - integrity sha512-DSO3CLVdZav7QC2DarbfAXW14z3omRvDFFfwF3URDwKH6nPIVJsE5WqiMpnQ1SL+a1qnevGkF5NLrvwv5bdRmQ== +"@ledgerhq/live-common@4.14.0": + version "4.14.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/live-common/-/live-common-4.14.0.tgz#56ecac0a21f0d77a66a57d5ce9e2159b426e0ec7" + integrity sha512-oKvb/QZrG2XzVvq/IM+73lyw33VlyDu03hmYFCR48U2DGao/SCFOH8J0vQZK/U9VTSqpnC8mEZKQhNOQkf5hoA== dependencies: "@aeternity/ledger-app-api" "0.0.4" "@ledgerhq/errors" "^4.32.0"