StatisticsClient

@human-protocol/sdk / Modules / statistics / StatisticsClient

Class: StatisticsClient

statistics.StatisticsClient

Introduction

This client enables to obtain statistical information from the subgraph.

Unlikely from the other SDK clients, StatisticsClient does not require signer or provider to be provided. We just need to create client object using relevant network data.

constructor(network: NetworkData)

A Signer or a Provider should be passed depending on the use case of this module:

  • Signer: when the user wants to use this model in order to send transactions caling the contract functions.

  • Provider: when the user wants to use this model in order to get information from the contracts or subgraph.

Installation

npm

npm install @human-protocol/sdk

yarn

yarn install @human-protocol/sdk

Code example

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new StatisticsClient(networkData)

StatisticsClient constructor

Parameters

Name
Type
Description

networkData

NetworkData

The network information required to connect to the Statistics contract

Defined in

statistics.ts:68

Properties

networkData

networkData: NetworkData

Defined in

statistics.ts:61

Methods

getEscrowStatistics

getEscrowStatistics(params?): Promise<EscrowStatistics>

This function returns the statistical data of escrows.

Input parameters

Parameters

Name
Type
Description

params

IStatisticsParams

Statistics params with duration data

Returns

Promise<EscrowStatistics>

Escrow statistics data.

Code example

Defined in

statistics.ts:121


getHMTStatistics

getHMTStatistics(params?): Promise<HMTStatistics>

This function returns the statistical data of HMToken.

Input parameters

Parameters

Name
Type
Description

params

IStatisticsParams

Statistics params with duration data

Returns

Promise<HMTStatistics>

HMToken statistics data.

Code example

Defined in

statistics.ts:395


getPaymentStatistics

getPaymentStatistics(params?): Promise<PaymentStatistics>

This function returns the statistical data of payments.

Input parameters

Parameters

Name
Type
Description

params

IStatisticsParams

Statistics params with duration data

Returns

Promise<PaymentStatistics>

Payment statistics data.

Code example

Defined in

statistics.ts:285


getWorkerStatistics

getWorkerStatistics(params?): Promise<WorkerStatistics>

This function returns the statistical data of workers.

Input parameters

Parameters

Name
Type
Description

params

IStatisticsParams

Statistics params with duration data

Returns

Promise<WorkerStatistics>

Worker statistics data.

Code example

Defined in

statistics.ts:196

Last updated