https://github.com/synonymdev/lsp-exchange-rate
https://github.com/synonymdev/lsp-exchange-rate
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/synonymdev/lsp-exchange-rate
- Owner: synonymdev
- License: mit
- Created: 2022-04-11T04:48:09.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2022-06-02T04:00:44.000Z (almost 4 years ago)
- Last Synced: 2025-01-24T11:29:19.454Z (about 1 year ago)
- Language: JavaScript
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Exchange Rate
Call Bitfinex API to get exchange rate for BTC USD (and other tickers).
## How to use
```javascript
const satsUSD = await ExchangeRate.satsToUSD(100000000)
const btcUSDRate = await ExchangeRate.getBtcUsd()
const getRatesRaw = await ExchangeRate.getRatesRaw("bfx tickers")
// returns closing price of that day
const getHistoricalPrice = await ExchangeRate.historicalBtcUsd()
```