How do I get all my wallet balance? I already have a very large number of wallet addresses, and I need to know the balance.and I want to know the number of addresses
With a block explorer
You can do it manually by looking up all your addresses on a block explorer (such as https://etherscan.io) and adding up the balances by hand.
With a script
Using geth and web3.js, you could create a script to iterate through a number of addresses and sum the balances.
Here's a simple script below;
web3 = new Web3(new Web3.providers.HttpProvider("https://mainnet.infura.io"));
var arrAddresses = ["0xb794f5ea0ba39494ce839613fffba74279579268", "0xe853c56864a2ebe4576a807d26fdc4a0ada51919"];
var flTotal = 0;
for(var intIteration = 0; intIteration < arrAddresses.length; intIteration++) {
flTotal += web3.fromWei(web3.eth.getBalance(arrAddresses[intIteration]).toString(10), "ether");
}
console.log("Total Ether: "+ flTotal);
Programatically: create an Etherscan API key then use the API to:
Get Ether Balance for a single Address
https://api.etherscan.io/api?module=account&action=balance&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a&tag=latest&apikey=YourApiKeyToken
Get Ether Balance for multiple Addresses in a single call
https://api.etherscan.io/api?module=account&action=balancemulti&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a,0x63a9975ba31b0b9626b34300f7f627147df1f526,0x198ef1ec325a96cc354c7266a038be8b5c558f67&tag=latest&apikey=YourApiKeyToken
Manually and easier
Just paste your addresses in this CoinSpectator tool.
Both options above do not include token balances. To get token balances:
Plug your address in the Ethplorer tool or use their API:
https://api.ethplorer.io/getAddressInfo/0xff71cb760666ab06aa73f34995b42dd4b85ea07b?apiKey=freekey
Try the below
function checkAllBalances() {
var totalBal = 0;
for (var acctNum in eth.accounts) {
var acct = eth.accounts[acctNum];
var acctBal = web3.fromWei(eth.getBalance(acct), "ether");
totalBal += parseFloat(acctBal);
console.log(" eth.accounts[" + acctNum + "]: \t" + acct + " \tbalance: " + acctBal + " ether");
}
console.log(" Total balance: " + totalBal + " ether");
};
You can sign up at etherscan.io to keep track of your addresses and balances:
- Register at etherscan.io
- Add your addresses https://etherscan.io/myaddress
- Check bottom of your address to see total
Bonus: you can also setup notifications for incoming or outgoing transactions. Plus it has number of APIs that you can use programmatically.