NiceHash

NiceHash




new NiceHash(apiKey, organizationId-, apiSecret)

instantiate a NiceHash class that you can use to make REST requests to the NiceHash API

Parameters:
Name Type Description
apiKey string

NiceHash api key

organizationId- string | number

NiceHash api id

apiSecret string

NiceHash api secret

Source:

Members

locale

Creates a new client

Source:

Methods




api(endpoint, paramsopt) → {AxiosInstance}

Build initial AxiosInstance with baseURL = "https://api.nicehash.com/api"

Parameters:
Name Type Attributes Description
endpoint
params Object <optional>
Source:
Returns:
Type:
AxiosInstance



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

Create new order. Only standard orders can be created with use of API.

Parameters:
Name Type Description
options
Properties
Name Type Attributes Default Description
pool_host string

Pool hostname or IP;

pool_port string

Pool port

pool_user string

Pool username

pool_pass string

Pool password

location string | number <optional>
1

0 for Europe (NiceHash), 1 for USA (WestHash);

algo string | number <optional>
'scrypt'

Algorithm name or ID

amount string | number <optional>
0.005

Pay amount in BTC;

price= string | number <optional>

Price in BTC/GH/day or BTC/TH/day;

limit string | number <optional>
0.01

Speed limit in GH/s or TH/s (0 for no limit);

code string | number <optional>

This parameter is optional. You have to provide it if you have 2FA enabled. You can use NiceHash2FA Java application to generate codes.

Source:
Returns:
Type:
Promise.<Object>



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

Decrease price for the existing order. Price decrease possible every 10 minutes

Parameters:
Name Type Description
options
Properties
Name Type Default Description
location string | number 0

0 for Europe (NiceHash), 1 for USA (WestHash);

algo string | number "scrypt"

Algorithm name or ID

order string | number

Order ID/number

Source:
Returns:
Type:
Promise.<Object>



(async) getBalance() → {Promise.<Number>}

Get current confirmed Bitcoin balance.

Source:
Returns:
Type:
Promise.<Number>



(async) getBuyInfo() → {Promise.<Array.<Object>>}

Get needed information for buying hashing power using NiceHashBot.

Source:
Returns:
Type:
Promise.<Array.<Object>>



(async) getCurrentGlobalStats() → {Promise.<Array.<Object>>}

Get current profitability (price) and hashing speed for all algorithms. Refreshed every 30 seconds. ${number} [location] - 0 for Europe, 1 for USA. Both if omitted.

Source:
Returns:
Type:
Promise.<Array.<Object>>



(async) getCurrentGlobalStats24h() → {Promise.<Array.<Object>>}

Get average profitability (price) and hashing speed for all algorithms in past 24 hours.

Source:
Returns:
Type:
Promise.<Array.<Object>>



(async) getMultiAlgoInfo() → {Promise.<Array.<Object>>}

Get information about Mult-Algorithm Mining

Source:
Returns:
Type:
Promise.<Array.<Object>>



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

Get all orders for certain algorithm owned by the customer. Refreshed every 30 seconds.

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

0 for Europe (NiceHash), 1 for USA (WestHash);

algo number | string <optional>
"scrypt"

Algorithm ID or name

Source:
Returns:
Type:
Promise.<Array.<Object>>



(async) getOrdersForAlgorithm(location, algo) → {Promise.<Array.<Object>>}

Get all orders for certain algorithm. Refreshed every 30 seconds.

Parameters:
Name Type Description
location number

1 for Europe (NiceHash), 2 for USA (WestHash);

algo number | string

Algorithm marked with ID or its name.

Source:
Returns:
Type:
Promise.<Array.<Object>>



(async) getProviderPayments(addr, fromopt) → {Promise.<Object>}

Get payments for provider.

Parameters:
Name Type Attributes Description
addr string

Provider's BTC address.

from number <optional>

Get history data from this time (UNIX timestamp). This parameter is optional and is by default considered to be 0 (return complete history)

Source:
Returns:
Type:
Promise.<Object>



(async) getProviderStats(addr) → {Promise.<Object>}

Get current stats for provider for all algorithms. Refreshed every 30 seconds. It also returns past 56 payments

Parameters:
Name Type Description
addr string

Provider's BTC address.

Source:
Returns:
Type:
Promise.<Object>



(async) getProviderStatsEx(addr, fromopt) → {Promise.<Object>}

Get detailed stats for provider for all algorithms including history data and payments in past 7 days.

Parameters:
Name Type Attributes Description
addr string

Provider's BTC address.

from number <optional>

Get history data from this time (UNIX timestamp). This parameter is optional and is by default considered to be 0 (return complete history)

Source:
Returns:
Type:
Promise.<Object>



(async) getSingleMultiAlgoInfo() → {Promise.<Array.<Object>>}

Get information about Simple Multi-Algorithm Mining

Source:
Returns:
Type:
Promise.<Array.<Object>>



(async) getWorkersStats(addr, algo) → {Promise.<Object>}

Get detailed stats for provider's workers (rigs).

Parameters:
Name Type Description
addr string

Provider's BTC address;

algo number | number

Algorithm marked with ID or its name

Source:
Returns:
Type:
Promise.<Object>



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

Create new order. Only standard orders can be created with use of API.

Parameters:
Name Type Description
options
Properties
Name Type Default Description
location string | number 0

0 for Europe (NiceHash), 1 for USA (WestHash);

algo string | number "scrypt"

Algorithm name or ID

amount string | number

Pay amount in BTC;

order string | number

Order ID

Source:
Returns:
Type:
Promise.<Object>



(async) removeOrder(location, algo, order) → {Promise.<Object>}

Remove existing order.

Parameters:
Name Type Default Description
location string | number 0

0 for Europe (NiceHash), 1 for USA (WestHash);

algo string | number "scrypt"

Algorithm name or ID

order string | number

Order ID

Source:
Returns:
Type:
Promise.<Object>



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

Set new limit for the existing order.

Parameters:
Name Type Description
options
Properties
Name Type Default Description
location string | number 0

0 for Europe (NiceHash), 1 for USA (WestHash);

algo string | number "scrypt"

Algorithm name or ID

amount string | number

Pay amount in BTC;

order string | number

Order ID/number;

limit string | number 0

Speed limit in GH/s or TH/s (0 for no limit);

Source:
Returns:
Type:
Promise.<Object>



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

Set new price for the existing order. Only increase is possible.

Parameters:
Name Type Description
options
Properties
Name Type Default Description
location string | number 0

0 for Europe (NiceHash), 1 for USA (WestHash);

algo string | number "scrypt"

Algorithm name or ID

price string | number

Price in BTC/GH/Day or BTC/TH/Day.

order string | number

Order ID/number

Source:
Returns:
Type:
Promise.<Object>



(async) testAuthorization() → {Promise.<Boolean>}

Test Authorization

Source:
Returns:
Type:
Promise.<Boolean>