UNPKG

coingecko-openapi-client

Version:
84 lines (83 loc) 3.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DerivativesService = void 0; class DerivativesService { constructor(httpRequest) { this.httpRequest = httpRequest; } /** * List all derivative tickers * List all derivative tickers.<br>Note: 'open_interest' and 'volume_24h' data are in USD * * Cache / Update Frequency: every 30 seconds * @returns any List all derivative tickers * @throws ApiError */ getDerivatives() { return this.httpRequest.request({ method: 'GET', url: '/derivatives', }); } /** * List all derivative exchanges * List all derivative exchanges. * * Cache / Update Frequency: every 60 seconds * @param order order results using following params name_asc,name_desc,open_interest_btc_asc,open_interest_btc_desc,trade_volume_24h_btc_asc,trade_volume_24h_btc_desc * @param perPage Total results per page * @param page Page through results * @returns any List all derivative exchanges * @throws ApiError */ getDerivativesExchanges(order, perPage, page) { return this.httpRequest.request({ method: 'GET', url: '/derivatives/exchanges', query: { 'order': order, 'per_page': perPage, 'page': page, }, }); } /** * show derivative exchange data * show derivative exchange data * * Dictionary:<li><strong>last</strong>: latest unconverted price in the respective pair target currency</li><li><strong>volume</strong>: unconverted 24h trading volume in the respective pair target currency</li><li><strong>converted_last</strong>: latest converted price in BTC, ETH, and USD</li><li><strong>converted_volume</strong>: converted 24h trading volume in BTC, ETH, and USD</li> * * Cache / Update Frequency: every 30 seconds * @param id pass the exchange id (can be obtained from derivatives/exchanges/list) eg. bitmex * @param includeTickers ['all', 'unexpired'] - expired to show unexpired tickers, all to list all tickers, leave blank to omit tickers data in response * @returns any show derivative exchange data * @throws ApiError */ getDerivativesExchanges1(id, includeTickers) { return this.httpRequest.request({ method: 'GET', url: '/derivatives/exchanges/{id}', path: { 'id': id, }, query: { 'include_tickers': includeTickers, }, }); } /** * List all derivative exchanges name and identifier * List all derivative exchanges name and identifier. * * Cache / Update Frequency: every 5 minutes * @returns any List all derivative exchanges name and identifier * @throws ApiError */ getDerivativesExchangesList() { return this.httpRequest.request({ method: 'GET', url: '/derivatives/exchanges/list', }); } } exports.DerivativesService = DerivativesService;