0.5.5 • Published 6 years ago

privateer v0.5.5

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

privateer

Integrate with exchanges like Bitfinex for crypto-currency trading in your JavaScript / Node.js / Sails.js app. Supports Bitcoin, Ethereum, and more.

Selling fiat currency / cryptocurrency Indirectly selling fiat currency / cryptocurrency by buying on a reciprocal market

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

Installation   NPM version

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.

Usage

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().

Exchanges

To see all available exchanges:

require('privateer');

Configuration

Set credentials as global defaults for a particular exchange:

privateer('gdax').configure({
  apiKey: '«YOUR API KEY->',
  secret: '«YOUR API SECRET->',
  password: '«YOUR GDAX PASSPHRASE->',
});

Methods

To see all available methods:

privateer('gdax');

See Docs

Other stuff

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

Compatibility

Node.js v8.x and up.

 

NPM

License

This package is available under the MIT license.

Copyright © 2017-present Mike McNeil, St. Nicholas Crumrine, Sails Co.

0.5.5

6 years ago

0.5.4

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.5

6 years ago

0.3.4

6 years ago

0.3.3

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago