coingecko-openapi-client
Version:
Coingecko openapi client
50 lines (49 loc) • 3.46 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CoingeckoAPIClient = void 0;
const FetchHttpRequest_1 = require("./core/FetchHttpRequest");
const AssetPlatformsService_1 = require("./services/AssetPlatformsService");
const CategoriesService_1 = require("./services/CategoriesService");
const CoinsService_1 = require("./services/CoinsService");
const CompaniesBetaService_1 = require("./services/CompaniesBetaService");
const ContractService_1 = require("./services/ContractService");
const DerivativesService_1 = require("./services/DerivativesService");
const ExchangeRatesService_1 = require("./services/ExchangeRatesService");
const ExchangesService_1 = require("./services/ExchangesService");
const GlobalService_1 = require("./services/GlobalService");
const NftsBetaService_1 = require("./services/NftsBetaService");
const PingService_1 = require("./services/PingService");
const SearchService_1 = require("./services/SearchService");
const SimpleService_1 = require("./services/SimpleService");
const TrendingService_1 = require("./services/TrendingService");
class CoingeckoAPIClient {
constructor(config, HttpRequest = FetchHttpRequest_1.FetchHttpRequest) {
var _a, _b, _c, _d;
this.request = new HttpRequest({
BASE: (_a = config === null || config === void 0 ? void 0 : config.BASE) !== null && _a !== void 0 ? _a : 'https://api.coingecko.com/api/v3',
VERSION: (_b = config === null || config === void 0 ? void 0 : config.VERSION) !== null && _b !== void 0 ? _b : '3.0.0',
WITH_CREDENTIALS: (_c = config === null || config === void 0 ? void 0 : config.WITH_CREDENTIALS) !== null && _c !== void 0 ? _c : false,
CREDENTIALS: (_d = config === null || config === void 0 ? void 0 : config.CREDENTIALS) !== null && _d !== void 0 ? _d : 'include',
TOKEN: config === null || config === void 0 ? void 0 : config.TOKEN,
USERNAME: config === null || config === void 0 ? void 0 : config.USERNAME,
PASSWORD: config === null || config === void 0 ? void 0 : config.PASSWORD,
HEADERS: config === null || config === void 0 ? void 0 : config.HEADERS,
ENCODE_PATH: config === null || config === void 0 ? void 0 : config.ENCODE_PATH,
});
this.assetPlatforms = new AssetPlatformsService_1.AssetPlatformsService(this.request);
this.categories = new CategoriesService_1.CategoriesService(this.request);
this.coins = new CoinsService_1.CoinsService(this.request);
this.companiesBeta = new CompaniesBetaService_1.CompaniesBetaService(this.request);
this.contract = new ContractService_1.ContractService(this.request);
this.derivatives = new DerivativesService_1.DerivativesService(this.request);
this.exchangeRates = new ExchangeRatesService_1.ExchangeRatesService(this.request);
this.exchanges = new ExchangesService_1.ExchangesService(this.request);
this.global = new GlobalService_1.GlobalService(this.request);
this.nftsBeta = new NftsBetaService_1.NftsBetaService(this.request);
this.ping = new PingService_1.PingService(this.request);
this.search = new SearchService_1.SearchService(this.request);
this.simple = new SimpleService_1.SimpleService(this.request);
this.trending = new TrendingService_1.TrendingService(this.request);
}
}
exports.CoingeckoAPIClient = CoingeckoAPIClient;