diff --git a/package.json b/package.json index 577bca14..395612d1 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "@fortawesome/fontawesome-free-solid": "^5.0.6", "@fortawesome/react-fontawesome": "^0.0.17", "@ledgerhq/common": "2.3.0", + "@ledgerhq/currencies": "^2.3.0", "@ledgerhq/hw-app-btc": "^2.2.0", "@ledgerhq/hw-app-eth": "^2.2.0", "@ledgerhq/hw-transport": "^2.2.0", diff --git a/src/helpers/format.js b/src/helpers/format.js index 7d907edb..0657f168 100644 --- a/src/helpers/format.js +++ b/src/helpers/format.js @@ -1,8 +1,11 @@ // @flow -import { formatCurrencyUnit } from '@ledgerhq/common/lib/data/currency' +import { formatCurrencyUnit } from '@ledgerhq/currencies' -export function formatBTC(v: string | number, options: Object = { alwaysShowSign: true }) { +export function formatBTC( + v: string | number, + options: Object = { alwaysShowSign: true, showCode: true }, +) { return formatCurrencyUnit( { name: 'bitcoin', @@ -11,7 +14,6 @@ export function formatBTC(v: string | number, options: Object = { alwaysShowSign magnitude: 8, }, Number(v), - options.alwaysShowSign, - true, + options, ) } diff --git a/yarn.lock b/yarn.lock index 48c47188..7cb9219d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -146,6 +146,12 @@ redux "^3.7.2" redux-thunk "^2.2.0" +"@ledgerhq/currencies@^2.3.0": + version "2.3.0" + resolved "https://registry.yarnpkg.com/@ledgerhq/currencies/-/currencies-2.3.0.tgz#4f76a7a47890d23a754b34da4d615fa479e2edec" + dependencies: + querystring "^0.2.0" + "@ledgerhq/hw-app-btc@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@ledgerhq/hw-app-btc/-/hw-app-btc-2.2.0.tgz#c5c99c8974ab8df378f773c5b03052304ce3812b"