helium_py.api.oracle_prices.OraclePrices

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

Bases: API

Oracle Prices client class for Helium Blockchain API.

https://docs.helium.com/api/blockchain/oracle-prices/

__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 price data.

all_activity(params)

Yield all oracle activity.

all_activity_for_oracle(address, params)

Yield all activity for specific oracle with provided address.

get_current()

Return the current oracle price data.

get_price_at_block(block)

Return price at a specific block.

get_stats(params)

Return price stats.

predictions()

Yield price predictions.

Attributes

base_path

client

Return a client singleton per API.

host

port

user_agent

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

Yield all price data.

all_activity(params: Optional[dict]) Generator[dict, None, None][source]

Yield all oracle activity.

all_activity_for_oracle(address: str, params: Optional[dict]) Generator[dict, None, None][source]

Yield all activity for specific oracle with provided address.

Args:

address: The oracle addres to fetch activity for. params: Limit and time filter parameters

property client: Client

Return a client singleton per API.

get_current() dict[source]

Return the current oracle price data.

get_price_at_block(block: int) dict[source]

Return price at a specific block.

Args:

block: The block to retrieve price data for.

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

Return price stats.

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

Yield price predictions.

May return one or more so caller should be prepared to handle StopIteration.