diff --git a/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx b/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx index fcf7204cbaa..fd9f478ab47 100644 --- a/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx +++ b/src/app/features/ledger/flows/request-bitcoin-keys/ledger-request-bitcoin-keys.tsx @@ -45,14 +45,16 @@ function LedgerRequestBitcoinKeys() { const { keys } = await pullBitcoinKeysFromLedgerDevice(app)({ network: bitcoinNetworkModeToCoreNetworkMode(network.chain.bitcoin.bitcoinNetwork), onRequestKey(index) { - if (index <= 4) { + const keyGroupFinalIndex = defaultNumberOfKeysToPullFromLedgerDevice - 1; + const isNativeSegwitkey = index <= keyGroupFinalIndex; + if (isNativeSegwitkey) { ledgerNavigate.toDeviceBusyStep( `Requesting Bitcoin Native Segwit address (${index + 1}…${defaultNumberOfKeysToPullFromLedgerDevice})` ); return; } ledgerNavigate.toDeviceBusyStep( - `Requesting Bitcoin Taproot address (${index - 4}…${defaultNumberOfKeysToPullFromLedgerDevice})` + `Requesting Bitcoin Taproot address (${index - keyGroupFinalIndex}…${defaultNumberOfKeysToPullFromLedgerDevice})` ); }, }); diff --git a/src/app/features/ledger/flows/request-bitcoin-keys/request-bitcoin-keys.utils.ts b/src/app/features/ledger/flows/request-bitcoin-keys/request-bitcoin-keys.utils.ts index f99c612906f..fe0a1e6f924 100644 --- a/src/app/features/ledger/flows/request-bitcoin-keys/request-bitcoin-keys.utils.ts +++ b/src/app/features/ledger/flows/request-bitcoin-keys/request-bitcoin-keys.utils.ts @@ -72,12 +72,13 @@ export function pullBitcoinKeysFromLedgerDevice(bitcoinApp: BitcoinApp, targetId }); keys.push({ id: createWalletIdDecoratedPath(path, 'default'), path, policy, targetId }); } + for ( let accountIndex = 0; accountIndex < defaultNumberOfKeysToPullFromLedgerDevice; accountIndex++ ) { - onRequestKey?.(accountIndex + 5); + onRequestKey?.(accountIndex + defaultNumberOfKeysToPullFromLedgerDevice); const { path, policy } = await getTaprootExtendedPublicKey({ bitcoinApp, fingerprint,