Last active
January 24, 2018 23:22
-
-
Save makevoid/8bfc85e475e5666d2d028f3d4e9a6ffc to your computer and use it in GitHub Desktop.
Bitcore-lib PrivateKey to Web3 account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Web3 = require('web3') | |
const web3 = new Web3("http://mainnet.infura.io") | |
const eth = web3.eth | |
const bitcore = require('bitcore-lib') | |
const PrivateKey = bitcore.PrivateKey | |
const privateKey = new PrivateKey() | |
eth.accounts.privateKeyToAccount(`0x${privateKey.toString()}`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment