# e-04-kencrypto

> Get the current quote and conversions of your favorite cryptos, based on the [coinmarketcap](https://coinmarketcap.com/api/) api.

Latest version **1.0.8** (published 2022-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install e-04-kencrypto
pnpm add e-04-kencrypto
yarn add e-04-kencrypto
bun add e-04-kencrypto
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.8 |
| Published | 2022-02-20 |
| First published | 2022-01-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 23 KB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | miguel.maurer |

## Links

- npm: https://www.npmjs.com/package/e-04-kencrypto
- npm.io page: https://npm.io/package/e-04-kencrypto

## Dependencies (2)

- [axios](https://npm.io/package/axios.md) ^0.25.0
- [@types/node](https://npm.io/package/@types/node.md) ^17.0.10

## Recent versions

- 1.0.8 (latest) — 2022-02-20
- 1.0.7 — 2022-01-29
- 1.0.6 — 2022-01-27
- 1.0.5 — 2022-01-27
- 1.0.4 — 2022-01-27
- 1.0.3 — 2022-01-27
- 1.0.1 — 2022-01-24
- 1.0.0 — 2022-01-24

## README

# KenCrypto

Get the current quote and conversions of your favorite cryptos, based on the [coinmarketcap](https://coinmarketcap.com/api/) api.

  
  

# Description

First of all, you need to go to their website, sign in and get your personal key. Visit the [Official Site](https://coinmarketcap.com/api/).

  

# Instalation

  

``` $ npm i e-04-kencrypto ```

### or

``` $ yarn add e-04-kencrypto ```

  

# How to use

  

``` import { KenCrypto } from "e-04-kencryto"; ```

  
  

### Create an instance:

  
  

```const my_crypto = new KenCrypto(API_KEY)``` -> Use your personal key that you got before.

  

### That instance provides two methods:

  

- quotes

  

Inside an array you can use an string with the crypto sign.

  
  

``` my_crypto.quotes(['BTC']); ```

  
  

The return is a promise where you can get the response with then()

  

example:

  
  
```
my_crypto.quotes(['BTC', 'eth']).then((response) => {
	console.log(response)
});
```
  

<b>log:</b>

  
```
{
	data: {
		BTC: {
			id: 1,
			name: 'Bitcoin',
			symbol: 'BTC',
			slug: 'bitcoin',
			date_added: '2013-04-28T00:00:00.000Z',
			last_updated: '2022-01-27T20:23:00.000Z',
			quote: {
				USD: {
					price: 36102.923873715255,
					last_updated: '2022-01-27T20:23:00.000Z'
				}
			}
		}

	}
}
```
  

- conversion

  

With the conversion method you can, obviously, convert currencies. For that you'll need three arguments: the amount to be converted, the origin currency, the target currency

  
  

```my_crypto.conversion(1, 'BTC', ['BRL']);``` --> The convertTo array can have multiple currencies, but it depends on your plan on Coin Market Cap.

  
  

Also the response is a promise where you can get the response with then()

  

example:

  
```
my_crypto.conversion(1, 'BTC', ['BRL']).then((response) => {
	console.log(response);
});
```
  

<b>log:</b>

  
```
{
	data: {
		id: 1,
		symbol: 'BTC',
		name: 'Bitcoin',
		amount: 1,
		last_updated: '2022-01-27T22:02:00.000Z',
		quote: {
			BRL: {
				price: 195481.12567089536,
				last_updated: '2022-01-27T22:02:02.000Z'
			}
		}
	}
}
```
  

# Tecnologies

- TypeScript

---
_Source: https://npm.io/package/e-04-kencrypto · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
