Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

cryptox

dutu56MIT1.2.1

Common API wrapper for multiple crypto currency exchanges

api, bitcoin, btc, eth, bitfinex, bitstamp, bitx, btc-e, btce, coinbase, crypto, exchange, open exchange rates, oxr, gdax, poloniex

readme

cryptox

Build Status Dependencies Status

cryptox is a node.js wrapper for REST API for multiple crypto currency exchanges.

cryptox manages API communication with different exchanges and provides common methods for all exchanges. Differences between the different API's are abstracted away.

Contents

Install

npm install cryptox

Use

var Cryptox = require("cryptox");
var account = new Cryptox("btce", {key: "your_key", secret: "your_secret"});

account.getOpenOrders({pair: "LTC_USD"}, function (err, openOrders) {
    if (!err)
        console.log(openOrders);
});

Example result:

{
    "timestamp": "2015-02-03T00:03:27+00:00",
    "error": "",
    "data": [
        {
            "order_id": "563489985",
            "pair": "LTC_USD",
            "type": "buy",
            "amount": "1",
            "rate": "0.1",
            "status": "0",
            "created_at": "2015-02-01T19:23:15+00:00"
        },
        {
            "order_id": "563612426",
            "pair": "LTC_USD",
            "type": "buy",
            "amount": "2",
            "rate": "0.5",
            "status": "0",
            "created_at": "2015-02-01T20:59:53+00:00"
        }        
    ]
}

Supported Exchanges and Implemented methods

if you are interested in extending cryptox for different exchange or a method not yet implemented, check out the document Exchanges

| |Bitfinex|Bitstamp |BitX|BTC-e|CEX.io| Gdax |Poloniex|OXR [1]| | --- | :-: | :-: |:-: | :-: | :-: | :-: | :-: | :-: | |getRate | FI | FI | FI | FI | | FI | FI | FI | |getTicker | FI | FI | FI | FI | | FI | FI | — | |getOrderBook | FI | FI | FI | FI | | FI | FI | — | |getTrades | | | | | | FI | | — | |getFee | | FI | FI | FI | | | | — | |getTransactions| FI | FI | FI | | | | | — | |getBalance | FI | FI | FI | | | FI | FI | — | |getMarginPositions | | | | | | | FI | — | |getOpenOrders | | | FI | FI | | | | — | |postSellOrder | | | | | | | | — | |postBuyOrder | | | | | | | | — | |cancelOrder | | | | | | | | — | |getLendBook | FI | — | — | — | — | — | | — | |native API calls| FI | FI | FI | FI | — | FI | FI | FI |

FI = Fully Implemented
FR = Fully Implemented, but restrictions apply; refer to notes below (if any)
PI = Partially Implemented; refer to notes below (if any)
= Not Supported

[1] OXR (Open Exchange Rates) is not a crypto exchange, however it provides exchange rates for world fiat currencies

ChangeLog

cryptox module adheres to [Semantic Versioning] (http://semver.org/) for versioning: MAJOR.MINOR.PATCH.

  1. MAJOR version increments when non-backwards compatible API changes are introduced
  2. MINOR version increments when functionality in a backwards-compatible manner are introduced
  3. PATCH version increments when backwards-compatible bug fixes are made

See detailed ChangeLog

Documentation

See API documentation

FAQ

See FAQ

License

MIT

changelog

cryptox ChangeLog

All notable changes to this module are documented in this file. cryptox module adheres to Semantic Versioning.

[1.2.1] - 2017-03-20

Added

  • poloiex.getMarginPositions() method supports options parameter { account: 'all' } to sum up the balances of all accounts (exchange, margin and lending)

[1.1.1] - 2017-02-10

Fixed

  • poloniex flipped base and counter currency

[1.1.0] - 2016-10-30

Added

  • implement native API calls

[1.0.0] - 2016-10-17

Changed

  • name Coinbase changed to Gdax
  • all numeric response parameters are now returned as string
  • parameter pair is represented with _ between curency symbols (eg USD_BTC instead of USDBTC)

Added

  • parameter margin added to getOpenOrder result
  • implement poloniex.postSellOrder()
  • implement poloniex.postBuyOrder()
  • implement poloiex.getMarginPositions()

[0.2.2] - 2015-11-01

Added

  • Implement bitx.getTransactions()
  • Implement bitfinex.getLendBook()
  • Implement coinbase.getRate()
  • Implement coinbase.getTicker()
  • Implement coinbase.getOrderBook()
  • Implement coinbase.getTrades()
  • Implement coinbase.getBalance()

[0.2.1] - 2015-03-10

Fixed

  • Fix: bitfinex.getTicker() returns the result with invalid JSON schema
  • Fix: btce.getFee() requires pair as parameter
  • Fix: bitfinex methods return BTC instead of XBT

Added

  • Implement bitstamp.getTransactions()
  • Implement bitfinex.getTransactions()

[0.2.0] - 2015-02-15

Fixed

  • Fix: bitstamp.getFee() does not return error when invalid API keys

Added

  • Add parameter account_id to getBalance() response
  • Implement bitstamp.getBalance() method
  • Implement bitstamp.getFee() method
  • Implement bitx.getBalance() method
  • Implement bitx.getFee() method
  • Implement bitfinex.getTicker() method
  • Implement bitfinex.getOrderBook() method
  • Implement bitfinex.getBalance() method
  • Add the CHANGELOG file

Changed

  • Change: API response for getOrderbook(). asks and bids are now arrays of JSON
  • Change: API response for getFee(). Parameter fee is replaced with maker_fee and taker_fee
  • Change: Bitcoin symbol from "BTC" to "XBT"
  • Update documentation