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 🙏

© 2026 – Pkg Stats / Ryan Hefner

coinex.com

v1.2.1

Published

API Interface for coinex.com Bitcoin Cash exchange.

Readme

coinex.com

API Interface for coinex.com Bitcoin Cash exchange.

This module fully implements tha Coinex API. The full documentation for the API is available on the API Wiki Page.

It is written in Coffescript V2 using native Promises and its only dependencies are bent and md5.js. You do not need Coffeescript to use the library; it is pre-compiled to Javascript ES6.

Install

npm install coinex.com

Get your API key and secret key from here.

Example

Coinex = require('coinex.com');

const API_KEY = 'F42F1492623D47EE861B7150E335AA89';
const SECRET  = '8B678410AF2D46ABB70910D08E4DEAE114F014971E3A4759'

const coinex = new Coinex(API_KEY, SECRET);

coinex.balance()
.then(response => console.log(response));
.catch(err => console.error(err.code, err.message);

Constructor

const coinex = new Coinex(API_KEY, SECRET);

Methods

All the following methods return native Promises which are resolved on a valid response or rejected on error. Each method returns a single result object to the .then().

For each method, please see the API documentation. Below I have simply documented the call; the response will generally be the data part of the response as documented by Coinex. If internally Coinex returns an error code of greater than zero, the promise will be rejected with a CoinexError.

The returned result will have floating point numbers for values rather than the string number values returned by the API. Where a pair is refered to below, it is the market, for example BTCBCH.

Market API

List Pairs

Returns a list of the available pairs.

coinex.list()

Get Market Data

Get the ticker information for a single pair.

coinex.ticker(pair)

Get All Ticker Data

Get the ticker information for all pairs.

coinex.tickerAll()

Get Market Depth

Get the buy / sell statistics. This will return up to 100 lines and the decimal places can be set between zero and eight.

coinex.depth(pair, [limit], [decimal-places]);

If not passed, limit is set to 100 and decimal-places is set to eight.

Transaction Data

Get the latest transaction data. This will return up to 1,000 lines of data.

coinex.transactions(pair, [lastID]);

K-Line Data

Get the k-line data for a specific period, including the last 1,000 data points.

coinex.kline(pair, [type]);

Type can be one of 1min, 3min, 5min, 15min, 30min, 1hour, 2hour, 4hour,6hour,12hour, 1day, 3day, 1week. Type defaults to 1hour if not passed.

Account API

Get account balance

Returns the balance of each currency currently on the account.

coinex.balance()

Trading API

Place Limit Order

Places a new order.

coinex.placeLimitOrder(pair, type, amount, price, [sourceID]);

Type must be buy or sell. SourceID is uptional and will be returned in the response, if provided.

Place Market Order

Places a new market order.

coinex.placeMarketOrder(pair, type, amount);

Cancel Order

Cancels an existing order

coinex.cancelOrder(pair, id);

List Pending Orders

This will return a list of orders that have not been filled nor cancelled.

coinex.pending(pair, [page], [limit]);

Page defaults to one and limit defaults to 100. Using the result, it is possibe to page through many transactions.

List Completed Orders

This will return a list of closed orders. Note that fully cancelled orders will not appear here.

coinex.completed(pair, [page], [limit]);

Order Status

This returns the status of a single order.

coinex.orderStatus(pair, id);

Deal History

This returns the history of the user's deals for the given pair.

coinex.history(pair, [page], [limit]);

Error Messages

API errors are returned as a code and a description. In this library they are returned as a class CoinexError. These will work like normal nodejs errors but should usually be caught with a .catch(err) statement. For example:

coinex.cancelOrder('BTCBCH', 3242404);
.then(data => console.log(data));
.catch(err => console.error(err.code, err.message);

Changes

  • v1.0.8 First fully working version
  • v1.1.2 Dropped request (deprecated) in favor of bent
  • v1.2.1 Using a custom version of bent to follow redirects

Issues

Please report any bugs or make any suggestions at the Github Issue page.