UNPKG

@gviper/alphavantage-api

Version:

TypeScript SDK for Alpha Vantage API with comprehensive type safety and all endpoint support

62 lines 2.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Crypto = void 0; class Crypto { constructor(client) { this.client = client; } /** * Returns intraday time series for any digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed every 5 minutes. * * @param params - Parameters including symbol, market, and interval * @returns Promise resolving to crypto intraday time series data * @example https://www.alphavantage.co/query?function=CRYPTO_INTRADAY&symbol=ETH&market=USD&interval=5min&apikey=demo */ async intraday(params) { return this.client.request({ function: 'CRYPTO_INTRADAY', ...params, }); } /** * Returns the daily historical time series for a digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed daily at midnight (UTC). * * @param params - Parameters including symbol and market * @returns Promise resolving to crypto daily time series data * @example https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_DAILY&symbol=BTC&market=EUR&apikey=demo */ async daily(params) { return this.client.request({ function: 'DIGITAL_CURRENCY_DAILY', ...params, }); } /** * Returns the weekly historical time series for a digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed daily at midnight (UTC). * * @param params - Parameters including symbol and market * @returns Promise resolving to crypto weekly time series data * @example https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_WEEKLY&symbol=BTC&market=EUR&apikey=demo */ async weekly(params) { return this.client.request({ function: 'DIGITAL_CURRENCY_WEEKLY', ...params, }); } /** * Returns the monthly historical time series for a digital currency (e.g., BTC) traded on a specific market (e.g., CNY/Chinese Yuan), refreshed daily at midnight (UTC). * * @param params - Parameters including symbol and market * @returns Promise resolving to crypto monthly time series data * @example https://www.alphavantage.co/query?function=DIGITAL_CURRENCY_MONTHLY&symbol=BTC&market=EUR&apikey=demo */ async monthly(params) { return this.client.request({ function: 'DIGITAL_CURRENCY_MONTHLY', ...params, }); } } exports.Crypto = Crypto; //# sourceMappingURL=crypto.js.map