helium_py.api.blocks.Blocks

class helium_py.api.blocks.Blocks(host=None, port=None, user_agent=None, base_path=None)[source]

Bases: API

Blocks client class for Helium Blockchain API.

https://docs.helium.com/api/blockchain/blocks

__init__(host=None, port=None, user_agent=None, base_path=None)

Allow for overriding API details at instantiation.

Methods

__init__([host, port, user_agent, base_path])

Allow for overriding API details at instantiation.

all()

Yield all block descriptions.

get_block_descriptor_for_hash(hash)

Return block descriptor for block with provided hash.

get_block_descriptor_for_height(height)

Return block descriptor for block at height.

get_height(params)

Return the current height of the blockchain.

get_stats()

Return stats for block production time.

get_transactions_for_hash(hash)

Yield transactions for block with provided hash.

get_transactions_for_height(height)

Yield transactions for block at height.

Attributes

base_path

client

Return a client singleton per API.

host

port

user_agent

all() Generator[dict, None, None][source]

Yield all block descriptions.

property client: Client

Return a client singleton per API.

get_block_descriptor_for_hash(hash: str) dict[source]

Return block descriptor for block with provided hash.

get_block_descriptor_for_height(height: int) dict[source]

Return block descriptor for block at height.

get_height(params: Optional[dict]) dict[source]

Return the current height of the blockchain.

get_stats() dict[source]

Return stats for block production time.

get_transactions_for_hash(hash: str) Generator[dict, None, None][source]

Yield transactions for block with provided hash.

get_transactions_for_height(height: int) Generator[dict, None, None][source]

Yield transactions for block at height.