nicehash-api-cpp  0.0.1
Public Member Functions | List of all members
NiceHashApi Class Reference

#include <nicehash-api.hpp>

Collaboration diagram for NiceHashApi:

Public Member Functions

std::string getCurrentGlobalStats ()
 Get current global stats. More...
 
std::string getAverageGlobalStats ()
 Get average (24h) global stats. More...
 
std::string getProviderStats (std::string address)
 Get current stats for provider for all algorithms. More...
 
std::string getDetailedProviderStats (std::string address)
 Get detailed current stats for provider for all algorithms. More...
 
std::string getProviderWorkerStats (std::string address, int algorithm_id)
 Get detailed stats for a provider's workers by algorithm id. More...
 
std::string getProviderWorkerStats (std::string address, std::string algorithm_name)
 Get detailed stats for a provider's workers by algorithm name. More...
 
std::string getOrdersByAlgorithm (int algorithm_id, int location_id)
 Get all orders for a given algorithm id. More...
 
std::string getOrdersByAlgorithm (std::string algorithm_name, int location_id)
 Get all orders for a given algorithm by name. More...
 
std::string getMultiAlgorithmInfo ()
 
std::string getSimpleMultiAlgorithmInfo ()
 
int algorithmNameToId (std::string algorithm_name)
 Convert an algorithm name to its id. More...
 
std::string algorithmIdToName (int algorithm_id)
 
std::string getApiVersion ()
 Get API version. More...
 
 NiceHashApi ()
 
 NiceHashApi (Client *new_client)
 

Detailed Description

Definition at line 8 of file nicehash-api.hpp.

Constructor & Destructor Documentation

◆ NiceHashApi() [1/2]

NiceHashApi::NiceHashApi ( )
inline

Definition at line 36 of file nicehash-api.hpp.

◆ NiceHashApi() [2/2]

NiceHashApi::NiceHashApi ( Client new_client)
inline

Definition at line 39 of file nicehash-api.hpp.

Member Function Documentation

◆ algorithmIdToName()

std::string NiceHashApi::algorithmIdToName ( int  algorithm_id)

◆ algorithmNameToId()

int NiceHashApi::algorithmNameToId ( std::string  algorithm_name)

Convert an algorithm name to its id.

See https://www.nicehash.com/?p=api for name->id mappings

Definition at line 16 of file algorithmNameToId.cpp.

References strToUpper().

Referenced by getOrdersByAlgorithm(), and getProviderWorkerStats().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getApiVersion()

std::string NiceHashApi::getApiVersion ( )

Get API version.

Query this to detect any changes of API.

Gets the API version by (GET) requesting https://api.nicehash.com/api

Definition at line 12 of file getApiVersion.cpp.

References Client::get().

Here is the call graph for this function:

◆ getAverageGlobalStats()

std::string NiceHashApi::getAverageGlobalStats ( )

Get average (24h) global stats.

Gets the average (24h) global stats by (GET) requesting https://api.nicehash.com/api?method=stats.global.24h

Definition at line 12 of file getAverageGlobalStats.cpp.

References Client::get().

Here is the call graph for this function:

◆ getCurrentGlobalStats()

std::string NiceHashApi::getCurrentGlobalStats ( )

Get current global stats.

Gets the current global stats by (GET) requesting https://api.nicehash.com/api?method=stats.global.current

Definition at line 12 of file getCurrentGlobalStats.cpp.

References Client::get().

Here is the call graph for this function:

◆ getDetailedProviderStats()

std::string NiceHashApi::getDetailedProviderStats ( std::string  address)

Get detailed current stats for provider for all algorithms.

Get the detailed current stats for provider for all algorithms (data refreshed every 30 seconds). It (GET) requests https://api.nicehash.com/api?method=stats.provider&addr=... where the addr param is a wallet address. The past 56 payments are also returned in the response.

Definition at line 15 of file getDetailedProviderStats.cpp.

References Client::get().

Here is the call graph for this function:

◆ getMultiAlgorithmInfo()

std::string NiceHashApi::getMultiAlgorithmInfo ( )

◆ getOrdersByAlgorithm() [1/2]

std::string NiceHashApi::getOrdersByAlgorithm ( int  algorithm_id,
int  location_id 
)

Get all orders for a given algorithm id.

Get all orders for a given algorithm (data refreshed every 30 seconds). It (GET) requests https://api.nicehash.com/api?method=orders.get&location=...&algo=... where the algo is an algorithm id and location is a location id (see https://www.nicehash.com/?p=api).

Definition at line 14 of file getOrdersByAlgorithm.cpp.

References Client::get().

Referenced by getOrdersByAlgorithm().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOrdersByAlgorithm() [2/2]

std::string NiceHashApi::getOrdersByAlgorithm ( std::string  algorithm_name,
int  location_id 
)

Get all orders for a given algorithm by name.

Get all orders for a given algorithm (data refreshed every 30 seconds). It (GET) requests https://api.nicehash.com/api?method=orders.get&location=...&algo=... where the algo is an algorithm id and location is a location id (see https://www.nicehash.com/?p=api).

Definition at line 36 of file getOrdersByAlgorithm.cpp.

References algorithmNameToId(), and getOrdersByAlgorithm().

Here is the call graph for this function:

◆ getProviderStats()

std::string NiceHashApi::getProviderStats ( std::string  address)

Get current stats for provider for all algorithms.

Get current stats for provider for all algorithms (data refreshed every 30 seconds). It (GET) requests https://api.nicehash.com/api?method=stats.provider&addr=... where the addr param is a wallet address. The past 56 payments are also returned in the response.

Definition at line 15 of file getProviderStats.cpp.

References Client::get().

Here is the call graph for this function:

◆ getProviderWorkerStats() [1/2]

std::string NiceHashApi::getProviderWorkerStats ( std::string  address,
int  algorithm_id 
)

Get detailed stats for a provider's workers by algorithm id.

Get current stats for provider for all algorithms (data refreshed every 30 seconds). It (GET) requests https://api.nicehash.com/api?method=stats.provider&addr=... where the addr param is a wallet address. The past 56 payments are also returned in the response.

Definition at line 15 of file getProviderWorkerStats.cpp.

References Client::get().

Referenced by getProviderWorkerStats().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getProviderWorkerStats() [2/2]

std::string NiceHashApi::getProviderWorkerStats ( std::string  address,
std::string  algorithm_name 
)

Get detailed stats for a provider's workers by algorithm name.

Get current stats for provider for all algorithms (data refreshed every 30 seconds). It (GET) requests https://api.nicehash.com/api?method=stats.provider&addr=... where the addr param is a wallet address. The past 56 payments are also returned in the response.

Definition at line 36 of file getProviderWorkerStats.cpp.

References algorithmNameToId(), and getProviderWorkerStats().

Here is the call graph for this function:

◆ getSimpleMultiAlgorithmInfo()

std::string NiceHashApi::getSimpleMultiAlgorithmInfo ( )

The documentation for this class was generated from the following files: