MiningRigRentals

MiningRigRentals




new MiningRigRentals(apiSettings)

instantiate a MRR api using this constructor

Parameters:
Name Type Description
apiSettings Object
Properties
Name Type Description
key string

mining rig rentals api key

secret string

mining rig rentals api secret

Source:

Members

createError

Utility function to provide users with in depth error messaging for debugging

Source:

Methods




(async) addPoolToProfile(options) → {Promise.<Object>}

Add a pool to the profile

Parameters:
Name Type Description
options Object
Properties
Name Type Description
profileID number

The profile id you want to add the pool to

poolid number

Pool ID to add -- see /account/pool

priority number

0-4

algo string

Name of algorithm

name string

Pool name (doesn't change the pool name... just an MRR requirement)

Source:
Returns:

//return example { success: true, data: { id: '23136', success: true, message: 'Updated' } }

Type:
Promise.<Object>



(async) addPoolToRentals(rentalIDs, options) → {Promise.<Object>}

Add a pool on one or more rentals

Parameters:
Name Type Description
rentalIDs number | Array.<number>

Rental IDs

options Object
Properties
Name Type Attributes Description
host string

pool host (the part after stratum+tcp://)

port number

pool port (ex: 3333)

user string

workername

pass string

worker password

priority number <optional>

0-4 -- can be passed in after pool/ instead.eg /rig/17/pool/0

Source:
Returns:
Type:
Promise.<Object>



(async) addPoolToRigs(rigIDs, options) → {Promise.<Object>}

Add a pool on one or more rigs

Parameters:
Name Type Description
rigIDs number | Array.<number>

Rig IDs

options Object
Properties
Name Type Attributes Description
host string

pool host (the part after stratum+tcp://)

port number

pool port (ex: 3333)

user string

workername

pass string

worker password

priority number <optional>

0-4 -- can be passed in after pool/ instead.eg /rig/17/pool/0

Source:
Returns:
Type:
Promise.<Object>



(async) applyPoolProfileToRentals(rentalIDs, profileID) → {Promise.<Object>}

Apply a pool profile to one or more rentals

Parameters:
Name Type Description
rentalIDs number | Array.<number>

rental IDs

profileID number

Profile ID to apply -- see /account/profile

Source:
Returns:
Type:
Promise.<Object>



(async) applyPoolToRigs(rigIDs, profileID) → {Promise.<Object>}

Apply a pool profile to one or more rigs

Parameters:
Name Type Description
rigIDs number | Array.<number>

Rig IDs

profileID number

Profile ID to apply -- see /account/profile

Source:
Returns:
Type:
Promise.<Object>



createHMACSignature(endpoint, nonce, versionopt, paramsopt) → {string}

Create a SHA1 HMAC signature required for every mrr api call (see more at 'https://www.miningrigrentals.com/apidocv2')

Parameters:
Name Type Attributes Default Description
endpoint string

the endpoint your wish to hit without the trailing slash

nonce number

a nonce that increments with each call

version string <optional>
'v2'

MRR API version number (which version of the api you want to hit)

params Object <optional>

An object of parameters. Only needed if hitting the v1 API (used for creating the signature)

Source:
Returns:

hmacSig - the HMAC signature in hex

Type:
string



(async) createPool(options) → {Promise.<Object>}

Create a pool

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
type string

Pool algo, eg: sha256, scrypt, x11, etc

name string

Name to identify the pool with

host string

Pool host, the part after stratum+tcp://

port number

Pool port, the part after the : in most pool host strings

user string

Your workname

pass string <optional>
'x'

Worker password

notes string <optional>

Additional notes to help identify the pool for you

Source:
Returns:
Type:
Promise.<Object>



(async) createPoolProfile(name, algo) → {Promise.<Object>}

Create a pool profile

Parameters:
Name Type Description
name string

Name of the profile

algo string

Algo of the profile -> see /info/algos

Source:
Returns:
Type:
Promise.<Object>



(async) createRental(options) → {Promise.<Object>}

Create a new rental

Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
rig number

Rig ID to rent

length number

Length in hours to rent

profile number

The profile ID to apply (see /account/profile)

currency string <optional>
'BTC'

Currency to use -- one of [BTC,LTC,ETH,DASH]

rate Object <optional>
Properties
Name Type Attributes Default Description
type string <optional>
'mh'

The hash type of rate. defaults to "mh", possible values: [hash,kh,mh,gh,th]

price number <optional>

Price per [rate.type] per day to pay -- this is a filter only, it will use the rig's current price as long as it is <= this value

Source:
Returns:
Type:
Promise.<Object>



(async) createRig(optionsopt) → {Promise.<Object>}

Create a Rig

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Description
name string

Name of rig

type string

Type of rig (scrypt, sha256, x11, etc)

status string <optional>

"enabled","disabled"

server string

Server name -- see /info/servers

price Object <optional>
Properties
Name Type Attributes Default Description
btc.price string <optional>

Price of the rig per price.type per day (BTC)

btc.autoprice boolean <optional>

Enable BTC autopricing

btc.minimum string | number <optional>

Minimum price for the autopricer -- 0 to disable

btc.modified string <optional>

Percent +/- to modify the autopricing (eg: +10 or -5.13 is 10% over or 5.13% under market rates, respectively), 0 to disable

ltc.enabled boolean <optional>
true
ltc.price string | number <optional>

Price of the rig per price.type per day (LTC)

ltc.autoprice boolean <optional>

Enable LTC autopricing -- adjusts the LTC rate based on your BTC price and the GDAX market rate

eth.enabled string <optional>
true
eth.price string | number <optional>

Price of the rig per price.type per day (ETH)

eth.autoprice boolean <optional>

Enable ETH autopricing -- adjusts the ETH rate based on your BTC price and the GDAX market rate

dash.enabled string <optional>
true
dash.price string <optional>

Price of the rig per price.type per day (DASH)

dash.autoprice boolean <optional>

Enable DASH autopricing -- adjusts the DASH rate based on your BTC price and the GDAX market rate

type string <optional>
'mh'

The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th]

minhours number <optional>

Minimum number of hours available

maxhours number <optional>

Maximum number of hours available

hash Object <optional>
Properties
Name Type Default Description
hash string | number

Amount of hash to advertise

type string 'mh'

The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th]

Source:
Returns:
Type:
Promise.<Object>



(async) deletePoolOnRentals(rentalIDs, priority) → {Promise.<Object>}

Delete a pool on one or more rentals

Parameters:
Name Type Description
rentalIDs number | Array.<number>

Rental IDs

priority number

0-4 -- can be passed in after pool/ instead.eg /rig/17/pool/0

Source:
Returns:
Type:
Promise.<Object>



(async) deletePoolOnRigs(rigIDs, priority) → {Promise.<Object>}

Delete a pool on one or more rigs

Parameters:
Name Type Description
rigIDs number | Array.<number>

Rig IDs

priority number

0-4 -- can be passed in after pool/ instead.eg /rig/17/pool/0

Source:
Returns:
Type:
Promise.<Object>



(async) deletePoolProfile(id) → {Promise.<Object>}

Delete a specific pool profile

Parameters:
Name Type Description
id number

Pool Profile ID

Source:
Returns:
Type:
Promise.<Object>



(async) deletePools(poolIDs) → {Promise.<Object>}

Delete 1 or more pools

Parameters:
Name Type Description
poolIDs number | Array.<number>

Pool IDS to delete

Source:
Returns:
Type:
Promise.<Object>



(async) deleteRigs(rigIDs) → {Promise.<Object>}

Delete 1 or more rigs by ID

Parameters:
Name Type Description
rigIDs number | Array.<number>
Source:
Returns:
Type:
Promise.<Object>



(async) extendRental(rigIDs, options) → {Promise.<Object>}

For rig owners: extend a rental to donate time to the renter -- Assuming an active rental is in progress.

Parameters:
Name Type Description
rigIDs number | Array.<number>

IDs of the Rigs you wish to extend @ToDo: unclear if rig ID or rental ID needed

options Object
Properties
Name Type Description
hours number

Hours to extend by

minutes number

Minutes to extend by

Source:
Returns:
Type:
Promise.<Object>



generateNonce() → {number}

Generate a nonce needed to build the HMAC signature

Source:
Returns:
  • the current UNIX time + the previous Nonce
Type:
number



(async) getAccount() → {Promise.<Object>}

Retrieve account information

Source:
Returns:
Type:
Promise.<Object>



(async) getAccountBalance() → {Promise.<Object>}

Retrieve account balances

Source:
Returns:
Type:
Promise.<Object>



(async) getAlgo(algo, currencyopt) → {Promise.<Object>}

Get statistics for an algo (suggested price, unit information, current rented hash/etc)

Parameters:
Name Type Attributes Default Description
algo string

the name of the algorithm you wish to search by. Ex: 'scrypt'

currency string <optional>
'BTC'

Currency to use for price info. Options: BTC, ETH, LTC, DASH

Source:
Returns:
Type:
Promise.<Object>



(async) getAlgos(algo, currencyopt) → {Promise.<Object>}

Get all algos and statistics for them (suggested price, unit information, current rented hash/etc)

Parameters:
Name Type Attributes Default Description
algo string

algo to search on

currency string <optional>
'BTC'

Currency to use for price info *Ticker. Options: BTC, ETH, LTC, DASH

Source:
Returns:
Type:
Promise.<Object>



(async) getPoolProfile(id) → {Promise.<Object>}

Get a specific pool profile

Parameters:
Name Type Description
id number

ID of the pool profile

Source:
Returns:
Type:
Promise.<Object>



(async) getPoolProfiles(algoopt) → {Promise.<Object>}

List all pool profiles, or list by algo

Parameters:
Name Type Attributes Description
algo string <optional>

Algo to filter -- see /info/algos

Source:
Returns:
Type:
Promise.<Object>



(async) getPools() → {Promise.<Object>}

Get saved pools

Source:
Returns:
Type:
Promise.<Object>



(async) getPoolsByID(ids) → {Promise.<Object>}

Get pools by ID

Parameters:
Name Type Description
ids number | Array.<number>

pool ids

Source:
Returns:
Type:
Promise.<Object>



(async) getPoolsByRentalID(rentalIDs) → {Promise.<Object>}

List pools assigned to one or more rentals.

Parameters:
Name Type Description
rentalIDs number | Array.<number>

Rental IDs

Source:
Returns:
Type:
Promise.<Object>



(async) getPoolsFromRigs(rigIDs) → {Promise.<Object>}

List pools assigned to one or more rigs

Parameters:
Name Type Description
rigIDs number | Array.<number>

Rig IDs

Source:
Returns:
Type:
Promise.<Object>



(async) getRentalById(ids) → {Promise.<Object>}

Get information on rentals by rental ID.

Parameters:
Name Type Description
ids number | Array.<number>

Rental IDs

Source:
Returns:
Type:
Promise.<Object>



(async) getRentals(optionsopt) → {Promise.<Object>}

Lists rentals

Parameters:
Name Type Attributes Description
options Object <optional>

input fields/query parameters

Properties
Name Type Attributes Default Description
type string <optional>
renter

Type is one of [owner,renter] -- owner means rentals on your rigs, renter means rentals you purchased

algo string <optional>

Filter by algo, see /info/algos

history boolean <optional>
false

true = Show completed rentals, false = Active rentals

rig number <optional>

Show rentals related to a specific rig ID

start number <optional>
0

Start number (for pagination)

limit number <optional>
25

Limit number (for pagination)

Source:
Returns:
Type:
Promise.<Object>



(async) getRigs(options) → {Promise.<Object>}

Search for rigs on a specified algo. This is identical to the main rig list pages.

Parameters:
Name Type Description
options object

input fields/query parameters

Properties
Name Type Attributes Default Description
type string

Rig type, eg: sha256, scrypt, x11, etc

minhours Object <optional>

Filter the minimum hours of the rig *broken

Properties
Name Type Attributes Description
min number <optional>
max number <optional>
maxhours Object <optional>

Filter the maximum hours of the rig *broken

Properties
Name Type Attributes Description
min number <optional>
max number <optional>
rpi Object <optional>

Filter the RPI score

Properties
Name Type Attributes Description
min number <optional>
max number <optional>
hash Object <optional>

Filter the hashrate

Properties
Name Type Attributes Description
min number <optional>
max number <optional>
type string <optional>

The hash type of min/max. defaults to "mh", possible values: [hash,kh,mh,gh,th]

price Object <optional>

Filter the price

Properties
Name Type Attributes Description
min number <optional>
max number <optional>
offline boolean <optional>
false

To show or not to show offline rigs

rented boolean false}

