StatisticsClient
@human-protocol/sdk / statistics / StatisticsClient
Class: StatisticsClient
Defined in: statistics.ts:64
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/sdkyarn
yarn install @human-protocol/sdkCode example
Constructors
Constructor
new StatisticsClient(
networkData):StatisticsClient
Defined in: statistics.ts:73
StatisticsClient constructor
Parameters
networkData
The network information required to connect to the Statistics contract
Returns
StatisticsClient
Properties
networkData
networkData:
NetworkData
Defined in: statistics.ts:65
subgraphUrl
subgraphUrl:
string
Defined in: statistics.ts:66
Methods
getEscrowStatistics()
getEscrowStatistics(
filter,options?):Promise<IEscrowStatistics>
Defined in: statistics.ts:127
This function returns the statistical data of escrows.
Input parameters
Parameters
filter
IStatisticsFilter = {}
Statistics params with duration data
options?
Optional configuration for subgraph requests.
Returns
Promise<IEscrowStatistics>
Escrow statistics data.
Code example
getHMTDailyData()
getHMTDailyData(
filter,options?):Promise<IDailyHMT[]>
Defined in: statistics.ts:510
This function returns the statistical data of HMToken day by day.
Input parameters
Parameters
filter
IStatisticsFilter = {}
Statistics params with duration data
options?
Optional configuration for subgraph requests.
Returns
Promise<IDailyHMT[]>
Daily HMToken statistics data.
Code example
getHMTHolders()
getHMTHolders(
params,options?):Promise<IHMTHolder[]>
Defined in: statistics.ts:434
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
options?
Optional configuration for subgraph requests.
Returns
Promise<IHMTHolder[]>
List of HMToken holders.
Code example
getHMTStatistics()
getHMTStatistics(
options?):Promise<IHMTStatistics>
Defined in: statistics.ts:392
This function returns the statistical data of HMToken.
Parameters
options?
Optional configuration for subgraph requests.
Returns
Promise<IHMTStatistics>
HMToken statistics data.
Code example
getPaymentStatistics()
getPaymentStatistics(
filter,options?):Promise<IPaymentStatistics>
Defined in: statistics.ts:321
This function returns the statistical data of payments.
Input parameters
Parameters
filter
IStatisticsFilter = {}
Statistics params with duration data
options?
Optional configuration for subgraph requests.
Returns
Promise<IPaymentStatistics>
Payment statistics data.
Code example
getWorkerStatistics()
getWorkerStatistics(
filter,options?):Promise<IWorkerStatistics>
Defined in: statistics.ts:218
This function returns the statistical data of workers.
Input parameters
Parameters
filter
IStatisticsFilter = {}
Statistics params with duration data
options?
Optional configuration for subgraph requests.
Returns
Promise<IWorkerStatistics>
Worker statistics data.
Code example
Last updated