Latest 4.1.9
License MIT
Platforms ios 10.0
Dependencies ObjectMapper

MiningPoolHub-Swift is a complete API wrapper for the API written in the Swift language. All working calls, both authenticated and unauthenticated are available natively in swift code. The goal was to empower others to help build applications for this great community.

This library also supports for balance tracking

Built in Swift 4.0


bitcoin: 17ZEBFw5peuoUwYaEJeGkpoJwP1htViLUY

litecoin: LSzwWG35KqfuR5SEiKeJrGq4L3Z36vzjdR

ethereum: 0x339c744e0c08862c0943431079e5a406413bf4ed



pod 'MiningPoolHub-Swift'

Manual Installation

Copy into your project all the files found in MiningPoolHub/Sources

How To Use

What you need

First, visit and click on "Edit Profile". Retrieve your API key for use below.

*Note: Some calls have an id field. This is normally used to specify the user associated with a given call. It is my observation that if this is left nil, the user will be identified from the API key

Import Files

If using cocoapods, import the library: import MiningPoolHub_Swift

Making a Request

To make a request to the MiningPoolHub API, simply do the following

let api_key = "YOUR_API_KEY"
let config = MphDefaultConfiguration(apiKey: api_key)
let provider = MphWebProvider(configuration: config)

//Make web call
let task = provider.getAutoSwitchingAndProfitsStatistics(completion: { (response: MphListResponse<MphAutoSwitchingProfitStatistics>) in
        }) { (error: Error) in

That’s it! Swift bjects are returned fully parsed and ready to use!

Cancelling a Request

To make a request to task, simply call: task.cancel()


The domains have been enumerated and are a variable on the MphWebProvider. To set the domain of interest, simply call

provider.set(domain: .litecoin)

Use the default .root domain for the root domain of the site. For a perhaps newly released custom domain not yet supported by enumeration, call

provider.setCustom(domain: "someCustomDomain")


Floating Point Precision

As noted by this stackoverflow question, the Swift JSONSerialization class used to handle core JSON serialization and deserialization will cast by default to Double instead of Decimal. Because of this, you may notice some rounding errors at the lowest decimal place. Sorry!


A special thanks to MiningPoolHub for a great community and site!

Latest podspec

    "name": "MiningPoolHub-Swift",
    "version": "4.1.9",
    "summary": "MiningPoolHub API Wrapper in Swift",
    "description": "Handles various routing scenarious, like phone calls, email, twitter, etc.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Matthew York": "[email protected]"
    "platforms": {
        "ios": "10.0"
    "source": {
        "git": "",
        "tag": "4.1.9"
    "source_files": "MiningPoolHub/Sources/**/*.*",
    "dependencies": {
        "ObjectMapper": []
    "pushed_with_swift_version": "4.0"

Pin It on Pinterest

Share This