node.js - How to transfer Ethereum from one wallet to another wallet by using web3? -


i in process of developing custom eth wallet, able generate public/private keys using vanity eth. after receiving amount in wallet, need send eth wallet trying use web3. how do this? wallet have few eth in when try check balance web3 code shows 0 balance. how transfer eth 1 wallet using web3 code, please advice.

my code balance of wallet address below.

<script src="./node_modules/web3/dist/web3.min.js"></script> <script type="text/javascript">     var web3 = require('web3');     var web3 = new web3(new web3.providers.httpprovider("http://localhost:8545"));     console.log("balance = " + web3.fromwei(web3.eth.getbalance('wallet_address'), 'ether').tonumber()); </script> 

try this.

web3.eth.sendtransaction({from: acct1, to:acct2, value: web3.towei(1, 'ether'), gaslimit: 21000, gasprice: 20000000000}) 

this how performed ether transaction in previous project. in future posting here, time being, may quicker response https://ethereum.stackexchange.com/


Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -