Key instead seed phrase #2293
-
Greetings, I would like to have an information, is it possible to use the secret key instead of the words? the code is simply the following:
i would like to use key instead
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@ubuntutest You can use the Wallet class by passing in the private key in the constructor. const privateKey = '....';
const wallet = new ethers.Wallet(privateKey); Just adding a note, you should use a private key that is generated from a great entropy source. The (also moving to discussions) |
Beta Was this translation helpful? Give feedback.
-
Thanks, it was simple, it worked without problems. Not sure about the Could you give me a simple example for what I need? |
Beta Was this translation helpful? Give feedback.
@ubuntutest You can use the Wallet class by passing in the private key in the constructor.
Just adding a note, you should use a private key that is generated from a great entropy source. The
ethers.Wallet.createRandom()
uses the secure entropy sources available in the enviornment. If the current environment does not have a secure entropy source, an error is thrown.(also moving to discussions)