Last active
June 14, 2017 02:08
-
-
Save vidul-nikolaev-petrov/d59f9fc026456a2b08062eb867391de1 to your computer and use it in GitHub Desktop.
Simulate BTC balance
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
#!/usr/bin/env node | |
var blockexplorer = require('blockchain.info/blockexplorer') | |
// randomly chosen | |
var addresses = [ | |
'1CEDQ9Vfq8pYVi3Anp926Zjac9Xiz394Y1', | |
'1CGXTwzjTHbUJXLAvWB4r7L2QLctEpWjti', | |
'1DUb2YYbQA1jjaNYzVXLZ7ZioEhLXtbUru', | |
'1Hz96kJKF2HLPGY15JWLB5m9qGNxvt8tHJ', | |
'3K34VEacgVG2tHJ7pb24jACJuLtpB3TDs2', | |
]; | |
var promises = addresses.map(blockexplorer.getAddress); | |
Promise.all(promises).then( | |
data => console.log(data.reduce((a, e) => a += e.final_balance / 1e8, 0)) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment