pcko1/bscscan-python
关于
最受欢迎的异步 Python API,用于访问 BscScan(Binance Smart Chain Explorer),可通过 PyPI 获取。
商业与金融实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文bscscan-python
A complete Python API for BscScan.com
Powered by BscScan.com APIs
Available on PyPI
:book: Read the official documentation here :book:
👇
A fork of the etherscan-python package.
Endpoints
The 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_paginated
Contracts (source)
get_contract_abiget_contract_source_code
Transactions (source)
get_tx_receipt_status
Blocks (source)
get_block_reward_by_block_numberget_est_block_countdown_time_by_block_numberget_block_number_by_timestamp
GETH/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_gas
Tokens (source)
get_total_supply_by_contract_addressget_circulating_supply_by_contract_addressget_acc_balance_by_token_contract_address
Stats (source)
get_total_bnb_supplyget_validators_list
Logs (source)
get_logs
If you think that a newly-added method is missing, kindly open an issue as a feature request and I will do my best to add it.
Installation
Before proceeding, you should register an account on BscScan.com and generate a personal API key to use.
Install from source:
pip install git+https://github.com/pcko1/bscscan-python.git@stable
Alternatively, install from PyPI:
pip install bscscan-python
Unit tests
In bash, test that everything looks OK on your end using your YOUR_API_KEY (without quotation marks):
bash run_tests.sh YOUR_API_KEY
Note: This will install the coverage package in your activated python environment.
Usage
In python, create a client with your personal BscScan.com API key:
import asyncio
from bscscan import BscScan
YOUR_API_KEY = "..."
async def main():
async with BscScan(YOUR_API_KEY) as bsc:
print(await bsc.get_bnb_balance(address="0x0000000000000000000000000000000000001004"))
if __name__ == "__main__":
asyncio.run(main())
> '167195709084498025431541166'
Examples
Detailed examples (arguments and results) for all methods may be found in the official documentation.
Issues
For problems regarding installing or using the package please open an issue. Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.
Cite
Kotsias, P. C., pcko1/bscscan-python: v1.0.0. https://github.com/pcko1/bscscan-python (2021). doi:10.5281/zenodo.4781726
or in bibtex:
@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}
}
Feel free to leave a :star: if you found this package useful.
Powered by Bscscan.com APIs.
探索相关项目
加载中…