npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

e04-kencrypto-lucasbrasil

v1.0.4

Published

Biblioteca com o objetivo de analisar os valores das criptomoedas e fazer a taxa de conversão entre elas.

Downloads

11

Readme

KenCrypto

Biblioteca com o objetivo de analisar os valores das criptomoedas e fazer a taxa de conversão entre elas.

Para utilizar a biblioteca faça a seguinte importação:

import { KenCrypto } from "e04-kencrypto-lucasbrasil";

Configure o seu ambiente virtual para receber a variável API_KEY, que pode ser obtida em https://coinmarketcap.com/api/ e siga os passos abaixo para executar as funções.

Detalhes da cripto

Para obter os detalhes de uma ou mais criptos deve fazer os seguintes passos:

1 - Criar uma constante chamando os métodos da biblioteca:

const krypto = new KenCrypto()

2 - Utilizar a seguinte função para obter os detalhes da cripto escolhida

const quotes_data = krypto.quotes(["BTC"]).then((resp) => {
console.log(resp);})

Onde "BTC" é um exemplo de sigla da cripto.

Além disso, mais de um valor pode ser passado como parâmetro. Exemplo:

krypto.quotes(["BTC", "ETH"])

3 - Após executar a função, obterá a seguinte resposta no console:

{
  BTC: {
    id: 1,
    name: 'Bitcoin',
    symbol: 'BTC',
    slug: 'bitcoin',
    num_market_pairs: 9120,
    date_added: '2013-04-28T00:00:00.000Z',
    tags: [
      'mineable',
      'pow',
      'sha-256',
      'store-of-value',
      'state-channel',
      'coinbase-ventures-portfolio',
      'three-arrows-capital-portfolio',
      'polychain-capital-portfolio',
      'binance-labs-portfolio',
      'blockchain-capital-portfolio',
      'boostvc-portfolio',
      'cms-holdings-portfolio',
      'dcg-portfolio',
      'dragonfly-capital-portfolio',
      'electric-capital-portfolio',
      'fabric-ventures-portfolio',
      'framework-ventures-portfolio',
      'galaxy-digital-portfolio',
      'huobi-capital-portfolio',
      'alameda-research-portfolio',
      'a16z-portfolio',
      '1confirmation-portfolio',
      'winklevoss-capital-portfolio',
      'usv-portfolio',
      'placeholder-ventures-portfolio',
      'pantera-capital-portfolio',
      'multicoin-capital-portfolio',
      'paradigm-portfolio'
    ],
    max_supply: 21000000,
    circulating_supply: 18941768,
    total_supply: 18941768,
    is_active: 1,
    platform: null,
    cmc_rank: 1,
    is_fiat: 0,
    self_reported_circulating_supply: null,
    self_reported_market_cap: null,
    last_updated: '2022-01-28T03:40:00.000Z',
    quote: { USD: [Object] }
  }
}

Conversão de criptos

Para obter a conversão entre as criptos deve seguir os seguintes passos:

1 - Criar uma constante chamando os métodos da biblioteca:

const krypto = new KenCrypto()

2 - Utilizar a seguinte função para obter os detalhes da cripto escolhida

const conversion_data = krypto.conversion("BTC", 25.67, "ETH").then((resp) =>
console.log(resp);});

Onde "BTC" é a moeda a ser convertida, 25.67 é o valor a ser convertido e "ETH" é a moeda que o valor será convertido.

3 - Após executar a função, obterá a seguinte resposta no console:

{
  "id": 1,
  "symbol": "BTC",
  "name": "Bitcoin",
  "amount": 25.67,
  "last_updated": "2022-01-28T03:41:00.000Z",
  "quote": {
    "ETH": {
      "price": 392.1596270213585,
      "last_updated": "2022-01-28T03:40:00.000Z"
    }
  }
}