UNPKG

@itick/browser-sdk

Version:

Official iTick API SDK for browser. Real-time & historical data for global Stocks, Forex, Crypto, Indices, Futures, Funds, Precious Metals. REST (OHLCV/K-line) + low-latency WebSocket. Promise-based, TypeScript-ready. For quant trading & fintech

58 lines 2.36 kB
"use strict"; /** * Base Data Module * Provides access interfaces for basic data such as symbol lists and holidays */ Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseClient = void 0; const client_1 = require("../../utils/client"); /** * Base Data SDK Client * Specialized for basic data access */ class BaseClient extends client_1.Client { constructor(token, options) { super(token, options); } /** * Get Product List * @description Returns corresponding symbol information list based on product type, market code and optional code filter * @param params - Query parameters object * @param params.type - Asset type, supports stock/crypto/forex/indices/future/fund * @param params.region - Market code (e.g., GB, BA, CN, US, HK, JP etc. {@link https://docs.itick.org/rest-api/basics/symbol-list iTick Official Documentation}) * @param params.code - Optional, symbol code keyword for fuzzy matching filter * @returns Returns Promise, on success returns standardized API response, data is {@link SymbolInfo} array * @example * ```typescript * // Get US stock list * getSymbolList({ type: 'stock', region: 'US' }).then(response => { * console.log(response.data); // Output US stock symbol list * }).catch(error => { * console.error('Error fetching symbol list:', error); * }); * ``` */ getSymbolList(params) { return this._get('/symbol/list', params); } /** * Get Country/Region Holiday List * @description Returns corresponding market holiday list based on country/region code * @param code Country/region code {@link https://docs.itick.org/rest-api/basics/symbol-holidays iTick Official Documentation} * @returns Returns Promise, on success returns standardized API response, data is {@link MarketHoliday} array * @example * ```typescript * // Get US holiday list * getSymbolHolidays('US').then(response => { * console.log(response.data); // Output US holiday list * }).catch(error => { * console.error('Error fetching symbol holidays:', error); * }); * ``` */ getSymbolHolidays(code) { return this._get('/symbol/v2/holidays', { code }); } } exports.BaseClient = BaseClient; //# sourceMappingURL=index.js.map