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

crypto-exchange-manager

v5.0.1

Published

Wrapper for cryptocurrencies exchanges apis.

Downloads

22

Readme

CircleCI

crypto-exchange-manager

NPM

Client for multiple exchanges, supporting tickers informations, as well as additio features as I implement them.

If you only need tickers (different currencies' values) you can use https://github.com/donbobvanbirt/coin-ticker which is dedicated to ticks information. crypto-manager was first a rewrite of this package so give the original module some love ;)

Install

$ npm install crypto-exchange-manager

Usage

Require:

const cryptoManager = require('crypto-exchange-manager'); // return an array of available exchanges

Get available asset pairs by exchange:

Use the (always implemented) getPairs() method

const cryptoManager = require('crypto-exchange-manager');
const polynex = new cryptoManager['polynex']();

polynex.getPairs()
  .then((pairs) => {
    console.log(pairs);
  })
// =>
// [
//   'BCN_BTC',
//   'BELA_BTC',
//   ...
// ]

Get Ticker Data:

Use the (always implemented) tick() method

const cryptoManager = require('crypto-exchange-manager');
const polynex = new cryptoManager['polynex']();

polynex.tick('BCN_BTC')
  .then((tick) => {
    console.log(tick); // {...}
  })

Will return an object containing the following values (all values are string) :

{
  last: // the last traded price
  ask:  // current ask
  bid: // current bid
  low: // 24 hour low
  high: // 24 hour high
  vol: // 24 hour volume
  timestamp: // precise time
  exchange: // the current exchange, i.e. 'bitfinex'
  pair: // the asset pair, i.e. 'BTC_USD'
  rawData: // the original, unformatted object received from the exchange api. Differs by exchange.
}

Authenticate user

Currently supported : 
  - bifinex
  - coinbase  
const cryptoManager = require('crypto-exchange-manager');
const bifinex = new cryptoManager['bifinex']({
  key: '123',
  secret: '123'
});

get wallet

Currently supported : 
  - bifinex
  - coinbase
const cryptoManager = require('crypto-exchange-manager');
const bifinex = new cryptoManager['bifinex']({
  key: '123',
  secret: '123'
});

bifinex.getWallet().then(result => {
  console.log(result);
})

Will return an array of currencies with their value in the wallet.

[
  {currency: 'ETH', wallet: '1.8'}
]

get book

Currently supported : 
  - bifinex
  - coinbase
const cryptoManager = require('crypto-exchange-manager');
const bifinex = new cryptoManager['bifinex']({
  key: '123',
  secret: '123'
});

bifinex.getBook().then(result => {
  console.log(result);
})

Will return an array of movement in / out of the account of the user for a specific currency. Native value and currency are values in USD (calculated with historical values).

[
  {
    currency: 'ETH',
    value: '1.8',
    completed: true,
    timestamp: '154787488',
    nativeCurrency: 'USD',
    nativeValue: 500,
  }
]

Utils

Convert values of currency (live or historical).

convertToUSDIfPossible({
  value : 1,
  currency : 'ETH',
  timestamp : '1519293784' (optionnal)
})