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
// npm install web3 | |
var Web3 = require('web3'); | |
var web3 = new Web3('wss://ropsten.infura.io/ws'); | |
console.log(web3.version) | |
// 0x9490d2d67f5455d6b1772a928cb1f3f05f2db32a | |
var privateKey = '0x1A6EDBD9EC44934671718982671A2E2B7A2573430BFEACEA65EB54E7F765442E'; | |
var weiValue = web3.utils.toWei('0.001', 'ether'); | |
var tx = { | |
to: '0x14ef8277775c680ac000443e9bde9dbb74a7ee74', | |
value: weiValue, | |
gasPrice: 20000000000, | |
gas: 2000000 | |
} | |
web3.eth.accounts.signTransaction(tx, privateKey, function(error, result) { | |
console.log(error); | |
console.log(result); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment