OperatorUtils

@human-protocol/sdkarrow-up-right


@human-protocol/sdkarrow-up-right / operator / OperatorUtils

Class: OperatorUtils

Defined in: operator.ts:29arrow-up-right

Constructors

Constructor

new OperatorUtils(): OperatorUtils

Returns

OperatorUtils

Methods

getOperator()

static getOperator(chainId, address, options?): Promise<IOperatorarrow-up-right | null>

Defined in: operator.ts:46arrow-up-right

This function returns the operator data for the given address.

Parameters

chainId

ChainIdarrow-up-right

Network in which the operator is deployed

address

string

Operator address.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IOperatorarrow-up-right | null>

  • Returns the operator details or null if not found.

Code example


getOperators()

static getOperators(filter, options?): Promise<IOperatorarrow-up-right[]>

Defined in: operator.ts:92arrow-up-right

This function returns all the operator details of the protocol.

Parameters

filter

IOperatorsFilterarrow-up-right

Filter for the operators.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IOperatorarrow-up-right[]>

Returns an array with all the operator details.

Code example


getReputationNetworkOperators()

static getReputationNetworkOperators(chainId, address, role?, options?): Promise<IOperatorarrow-up-right[]>

Defined in: operator.ts:159arrow-up-right

Retrieves the reputation network operators of the specified address.

Parameters

chainId

ChainIdarrow-up-right

Network in which the reputation network is deployed

address

string

Address of the reputation oracle.

role?

string

(Optional) Role of the operator.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IOperatorarrow-up-right[]>

  • Returns an array of operator details.

Code example


getRewards()

static getRewards(chainId, slasherAddress, options?): Promise<IRewardarrow-up-right[]>

Defined in: operator.ts:205arrow-up-right

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

Parameters

chainId

ChainIdarrow-up-right

Network in which the rewards are deployed

slasherAddress

string

Slasher address.

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IRewardarrow-up-right[]>

Returns an array of Reward objects that contain the rewards earned by the user through slashing other users.

Code example

Last updated