Categories
Cryptocurrency Ethereum Mastering Development

problem help me gas * price + value

i see all topic , but yet not slove my problem . please help me <pre> var EthereumTx=require(‘ethereumjs-tx’).Transaction const Web3=require(‘web3’) const web3 = new Web3(‘https://rinkeby.infura.io/v3/85xxxxxxxxxxx2af25e829b8d9df‘) const account1=’0xbd77caf08fe49d3f5aef6f83fc23b8d2129b468f’ const main = async () => { const count = await web3.eth.getTransactionCount(‘0xxxxxxxxxxxxxxxf5aef6f83fc23b8d2129b468f’); const nonce = web3.utils.toHex(count); const block = await web3.eth.getBlock(‘latest’); const gasLimit = web3.utils.toHex(3000000) const gasPrice = […]

Categories
Cryptocurrency Development Ethereum

Error: Unhandled promise rejection

I keep on getting this error whenever I run my code below: var Tx = require(‘ethereumjs-tx’).Transaction var Web3 = require(‘web3’) web3 = new Web3(‘https://ropsten.infura.io/v3/9526911a3c4843388be35f52ce95de02’) const account1 = ‘0x0539B9c9C886e93778542B553C64cb5EAfB902b1’ const account2 = ‘0xca7F442c44b079dd07324C9c7eDfe348b92f46c9’ const privatekey1 = Buffer.from(‘c986afe09588ea4d871e6b8a25821bbd0804611bc1a332c18238ca1aed18981b’ , ‘hex’) const privatekey2 = Buffer.from(‘1311767cc9f7ac6e711b12dec8949057d4148ca004b97bbfee1cf7fd2411e2d8’ , ‘hex’) var transCount = web3.eth.getTransactionCount(account1) transCount.then(count => { const txObject = { […]

Categories
Cryptocurrency Development Ethereum

Transaction hash is ‘undefined’ when running web3 code from command prompt

I wrote this java script code to send test ether to my other account: var Tx = require(‘ethereumjs-tx’).Transaction var Web3 = require(‘web3’) web3 = new Web3(‘https://ropsten.infura.io/hqRzEqFKv6IsjRxfVUMH’) const account1 = ‘0x0539B9c9C886e93778542B553C64cb5EAfB902b1’ const account2 = ‘0xca7F442c44b079dd07324C9c7eDfe348b92f46c9’ const privatekey1 = Buffer.from(‘cxxxxxxxxxxxxx5xd0804xxxxxxx238ca1aed1xxx’ , ‘hex’) web3.eth.getTransactionCount(account1 , (err, transCount) => { const txObject = { nonce: web3.utils.toHex(transCount) , to: account2 […]