Code Monkey home page Code Monkey logo

nicehash-api-cpp's Introduction

Nicehash API wrapper (C++)

License: MIT Build Status Docs

A C++ API wrapper for the NiceHash cloud cryptomining service.

Requirements

  • cURL libs (e.g. Fedora: libcurl-devel, Ubuntu/Debian: libcurl-dev)

  • CMake >= 3.1

Setup

See example CMakeLists.txt in the examples/ folder that uses ExternalProject to integrate nicehash-api-cpp with an existing CMake project.

Alternatively, manually build the library as below, then link libnicehash-api-cpp.so.

git clone https://github.com/4iar/nicehash-api-cpp.git && cd nicehash-api-cpp
mkdir build && cd build
cmake ..
make

Offline documentation can be built using doxygen

make doc

Usage

#include <nicehash-api.hpp>

...

    // Initialise client
    NiceHashApi niceHashApi;

    // Run a query
    // (see docs below for all API functions)
    std::string algorithm_name = "equihash";
    std::string stats = niceHashApi.getOrdersByAlgorithm(algorithm_name, 0)

API

Official documentation @ NiceHash.com

Public

niceHashApi.getApiVersion()

Global

stats.global.current

Get current profitability (price) and hashing speed for all algorithms. Refreshed every 30 seconds.

niceHashApi.getAverageGlobalStats()

stats.global.24h

Get average profitability (price) and hashing speed for all algorithms in past 24 hours.

niceHashApi.getCurrentGlobalStats()

Provider

stats.provider

Get current stats for provider for all algorithms. Refreshed every 30 seconds. It also returns past 56 payments.

niceHashApi.getProviderStats (std::string address)

stats.provider.ex

Get detailed stats for provider for all algorithms including history data and past 56 payments.

niceHashApi.getDetailedProviderStats (std::string address)

stats.provider.workers

Get detailed stats for provider's workers (rigs).

niceHashApi.getProviderWorkerStats (std::string address, int algorithm_id)

or

niceHashApi.getProviderWorkerStats (std::string address, std::string algorithm_name)

Orders

orders.get

Get all orders for certain algorithm. Refreshed every 30 seconds.

niceHashApi.getOrdersByAlgorithm (int algorithm_id, int location_id)

or

niceHashApi.getOrdersByAlgorithm (std::string algorithm_name, int location_id)

Algorithms

multialgo.info

Get information about Multi-Algorithm Mining.

simplemultialgo.info

Get information about Simple Multi-Algorithm Mining.

Private

orders.get&my
orders.create
orders.refill
orders.remove
orders.set.price
orders.set.price.decrease
orders.set.limit
balance

nicehash-api-cpp's People

Contributors

4iar avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ispyco 00mjk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.