Integrate with exchanges like Bitfinex for crypto-currency trading in your JavaScript / Node.js / Sails.js app. Supports Bitcoin, Ethereum, and more.
WARNING
This package does not yet necessarily use IEEE-floating-point-safe math yet (see TODOs in the code). Pull requests welcome!
As of the time of writing this note, you can find the latest abstract method definitions here.
-@mikermcneil, May 11, 2018
To install this package, run:
$ npm install privateer
Then require it from the actions or helpers in your Sails app, a command-line script, or any other Node.js module.
privateer supports await
, with fallback support for callbacks (.exec()
), and promise-chaining (.then()
) via the parley interface (an extension of bluebird). Other than the special case of .configure()
, all exchange methods are parley Callables, which means they can use Deferreds that support .intercept()
, .tolerate()
, .toPromise()
, .now()
, and .log()
.
To see all available exchanges:
require('privateer');
Set credentials as global defaults for a particular exchange:
privateer('gdax').configure({
apiKey: '«YOUR API KEY->',
secret: '«YOUR API SECRET->',
password: '«YOUR GDAX PASSPHRASE->',
});
To see all available methods:
privateer('gdax');
See Docs
For convenience, privateer
exposes the underlying ccxt library as ._ccxt
.
WARNING: The underlying version of ccxt might change at any time between major (or even minor) releases of privateer.
require('privateer')._ccxt
// e.g.
// { version: '1.9.346',
// Exchange: { [Function: Exchange] ccxtVersion: '1.9.346' },
// exchanges:
// [ '_1broker',
//
// …and so on
See http://npmjs.com/package/ccxt for more information.
Similarly, privateer exposes the exchange-specific ccxt dao as _ccxtExchange
:
require('privateer')('bittrex')._ccxtExchange
Node.js v8.x and up.
This package is available under the MIT license.
Copyright © 2017-present Mike McNeil, St. Nicholas Crumrine, Sails Co.