operator_utils
Last updated
Last updated
Utility class for operator-related operations.
Bases: object
Initializes a LeaderData instance.
Parameters:
chain_id () – Chain Identifier
id (str
) – Identifier
address (str
) – Address
amount_staked (int
) – Amount staked
amount_locked (int
) – Amount locked
locked_until_timestamp (int
) – Locked until timestamp
amount_withdrawn (int
) – Amount withdrawn
amount_slashed (int
) – Amount slashed
reward (int
) – Reward
amount_jobs_processed (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
website (Optional
[str
]) – Website URL
url (Optional
[str
]) – URL
job_types (Optional
[List
[str
]]) – Job types
registration_needed (Optional
[bool
]) – Whether registration is needed
registration_instructions (Optional
[str
]) – Registration instructions
reputation_networks (Optional
[List
[str
]]) – List of reputation networks
name (Optional
[str
]) – Name
category (Optional
[str
]) – Category
Bases: object
A class used to filter leaders.
Initializes a LeaderFilter instance.
Parameters:
roles (Optional
[str
]) – Roles to filter by
min_amount_staked (Optional
[int
]) – Minimum amount staked to filter by
order_by (Optional
[str
]) – Property to order by, e.g., “role”
first (int
) – Number of items per page
skip (int
) – Number of items to skip (for pagination)
Bases: object
Initializes an Operator instance.
Parameters:
address (str
) – Operator address
role (str
) – Role of the operator
url (str
) – URL of the operator
job_types (List
[str
]) – List of job types
registration_needed (Optional
[bool
]) – Whether registration is needed
registration_instructions (Optional
[str
]) – Registration instructions
Bases: object
A utility class that provides additional operator-related functionalities.
Gets 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
Raised when an error occurs while interacting with the operator.
Bases: object
Initializes a RewardData instance.
Parameters:
escrow_address (str
) – Escrow address
amount (int
) – Amount
chain_id () – Chain ID to request data
order_direction () – Order direction of results, “asc” or “desc”
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
[]