StatisticsClient

@human-protocol/sdkarrow-up-right


@human-protocol/sdkarrow-up-right / statistics / StatisticsClient

Class: StatisticsClient

Defined in: statistics.ts:64arrow-up-right

Introduction

This client enables obtaining statistical information from the subgraph.

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

constructor(network: NetworkData)

Installation

npm

npm install @human-protocol/sdk

yarn

yarn install @human-protocol/sdk

Code example

Constructors

Constructor

new StatisticsClient(networkData): StatisticsClient

Defined in: statistics.ts:73arrow-up-right

StatisticsClient constructor

Parameters

networkData

NetworkDataarrow-up-right

The network information required to connect to the Statistics contract

Returns

StatisticsClient

Properties

networkData

networkData: NetworkDataarrow-up-right

Defined in: statistics.ts:65arrow-up-right


subgraphUrl

subgraphUrl: string

Defined in: statistics.ts:66arrow-up-right

Methods

getEscrowStatistics()

getEscrowStatistics(filter, options?): Promise<IEscrowStatisticsarrow-up-right>

Defined in: statistics.ts:127arrow-up-right

This function returns the statistical data of escrows.

Input parameters

Parameters

filter

IStatisticsFilterarrow-up-right = {}

Statistics params with duration data

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IEscrowStatisticsarrow-up-right>

Escrow statistics data.

Code example


getHMTDailyData()

getHMTDailyData(filter, options?): Promise<IDailyHMTarrow-up-right[]>

Defined in: statistics.ts:510arrow-up-right

This function returns the statistical data of HMToken day by day.

Input parameters

Parameters

filter

IStatisticsFilterarrow-up-right = {}

Statistics params with duration data

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IDailyHMTarrow-up-right[]>

Daily HMToken statistics data.

Code example


getHMTHolders()

getHMTHolders(params, options?): Promise<IHMTHolderarrow-up-right[]>

Defined in: statistics.ts:434arrow-up-right

This function returns the holders of the HMToken with optional filters and ordering.

Input parameters

Parameters

params

IHMTHoldersParamsarrow-up-right = {}

HMT Holders params with filters and ordering

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IHMTHolderarrow-up-right[]>

List of HMToken holders.

Code example


getHMTStatistics()

getHMTStatistics(options?): Promise<IHMTStatisticsarrow-up-right>

Defined in: statistics.ts:392arrow-up-right

This function returns the statistical data of HMToken.

Parameters

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IHMTStatisticsarrow-up-right>

HMToken statistics data.

Code example


getPaymentStatistics()

getPaymentStatistics(filter, options?): Promise<IPaymentStatisticsarrow-up-right>

Defined in: statistics.ts:321arrow-up-right

This function returns the statistical data of payments.

Input parameters

Parameters

filter

IStatisticsFilterarrow-up-right = {}

Statistics params with duration data

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IPaymentStatisticsarrow-up-right>

Payment statistics data.

Code example


getWorkerStatistics()

getWorkerStatistics(filter, options?): Promise<IWorkerStatisticsarrow-up-right>

Defined in: statistics.ts:218arrow-up-right

This function returns the statistical data of workers.

Input parameters

Parameters

filter

IStatisticsFilterarrow-up-right = {}

Statistics params with duration data

options?

SubgraphOptionsarrow-up-right

Optional configuration for subgraph requests.

Returns

Promise<IWorkerStatisticsarrow-up-right>

Worker statistics data.

Code example

Last updated