# caeb-bscscan

> Bypass cloudfare api.bscscan.com DDoS verifications for your APIs.

Latest version **1.0.25** (published 2021-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install caeb-bscscan
pnpm add caeb-bscscan
yarn add caeb-bscscan
bun add caeb-bscscan
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.25 |
| Published | 2021-04-05 |
| First published | 2021-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 15.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Caeb WALLACE |
| Maintainers | caebwallace |
| Keywords | bsc, ethereum, bscscan, blockchain, api, puppeteer, cloudfare |

## Links

- npm: https://www.npmjs.com/package/caeb-bscscan
- npm.io page: https://npm.io/package/caeb-bscscan

## Dependencies (4)

- [web3](https://npm.io/package/web3.md) ^1.3.4
- [puppeteer-extra](https://npm.io/package/puppeteer-extra.md) ^3.1.18
- [puppeteer-extra-plugin-stealth](https://npm.io/package/puppeteer-extra-plugin-stealth.md) ^2.7.6
- [puppeteer-extra-plugin-recaptcha](https://npm.io/package/puppeteer-extra-plugin-recaptcha.md) ^3.3.7

## Alternatives

- [@snazzah/davey](https://npm.io/package/@snazzah/davey.md) — 1.5M weekly downloads
- [@vendure/testing](https://npm.io/package/@vendure/testing.md) — 8.3K weekly downloads
- [vue-simple-context-menu](https://npm.io/package/vue-simple-context-menu.md) — 6.6K weekly downloads
- [cypress-webpack-preprocessor-v5](https://npm.io/package/cypress-webpack-preprocessor-v5.md) — 2.1K weekly downloads
- [@backstage/plugin-catalog-backend-module-puppetdb](https://npm.io/package/@backstage/plugin-catalog-backend-module-puppetdb.md) — 1.3K weekly downloads

## Recent versions

- 1.0.25 (latest) — 2021-04-05
- 1.0.24 — 2021-04-05
- 1.0.22 — 2021-04-05
- 1.0.21 — 2021-04-05
- 1.0.20 — 2021-04-05
- 1.0.19 — 2021-04-05
- 1.0.18 — 2021-04-05
- 1.0.17 — 2021-04-05
- 1.0.16 — 2021-04-05
- 1.0.14 — 2021-04-05
- 1.0.12 — 2021-04-05
- 1.0.11 — 2021-04-05
- 1.0.10 — 2021-04-05
- 1.0.9 — 2021-04-05
- 1.0.8 — 2021-04-05
- … 4 more at https://npm.io/package/caeb-bscscan/versions

## README

CAEB BSCSCAN
============

![NPM Version](https://badge.fury.io/js/caeb-bscscan.svg)

[BscScan](https://bscscan.com/) is a Block Explorer and Analytics Platform for **Binance Smart Chain** and provides [APIs](https://bscscan.com/apis) that returns informations about accounts, token, contracts and a lot of other analytics.

Why another package ?
---------------------

There's already a node package [bsc-scan](https://github.com/jpgarcia/bsc-scan) using [axios](https://github.com/axios/axios) to request [BscScan API infos](https://bscscan.com/apis), but the problem is that the API is behind a **cloudfare DDoS protection** and a captcha is asked sometimes 🥺

Why [cz_binance](https://twitter.com/cz_binance) ? It's an **API** and **apiKey IP rate limit** should normally do the job no 🥴 ?

**No matter**, so instead of using **axios**, this package use [Puppeteer Extra](https://github.com/berstend/puppeteer-extra) with [Stealth](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-stealth) and [Recaptcha](https://github.com/berstend/puppeteer-extra/tree/master/packages/puppeteer-extra-plugin-recaptcha) plugins to **bypass that ridiculous API limitations...**

And it works really well 👻

Install
-------

```shell
yarn add caeb-bscscan
# - or -
npm i caeb-bscscan
```

Usage
-----

```ts
// Import the lib
import BscClient from 'caeb-bscscan';

// Create a new client
const client = new BscClient();
```

Methods
-------

### getAccountBalance(address)

```ts
// Get account balance
const balance = await client.getAccountBalance('0x1Ed970C1D3F9B85bA6607d45C752E22D9b0b09f4');
```


Options
-------

**BscClient** options.

Create a BscScan apiKey [here](https://bscscan.com/myapikey)

```ts
// BscClient example with full options (and TOR as proxy)
const client = new BscClient({
    apiUrl: 'https://api.bscscan.com/api',
    apiKey: 'XXX',
    headless: true,
    proxy: 'http://127.0.0.1:9150'
});
```

Run Unit Tests
--------------

```shell
npm run test:watch
```

More docs
---------

You can download package and open `docs/index.html` for extended informations and documentations.

Want to donate ?
----------------

If you like **that project and my work**, you can send me your **favorite shitcoin** to my **BEP20** wallet address : [0x1Ed970C1D3F9B85bA6607d45C752E22D9b0b09f4](https://bscscan.com/address/0x1Ed970C1D3F9B85bA6607d45C752E22D9b0b09f4)


License
-------

Copyright © 2021, [Caeb WALLACE](https://twitter.com/caeb_wallace). Released under the MIT License.

---
_Source: https://npm.io/package/caeb-bscscan · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
