diff --git a/packages/hdwallet-ledger/src/bitcoin.ts b/packages/hdwallet-ledger/src/bitcoin.ts index 28bc0a245..73263259d 100644 --- a/packages/hdwallet-ledger/src/bitcoin.ts +++ b/packages/hdwallet-ledger/src/bitcoin.ts @@ -45,7 +45,8 @@ export async function btcGetAddress(transport: LedgerTransport, msg: core.BTCGet const res = await transport.call("Btc", "getWalletPublicKey", bip32path, opts); handleError(res, transport, "Unable to obtain BTC address from device"); - return res.payload.bitcoinAddress; + const address = res.payload.bitcoinAddress; + return msg.coin.toLowerCase() === "bitcoincash" ? bchAddr.toCashAddress(address) : address; } // Adapted from https://github.com/LedgerHQ/ledger-wallet-webtool