bitx

A simple wrapper for the BitX API.

npm install bitx
10 downloads in the last week
12 downloads in the last month

node-bitx

Build Status

A simple wrapper for the BitX API.

Usage

Add bitx as a dependency:

$ npm install --save bitx

BitX([keyId, keySecret, ][options])

To access the private BitX API methods you must supply your key id and key secret as the first two arguments. If you are only accessing the public API endpoints you can leave these two arguments out.

The optional options argument can be used to override the default options. The default options are equivalent to:

{
  hostname: 'bitx.co.za',
  port: 443,
  ca: undefined,
  pair: 'XBTZAR'
}

Methods

For details about the API endpoints see https://bitx.co.za/api.

Callbacks

The arguments passed to the callback function for each method are:

  1. An error or null if no error occurred.
  2. An object containing the data returned by the BitX API.

getTicker(callback)

GET https://bitx.co.za/api/1/ticker

getOrderBook(callback)

GET https://bitx.co.za/api/1/orderbook

getTrades(callback)

GET https://bitx.co.za/api/1/trades

getOrderList(callback)

GET https://bitx.co.za/api/1/listorders

getBalance(asset, callback)

GET https://bitx.co.za/api/1/balance

getFundingAddress(asset, callback)

GET https://bitx.co.za/api/1/funding_address

postBuyOrder(volume, price, callback)

POST https://bitx.co.za/api/1/postorder

postSellOrder(volume, price, callback)

POST https://bitx.co.za/api/1/postorder

stopOrder(orderId, callback)

POST https://bitx.co.za/api/1/stoporder

Contributing

Like my work? Please donate 1E1sebnWax5Br2mp8y9dox6oX9Snmf42uz.

Don't like it? Open a pull request or create an issue and help me improve it.

npm loves you