web3data.handlers.block

This module contains the address subhandler.

class web3data.handlers.block.BlockHandler(initial_headers: Dict[str, str], chain: web3data.chains.Chains)[source]

Bases: web3data.handlers.base.BaseHandler

The subhandler for block-related queries.

functions(block_id: str, **kwargs) → Dict[source]

Retrieves all the functions which were called at the specified block number or hash.

Parameters

block_id – The block’s ID to fetch information for

Key validationMethod

The validation method to be added to the response: none, basic, full. Default: none. (str)

Returns

The API response parsed into a dict

logs(block_id: str, **kwargs) → Dict[source]

Retrieves all the logs at the specified block number or hash.

Parameters

block_id – The block’s ID to fetch information for

Key validationMethod

The validation method to be added to the response: none, basic, full. Default: none. (str)

Key transactionHash

Filter by logs for this transaction. (str)

Returns

The API response parsed into a dict

metrics_historical(**kwargs) → Dict[source]

Get metrics for historical confirmed blocks for a given blockchain.

Key timeFormat

The time format to use for the timestamps (milliseconds, ms, iso, iso8611). (str)

Key timeFrame

time frame to return the historical data in, options: (1m, 5m, 1h, 1d, 1w) (str)

Key startDate

Filter by data after this date. (str)

Key endDate

Filter by data before this date. (str)

Returns

The API response parsed into a dict

metrics_latest(**kwargs) → Dict[source]

Get metrics for recent confirmed blocks for a given blockchain.

Key timeFormat

The time format to use for the timestamps (milliseconds, ms, iso, iso8611). (str)

Returns

The API response parsed into a dict

single(block_id: str, **kwargs) → Dict[source]

Retrieves the block specified by its id (number or hash).

Parameters

block_id – The block’s ID to fetch information for

Key validationMethod

The validation method to be added to the response: none, basic, full. Default: none. (str)

Key timeFormat

The time format to use for the timestamps (milliseconds, ms, iso, iso8611). (str)

Returns

The API response parsed into a dict

token_transfers(block_id: str, **kwargs) → Dict[source]

Retrieves all the token which were transferred at the specified block number.

Parameters

block_id – The block’s ID to fetch information for

Key amount

Filter by tokens transfers where the number of tokens is equal to the specified amount. (int)

Key amountGt

Filter by token transfers where the number of tokens is more than the specified amount. (int)

Key amountGte

Filter by token transfers where the number of tokens is more than or equal to the specified amount. (int)

Key amountLt

Filter by token transfers where the number of tokens is less than the specified amount. (int)

Key amountLte

Filter by token transfers where the number of tokens is less than or equal to the specified amount. (int)

Key from

Filter by token transfers originating from this address. (str)

Key to

Filter token transfers received by this address. (str)

Key tokenAddress

Filter by token transfers for this token. (str)

Key transactionHash

Filter by token transfers for this transaction. (str)

Key includePrice

Indicates whether or not to include price data with the results. (bool)

Key currency

The currency of the price information. Options: usd, btc. Only used in conjunction with includePrice. (str)

Returns

The API response parsed into a dict

total(**kwargs) → Dict[source]

Retrieves all the blocks within the specified range.

Key startNumber

The range of blocks to return, inclusive (startNumber and endNumber should be both specified, or both empty) (str)

Key endNumber

The end of the range of blocks to return, exclusive (startNumber and endNumber should be both specified, or both empty) (str)

Key size

The number of results to return. (int)

Key validationMethod

The validation method to be added to the response: none, basic, full. Default: none. (str)

Returns

The API response parsed into a dict

transactions(block_id: str, **kwargs) → Dict[source]

Retrieves all the transactions included in a specified block id.

Parameters

block_id – The block’s ID to fetch information for

Key includeFunctions

Indicates whether or not to include functions (aka internal messages) information for each transaction, if available. Options: true, false. (bool)

Key includeTokenTransfers

Indicates whether or not to include token transfers information for each transaction, if available. Options: true, false. (bool)

Key includeLogs

Indicates whether or not to include log information for each transaction, if available. Options: true, false. (bool)

Key validationMethod

The validation method to be added to the response: none, basic, full. Default: none. (str)

Key currency

The currency of the price information. Options: usd, btc. Only used in conjunction with includePrice. (str)

Key includePrice

Indicates whether or not to include price data with the results. Options: true, false. (bool)

Key startDate

Filter by transactions executed after this date. Note that the interval can not exceed 1 minute (startDate and endDate should be both specified, or both empty) (int)

Key endDate

Filter by transactions executed before this date. Note that the interval can not exceed 1 minute (startDate and endDate should be both specified, or both empty). (int)

Key size

The number of results to return. (int)

Returns

The API response parsed into a dict