diff --git a/src/hooks/useLedger.ts b/src/hooks/useLedger.ts index d44999eeb..290477ae5 100644 --- a/src/hooks/useLedger.ts +++ b/src/hooks/useLedger.ts @@ -113,7 +113,7 @@ const useLedger = () => { const getLedgerAccounts = useCallback( async (solana: AppSolana, accounts: LedgerAccount[]): Promise => { - let index = 0 + let index = -1 const prevAcct = last(accounts) if (prevAcct) { index = prevAcct.accountIndex + 1 diff --git a/src/utils/heliumLedger.ts b/src/utils/heliumLedger.ts index b92e3ddcd..95d136eff 100644 --- a/src/utils/heliumLedger.ts +++ b/src/utils/heliumLedger.ts @@ -2,7 +2,12 @@ import AppSolana from '@ledgerhq/hw-app-solana' import TransportBLE from '@ledgerhq/react-native-hw-transport-ble' import TransportHID from '@ledgerhq/react-native-hid' -const mainNetDerivation = (account = 0) => `44'/501'/${account}'` // HD derivation path +const mainNetDerivation = (account = -1) => { + if (account === -1) { + return "44'/501'" // main derivation path + } + return `44'/501'/${account}'` // sub derivation path +} // Replaces the account alias with the index from the ledger export const runDerivationScheme = (account = 0) => {