@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
47 lines • 1.54 kB
TypeScript
import { KlineType } from "../types/kline";
import { SubscribeType, SymbolType } from "../types/socket";
export declare function buildApiUrl(baseURL: string, path: string): string;
export declare function buildWebSocketUrl(wssURL: string, path: string): string;
/**
* Convert K-line period string to number
*/
export declare function convertKlinePeriod(period: KlineType): number;
/**
* Convert websocket subscription type
*/
export declare function convertSubscribeType(type: SubscribeType): string;
/**
* Convert subscription type list
*/
export declare function parseeSubscribeType(type: string | SubscribeType[]): string;
/**
* Subscription product parameter formatting function
* @param input Subscription parameters
*/
export declare function parseSymbols(input: SymbolType[] | string): string;
/**
* HTTP Request Options Interface
*/
export interface HttpRequestOptions {
method?: 'GET' | 'POST' | 'PUT' | 'DELETE';
headers?: Record<string, string>;
body?: string;
params?: Record<string, any>;
}
/**
* HTTP Response Interface
*/
export interface HttpResponse {
status: number;
data: any;
headers: Record<string, string>;
}
/**
* HTTP request implementation for Browser environment (using fetch API)
*/
export declare function makeHttpRequest(url: string, options?: HttpRequestOptions): Promise<HttpResponse>;
/**
* Create WebSocket instance (Browser environment)
*/
export declare function createWebSocket(url: string, token?: string): Promise<WebSocket>;
//# sourceMappingURL=index.d.ts.map