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

@coinsamba/node-sdk

v1.0.1

Published

Una biblioteca de Node.js para interactuar con la API de Coinsamba, que proporciona acceso a datos de criptomonedas e información sobre intercambios.

Downloads

22

Readme

🌎 English | 🌎 Português | 🌎 Español

@coinsamba/coinsamba-node-sdk

Una biblioteca de Node.js para interactuar con la API de Coinsamba, que proporciona acceso a datos de criptomonedas e información sobre intercambios.

Instalación

npm install @coinsamba/coinsamba-node-sdk

Uso

const { Coinsamba } = require('@coinsamba/coinsamba-node-sdk');

// Crea una instancia de la API de Coinsamba
const coinsamba = new Coinsamba({ isDev: true });

// Obtener datos del ticker
coinsamba.getTicker('BTC', 'USD', 'exchange123')
  .then(ticker => {
    console.log(ticker);
  })
  .catch(error => {
    console.error(error);
  });

// Obtener datos del índice
coinsamba.getIndex('BTC', 'USD')
  .then(index => {
    console.log(index);
  })
  .catch(error => {
    console.error(error);
  });

// Obtener intercambios disponibles
coinsamba.getExchanges()
  .then(exchanges => {
    console.log(exchanges);
  })
  .catch(error => {
    console.error(error);
  });

API

Coinsamba(options)

Crea una nueva instancia de la API de Coinsamba.

Parámetros

  • options (opcional): Un objeto que contiene opciones de configuración para la instancia de la API de Coinsamba.
    • isDev (opcional): Un booleano que indica si la biblioteca está en modo de desarrollo. Por defecto: false.

Métodos

getTicker(base: string, quote: string, exchangeId?: string): Promise<Ticker[]>

Obtiene los datos del ticker para la moneda base y la moneda de cotización especificadas.

Parámetros
  • base (string): El símbolo de la moneda base.
  • quote (string): El símbolo de la moneda de cotización.
  • exchangeId (opcional): El ID del intercambio. Si se proporciona, filtrará los resultados según el intercambio.
Retorna
  • Una Promise que se resuelve a un array de objetos Ticker.
getIndex(base: string, quote: string): Promise

Obtiene los datos del índice para la moneda base y la moneda de cotización especificadas.

Parámetros
  • base (string): El símbolo de la moneda base.
  • quote (string): El símbolo de la moneda de cotización.
Retorna
  • Una Promise que se resuelve a un objeto Index.
getExchanges(): Promise<string[]>

Obtiene una lista de intercambios disponibles.

Retorna
  • Una Promise que se resuelve a un array de nombres de intercambios.

Tipos

La biblioteca incluye los siguientes tipos para una mejor organización y seguridad de tipo:

Ticker

Representa los datos del ticker para un par de criptomonedas.

interface Ticker {
  exchangeId: string;
  base: string;
  quote: string;
  last: number;
  ask: number;
  bid: number;
  vol: number;
  updatedAt: string;
}
Index

Representa los datos del índice para un par de criptomonedas.

interface Index {
  open: number;
  high: number;
  low: number;
  close: number;
  vol: number;
  change: number;
}