StatisticsClient
@human-protocol/sdk / statistics / StatisticsClient
Class: StatisticsClient
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
new StatisticsClient()
new StatisticsClient(
networkData):StatisticsClient
StatisticsClient constructor
Parameters
networkData
The network information required to connect to the Statistics contract
Returns
Defined in
Properties
networkData
networkData:
NetworkData
Defined in
subgraphUrl
subgraphUrl:
string
Defined in
Methods
getEscrowStatistics()
getEscrowStatistics(
filter):Promise<EscrowStatistics>
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
Defined in
getHMTDailyData()
getHMTDailyData(
filter):Promise<DailyHMTData[]>
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
Defined in
getHMTHolders()
getHMTHolders(
params):Promise<HMTHolder[]>
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
Defined in
getHMTStatistics()
getHMTStatistics():
Promise<HMTStatistics>
This function returns the statistical data of HMToken.
Returns
Promise<HMTStatistics>
HMToken statistics data.
Code example
Defined in
getPaymentStatistics()
getPaymentStatistics(
filter):Promise<PaymentStatistics>
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
Defined in
getWorkerStatistics()
getWorkerStatistics(
filter):Promise<WorkerStatistics>
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
Defined in
Last updated