diff --git a/build/icon.icns b/build/icon.icns index e730532f..66b2d6bd 100644 Binary files a/build/icon.icns and b/build/icon.icns differ diff --git a/package.json b/package.json index 6d3cc888..de494d04 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "compile": "bash ./scripts/compile.sh", "lint": "eslint src webpack .storybook", "flow": "flow", - "prettier": "prettier --write \"{src,webpack,.storybook,static/i18n}/**/*.{js,json}\"", + "prettier": "prettier --write \"{src,webpack,.storybook}/**/*.{js,json}\"", "ci": "yarn lint && yarn flow && yarn prettier", "storybook": "NODE_ENV=development STORYBOOK_ENV=1 start-storybook -s ./static -p 4444", "publish-storybook": "bash ./scripts/legacy/publish-storybook.sh", @@ -36,7 +36,7 @@ "@ledgerhq/hw-app-xrp": "^4.13.0", "@ledgerhq/hw-transport": "^4.13.0", "@ledgerhq/hw-transport-node-hid": "^4.13.0", - "@ledgerhq/ledger-core": "2.0.0-rc.4", + "@ledgerhq/ledger-core": "2.0.0-rc.5", "@ledgerhq/live-common": "3.0.0-beta.2", "animated": "^0.2.2", "async": "^2.6.1", diff --git a/src/bridge/EthereumJSBridge.js b/src/bridge/EthereumJSBridge.js index 496a15ba..5e7f0496 100644 --- a/src/bridge/EthereumJSBridge.js +++ b/src/bridge/EthereumJSBridge.js @@ -1,6 +1,7 @@ // @flow import { Observable } from 'rxjs' import { BigNumber } from 'bignumber.js' +import logger from 'logger' import React from 'react' import FeesField from 'components/FeesField/EthereumKind' import AdvancedOptions from 'components/AdvancedOptions/EthereumKind' @@ -184,7 +185,7 @@ const EthereumBridge: WalletBridge = { index, { address, path: freshAddressPath, publicKey }, isStandard, - mandatoryCount, + shouldSkipEmpty, ): { account?: Account, complete?: boolean } { const balance = await api.getAccountBalance(address) if (finished) return { complete: true } @@ -221,7 +222,7 @@ const EthereumBridge: WalletBridge = { newAccountCount++ } - if (index < mandatoryCount) { + if (shouldSkipEmpty) { return {} } // NB for legacy addresses maybe we will continue at least for the first 10 addresses @@ -262,6 +263,8 @@ const EthereumBridge: WalletBridge = { const last = derivations[derivations.length - 1] for (const derivation of derivations) { const isStandard = last === derivation + let emptyCount = 0 + const mandatoryEmptyAccountSkip = derivation.mandatoryEmptyAccountSkip || 0 for (let index = 0; index < 255; index++) { const freshAddressPath = derivation({ currency, x: index, segwit: false }) const res = await getAddressCommand @@ -271,10 +274,18 @@ const EthereumBridge: WalletBridge = { index, res, isStandard, - // $FlowFixMe i know i know, not part of function - derivation.mandatoryCount || 0, + emptyCount < mandatoryEmptyAccountSkip, ) - if (r.account) o.next(r.account) + logger.log( + `scanning ${currency.id} at ${freshAddressPath}: ${res.address} resulted of ${ + r.account ? `Account with ${r.account.operations.length} txs` : 'no account' + }. ${r.complete ? 'ALL SCANNED' : ''}`, + ) + if (r.account) { + o.next(r.account) + } else { + emptyCount++ + } if (r.complete) { break } diff --git a/src/components/Onboarding/OnboardingBreadcrumb.js b/src/components/Onboarding/OnboardingBreadcrumb.js index b1505aef..240adb61 100644 --- a/src/components/Onboarding/OnboardingBreadcrumb.js +++ b/src/components/Onboarding/OnboardingBreadcrumb.js @@ -51,7 +51,7 @@ function OnboardingBreadcrumb(props: Props) { return ( diff --git a/src/components/base/Chart/handleMouseEvents.js b/src/components/base/Chart/handleMouseEvents.js index 6e45ebe7..99f32a80 100644 --- a/src/components/base/Chart/handleMouseEvents.js +++ b/src/components/base/Chart/handleMouseEvents.js @@ -65,7 +65,7 @@ export default function handleMouseEvents({ NODES.tooltip .style('transition', '100ms cubic-bezier(.61,1,.53,1) opacity') .style('opacity', 1) - .style('transform', `translate3d(${MARGINS.left + x(d.parsedDate)}px, 0, 0)`) + .style('left', `${Math.floor(MARGINS.left + x(d.parsedDate))}px`) NODES.focus.style('opacity', 1) NODES.xBar.style('opacity', 1) } @@ -102,7 +102,7 @@ export default function handleMouseEvents({ , ), ) - .style('transform', `translate3d(${MARGINS.left + x(d.parsedDate)}px, 0, 0)`) + .style('left', `${Math.floor(MARGINS.left + x(d.parsedDate))}px`) NODES.xBar .attr('x1', x(d.parsedDate)) .attr('x2', x(d.parsedDate)) diff --git a/src/helpers/derivations.js b/src/helpers/derivations.js index 8579e4f4..f80e0e22 100644 --- a/src/helpers/derivations.js +++ b/src/helpers/derivations.js @@ -1,17 +1,21 @@ // @flow import type { CryptoCurrency } from '@ledgerhq/live-common/lib/types' -type Derivation = ({ - currency: CryptoCurrency, - segwit: boolean, - x: number, -}) => string +type Derivation = { + ({ + currency: CryptoCurrency, + segwit: boolean, + x: number, + }): string, + + mandatoryEmptyAccountSkip?: number, +} const ethLegacyMEW: Derivation = ({ x }) => `44'/60'/0'/${x}` -ethLegacyMEW.mandatoryCount = 5 +ethLegacyMEW.mandatoryEmptyAccountSkip = 10 const etcLegacyMEW: Derivation = ({ x }) => `44'/60'/160720'/${x}'/0` -etcLegacyMEW.mandatoryCount = 5 +etcLegacyMEW.mandatoryEmptyAccountSkip = 10 const rippleLegacy: Derivation = ({ x }) => `44'/144'/0'/${x}'` diff --git a/src/logger/logger-storybook.js b/src/logger/logger-storybook.js index eee5c550..81069e5f 100644 --- a/src/logger/logger-storybook.js +++ b/src/logger/logger-storybook.js @@ -16,6 +16,8 @@ module.exports = { analyticsTrack: noop, analyticsPage: noop, log: noop, + info: noop, + debug: noop, warn: noop, error: noop, critical: noop, diff --git a/src/logger/logger.js b/src/logger/logger.js index 234e017f..13fcdee1 100644 --- a/src/logger/logger.js +++ b/src/logger/logger.js @@ -350,6 +350,14 @@ export default { // General functions in case the hooks don't apply + debug: (...args: any) => { + logger.log('debug', ...args) + }, + + info: (...args: any) => { + logger.log('info', ...args) + }, + log: (...args: any) => { logger.log('info', ...args) }, diff --git a/src/styles/reset.js b/src/styles/reset.js index cf45923f..a413c8f3 100644 --- a/src/styles/reset.js +++ b/src/styles/reset.js @@ -1,5 +1,6 @@ module.exports = `* { -webkit-font-smoothing: antialiased; + backface-visibility: hidden; box-sizing: border-box; margin: 0; padding: 0; diff --git a/static/i18n/en/app.json b/static/i18n/en/app.json index 7502d81f..7b4cbf7c 100644 --- a/static/i18n/en/app.json +++ b/static/i18n/en/app.json @@ -323,6 +323,9 @@ "title": "Transaction sent", "text": "The transaction has been signed and sent to the network. Your account balance will update once the blockchain has confirmed the transaction.", "cta": "View operation details" + }, + "pending": { + "title": "Broadcasting transaction..." } } } diff --git a/static/i18n/en/errors.json b/static/i18n/en/errors.json index b60abb8e..235669aa 100644 --- a/static/i18n/en/errors.json +++ b/static/i18n/en/errors.json @@ -37,7 +37,7 @@ }, "EnpointConfig": { "title": "Invalid endpoint", - "description": "Please provide with a valid endpoint" + "description": "Please provide a valid endpoint" }, "FeeEstimationFailed": { "title": "Sorry, fee estimation failed", @@ -116,11 +116,11 @@ "description": "It took too long for the server to respond." }, "TransportError": { - "title": "Something went wrong. Please replug your device.", + "title": "Something went wrong. Please reconnect your device.", "description": "{{message}}" }, "TransportStatusError": { - "title": "Something went wrong. Please replug your device.", + "title": "Something went wrong. Please reconnect your device.", "description": "{{message}}" }, "UserRefusedFirmwareUpdate": { @@ -154,4 +154,4 @@ "InvalidAddress": { "title": "This is not a valid {{currencyName}} address" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 392d3943..a4815b2f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1521,9 +1521,9 @@ dependencies: events "^2.0.0" -"@ledgerhq/ledger-core@2.0.0-rc.4": - version "2.0.0-rc.4" - resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.4.tgz#0ec80a763c666658bea94bd38b86aa90d5a24906" +"@ledgerhq/ledger-core@2.0.0-rc.5": + version "2.0.0-rc.5" + resolved "https://registry.yarnpkg.com/@ledgerhq/ledger-core/-/ledger-core-2.0.0-rc.5.tgz#ec42f6c3cc265fc5ca82e01d27df38357642d3ed" dependencies: "@ledgerhq/hw-app-btc" "^4.7.3" "@ledgerhq/hw-transport-node-hid" "^4.7.6"