StatisticsClient

@human-protocol/sdk


@human-protocol/sdk / statistics / StatisticsClient

Class: StatisticsClient

Defined in: statistics.ts:58

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

new StatisticsClient()

new StatisticsClient(networkData): StatisticsClient

Defined in: statistics.ts:67

StatisticsClient constructor

Parameters

networkData

NetworkData

The network information required to connect to the Statistics contract

Returns

StatisticsClient

Properties

networkData

networkData: NetworkData

Defined in: statistics.ts:59


subgraphUrl

subgraphUrl: string

Defined in: statistics.ts:60

Methods

getEscrowStatistics()

getEscrowStatistics(filter): Promise<EscrowStatistics>

Defined in: statistics.ts:120

This function returns the statistical data of escrows.

Input parameters

Parameters

filter

IStatisticsFilter = {}

Statistics params with duration data

Returns

Promise<EscrowStatistics>

Escrow statistics data.

Code example


getHMTDailyData()

getHMTDailyData(filter): Promise<DailyHMTData[]>

Defined in: statistics.ts:478

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

Input parameters

Parameters

filter

IStatisticsFilter = {}

Statistics params with duration data

Returns

Promise<DailyHMTData[]>

Daily HMToken statistics data.

Code example


getHMTHolders()

getHMTHolders(params): Promise<HMTHolder[]>

Defined in: statistics.ts:407

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

Input parameters

Parameters

params

IHMTHoldersParams = {}

HMT Holders params with filters and ordering

Returns

Promise<HMTHolder[]>

List of HMToken holders.

Code example


getHMTStatistics()

getHMTStatistics(): Promise<HMTStatistics>

Defined in: statistics.ts:364

This function returns the statistical data of HMToken.

Returns

Promise<HMTStatistics>

HMToken statistics data.

Code example


getPaymentStatistics()

getPaymentStatistics(filter): Promise<PaymentStatistics>

Defined in: statistics.ts:300

This function returns the statistical data of payments.

Input parameters

Parameters

filter

IStatisticsFilter = {}

Statistics params with duration data

Returns

Promise<PaymentStatistics>

Payment statistics data.

Code example


getWorkerStatistics()

getWorkerStatistics(filter): Promise<WorkerStatistics>

Defined in: statistics.ts:204

This function returns the statistical data of workers.

Input parameters

Parameters

filter

IStatisticsFilter = {}

Statistics params with duration data

Returns

Promise<WorkerStatistics>

Worker statistics data.

Code example

Last updated