UNPKG

@hackape/tardis-dev

Version:

Convenient access to tick-level historical and real-time cryptocurrency market data via Node.js

26 lines (21 loc) 572 B
import got from 'got' import { getOptions } from './options' import { Exchange } from './types' export async function getApiKeyAccessInfo(apiKey?: string) { const options = getOptions() const apiKeyToCheck = apiKey || options.apiKey const apiKeyAccessInfo = await got .get(`${options.endpoint}/api-key-info`, { headers: { Authorization: `Bearer ${apiKeyToCheck}` } }) .json() return apiKeyAccessInfo as ApiKeyAccessInfo } export type ApiKeyAccessInfo = { exchange: Exchange from: string to: string symbols: string[] }[]