Node.js library for Etherscan.io
npm install etherscan.jstypescript
// Loads the library
import { API as Etherscan } from 'etherscan.js';
// Creates an instance of the API class with your key and network
const es = new Etherscan({
key: {
key: "YOUR_KEY_HERE",
plan: "free"
limit: 5
},
network: "mainnet"
});
// Retrieves account balance for an address using promises
console.log(await es.fetcher.getAccountBalance("0x2A20380DcA5bC24D052acfbf79ba23e988ad0050"))
``