Package: bscscan-python-testnet
bscscan-pythonA complete Python API forBscScan.comPowered byBscScan.com APIsAvailable onPyPI:book: Read the official documentation here :book:👇A fork of theetherscan-pythonpackage.ForkModified version hosted athttps://github.com/gabr1e11/bscscan-pythonthat supports BSC TesnetSeeUsagebelow for an example of how to use the package for the testnetEndpointsThe following endpoints are provided:Accounts(source)get_bnb_balanceget_bnb_balance_multipleget_normal_txs_by_addressget_normal_txs_by_address_paginatedget_internal_txs_by_addressget_internal_txs_by_address_paginatedget_internal_txs_by_txhashget_internal_txs_by_block_range_paginatedget_bep20_token_transfer_events_by_addressget_bep20_token_transfer_events_by_contract_address_paginatedget_bep20_token_transfer_events_by_address_and_contract_paginatedget_bep721_token_transfer_events_by_addressget_bep721_token_transfer_events_by_contract_address_paginatedget_bep721_token_transfer_events_by_address_and_contract_paginatedget_validated_blocks_by_addressget_validated_blocks_by_address_paginatedContracts(source)get_contract_abiget_contract_source_codeTransactions(source)get_tx_receipt_statusBlocks(source)get_block_reward_by_block_numberget_est_block_countdown_time_by_block_numberget_block_number_by_timestampGETH/Parity Proxy(source)get_proxy_block_numberget_proxy_block_by_numberget_proxy_block_transaction_count_by_numberget_proxy_transaction_by_hashget_proxy_transaction_by_block_number_and_indexget_proxy_transaction_countget_proxy_transaction_receiptget_proxy_callget_proxy_code_atget_proxy_storage_position_atget_proxy_gas_priceget_proxy_est_gasTokens(source)get_total_supply_by_contract_addressget_circulating_supply_by_contract_addressget_acc_balance_by_token_contract_addressStats(source)get_total_bnb_supplyget_validators_listLogs(source)get_logsIf you think that a newly-added method is missing, kindly open anissueas a feature request and I will do my best to add it.InstallationBefore proceeding, you should register an account onBscScan.comandgenerate a personal API keyto use.Install from source:pipinstallgit+https://github.com/pcko1/bscscan-python.git@stableAlternatively, install fromPyPI:pipinstallbscscan-pythonUnit testsInbash, test that everything looks OK on your end using yourYOUR_API_KEY(without quotation marks):bashrun_tests.shYOUR_API_KEYNote: This will install thecoveragepackage in your activatedpythonenvironment.UsageInpython, create a client with your personalBscScan.comAPI key:importasynciofrombscscanimportBscScanYOUR_API_KEY="..."asyncdefmain():asyncwithBscScan(YOUR_API_KEY)asbsc:print(awaitbsc.get_bnb_balance(address="0x0000000000000000000000000000000000001004"))if__name__=="__main__":asyncio.run(main())>'167195709084498025431541166'For the BSC Testnet you can pass a thetestnetparameter set toTrueto connect to the Testnet:importasynciofrombscscanimportBscScanYOUR_API_KEY="..."asyncdefmain():asyncwithBscScan(YOUR_API_KEY,testnet=True)asbsc:print(awaitbsc.get_bnb_balance(address="0x0000000000000000000000000000000000001004"))if__name__=="__main__":asyncio.run(main())>'167195709084498025431541166'ExamplesDetailed examples (arguments and results) for all methods may be found in theofficial documentation.IssuesFor problems regarding installing or using the package please open anissue. Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.CiteKotsias, P. C., pcko1/bscscan-python: v1.0.0.https://github.com/pcko1/bscscan-python(2021). doi:10.5281/zenodo.4781726or inbibtex:@misc{Kotsias2020,author={Kotsias, P.C.},title={pcko1/bscscan-python},year={2021},publisher={Zenodo},url={https://github.com/pcko1/bscscan-python},doi={10.5281/zenodo.4781726}}Roberto Cano, gabr1e11/bscscan-python: v2.0.1https://github.com/gabr1e11/bscscan-python(2021).or inbibtex:@misc{RobertoCano2021,author={Roberto Cano},title={gabr1e11/bscscan-python},year={2021},url={https://github.com/gabr1e11/bscscan-python},}Feel free to leave a :star: if you found this package useful.Powered byBscscan.com APIs.