to show or not to show rented rigs

region Object <optional>

Filter the region

Properties
Name Type Attributes Description
type string <optional>

Determines if this filter is an inclusive or exclusive filter.. possible options are [include,exclude]

boolean <optional>

A region to include/exclude

count number <optional>
100

Number of results to return, max is 100

offset number <optional>
0

What result number to start with, returning COUNT results

order string <optional>
"score"

Field to order the results by. Default is "score", Possible values: [rpi,hash,price,minhrs,maxhrs,score]

orderdir string <optional>
"asc"

Order direction

Source:
Returns:
Type:
Promise.<Object>



(async) getRigsByID(rigIDs) → {Promise.<Object>}

Get 1 or more rigs by ID

Parameters:
Name Type Description
rigIDs number | Array.<number>

Rig IDs

Source:
Returns:
Type:
Promise.<Object>



(async) getServers() → {Promise.<Object>}

Get a list of MRR rig servers

Source:
Returns:
Type:
Promise.<Object>



(async) getTransactions(optionsopt) → {Promise.<Object>}

List/search transaction history

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
start number <optional>
0

Start number (for pagination)

limit number <optional>
100

Limit number (for pagination)

algo string <optional>

Algo to filter -- see /info/algos

type string <optional>

Type to filter -- one of [credit,payout,referral,deposit,payment,credit/refund,debit/refund,Rental Fee]

