I am in the process of developing a custom ETH wallet, I am able to generate the public/private keys by using vanity eth. After receiving the amount in this wallet, I need to send ETH to another wallet for which I am trying to use web3. How do I do this? The wallet currently have few ETH in it but when I try to check the balance with web3 code it shows zero balance. So how do I transfer ETH from one wallet to another using web3 code, please advice.
My code for get balance of my wallet address is as 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.
This is how I performed an ether transaction in a previous project. Also in the future posting here, for the time being, may get you a quicker response https://ethereum.stackexchange.com/