1.0.16 • Published 3 years ago

cryptolib-ts v1.0.16

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
3 years ago
  1. Installing
  2. Setup
  3. Usage
  4. Quotes
  5. Price Conversion

1. Installing

$ npm install cryptolib-ts

or

$ yarn add cryptolib-ts

2. Setup

COIN_MARKET_CAP_KEY="myAPIkey"

3. Usage

import { Cryptolib } from 'cryptolib-ts'

instance
const CryptoLibInstance = new Cryptolib()

4. Quotes

const BTCquote = CryptoLibInstance.quotes(['BTC'])
{
    data: {
        BTC: {
            id: 1,
            name: "Bitcoin",
            symbol: "BTC",
            slug: "bitcoin",
            date_added: "2013-04-28T00:00:00.000Z",
            last_updated: "2021-08-26T17:44:11.000Z",
            quote: {
                USD: {
                    price: 46963.215165006586,
                    last_updated: "2021-08-26T17:44:11.000Z"
                }
            }
        }
    }
}

5. Price Conversion

const BTCtoBRL = CryptoLibInstance.conversion(100, 'BTC', ['BRL'])
{
    data: {
        id: 1,
        symbol: 'BTC',
        name: 'Bitcoin',
        amount: 100,
        last_updated: '2022-01-27T13:51:00.000Z',
        quote: {
            BRL: {
                price: 19779249.361347176,
                last_updated: '2022-01-27T13:51:02.000Z'
            }
        }
    }
}
1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago