Skip to content

defipy-devs/blockscout-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

blockscout-python

Python API for blockscout.com as currently tested on:


REST Endpoints

The following REST endpoints are provided:

Accounts (source) (test notebook)

  • get_addresses
  • get_address_info
  • get_address_counters
  • get_address_transactions
  • get_address_logs
  • get_blocks_validated
  • get_token_balances
  • get_token_balances_with_filtering
  • get_coin_balance_history
  • get_coin_balance_history_by_day
Block (source) (test notebook)

  • get_block_info
  • get_block_transactions
  • get_block_withdrawals
  • get_main_page_blocks
Contract (source) (test notebook)

  • get_smart_contracts
  • get_smart_contract_counters
  • get_smart_contract
Stats (source) (test notebook)

  • get_stats_transactions_chart
  • get_stats_counters
Tokens (source) (test notebook)

  • get_tokens_list
  • get_token_info
  • get_token_transfers
  • get_token_holders
  • get_token_counters
Transactions (source) (test notebook)

  • get_state_changes
  • get_transaction_logs
  • get_internal_transactions
  • get_token_hash_transfers
  • get_transaction_info
  • get_main_page_transactions

RPC Endpoints

The following RPC endpoints are provided:

Accounts (source) (test notebook)

  • get_balance
  • get_pending_txs_by_address_paginated
  • get_txs_by_address_paginated
  • get_erc20_token_transfer_events_by_address
  • get_erc721_token_transfer_events_by_address
  • get_erc20_balance_by_contract_address
  • get_erc20_tokens_by_address
  • get_account_list_balances
Block (source) (test notebook)

  • get_block_reward_by_block_number
  • get_est_block_countdown_time_by_block_number
  • get_block_number_by_timestamp
Contract (source) (test notebook)

  • get_contract_list
  • get_contract_abi
  • get_source_code
  • get_contract_creation
Stats (source) (test notebook)

  • get_total_token_supply
  • get_total_eth_supply
  • get_total_coin_supply
  • get_eth_price
  • get_coin_price
Tokens (source) (test notebook)

  • get_total_supply_by_contract_address
  • get_total_holders_by_contract_address
  • get_tx_info
  • get_tx_receipt_status
  • get_status

Installation

Install from source:

pip install git+https://github.com/defipy-devs/blockscout-python.git

Alternatively, install from PyPI:

pip install blockscout-python

Usage

from blockscout import Blockscout
from blockscout import Net
eth = Blockscout(Net.ROLLUX, API.RPC)  

Then you can call all available methods, e.g.:

eth.get_balance(address="0xBb8b9456F615545c88528653024E87C6069d1598")

> {'message': 'OK', 'result': '2010991698475838058402243', 'status': '1'}

If you found this package helpful, please leave a ⭐!


Powered by Blockscout.com APIs.

About

Python API for blockscout.com explorers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages