messari.blockexplorers package
Subpackages
- messari.blockexplorers.arbiscan package
- messari.blockexplorers.bscscan package
- messari.blockexplorers.etherscan package
- messari.blockexplorers.ftmscan package
- messari.blockexplorers.optimisticetherscan package
- messari.blockexplorers.polygonscan package
- messari.blockexplorers.snowtrace package
- messari.blockexplorers.solscan package
Submodules
messari.blockexplorers.helpers module
This module is dedicated to helpers for the Scanners class
- messari.blockexplorers.helpers.int_to_hex(ints_in: Union[int, List]) List[str]
Converts a lits of integers to a list of hex strings ‘0x’
messari.blockexplorers.scanner module
This module is meant to contain the Scanner class
- class messari.blockexplorers.scanner.Scanner(base_url: str, api_key: Optional[str] = None)
Bases:
messari.dataloader.DataLoader
This class is a wrapper around the blockexplorer APIs
Methods
get_account_blocks_mined
(accounts_in[, ...])Returns the list of blocks mined by an address
get_account_internal_transactions
(accounts_in)Returns the list of internal transactions performed by an address
get_account_native_balance
(accounts_in)Returns the native token balance of a given address
get_account_nft_transfers
(accounts_in[, ...])Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract
get_account_normal_transactions
(accounts_in)Returns the list of transactions performed by an address, with optional pagination
get_account_token_transfers
(accounts_in[, ...])Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract
get_block_by_timestamp
(times_in[, before])Returns the block number that was mined at a certain timestamp (in unix)
get_block_countdown
(blocks_in)Returns the estimated time remaining, in seconds, until a certain block is mined
get_block_range_internal_transactions
(...[, ...])Returns the list of internal transactions performed within a block range Parameters ---------- start_block: int block to start search end_block: int block to end search page: int Page number starting at 0. Increment value to paginate through results offset: int Offset starting at 0. Increment value to offset paginated results ascending: bool return results ascending or descending (default True).
get_block_reward
(blocks_in)Returns the block reward and 'Uncle' block rewards
get_contract_abi
(contracts_in)Returns the Contract Application Binary Interface (ABI) of a verified smart contract
get_contract_execution_status
(transactions_in)Returns the status code of a contract execution
get_contract_source_code
(contracts_in)Returns the Solidity source code of a verified smart contract
get_est_confirmation
(gas_price)Returns the estimated time, in seconds, for a transaction to be confirmed on the blockchain gas price in wei
get_eth_account_transaction_count
(accounts_in)Returns the number of transactions performed by an address
get_eth_block
(blocks_in)Returns information about a block by block number
Returns the number of most recent block
get_eth_block_transaction_count
(blocks_in)Returns the number of transactions in a block
Returns the current price per gas in wei
get_eth_transaction_by_block_index
(block, index)Returns information about a transaction by block number and transaction index position
get_eth_transaction_by_hash
(transactions_in)Returns the information about a transaction requested by transaction hash
get_eth_transaction_receipt
(transactions_in)Returns the receipt of a transaction by transaction hash
get_eth_uncle
(block, index)Returns information about an uncle by block number and index
Returns the current Safe, Proposed and Fast gas prices
get_logs
(address, from_block[, to_block, ...])This function is a wrapper around the Etherscan API which is a wrapper around the native eth_getLogs.
get_response
(endpoint_url[, params, headers])Gets response from endpoint and checks for HTTP errors when requesting data.
get_token_account_balance
(tokens_in, accounts_in)Returns the current balance of an ERC-20 token of an address
get_token_total_supply
(tokens_in)Returns the current amount of an ERC-20 token in circulation
get_transaction_execution_status
(transactions_in)Returns the status code of a transaction execution.
Returns the list of internal transactions performed within a transaction Parameters ---------- transactions_in: str, List single transaction in or list of transactions in
set_api_dict
(api_dict)Sets a new dictionary to be used as an API key pair
set_taxonomy_dict
(taxonomy_dict)Sets a new dictionary to be used for taxonomy translations
translate
(input_slugs)Wrapper around messari.utils.validate_input, validate input & check if it's supported by DeFi Llama
- get_account_blocks_mined(accounts_in: Union[str, List], block_type: str = 'blocks', page: int = 0, offset: int = 0) pandas.core.frame.DataFrame
Returns the list of blocks mined by an address
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- page: int
Page number starting at 0. Increment value to paginate through results
- offset: int
Offset starting at 0. Increment value to offset paginated results
- Returns
- DataFrame
DataFrame with blocks mined by given account(s)
- get_account_internal_transactions(accounts_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the list of internal transactions performed by an address
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- Returns
- DataFrame
DataFrame with internal transactions performed in given account(s)
- get_account_native_balance(accounts_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the native token balance of a given address
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- Returns
- DataFrame
DataFrame containing accounts_in native (sol) balance
- get_account_nft_transfers(accounts_in: Union[str, List], nfts_in: Optional[Union[str, List]] = None, start_block: Optional[int] = None, end_block: Optional[int] = None, page: int = 0, offset: int = 0, ascending: bool = True) pandas.core.frame.DataFrame
Returns the list of ERC-721 ( NFT ) tokens transferred by an address, with optional filtering by token contract
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- nfts_in: str, List
single nft in or list of nfts in, used to filter results
- start_block: int
block to start search
- end_block: int
block to end search
- page: int
Page number starting at 0. Increment value to paginate through results
- offset: int
Offset starting at 0. Increment value to offset paginated results
- ascending: bool
return results ascending or descending (default True)
- Returns
- DataFrame
DataFrame with NFT transfers for given account(s)
- get_account_normal_transactions(accounts_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the list of transactions performed by an address, with optional pagination
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- Returns
- DataFrame
DataFrame containing accounts_in normal transactions
- get_account_token_transfers(accounts_in: Union[str, List], tokens_in: Optional[Union[str, List]] = None, start_block: Optional[int] = None, end_block: Optional[int] = None, page: int = 0, offset: int = 0, ascending: bool = True) pandas.core.frame.DataFrame
Returns the list of ERC-20 tokens transferred by an address, with optional filtering by token contract
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- tokens_in: str, List
single token address in or list of token addresses, used to filter results
- start_block: int
block to start search
- end_block: int
block to end search
- page: int
Page number starting at 0. Increment value to paginate through results
- offset: int
Offset starting at 0. Increment value to offset paginated results
- ascending: bool
return results ascending or descending (default True)
- Returns
- DataFrame
DataFrame with token transfers for given account(s)
- get_block_by_timestamp(times_in: Union[int, List], before: bool = True) pandas.core.frame.DataFrame
Returns the block number that was mined at a certain timestamp (in unix)
- Parameters
- timess_in: int, List
single time in or list of times in as unix timestamp(s)
- before: bool (default True)
Return block immediately before or after given times_in
- Returns
- DataFrame
DataFrame with block number(s) closest to times_in
- get_block_countdown(blocks_in: Union[int, List]) pandas.core.frame.DataFrame
Returns the estimated time remaining, in seconds, until a certain block is mined
- Parameters
- blocks_in: int, List
single block in or list of blocks in
- Returns
- DataFrame
DataFrame with time(s) remaining until block confirmation
- get_block_range_internal_transactions(start_block: int, end_block: int, page: int = 0, offset: int = 0, ascending: bool = True) pandas.core.frame.DataFrame
Returns the list of internal transactions performed within a block range Parameters ———-
- start_block: int
block to start search
- end_block: int
block to end search
- page: int
Page number starting at 0. Increment value to paginate through results
- offset: int
Offset starting at 0. Increment value to offset paginated results
- ascending: bool
return results ascending or descending (default True)
- Returns
- DataFrame
DataFrame with internal transactions for a given block range
- get_block_reward(blocks_in: Union[int, List]) pandas.core.frame.DataFrame
Returns the block reward and ‘Uncle’ block rewards
- Parameters
- blocks_in: int, List
single block in or list of blocks in
- Returns
- DataFrame
DataFrame with block reward(s)
- get_contract_abi(contracts_in: Union[str, List]) Dict
Returns the Contract Application Binary Interface (ABI) of a verified smart contract
- Parameters
- contracts_in: str, List
single contract in or list of contracts in
- Returns
- Dict
Dictionary with {contract: contract_abi}
- get_contract_execution_status(transactions_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the status code of a contract execution
- Parameters
- transactions_in: str, List
single transaction in or list of transactions in
- Returns
- DataFrame
DataFrame with contract execution status
- get_contract_source_code(contracts_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the Solidity source code of a verified smart contract
- Parameters
- contracts_in: str, List
single contract in or list of contracts in
- Returns
- DataFrame
DataFrame with contract source code
- get_est_confirmation(gas_price: int) int
Returns the estimated time, in seconds, for a transaction to be confirmed on the blockchain gas price in wei
- Parameters
- gas_price: int
Gas price (in Wei) used for transaction
- Returns
- int
The estimated time (in seconds) for a transaction to be confirmed
- get_eth_account_transaction_count(accounts_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the number of transactions performed by an address
- Parameters
- accounts_in: str, List
single account in or list of accounts in
- Returns
- DataFrame
DataFrame containing transaction count(s) for the given account(s)
- get_eth_block(blocks_in: Union[int, List]) pandas.core.frame.DataFrame
Returns information about a block by block number
- Parameters
- blocks_in: int, List
single block in or list of blocks in
- Returns
- DataFrame
DataFrame containing information about block(s)
- get_eth_block_number() int
Returns the number of most recent block
- Returns
- int
Number of the most recent block
- get_eth_block_transaction_count(blocks_in: Union[int, List]) pandas.core.frame.DataFrame
Returns the number of transactions in a block
- Parameters
- blocks_in: int, List
single block in or list of blocks in
- Returns
- DataFrame
DataFrame containing transaction count(s) for the given block(s)
- get_eth_gas_price() int
Returns the current price per gas in wei
- Returns
- int
Current price per gas in wei
- get_eth_transaction_by_block_index(block: int, index: int) pandas.core.frame.DataFrame
Returns information about a transaction by block number and transaction index position
- Parameters
- blocks: int
single block in
- Returns
- DataFrame
DataFrame containing transaction details
- get_eth_transaction_by_hash(transactions_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the information about a transaction requested by transaction hash
- Parameters
- transactions_in: str, List
single contract in or list of transactions in
- Returns
- DataFrame
DataFrame containing transaction details
- get_eth_transaction_receipt(transactions_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the receipt of a transaction by transaction hash
- Parameters
- transactions_in: str, List
single contract in or list of transactions in
- Returns
- DataFrame
DataFrame with transaction receipts
- get_eth_uncle(block: int, index: int) Dict
Returns information about an uncle by block number and index
- Parameters
- block: int
single block in
- index: int
single index in
- Returns
- Dict
Information about an uncle by block number and index
- get_gas_oracle() pandas.core.frame.DataFrame
Returns the current Safe, Proposed and Fast gas prices
- Returns
- DataFrame
DataFrame containing the current Safe, Proposed and Fast gas prices
- get_logs(address: str, from_block: Union[int, str], to_block: Union[int, str] = 'latest', topic0: Optional[str] = None, topic1: Optional[str] = None, topic2: Optional[str] = None, topic3: Optional[str] = None, topic0_1_opr: Optional[str] = None, topic1_2_opr: Optional[str] = None, topic2_3_opr: Optional[str] = None, topic0_2_opr: Optional[str] = None, topic0_3_opr: Optional[str] = None, topic1_3_opr: Optional[str] = None) pandas.core.frame.DataFrame
This function is a wrapper around the Etherscan API which is a wrapper around the native eth_getLogs. Please check out their documentation for a more in depth explanation: https://docs.etherscan.io/api-endpoints/logs
- get_token_account_balance(tokens_in: Union[str, List], accounts_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the current balance of an ERC-20 token of an address
- Parameters
- tokens_in: str, List
single token address in or list of token addresses
- accounts_in: str, List
single account in or list of accounts in
- Returns
- DataFrame
DataFrame containing token balance(s) for given account(s)
- get_token_total_supply(tokens_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the current amount of an ERC-20 token in circulation
- Parameters
- tokens_in: str, List
single token address in or list of token addresses
- Returns
- DataFrame
DataFrame containing total supply for token(s)
- get_transaction_execution_status(transactions_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the status code of a transaction execution.
- Parameters
- transactions_in: str, List
single transaction in or list of transactions in
- Returns
- DataFrame
DataFrame with transaction execution status
- get_transaction_internal_transactions(transactions_in: Union[str, List]) pandas.core.frame.DataFrame
Returns the list of internal transactions performed within a transaction Parameters ———-
- transactions_in: str, List
single transaction in or list of transactions in
- Returns
- DataFrame
DataFrame with internal transactions performed in given transaction(s)
Module contents
Module to handle initialization, imports, for scanner class