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

bitpay-rates

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bitpay-rates

A tiny Node.js wrapper for the BitPay Rates API

  • 1.2.18
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
51
increased by920%
Maintainers
1
Weekly downloads
 
Created
Source

bitpay-rates

GitHub Workflow Status BundlePhobia BundlePhobia

A lightweight Node.js wrapper for BitPay's exchange rates API, now in TypeScript.

Zero-dependency, promise and callback support for easy integration into your project. ✨

Requirements

  • nodejs >= 12.x

Examples

Getting a rate by code:

import bitpayRates from 'bitpay-rates';

const code = 'ARS'; // see list of codes bellow

// Using promise
bitpayRates
  .get(code)
  .then((rate) => console.log('Promise Rate:', rate))
  .catch((err) => console.error('Promise Error:', err));

Successful response:

{
  "code": "ARS",
  "name": "Argentine Peso",
  "rate": 3793422.92
}

Getting all the rates:

import bitpayRates from 'bitpay-rates';

// Using callback
bitpayRates.get((err, res) => {
  console.error('Callback Error:', err);
  console.log('Callback Rates:', res);
});

Successful response:

[
  {
    "code": "ARS",
    "name": "Argentine Peso",
    "rate": 5291987.02
  },
  {
    "code": "BUSD",
    "name": "Binance USD",
    "rate": 57818.28
  },
  {...}
]

More examples here.

Available Codes (updated: 2024-01-24)

Follow this link to see the complete list of codes.

Keywords

FAQs

Package last updated on 24 Jan 2024

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