Skip to main content

Local tracker of an eth address for ETH and BSC scan

Project description

Note

This library is developed and maintained by EtWnn, feel free to drop your suggestions or remarks in the discussion tab of the git repo. You are also welcome to contribute by submitting PRs.

Source Code:

https://github.com/EtWnn/ScanWatch

Documentation:

https://scanwatch.readthedocs.io

This library is a local tracker of transactions for the Ethereum chain and the Binance Smart chain. It is a simple interface with the etherscan and the bscscan APIs and will save locally the results to gain time and avoid over-calling the APIs.

Announcement

If you previously used this library with a version inferior to 0.1.3, please head here to correct a potential bug in the database.

Quick Tour

You will need to generate an API token to use this library. Go on etherscan for the Ethereum chain and on bscscan for the BSC chain. (If you want to use both chains, you will need an API token for each).

ScanWatch is available on PYPI, install with pip:

pip install ScanWatch

You can also install the latest developments (not stable):

pip install git+https://github.com/EtWnn/ScanWatch.git@develop

You can then use your API token to instantiate the manager.

Example for Ethereum:

from ScanWatch.ScanManager import ScanManager
from ScanWatch.utils.enums import NETWORK

api_token = "<ETH_API_TOKEN>"
address = "<YOUR_ETH_ADDRESS>"

manager = ScanManager(address, NETWORK.ETHER, api_token)

Example for BSC:

from ScanWatch.ScanManager import ScanManager
from ScanWatch.utils.enums import NETWORK

api_token = "<BSC_API_TOKEN>"
address = "<YOUR_BSC_ADDRESS>"

manager = ScanManager(address, NETWORK.BSC, api_token)

Once the manager is setup, you can update the locally saved transactions:

manager.update_all_transactions()
# all transactions updated for address 0xaAC...748E8: 100%|████████████| 4/4 [00:02<00:00,  1.86it/s]

This needs to be done only when new transactions have been made since the last time you called the update method. Otherwise you can just fetch the transactions that have been previously saved, as shown below (see the documentation for more details).

from ScanWatch.utils.enums import TRANSACTION

manager.get_transactions(TRANSACTION.NORMAL)  # normal transactions

manager.get_transactions(TRANSACTION.ERC20)  # erc20 transactions

manager.get_transactions(TRANSACTION.ERC721)  # erc721 transactions

manager.get_transactions(TRANSACTION.INTERNAL)  # internal transactions

Main / test nets

If you want to switch from main to test nets, you can specify the net name at the manager creation:

manager = ScanManager(address, <network>, api_token, <net_name>)
Supported nets are:
  • For Ethereum: “main”, “goerli”, “kovan”, “rinkeby”, “ropsten”

  • For BSC: “main”, “test”

Donation

If this library has helped you in any way, feel free to donate:

  • BTC: 14ou4fMYoMVYbWEKnhADPJUNVytWQWx9HG

  • ETH: 0xfb0ebcf8224ce561bfb06a56c3b9a43e1a4d1be2

  • LTC: LfHgc969RFUjnmyLn41SRDvmT146jUg9tE

  • EGLD: erd1qk98xm2hgztvmq6s4jwtk06g6laattewp6vh20z393drzy5zzfrq0gaefh

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ScanWatch-0.1.3.tar.gz (14.4 kB view details)

Uploaded Source

File details

Details for the file ScanWatch-0.1.3.tar.gz.

File metadata

  • Download URL: ScanWatch-0.1.3.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.12

File hashes

Hashes for ScanWatch-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9fb8b4bd5dfc07c649449503fe93d4265a79fef14e37c205e1196be7df96d1f1
MD5 2fc6405d4281873237765556a39166ce
BLAKE2b-256 b39f786d6c8030a0cddd21b24cb342293da491a2e5c6b30cbd5dd1ab9c1cdca5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page