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
yarn add @arkecosystem/platform-sdk-markets
Usage
Initialize the market service instance
import { MarketService } from "@arkecosystem/platform-sdk-markets";
import { PriceTracker } from "@arkecosystem/platform-sdk-cryptocompare";
MarketService.make(new PriceTracker(), new Request());
Verify if the given currency exists on the service
await marketService.verifyToken("ark");
Get information about the given currency
await marketService.marketData("ark");
Get the historical price for the today
await marketService.historicalPriceForDay("ark", "btc");
Get the historical price for the last 7 days
await marketService.historicalPriceForWeek("ark", "btc");
Get the historical price for the last 30 days
await marketService.historicalPriceForMonth("ark", "btc");
Get the historical price for the last 120 days
await marketService.historicalPriceForQuarter("ark", "btc");
Get the historical price for the last 365 days
await marketService.historicalPriceForYear("ark", "btc");
Get the historical volume for the today
await marketService.historicalVolumeForDay("ark", "btc");
Get the historical volume for the last 7 days
await marketService.historicalVolumeForWeek("ark", "btc");
Get the historical volume for the last 30 days
await marketService.historicalVolumeForMonth("ark", "btc");
Get the historical volume for the last 120 days
await marketService.historicalVolumeForQuarter("ark", "btc");
Get the historical volume for the last 365 days
await marketService.historicalVolumeForYear("ark", "btc");
Get the average price for today
await 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 5 months ago
Edit Page