human_protocol_sdk.worker.worker_utils module
class human_protocol_sdk.worker.worker_utils.WorkerData(id, address, total_amount_received, payout_count)
Bases: object
__init__(id, address, total_amount_received, payout_count)
Initializes a WorkerData instance.
Parameters:
id (
str) – Worker IDaddress (
str) – Worker addresstotal_amount_received (
int) – Total amount received by the workerpayout_count (
int) – Number of payouts received by the worker
class human_protocol_sdk.worker.worker_utils.WorkerUtils
Bases: object
A utility class that provides additional worker-related functionalities.
static get_worker(chain_id, worker_address)
Gets the worker details.
Parameters:
chain_id (
ChainId) – Network in which the worker existsworker_address (
str) – Address of the worker
Return type:
Optional[WorkerData]Returns: Worker data if exists, otherwise None
static get_workers(filter)
Get workers data of the protocol.
Parameters: filter (
WorkerFilter) – Worker filterReturn type:
List[WorkerData]Returns: List of workers data
exception human_protocol_sdk.worker.worker_utils.WorkerUtilsError
Bases: Exception
Raised when an error occurs when getting data from subgraph.
Last updated