https://github.com/anotherrusty/reflector-coinmarketcap-connector
https://github.com/anotherrusty/reflector-coinmarketcap-connector
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anotherrusty/reflector-coinmarketcap-connector
- Owner: AnotherRusty
- License: mit
- Created: 2024-05-21T22:35:55.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-05-21T22:56:11.000Z (about 1 year ago)
- Last Synced: 2024-09-15T19:14:39.205Z (9 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @reflector/reflector-coinmarketcap-connector
> CoinMarketCap data source for Reflector backend
## Installation
Add package reference to the `dependencies` section of `package.json`
```json
{
"dependencies": {
"@reflector/reflector-coinmarketcap-connector": "github:reflector-network/reflector-coinmarketcap-connector#v0.1.0"
}
}
```## Usage
Obtain API key from CoinMarketCap to use this connector.
Retrieve prices data:```js
expect(await fetchQuotes(['BTC', 'ETH', 'SOL', 'XRP'], 14, 'api_key')).toStrictEqual()
/*{
timestamp: 1701730809,
prices: [
4195490670451561891n,
222869653423301861n,
6094333522737736n,
62223524826168n
]
}*/
```## Tests
```
npm run test
```