Socket
Book a DemoInstallSign in
Socket

nicehash-api

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nicehash-api

javascript wrapper for nicehash api

1.1.4
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

npm version Build Status

NiceHash API

nicehash-api is a JavaScript wrapper library over the NiceHash API, using es6/7 async functionality. Create a NiceHash account first, generate an API key and id, and enable API functionality within the Nice Hash settings. Then simply download and import the library to start using it. Initialize the NiceHash class with your api key and id, and call any method defined in the documentation!

Installation

To install nicehash-api for use in an application, install the latest version from NPM and save it to your package.json. For this example we're using npm

$ npm install nicehash-api

Getting Started

To get started using the library, first import the NiceHash class from the nicehash-api module.

import NiceHash from 'nicehash-api'

After you have imported the api, you can go ahead and spawn a new NiceHash Object. You must pass it your NiceHash api key and id or else the class will not be able to make the API calls.

let NiceHash = new NiceHash(api_key, api_id)

Using your first method

To make sure the class was initiliazed correctly, we can test authorization by calling:

await NiceHash.testAuthorization()

This library wraps every function in a es7 async/await wrapper. If instead you wish to deal with promises in a different way, feel free to do:

NiceHash.testAuthorization().then(success => success).catch(err => err)

We recommend using async/await as it makes the code more terse. await will resolve the promise in a synchronous manner that allows one to expect deterministic behavior.

If NiceHash.testAuthorization() returns true then you are good to go! Check out the rest of the documentation to see what else you can do!

Documentation

https://oipwg.github.io/nicehash-api/

FAQs

Package last updated on 15 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.