@blooks/exchange-rates
Convert currencies according to historical rates.
Last updated 3 years ago by blooks .
GPL · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @blooks/exchange-rates 
SYNC missed versions from official npm registry.

coynverter

A npm package to convert any currency based on public available exchange rate data.

Install the dependencies $> npm install To test the package

$> npm test

API

  var coynoverter = require('../src/coynverter.js') 
  coynoconverter = new Coynverter(mongourl, collectionWhereToWriteData);

  /**
   * update the information available on the database for a provided currency
   * @param  {String}   currency           the currency to find the conversion rate
   * @param  {Function} callback           return two possible objects, error and result of the operation
   * @return {undefined}                   not return value
   */
  coynoconverter.update(collectionToUpdate, currency, function (err, result) {
    
  });

  /**
   * convert convert a specified amount of BTC to a specified currency for one date
   * @param  {String}   fromCurrency     the currency to find the conversion rate
   * @param  {String}   toCurrency       the currency to find the conversion rate
   * @param  {Number}   amountToConvert  the amount of bitcoins to convert to the currency specified
   * @param  {String}   date             the day to look for in the database, if no data in database request to coinbase API
   * @param  {Function} callback         return two possible objects, error and result of the operation
   * @return {undefined}                 not return value
   */
  coynoconverter.convert(fromCurrency,  toCurrency, amountToConvert, date, function (err, result) {

  });

Current Tags

  • 0.1.3                                ...           latest (3 years ago)

1 Versions

  • 0.1.3                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 2
Dependencies (9)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |