Socket
Book a DemoInstallSign in
Socket

miningrigrentals-api-v2

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

miningrigrentals-api-v2

Node JS Module interface with the Mining Rig Rentals API V2 easily

1.1.2
latest
npmnpm
Version published
Weekly downloads
21
950%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status

Mining Rig Rentals API V2

miningrigrentals-api-v2 is a JavaScript wrapper library over the MiningRigRentals (MRR) API, using es6/7 async functionality. First create a MRR and generate an API key and secret. Then simply download and import the library to start using it. Initialize the MRR class with your api key and secret, and call any method defined in the documentation!

Installation

To install miningrigrentals-api-v2 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 miningrigrentals-api-v2

Getting Started

To get started using the library, first import the MiningRigRentals class from the miningrigrentals-api-v2 module.

import MiningRigRentals from 'miningrigrentals-api-v2'

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

const apiKey = {
	key: api_key,
	secret: api_secret
};
let MRR = new MiningRigRentals(api_key)

Using your first method

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

let test = await MRR.whoami()

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:

MRR.whoami().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 test.success === true than you are good to go!

Check out the rest of the documentation to see what else you can do!

Documentation

https://oipwg.github.io/miningrigrentals-api-v2/

Keywords

Mining

FAQs

Package last updated on 03 May 2019

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.