messari.blockexplorers.etherscan package

Submodules

messari.blockexplorers.etherscan.etherscan module

This module is meant to contain the Etherscan class

class messari.blockexplorers.etherscan.etherscan.Etherscan(api_key: Optional[str] = None)

Bases: messari.blockexplorers.scanner.Scanner

This class is a wrapper around the Etherscan API

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

get_eth_block_number()

Returns the number of most recent block

get_eth_block_transaction_count(blocks_in)

Returns the number of transactions in a block

get_eth_gas_price()

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

get_gas_oracle()

Returns the current Safe, Proposed and Fast gas prices

get_last_eth_price()

Returns the latest price of 1 ETH in BTC & USD

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_nodes_size(start_date, end_date[, ...])

Returns the size of the Ethereum blockchain, in bytes, over a date range

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_total_eth2_supply()

Returns the current amount of Ether in circulation, ETH2 Staking rewards and EIP1559 burnt fees statistics

get_total_eth_supply()

Returns the current amount of Ether in circulation.

get_total_nodes_count()

Returns the total number of discoverable Ethereum nodes

get_transaction_execution_status(transactions_in)

Returns the status code of a transaction execution.

get_transaction_internal_transactions(...)

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_last_eth_price() pandas.core.frame.DataFrame

Returns the latest price of 1 ETH in BTC & USD

Returns
DataFrame

DataFrame with current eth price

get_nodes_size(start_date: Union[str, datetime.datetime], end_date: Union[str, datetime.datetime], client_type: str = 'geth', sync_mode: str = 'archive', ascending: bool = True) pandas.core.frame.DataFrame

Returns the size of the Ethereum blockchain, in bytes, over a date range

Parameters
start_date: str, datetime.datetime

starting date for node

end_date: str, datetime.datetime

ending date for node

client_type: str (default ‘geth’)

type of client (‘geth’, ‘parity’)

sync_mode: str (default ‘archive’)

type of node (‘default’, ‘archive’)

ascending: bool

return results ascending or descending (default True)

Returns
DataFrame

DataFrame with information about node size for given period & node type

get_total_eth2_supply() pandas.core.frame.DataFrame

Returns the current amount of Ether in circulation, ETH2 Staking rewards and EIP1559 burnt fees statistics

Returns
DataFrame

DataFrame with current amount of eth2 circulating

get_total_eth_supply() int

Returns the current amount of Ether in circulation.

Returns
DataFrame

DataFrame with current amount of eth circulating

get_total_nodes_count() int

Returns the total number of discoverable Ethereum nodes

Returns
int

number of discoverable nodes

Module contents

Module to handle initialization, imports, for Etherscan class