1.2.18 • Published 3 months ago

bitpay-rates v1.2.18

Weekly downloads
4
License
MIT
Repository
github
Last release
3 months ago

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.

Related Packages

1.2.18

3 months ago

1.2.9

1 year ago

1.2.10

1 year ago

1.2.11

1 year ago

1.2.16

1 year ago

1.2.17

1 year ago

1.2.7

2 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.2.1

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.3

4 years ago

0.2.19

4 years ago

0.2.14

4 years ago

0.2.12

4 years ago

0.2.10

4 years ago

0.2.9

4 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.2

6 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.4

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago