OperatorUtils

@human-protocol/sdkDocs


@human-protocol/sdk / operator / OperatorUtils

Class: OperatorUtils

Constructors

new OperatorUtils()

new OperatorUtils(): OperatorUtils

Returns

OperatorUtils

Methods

getLeader()

static getLeader(chainId, address): Promise<ILeader>

This function returns the leader data for the given address.

Parameters

chainId: ChainId

address: string

Leader address.

Returns

Promise<ILeader>

Returns the leader details.

Code example

Defined in

operator.ts:44


getLeaders()

static getLeaders(filter): Promise<ILeader[]>

This function returns all the leader details of the protocol.

Parameters

filter: ILeadersFilter

Filter for the leaders.

Returns

Promise<ILeader[]>

Returns an array with all the leader details.

Code example

Defined in

operator.ts:99


getReputationNetworkOperators()

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

Retrieves the reputation network operators of the specified address.

Parameters

chainId: ChainId

address: string

Address of the reputation oracle.

role?: string

(Optional) Role of the operator.

Returns

Promise<IOperator[]>

  • Returns an array of operator details.

Example

Defined in

operator.ts:151


getRewards()

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

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

Parameters

chainId: ChainId

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

Defined in

operator.ts:201

Last updated