Node.js package to interact with official BscScan API powered by TypeScript.
$ yarn add bsc-scan
import bscscan, { account } from 'bsc-scan'
bscscan.setUrl('https://testnet.bscscan.com')
bscscan.setApiKey('YourApiKeyToken')
const start = async () => {
try {
const balance = await account.getBnbBalance('0x765090aB712984081aeE059eA7025C48a4198183')
console.log(`Your balance is: ${balance}`)
} catch (err) {
console.log(err)
}
}
start()