hypersync.utils

Documentation for eth_defi.hypersync.utils Python module.

Hypersync configuration utils.

Functions

configure_hypersync_from_env(web3[, ...])

Helper for scan-vaults and scan-prices scripts to configure Hypersync client from environment variables.

Classes

HypersyncBackendConfig

HypersyncBackendConfig(hypersync_client: 'hypersync.HypersyncClient | None', hypersync_url: 'str | None', scan_backend: str)

class HypersyncBackendConfig

Bases: object

HypersyncBackendConfig(hypersync_client: ‘hypersync.HypersyncClient | None’, hypersync_url: ‘str | None’, scan_backend: str)

__init__(hypersync_client, hypersync_url, scan_backend)
Parameters
  • hypersync_client (hypersync.HypersyncClient | None) –

  • hypersync_url (str | None) –

  • scan_backend (str) –

Return type

None

configure_hypersync_from_env(web3, hypersync_api_key=None)

Helper for scan-vaults and scan-prices scripts to configure Hypersync client from environment variables.

  • Some chains support HyperSync, others don’t - autodetect support

Parameters
  • hypersync_api_key (str | None) – Use given API key, instead of reading from env.

  • web3 (web3.main.Web3) –

Returns

A valid Hypersync config if the chain supports HyperSync

Return type

eth_defi.hypersync.utils.HypersyncBackendConfig