ethereumjs-util#isValidPrivate TypeScript Examples
The following examples show how to use
ethereumjs-util#isValidPrivate.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: accounts.ts From remix-project with MIT License | 5 votes |
newAccount (cb) {
let privateKey:Buffer
do {
privateKey = crypto.randomBytes(32)
} while (!isValidPrivate(privateKey))
this._addAccount(privateKey, '0x56BC75E2D63100000')
return cb(null, '0x' + privateToAddress(privateKey).toString('hex'))
}