Closed ifelsedeveloper closed 7 months ago
Your comment says Add path support for the ledger for andre-t/ledger and etherporject/hardware-wallet.
But the code will only call derivationPath = getDerivationPath(network.config.chainId);
for ethersprojectHardwareWalletsModule
I have implemented logic to handle different scenarios when loading the EtherProject. When this module is loaded, I add the specified path, which I have verified on Ubuntu. Additionally, if the 'andre' module is detected, I initialize the LedgerSigner with an alternate path. This setup has been tested and confirmed working with a Ledger device on macOS.
The code functions as follows: If the ethersprojectHardwareWalletsModule is present, it determines the derivationPath based on the network's chain ID. Subsequently, ethersSigner is instantiated as a new LedgerSigner, using the provider and the derived path. In the absence of this module, ethersSigner is simply initialized with the provider and a predefined registeredProtocol."
" if (ethersprojectHardwareWalletsModule) { derivationPath = getDerivationPath(network.config.chainId); ethersSigner = new LedgerSigner( provider, 'default', derivationPath ); } else { ethersSigner = new LedgerSigner(provider, registeredProtocol); } "
Ok, so it is intended that derivationPath
is not used if @anders-t/ethers-ledger
is installed (but not @ethersproject/hardware-wallets
)
Yes, these two libraries have different constructors. I assume that no one have tested this project with ledger device.
I can make tests on ubuntu, mac os and windows with my ledger device one more time and post results here that it actually works. Please fill free to share any ideas how to improve the code
Thanks, just wanted to clarify, I ll merge this and publish. Thanks for your PR!
available in v0.11.44
Add path support for the ledger for andre-t/ledger and etherporject/hardware-wallet. Please check