OperatorUtils
@human-protocol/sdk / operator / OperatorUtils
Class: OperatorUtils
Defined in: operator.ts:29
Constructors
Constructor
new OperatorUtils():
OperatorUtils
Returns
OperatorUtils
Methods
getOperator()
staticgetOperator(chainId,address,options?):Promise<IOperator|null>
Defined in: operator.ts:46
This function returns the operator data for the given address.
Parameters
chainId
Network in which the operator is deployed
address
string
Operator address.
options?
Optional configuration for subgraph requests.
Returns
Promise<IOperator | null>
Returns the operator details or null if not found.
Code example
getOperators()
staticgetOperators(filter,options?):Promise<IOperator[]>
Defined in: operator.ts:92
This function returns all the operator details of the protocol.
Parameters
filter
Filter for the operators.
options?
Optional configuration for subgraph requests.
Returns
Promise<IOperator[]>
Returns an array with all the operator details.
Code example
getReputationNetworkOperators()
staticgetReputationNetworkOperators(chainId,address,role?,options?):Promise<IOperator[]>
Defined in: operator.ts:159
Retrieves the reputation network operators of the specified address.
Parameters
chainId
Network in which the reputation network is deployed
address
string
Address of the reputation oracle.
role?
string
(Optional) Role of the operator.
options?
Optional configuration for subgraph requests.
Returns
Promise<IOperator[]>
Returns an array of operator details.
Code example
getRewards()
staticgetRewards(chainId,slasherAddress,options?):Promise<IReward[]>
Defined in: operator.ts:205
This function returns information about the rewards for a given slasher address.
Parameters
chainId
Network in which the rewards are deployed
slasherAddress
string
Slasher address.
options?
Optional configuration for subgraph requests.
Returns
Promise<IReward[]>
Returns an array of Reward objects that contain the rewards earned by the user through slashing other users.
Code example
Last updated