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

crypto-exchange-rates

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crypto-exchange-rates

Receives up-to-date cryptocurrency rates without delays

  • 1.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
decreased by-20%
Maintainers
1
Weekly downloads
 
Created
Source

Crypto Rates

This repository contains JavaScript functions for retrieving cryptocurrency rates from Binance using the axios library.

Installation

  1. Clone or download this repository.
  2. Navigate to the project directory in your terminal.
  3. Run npm install to install the required dependencies.

Usage

The Crypto Rates module provides the following functions:

getCryptoRates([symbols])

This function retrieves cryptocurrency rates from the Binance API.

  • symbols (optional): An array of cryptocurrency symbols. If provided, it will return rates for the specified symbols. If not provided, it will return rates for all available cryptocurrencies.
const { getCryptoRates } = require('crypto-exchange-rates');
  
getCryptoRates(['BTCUSDT', 'ETHUSDT'])
  .then(result => {
    console.log(result);
  })
  .catch(error => {
    console.error(error);
  });

getCryptoRate(symbol)

This function retrieves the rate for a specific cryptocurrency symbol from the Binance API.

  • symbol: A string representing the cryptocurrency symbol for which you want to get the rate.
const { getCryptoRate } = require('crypto-exchange-rates');
  
getCryptoRate('BTCUSDT')
  .then(result => {
    console.log(result);
  })
  .catch(error => {
    console.error(error);
  });

loadMarketData()

This function retrieves market data from the Binance API.

const { loadMarketData } = require('crypto-exchange-rates');
  
loadMarketData()
  .then(result => {
    console.log(result);
  })
  .catch(error => {
    console.error(error);
  });

API Reference

  • Binance API

Contributing

Contributions to this project are welcome. Feel free to open issues and submit pull requests.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 19 Jul 2023

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