Socket
Socket
Sign inDemoInstall

crypto-convert

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-convert

Instantly convert cryptocurrency and get price information


Version published
Weekly downloads
491
decreased by-13.86%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

FAQs

Package last updated on 17 Feb 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc