Giter VIP home page Giter VIP logo

crypto-convert's Introduction

Crypto-Convert

license npm npm

Instantly convert cryptocurrency and get price information.

  • Top 100 Crypto Currencies Supported
  • Top 30 Fiats Supported
  • Price & Ticker information updated on a configurable interval from multiple secure sources (Binance, Bitfinex, OKEx)
  • Any pair can be converted, be it Crypto -> Crypto or Fiat -> Crypto.
  • Instant convert, no slow promises.

Installation

npm i crypto-convert

Usage

const convert = require("crypto-convert");

(async function(){

	//Cache is not yet loaded on application start
	if(!convert.isReady){
		await convert.ready();
	}

	convert.BTC.USD(1);
	convert.ETH.JPY(255);
	convert.LINK.LTC(5);
	convert.USD.CRO(100);

	//More readable syntax
	new convert.from("BTC").to("USD").amount(1);
})();

For Browsers

<script type="text/javascript" src="https://coinconvert.net/assets/js/crypto-convert.min.js"></script>

<script>
	console.log(convert.BTC.USD(1));
</script>

Configuration

const convert = require("crypto-convert");

convert.set({
	crypto_interval: 5000, //Crypto cache update interval, default every 5 seconds
	fiat_interval: (60 * 1e3 * 60), //Fiat cache update interval, default every 1 hour
	binance: true, //Use binance rates
	bitfinex: true, //Use bitfinex rates
	okex: true, //Use okex rates
	onUpdate: (tickers)=> {} //Call Hook on every crypto update	
});

API

Free public API, up to 50 req/s.

https://api.coinconvert.net/convert/btc/usd?amount=1

crypto-convert's People

Contributors

el1s7 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.