diff --git a/src/bridge/EthereumJSBridge.js b/src/bridge/EthereumJSBridge.js index 618b8c75..48972922 100644 --- a/src/bridge/EthereumJSBridge.js +++ b/src/bridge/EthereumJSBridge.js @@ -176,6 +176,7 @@ const EthereumBridge: WalletBridge = { index, { address, path: freshAddressPath, publicKey }, isStandard, + mandatoryCount, ): { account?: Account, complete?: boolean } { const balance = await api.getAccountBalance(address) if (finished) return { complete: true } @@ -211,6 +212,10 @@ const EthereumBridge: WalletBridge = { } newAccountCount++ } + + if (index < mandatoryCount) { + return {} + } // NB for legacy addresses maybe we will continue at least for the first 10 addresses return { complete: true } } @@ -254,7 +259,13 @@ const EthereumBridge: WalletBridge = { const res = await getAddressCommand .send({ currencyId: currency.id, devicePath: deviceId, path: freshAddressPath }) .toPromise() - const r = await stepAddress(index, res, isStandard) + const r = await stepAddress( + index, + res, + isStandard, + // $FlowFixMe i know i know, not part of function + derivation.mandatoryCount || 0, + ) if (r.account) o.next(r.account) if (r.complete) { break diff --git a/src/helpers/derivations.js b/src/helpers/derivations.js index 2b74942a..8ed1748c 100644 --- a/src/helpers/derivations.js +++ b/src/helpers/derivations.js @@ -8,6 +8,7 @@ type Derivation = ({ }) => string const ethLegacyMEW: Derivation = ({ x }) => `44'/60'/0'/${x}` +ethLegacyMEW.mandatoryCount = 5 const etcLegacyMEW: Derivation = ({ x }) => `44'/60'/160720'/${x}'/0`