OperatorUtils

@human-protocol/sdk


@human-protocol/sdk / operator / OperatorUtils

Class: OperatorUtils

Defined in: operator.ts:27

Constructors

Constructor

new OperatorUtils(): OperatorUtils

Returns

OperatorUtils

Methods

getOperator()

static getOperator(chainId, address): Promise<IOperator>

Defined in: operator.ts:43

This function returns the operator data for the given address.

Parameters

chainId

ChainId

Network in which the operator is deployed

address

string

Operator address.

Returns

Promise<IOperator>

Returns the operator details.

Code example


getOperators()

static getOperators(filter): Promise<IOperator[]>

Defined in: operator.ts:109

This function returns all the operator details of the protocol.

Parameters

filter

IOperatorsFilter

Filter for the operators.

Returns

Promise<IOperator[]>

Returns an array with all the operator details.

Code example


getReputationNetworkOperators()

static getReputationNetworkOperators(chainId, address, role?): Promise<IOperator[]>

Defined in: operator.ts:190

Retrieves the reputation network operators of the specified address.

Parameters

chainId

ChainId

Network in which the reputation network is deployed

address

string

Address of the reputation oracle.

role?

string

(Optional) Role of the operator.

Returns

Promise<IOperator[]>

  • Returns an array of operator details.

Code example


getRewards()

static getRewards(chainId, slasherAddress): Promise<IReward[]>

Defined in: operator.ts:244

This function returns information about the rewards for a given slasher address.

Parameters

chainId

ChainId

Network in which the rewards are deployed

slasherAddress

string

Slasher address.

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