rig number <optional>

Filter to specific rig by ID

rental number <optional>

Filter to specific rental by ID

txid string <optional>

Filter to specific txid

Source:
Returns:
Type:
Promise.<Object>



initAPI(endpoint, paramsopt, versionopt) → {AxiosInstance}

Initialize a new instance of axios with desired endpoint

Parameters:
Name Type Attributes Default Description
endpoint string

the endpoint you wish to hit WITHOUT THE TRAILING SLASH; ex: /rig/14

params Object <optional>

extra parameters to be passed along to the API

version string <optional>
'v2'

specify the mining rig rental api version you want to hit; defaults v2

Source:
Returns:
Type:
AxiosInstance



(async) listMyRigs(optionsopt) → {Promise.<Object>}

List my rigs

Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
type string <optional>

Filter on algo -- see /info/algos

hashrate boolean <optional>
false

Calculate and display hashrates

Source:
Returns:
Type:
Promise.<Object>



(async) replacePoolOnRigs(rigIDs, options) → {Promise.<Object>}

Replace a pool on one or more rigs

Parameters:
Name Type Description
rigIDs number | Array.<number>

Rig IDs

options Object
Properties
Name Type Attributes Description
host string

pool host (the part after stratum+tcp://)

port number

pool port (ex: 3333)

user string

workername

pass string

worker password

priority number <optional>

0-4 -- can be passed in after pool/ instead.eg /rig/17/pool/0

Source:
Returns:
Type:
Promise.<Object>



(async) updatePoolOnProfile(options) → {Promise.<Object>}

Update or replace a pool to a profile... **Poor MRR Documentation

Parameters:
Name Type Description
options Object
Properties
Name Type Description
profileID number

Pool Profile ID

poolid number

Pool ID

priority number

0-4

algo string

Name of algorithm

name string

Pool name (doesn't change the pool name... just an MRR requirement)

Source:
Returns:
Type:
Promise.<Object>



(async) updatePoolOnRentals(rentalIDs, options) → {Promise.<Object>}

Update a pool on one or more rentals

Parameters:
Name Type Description
rentalIDs number | Array.<number>

Rental IDs

options Object
Properties
Name Type Attributes Description
host string

pool host (the part after stratum+tcp://)

port number

pool port (ex: 3333)

user string

workername

pass string

worker password

priority number <optional>

0-4 -- can be passed in after pool/ instead.eg /rig/17/pool/0

Source:
Returns:
Type:
Promise.<Object>



(async) updatePools(poolIDs, optionsopt) → {Promise.<Object>}

Update saved pools

Parameters:
Name Type Attributes Description
poolIDs number | Array.<number>

IDs of the pools you wish to update

options Object <optional>
Properties
Name Type Attributes Description
type string <optional>

Pool algo, eg: sha256, scrypt, x11, etc

name string <optional>

Name to identify the pool with

host string <optional>

Pool host, the part after stratum+tcp://

port number <optional>

Pool port, the part after the : in most pool host strings

user string <optional>

Your workname

pass string <optional>

Worker password

notes string <optional>

Additional notes to help identify the pool for you

Source:
Returns:
Type:
Promise.<Object>



(async) updateRigsByID(rigIDs, optionsopt) → {Promise.<Object>}

Update 1 or more rigs by ID

Parameters:
Name Type Attributes Description
rigIDs number | Array.<number>

Rig ID(s)

options Object <optional>
Properties
Name Type Attributes Description
name string <optional>

Name of rig

status string <optional>

"enabled","disabled"

server string <optional>

Server name -- see /info/servers

price Object <optional>
Properties
Name Type Attributes Default Description
btc.price string <optional>

Price of the rig per price.type per day (BTC)

btc.autoprice boolean <optional>

Enable BTC autopricing

btc.minimum string | number <optional>

Minimum price for the autopricer -- 0 to disable

btc.modified string <optional>

Percent +/- to modify the autopricing (eg: +10 or -5.13 is 10% over or 5.13% under market rates, respectively), 0 to disable

ltc.enabled boolean <optional>
true
ltc.price string | number <optional>

Price of the rig per price.type per day (LTC)

ltc.autoprice boolean <optional>

Enable LTC autopricing -- adjusts the LTC rate based on your BTC price and the GDAX market rate

eth.enabled string <optional>
true
eth.price string | number <optional>

Price of the rig per price.type per day (ETH)

eth.autoprice boolean <optional>

Enable ETH autopricing -- adjusts the ETH rate based on your BTC price and the GDAX market rate

dash.enabled string <optional>
true
dash.price string <optional>

Price of the rig per price.type per day (DASH)

dash.autoprice boolean <optional>

Enable DASH autopricing -- adjusts the DASH rate based on your BTC price and the GDAX market rate

type string <optional>
'mh'

The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th]

minhours number <optional>

Minimum number of hours available

maxhours number <optional>

Maximum number of hours available

hash Object <optional>
Properties
Name Type Attributes Default Description
hash string | number <optional>

Amounto f hash to advertise

type string <optional>
'mh'

The hash type of hash.. defaults to "mh" possible values: [hash,kh,mh,gh,th]

Source:
Returns:
Type:
Promise.<Object>



(async) whoami() → {Promise.<Object>}

Test connectivity and return information about you

Source:
Returns:
Type:
Promise.<Object>