This is a C# wrapper for the Cryptocurrency mining platform, Nanopool. Its wraps the web API into an easy to use package.
As of this moment (9th September) it only uses the Miner section of the API which is used to get access about a user and their miners. However, I would like to continue to develop it and implement the entire API. As for the Miner section of the API this can retrieve about 95% of the calls.
It simply constructs the URL using the enum that you pass into the method along with your cryptocurrency address. It then downloads the JSON from the URL and parses it into a C# class which is returned and able to be accessed by the user.
- Through the Nuget package manager - Simply search for Nanopool or run:
Install-Package NanopoolAPI -Version 0.9.0
- Alternatively, visiting the nuget page and downloading the package manually
Within your scripts you can then add 3 using statements:
using NanopoolAPI_Sharp;
using NanopoolAPI_Sharp.Data;
using NanopoolAPI_Sharp.Helpers;
After including the using statements in the previous question, you now want to create a new 'EthClient'.
EthClient client = new EthClient("YourEthAddress");
Now, you can use the method SendRequest like so:
var result = await client.SendRequest<GeneralInfo>(Requests.RequestType.User);
Console.WriteLine(result.info.balance);
In that example, it will print the Eth balance of your account to the console It is very important that you match the correct class with the type of call you are making.
For example, calling SendRequest with the Requests.RequestType.User value will return a GeneralInfo class, whereas a value of Requests.RequestType.AccountExist will return a class of AccountExists.
I commented everything so you should be able to hover over the enum and it will say something along the lines of:
Pair with the 'AccountExists' class
Which should give you an indication of what to use.
Yes! Make sure you have Newtonsoft JSON installed. The latest version should be fine and can be installed however you want.