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

exio-node

v1.0.22

Published

<p align="center"> <img src="https://sandbox.ex.io/static/exio-transparent.png" height="30%" width="30%" alt="ex.io"> </p> <p align="center"> <b>A minimal client library &amp; CLI demonstrating API usage</b> </p>

Downloads

5

Readme

Build Status Coverage Status

This project contains a minimal client library that wraps ex.io's API. In addition, it contains a command-line utility that you can use to drive the client library. This is intended to demonstrate basic API usage.

Library Usage

In your node.js app, add exio-node as a dependency:

$ npm install --save exio-node

You can now import and instantiate a client object in your app.

Example

const Client = require("exio-node");

// construct the client
const client = new Client({
  key: <YOUR-API-KEY>,                  // provide your api key
  secret: <YOUR-API-SECRET>,            // provide your api secret
  passphrase: <YOUR-API-PASSPHRASE>,    // provide your api passphrase
  domain: "sandbox.ex.io"               // use "ex.io" for production
});

// subscribe to orders and books channels for btc-usdt and eth-usdt
const socket = client.subscribe(["orders", "books"], ["btc-usdt", "eth-usdt"]);
socket.on("message", (data) => {
  console.log(data);
});

// insert an order
client.insertOrder("btc-usdt", "buy", "6000", "1", (err, data) => {
  console.log(err, data);
});

CLI Usage

This repository comes bundled with a simple CLI app that you can use to run various operations. The CLI app is built on top of the library. You can execute the CLI remotely without downloading anything via npx:

$ npx exio-node subscribe btc-usdt

After running that command, you should see public market data for btc-usdt logged to your console. You can run various other commands documented below. Detailed usage for each command is available via npx exio-node <command> -h

Certain commands require authentication. To use these commands, you can provide your authentication credentials as environment variables, e.g.:

$ export EX_API_KEY=<YOUR-API-KEY>
$ export EX_API_SECRET=<YOUR-API-SECRET>
$ export EX_API_PASSPHRASE=<YOUR-API-PASSPHRASE>

$ npx exio-node subscribe btc-usdt

You can also specify your credentials directly via command-line instead of through environment variables, e.g:

$ npx exio-node --apiKey=<YOUR-API-KEY> --apiSecret=<YOUR-API-SECRET> --apiPassphrase=<YOUR-API-PASSPHRASE> subscribe btc-usdt

Note: To get an API credentials, you must login to ex.io and create one from with your user settings.

The command-line utility defaults to using endpoints that are in the sandbox environment, not production. Therefore, you should use API key, secret, and passphrases that were created from sandbox environment. If you want to use production endpoints, you can specificy them through the command-line:

$ npx exio-node --restApi=https://api.ex.io --websocketApi=wss://feed.ex.io subscribe btc-usdt

Subscribe

The subscribe command will subscribe to the public books channel. If an API credentials are available, it will also subscribe to the private orders channel.

Insert

The insert command will insert an order into the exchange. This command requires API credentials.

$ npx exio-node insert buy btc-usdt 4000 1

Cancel

This cancel command will cancel all open orders for a particular symbol, or a particular order if given an order-id to cancel. This command requires you to provide an API credentials.

$ npx exio-node cancel btc-usdt

Open

The open command will return all open orders you might have for a given symbol. This command requires API credentials.

$ npx exio-node open btc-usdt

Funds

The funds command will return your balance information for all currencies. This command requiers API credentials.

$ npx exio-node funds