operator_utils
Last updated
Last updated
Utility class for operator-related operations.
Bases: object
Initializes an LeaderData instance.
Parameters:
chain_id () – Chain Identifier
id (str
) – Identifier
address (str
) – Address
amount_staked (int
) – Amount staked
amount_allocated (int
) – Amount allocated
amount_locked (int
) – Amount locked
locked_until_timestamp (int
) – Locked until timestamp
amount_withdrawn (int
) – Amount withdrawn
amount_slashed (int
) – Amount slashed
reputation (int
) – Reputation
reward (int
) – Reward
amount_jobs_launched (int
) – Amount of jobs launched
role (Optional
[str
]) – Role
fee (Optional
[int
]) – Fee
public_key (Optional
[str
]) – Public key
webhook_url (Optional
[str
]) – Webhook url
url (Optional
[str
]) – Url
Bases: object
A class used to filter leaders.
Initializes a LeaderFilter instance.
Parameters:
role (Optional
[str
]) – Leader role
Bases: object
Initializes an Operator instance.
Parameters:
address (str
) – Operator address
role (str
) – Role of the operator
Bases: object
A utility class that provides additional operator-related functionalities.
Get the leader details.
Parameters:
leader_address (str
) – Address of the leader
Returns: Leader data if exists, otherwise None
Example:
Get leaders data of the protocol
Returns: List of leaders data
Example:
Get the reputation network operators of the specified address.
Parameters:
address (str
) – Address of the reputation oracle
role (Optional
[str
]) – (Optional) Role of the operator
Returns: Returns an array of operator details
Example:
Get rewards of the given slasher
Parameters:
slasher (str
) – Address of the slasher
Returns: List of rewards info
Example:
Bases: Exception
Raises when some error happens when interacting with operator.
Bases: object
Initializes a RewardData instance.
Parameters:
escrow_address (str
) – Escrow address
amount (int
) – Amount
networks (List
[]) – Networks to request data
chain_id () – Network in which the leader exists
Return type: Optional
[]
Parameters: filter () – Leader filter
Return type: List
[]
chain_id () – Network in which the reputation network exists
Return type: List
[]
chain_id () – Network in which the slasher exists
Return type: List
[]