Markets
This is a CoinGecko Client for the Platform SDK. The implementation makes use of CoinCap, CoinGecko and CryptoCompare and adheres to the contracts laid out in the specification.
Repository
Installation
1yarn add @ardenthq/sdk-markets
Usage
Initialize the market service instance
1import { MarketService } from "@ardenthq/sdk-markets";2 3MarketService.make("cryptocompare", new Request());
Verify if the given currency exists on the service
1await marketService.verifyToken("ark");
Get information about the given currency
1await marketService.marketData("ark");
Get the historical price for the today
1await marketService.historicalPriceForDay("ark", "btc");
Get the historical price for the last 7 days
1await marketService.historicalPriceForWeek("ark", "btc");
Get the historical price for the last 30 days
1await marketService.historicalPriceForMonth("ark", "btc");
Get the historical price for the last 120 days
1await marketService.historicalPriceForQuarter("ark", "btc");
Get the historical price for the last 365 days
1await marketService.historicalPriceForYear("ark", "btc");
Get the historical volume for the today
1await marketService.historicalVolumeForDay("ark", "btc");
Get the historical volume for the last 7 days
1await marketService.historicalVolumeForWeek("ark", "btc");
Get the historical volume for the last 30 days
1await marketService.historicalVolumeForMonth("ark", "btc");
Get the historical volume for the last 120 days
1await marketService.historicalVolumeForQuarter("ark", "btc");
Get the historical volume for the last 365 days
1await marketService.historicalVolumeForYear("ark", "btc");
Get the average price for today
1await marketService.dailyAverage("ark", "btc", Date.now());
Security
If you discover a security vulnerability within this package, please send an e-mail to [email protected]. All security vulnerabilities will be promptly addressed.
Last updated 2 years ago
Edit Page