Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

This package has been deprecated

Author message:

This package is obsolete; the Kraken websockets API should be used in its place.

kraken-pool

1.0.1 • Public • Published

Kraken Pool

A wrapper for kraken-api which enables simultaneous requests to the kraken.com API via multiple API keypairs. Simultaneous requests using a single keypar can result in "Invalid nonce" errors.

Installation

npm install kraken-pool
const KrakenPool = require('kraken-pool');

Usage

The Kraken Pool API is effectively a superset of that of the kraken-api library.

The constructor accepts an array of key/secret arrays, and an options object:

var client = new KrakenPool([
  [key0, secret0],
  [key1, secret1],
  [key2, secret2],
  ...
], options);

Note that kraken.com allows the creation of up to 16 keypairs.

The constructor also accepts the same arguments as that of the kraken-api library, for compatibility:

var client = new KrakenPool(key, secret, options);

For those who cannot decide whether to pass a single keypair or an array of keypairs:

var client = new KrakenPool([key, secret], options);

Once instantiated, a Kraken Pool object may be interacted with via the api method. See the kraken-api documentation for details.

Job Queue

If all keypairs are in use when the api method is called, the request is queued until one becomes available.

To access the number of available keypairs:

client.getAvailableClientCount();

Call Counter

Kraken Pool keeps track of the user's theoretical progress towards the API rate limit. See the Kraken API documentation for details regarding this limit and the call counter system.

The default countdown time is 3000 milliseconds. Tier 3 and 4 users should include a ratelimitCooldown option of 2000 and 1000, respectively, when instantiating the Kraken Pool.

To access the counter value:

client.getRateLimitCounter();

Note

The documentation states the following:

Ledger/trade history calls increase the counter by 2.

It is not clear whether this refers to the "Ledgers" route, the "QueryLedgers" route, or both. Therefore, the call counter takes a conservative approach and adds +2 for both routes, in addition to the "TradeHistory" route.

Keywords

Install

npm i kraken-pool

DownloadsWeekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

5.99 kB

Total Files

4

Last publish

Collaborators

  • avatar