JSPM

cryptoex

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q33226F
  • License MIT

Cryptocurrency exchange rate library with support for 100+ exchanges and 15+ reliable banks and financial data sources.

Package Exports

  • cryptoex

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cryptoex) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

node-cryptoex

Build Status

Simple cryptocurrency converter

Cryptocurrency exchange rate library with support for 100+ exchanges and 15+ reliable banks and financial data sources.

Foreign exchange rates source

https://fixer.io/ ☞ Fixer is a simple and lightweight API for current and historical foreign exchange (forex) rates. You need to register for access key before using node-cryptoex module.

Installing

Using npm:

$ npm install cryptoex

Using yarn:

$ yarn add cryptoex

example

cryptocurrency.js

const Cryptoex = require('cryptoex');

let cryptoex = new Cryptoex({ fixerAccessKey: 'YOUR FIXER ACCESS KEY' });

// The rates for BTC
cryptoex.getRates('BTC').then((rates) => {
  // { USD: 7469.72, CNY: 50029.92870456, TWD: 228042.90260672002...}
});

// The rate for BTC to TWD
cryptoex.getRate('BTC', 'TWD').then((rate) => {
  // 228065.45655225002
});

// Convert BTC to TWD by amount
cryptoex.convert('BTC', 'TWD', 8).then((amount) => {
  // 1824394.099112
});

// Convert TWD to BTC by amount
cryptoex.convertToCrypto('TWD', 'BTC', 8).then((amount) => {
  // 0.00003512
});

license

MIT