Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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

Convert crypto to fiat and vice-versa instantly.

  • 1.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
300
decreased by-13.29%
Maintainers
1
Weekly downloads
 
Created
Source

Crypto-Convert

npm npm

Convert crypto to fiat and vice-versa instantly.

  • Top 100 Cryptocurrencies Supported
  • 20+ fiats Supported
  • Instantly convert, no slow promises.
  • Cross-compatible on Node.js & Browser
  • Price & Ticker information updated on a configurable interval from multiple secure sources (Binance, Bitfinex, Coinbase)
  • Any pair can be converted, be it Crypto -> Crypto or Fiat -> Crypto.

Installation

npm i crypto-convert

Import

import convert from 'crypto-convert';

Or with require, import it like this to get TypeScript:

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

Usage

(async function(){

	await convert.ready(); //Cache is not yet loaded on first start
	
	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);
})();

Configuration

convert.setOptions({
	crypto_interval: 5000, //Crypto prices update interval, default every 5 seconds
	fiat_interval: (60 * 1e3 * 60), //Fiat prices update interval, default every 1 hour
	calculateAverage: true, //Calculate the average crypto price from exchanges
	binance: true, //Use binance rates
	bitfinex: true, //Use bitfinex rates
	coinbase: true, //Use coinbase rates
	onUpdate: (tickers, isFiat?)=> any //Callback on every crypto update	
});

CDN

<script src='https://coinconvert.net/assets/js/crypto-convert.min.js'></script>

API

Free public API

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

Keywords

FAQs

Package last updated on 14 Sep 2022

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