Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-eth-balances

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-eth-balances - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

39

bin/index.js

@@ -0,3 +1,40 @@

#!/usr/bin/env node
const args = require('args');
args
.option('input', 'The file with ETH addresses, that will be processed');
const flags = args.parse(process.argv);
console.log('test');
const API = addr => `https://api.etherscan.io/api?module=account&action=balancemulti&address=${addr}&tag=latest&apikey=YourApiKeyToken`;
const fs = require('fs');
const request = require('request');
let addresses = (fs.readFileSync(flags.i)+'').match(/0x[0-9a-f]{40}/ig);
// console log balances
(function loop() {
let chunk = addresses.splice(0, 20);
request(API(chunk.join(',')), function (error, response, body) {
if (error) {
console.error(error);
}
JSON.parse(body).result.map(acc => {
console.log(`${acc.account} ${acc.balance}`);
});
if (addresses.length) {
loop();
}
});
}());

8

package.json
{
"name": "get-eth-balances",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -22,3 +22,7 @@ "main": "index.js",

},
"homepage": "https://github.com/gkucmierz/get-eth-balances#readme"
"homepage": "https://github.com/gkucmierz/get-eth-balances#readme",
"dependencies": {
"args": "^5.0.0",
"request": "^2.88.0"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc