-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change options.path #2
Comments
For which API call? The Wallet should already allow you to override the HDNode path. Can you provide an example and background for what you are trying to do? :) |
Oh! Sorry! Just realized this is not the ethers.js repo. Yes, that is a totally reasonable request. This library will be brought into the ethers.js monrepo in v5. I will add that then. :) |
Ack. Actually, back to the origina post, now that I’ve re-read the repo code. Do you mean you want to be able to change the path after instantiation? In general I prefer an immuatable signer, but having something akin to connect might make sense. Sorry for the noise. |
Np @ricmoo. And yeah, It would be great to could change the path after instantiation, in that way, we will be able to get a new address by a custom An example could be in a web app where the user has an input to enter a custom path and load the addresses for that path. I imagine that could be something like this: signer.changePath("m'/44'/60'/10'/0/0").getAddress().then((address) => {
...
}); |
To do this, you will need to re-instantiate a new LedgerSigner, since it is immutable. The Signer may have already be passed into an asynchronous function, which is in the process of using it. If it used the address to compute the recipient of a token at the beginning, then had its address changed and finally submitted a transaction, you can imagine how things could get complicated (and do wrong things) very quickly. But it is cheap and easy to create many instances. I could add a method similar to |
Thanks for this amazing library!
I have a question, it is possible to have a method to change/override the
options.path
value ??The text was updated successfully, but these errors were encountered: