Skip to content

Commit

Permalink
feat: ledger BCH Cash address format
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre committed Oct 3, 2023
1 parent 8714b53 commit 3f8a59d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/hdwallet-ledger/src/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3f8a59d

Please sign in to comment.