Skip to content

Instantly share code, notes, and snippets.

@rahuldamodar94
Created October 26, 2020 11:31
Show Gist options
  • Save rahuldamodar94/46bf2d8118d6f571ff9c97d0c3753c84 to your computer and use it in GitHub Desktop.
Save rahuldamodar94/46bf2d8118d6f571ff9c97d0c3753c84 to your computer and use it in GitHub Desktop.
Balance scanner
let Web3 = require("web3");
let ethScan =require('@mycrypto/eth-scan');
// Matic balance
ethScan.getEtherBalances("https://rpc-mumbai.matic.today",["0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C"],{contractAddress: "0xa878A805F78d22126188aBa9b6D0c5E907e29459"}).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
// Matic tokens balances
ethScan.getTokensBalance("https://rpc-mumbai.matic.today","0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C",["0xd393b1E02dA9831Ff419e22eA105aAe4c47E1253"],{contractAddress: "0xa878A805F78d22126188aBa9b6D0c5E907e29459"}).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
// // Ether balance
ethScan.getEtherBalances("https://goerli.infura.io/v3/5687b932e64441e5a297a0bfba8895cd",["0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C","0x28e9E72DbF7ADee19B5279C23E40a1b0b35C2B90"]).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
// // Ethereum tokens balances
ethScan.getTokensBalance("https://goerli.infura.io/v3/5687b932e64441e5a297a0bfba8895cd","0xFd71Dc9721d9ddCF0480A582927c3dCd42f3064C",["0xC1BB27a58bc4E14e49973a1345d23D6146895A9F"]).then(res => {
console.log(res)
}).catch(err => {
console.log(err)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment