diff --git a/.storybook/webpack.config.js b/.storybook/webpack.config.js
index 62f80fb7..9cf5cca1 100644
--- a/.storybook/webpack.config.js
+++ b/.storybook/webpack.config.js
@@ -10,4 +10,7 @@ module.exports = {
},
],
},
+ node: {
+ fs: 'empty',
+ },
}
diff --git a/package.json b/package.json
index cd33e8b6..71a034c2 100644
--- a/package.json
+++ b/package.json
@@ -41,7 +41,7 @@
"@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.8.0-beta.24",
+ "@ledgerhq/live-common": "4.12.0",
"animated": "^0.2.2",
"async": "^2.6.1",
"axios": "^0.18.0",
@@ -185,7 +185,7 @@
"yaml-loader": "^0.5.0"
},
"engines": {
- "node": ">=8.9.0 <=8.14.0",
+ "node": ">=8.9.0 <=8.15.0",
"yarn": "^1.10.1"
},
"private": true
diff --git a/src/api/Ethereum.js b/src/api/Ethereum.js
index 4542ddb6..bd7b2160 100644
--- a/src/api/Ethereum.js
+++ b/src/api/Ethereum.js
@@ -1,7 +1,7 @@
// @flow
import type { CryptoCurrency } from '@ledgerhq/live-common/lib/types'
import { BigNumber } from 'bignumber.js'
-import { LedgerAPINotAvailable } from '@ledgerhq/live-common/lib/errors'
+import { LedgerAPINotAvailable } from '@ledgerhq/errors'
import network from './network'
import { blockchainBaseURL } from './Ledger'
diff --git a/src/api/Fees.js b/src/api/Fees.js
index 476ea5d0..84623f88 100644
--- a/src/api/Fees.js
+++ b/src/api/Fees.js
@@ -2,7 +2,7 @@
import invariant from 'invariant'
import LRU from 'lru-cache'
import type { Currency } from '@ledgerhq/live-common/lib/types'
-import { FeeEstimationFailed } from '@ledgerhq/live-common/lib/errors'
+import { FeeEstimationFailed } from '@ledgerhq/errors'
import { blockchainBaseURL } from './Ledger'
import network from './network'
diff --git a/src/api/network.js b/src/api/network.js
index db0a3e5d..66504be2 100644
--- a/src/api/network.js
+++ b/src/api/network.js
@@ -3,11 +3,7 @@ import axios from 'axios'
import { GET_CALLS_RETRY, GET_CALLS_TIMEOUT } from 'config/constants'
import { retry } from 'helpers/promise'
import logger from 'logger'
-import {
- LedgerAPIErrorWithMessage,
- LedgerAPIError,
- NetworkDown,
-} from '@ledgerhq/live-common/lib/errors'
+import { LedgerAPIErrorWithMessage, LedgerAPIError, NetworkDown } from '@ledgerhq/errors'
import anonymizer from 'helpers/anonymizer'
const userFriendlyError = (p: Promise, { url, method, startTime, ...rest }): Promise =>
diff --git a/src/bridge/EthereumJSBridge.js b/src/bridge/EthereumJSBridge.js
index a337dd85..1eeeca8f 100644
--- a/src/bridge/EthereumJSBridge.js
+++ b/src/bridge/EthereumJSBridge.js
@@ -25,7 +25,7 @@ import { apiForCurrency } from 'api/Ethereum'
import type { Tx } from 'api/Ethereum'
import getAddressCommand from 'commands/getAddress'
import signTransactionCommand from 'commands/signTransaction'
-import { NotEnoughBalance, FeeNotLoaded, ETHAddressNonEIP } from '@ledgerhq/live-common/lib/errors'
+import { NotEnoughBalance, FeeNotLoaded, ETHAddressNonEIP } from '@ledgerhq/errors'
import type { EditProps, WalletBridge } from './types'
type Transaction = {
diff --git a/src/bridge/LibcoreBridge.js b/src/bridge/LibcoreBridge.js
index 16d52909..e9d2ce8b 100644
--- a/src/bridge/LibcoreBridge.js
+++ b/src/bridge/LibcoreBridge.js
@@ -11,7 +11,7 @@ import libcoreSyncAccount from 'commands/libcoreSyncAccount'
import libcoreSignAndBroadcast from 'commands/libcoreSignAndBroadcast'
import libcoreGetFees, { extractGetFeesInputFromAccount } from 'commands/libcoreGetFees'
import libcoreValidAddress from 'commands/libcoreValidAddress'
-import { NotEnoughBalance, FeeNotLoaded } from '@ledgerhq/live-common/lib/errors'
+import { NotEnoughBalance, FeeNotLoaded } from '@ledgerhq/errors'
import type { WalletBridge, EditProps } from './types'
const NOT_ENOUGH_FUNDS = 52
diff --git a/src/bridge/RippleJSBridge.js b/src/bridge/RippleJSBridge.js
index c67a5a94..88f83531 100644
--- a/src/bridge/RippleJSBridge.js
+++ b/src/bridge/RippleJSBridge.js
@@ -32,7 +32,7 @@ import {
NotEnoughBalance,
FeeNotLoaded,
NotEnoughBalanceBecauseDestinationNotCreated,
-} from '@ledgerhq/live-common/lib/errors'
+} from '@ledgerhq/errors'
import type { WalletBridge, EditProps } from './types'
type Transaction = {
diff --git a/src/commands/firmwareRepair.js b/src/commands/firmwareRepair.js
index 64009722..d990fb4b 100644
--- a/src/commands/firmwareRepair.js
+++ b/src/commands/firmwareRepair.js
@@ -3,12 +3,15 @@
import repair from '@ledgerhq/live-common/lib/hw/firmwareUpdate-repair'
import { createCommand, Command } from 'helpers/ipc'
-type Input = void
+type Input = {
+ version: ?string,
+}
+
type Result = { progress: number }
const cmd: Command = createCommand(
'firmwareRepair',
- () => repair(''), // devicePath='' HACK to not depend on a devicePath because it's dynamic
+ ({ version }) => repair('', version), // devicePath='' HACK to not depend on a devicePath because it's dynamic
)
export default cmd
diff --git a/src/commands/libcoreGetFees.js b/src/commands/libcoreGetFees.js
index faebcdd0..fcedd03d 100644
--- a/src/commands/libcoreGetFees.js
+++ b/src/commands/libcoreGetFees.js
@@ -13,7 +13,7 @@ import {
bigNumberToLibcoreAmount,
getOrCreateWallet,
} from 'helpers/libcore'
-import { InvalidAddress } from '@ledgerhq/live-common/lib/errors'
+import { InvalidAddress } from '@ledgerhq/errors'
type BitcoinLikeTransaction = {
// TODO we rename this Transaction concept into transactionInput
diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js
index 30dd27ab..b683a58b 100644
--- a/src/commands/libcoreSignAndBroadcast.js
+++ b/src/commands/libcoreSignAndBroadcast.js
@@ -14,7 +14,7 @@ import {
bigNumberToLibcoreAmount,
getOrCreateWallet,
} from 'helpers/libcore'
-import { UpdateYourApp } from '@ledgerhq/live-common/lib/errors'
+import { UpdateYourApp } from '@ledgerhq/errors'
import withLibcore from 'helpers/withLibcore'
import { createCommand, Command } from 'helpers/ipc'
diff --git a/src/components/EnsureDeviceApp.js b/src/components/EnsureDeviceApp.js
index 47f90e79..623166a9 100644
--- a/src/components/EnsureDeviceApp.js
+++ b/src/components/EnsureDeviceApp.js
@@ -23,11 +23,7 @@ import IconUsb from 'icons/Usb'
import type { Device } from 'types/common'
-import {
- WrongDeviceForAccount,
- CantOpenDevice,
- UpdateYourApp,
-} from '@ledgerhq/live-common/lib/errors'
+import { WrongDeviceForAccount, CantOpenDevice, UpdateYourApp } from '@ledgerhq/errors'
import { getCurrentDevice } from 'reducers/devices'
const usbIcon =
diff --git a/src/components/FeesField/BitcoinKind.js b/src/components/FeesField/BitcoinKind.js
index 81c2ea9b..937e0702 100644
--- a/src/components/FeesField/BitcoinKind.js
+++ b/src/components/FeesField/BitcoinKind.js
@@ -8,7 +8,7 @@ import { translate } from 'react-i18next'
import type { T } from 'types/common'
-import { FeeNotLoaded } from '@ledgerhq/live-common/lib/errors'
+import { FeeNotLoaded } from '@ledgerhq/errors'
import InputCurrency from 'components/base/InputCurrency'
import Select from 'components/base/Select'
import type { Fees } from 'api/Fees'
diff --git a/src/components/FeesField/EthereumKind.js b/src/components/FeesField/EthereumKind.js
index aa02c86a..d6ef3d6d 100644
--- a/src/components/FeesField/EthereumKind.js
+++ b/src/components/FeesField/EthereumKind.js
@@ -4,7 +4,7 @@ import React, { Component } from 'react'
import { BigNumber } from 'bignumber.js'
import type { Account } from '@ledgerhq/live-common/lib/types'
-import { FeeNotLoaded } from '@ledgerhq/live-common/lib/errors'
+import { FeeNotLoaded } from '@ledgerhq/errors'
import InputCurrency from 'components/base/InputCurrency'
import type { Fees } from 'api/Fees'
import WithFeesAPI from '../WithFeesAPI'
diff --git a/src/components/FeesField/RippleKind.js b/src/components/FeesField/RippleKind.js
index 8692cb12..acf7622e 100644
--- a/src/components/FeesField/RippleKind.js
+++ b/src/components/FeesField/RippleKind.js
@@ -4,7 +4,7 @@ import React, { Component } from 'react'
import type { BigNumber } from 'bignumber.js'
import type { Account } from '@ledgerhq/live-common/lib/types'
import { apiForEndpointConfig, parseAPIValue } from 'api/Ripple'
-import { FeeNotLoaded } from '@ledgerhq/live-common/lib/errors'
+import { FeeNotLoaded } from '@ledgerhq/errors'
import InputCurrency from 'components/base/InputCurrency'
import GenericContainer from './GenericContainer'
diff --git a/src/components/GenuineCheck.js b/src/components/GenuineCheck.js
index 09107831..d3487591 100644
--- a/src/components/GenuineCheck.js
+++ b/src/components/GenuineCheck.js
@@ -20,7 +20,7 @@ import {
DeviceNotGenuineError,
DeviceGenuineSocketEarlyClose,
UnexpectedBootloader,
-} from '@ledgerhq/live-common/lib/errors'
+} from '@ledgerhq/errors'
import getDeviceInfo from 'commands/getDeviceInfo'
import getIsGenuine from 'commands/getIsGenuine'
@@ -156,10 +156,10 @@ class GenuineCheck extends PureComponent {
{
id: 'deviceInfo',
title: (
-
+
{'Navigate to the '}
{'dashboard'}
- {' app on your device'}
+ {' on your device'}
),
icon: homeIcon,
diff --git a/src/components/IsUnlocked.js b/src/components/IsUnlocked.js
index 391599db..997ee69f 100644
--- a/src/components/IsUnlocked.js
+++ b/src/components/IsUnlocked.js
@@ -17,7 +17,7 @@ import { hardReset } from 'helpers/reset'
import { fetchAccounts } from 'actions/accounts'
import { isLocked, unlock } from 'reducers/application'
-import { PasswordIncorrectError } from '@ledgerhq/live-common/lib/errors'
+import { PasswordIncorrectError } from '@ledgerhq/errors'
import Box from 'components/base/Box'
import InputPassword from 'components/base/InputPassword'
diff --git a/src/components/SelectCurrency/index.js b/src/components/SelectCurrency/index.js
index 0ba3bab4..97823765 100644
--- a/src/components/SelectCurrency/index.js
+++ b/src/components/SelectCurrency/index.js
@@ -18,6 +18,7 @@ type OwnProps = {
currencies?: CryptoCurrency[],
value?: CryptoCurrency,
placeholder: string,
+ autoFocus?: boolean,
t: T,
}
@@ -29,12 +30,21 @@ const mapStateToProps = (state, props: OwnProps) => ({
currencies: props.currencies || availableCurrencies(state),
})
-const SelectCurrency = ({ onChange, value, t, placeholder, currencies, ...props }: Props) => {
+const SelectCurrency = ({
+ onChange,
+ value,
+ t,
+ placeholder,
+ currencies,
+ autoFocus,
+ ...props
+}: Props) => {
const options = currencies
? currencies.map(c => ({ ...c, value: c.id, label: c.name, currency: c }))
: []
return (