npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

bitx

v1.5.1

Published

A simple wrapper for the BitX API.

Downloads

204

Readme

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: 'api.mybitx.com',
  port: 443,
  ca: undefined,
  pair: 'XBTZAR'
}

Methods

For details about the API endpoints see https://api.mybitx.com/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([options, ]callback)

GET https://api.mybitx.com/api/1/ticker

Default options:

{
  pair: bitx.pair
}

Example:

bitx.getTicker(function(err, ticker) {});

getAllTickers(callback)

GET https://api.mybitx.com/api/1/tickers

Example:

bitx.getAllTickers(function(err, tickers) {});

getOrderBook([options, ]callback)

GET https://api.mybitx.com/api/1/orderbook

Default options:

{
  pair: bitx.pair
}

Example:

bitx.getOrderBook(function(err, orderBook) {});

getTrades([options, ]callback)

GET https://api.mybitx.com/api/1/trades

Default options:

{
  pair: bitx.pair
}

Example:

bitx.getTrades(function(err, trades) {});

getOrderList([options, ]callback)

GET https://api.mybitx.com/api/1/listorders

Default options:

{
  pair: bitx.pair,
  state: undefined
}

Example:

bitx.getOrderList({state: 'PENDING'}, function(err, orderList) {});

getBalance([asset, ]callback)

GET https://api.mybitx.com/api/1/balance

Example:

bitx.getBalance('ZAR', function(err, balance) {});

getFundingAddress(asset, [options, ]callback)

GET https://api.mybitx.com/api/1/funding_address

Default options:

{
  address: undefined
}

Example:

bitx.getFundingAddress('XBT', {address: 'B1tC0InExAMPL3fundIN6AdDreS5t0Use'}, function(err, fundingAddress) {});

createFundingAddress(asset, callback)

POST https://api.mybitx.com/api/1/funding_address

Example:

bitx.createFundingAddress('XBT', function(err, fundingAddress) {});

postBuyOrder(volume, price, callback)

POST https://api.mybitx.com/api/1/postorder

Example:

bitx.postBuyOrder(9999.99, 0.01, function(err, order) {});

postSellOrder(volume, price, callback)

POST https://api.mybitx.com/api/1/postorder

Example:

bitx.postSellOrder(0.01, 9999.99, function(err, order) {});

postMarketBuyOrder(volume, callback)

POST https://api.mybitx.com/api/1/marketorder

Example:

bitx.postMarketBuyOrder(0.01, function(err, order) {});

postMarketSellOrder(volume, callback)

POST https://api.mybitx.com/api/1/marketorder

Example:

bitx.postMarketSellOrder(0.01, function(err, order) {});

stopOrder(orderId, callback)

POST https://api.mybitx.com/api/1/stoporder

Example:

bitx.stopOrder('BXMC2CJ7HNB88U4', function(err, result) {});

getOrder(orderId, callback)

GET https://api.mybitx.com/api/1/orders/{orderId}

Example:

bitx.getOrder('BXHW6PFRRXKFSB4', function(err, result) {});

getTransactions(asset, [options, ]callback)

GET https://api.mybitx.com/api/1/transactions

Default options:

{
  offset: 0,
  limit: 10
}

Example:

bitx.getTransactions('XBT', {offset: 5, limit: 20}, function(err, transactions) {});

getWithdrawals(callback)

GET https://api.mybitx.com/api/1/withdrawals

Example:

bitx.getWithdrawals(function(err, withdrawals) {});

getWithdrawal(withdrawalId, callback)

GET https://api.mybitx.com/api/1/withdrawals/{withdrawalId}

Example:

bitx.getWithdrawal('1212', function(err, withdrawal) {});

requestWithdrawal(type, amount, callback)

POST https://api.mybitx.com/api/1/withdrawals

Example:

bitx.requestWithdrawal('ZAR_EFT', 1000, function(err, withdrawal) {});

cancelWithdrawal(withdrawalId, callback)

DELETE https://api.mybitx.com/api/1/withdrawals/{withdrawalId}

Example:

bitx.cancelWithdrawal('1212', function(err, withdrawal) {});

Contributing

Like my work? Please donate 1E1sebnWax5Br2mp8y9dox6oX9Snmf42uz.

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