tradestation-api-ts
Version:
A comprehensive TypeScript wrapper for TradeStation WebAPI v3
40 lines (39 loc) • 1.5 kB
TypeScript
import { ClientConfig } from '../types/config';
import { MarketDataService } from '../services/MarketDataService';
import { OrderExecutionService } from '../services/OrderExecutionService';
import { BrokerageService } from '../services/BrokerageService';
export declare class TradeStationClient {
private readonly httpClient;
private readonly streamManager;
readonly marketData: MarketDataService;
readonly orderExecution: OrderExecutionService;
readonly brokerage: BrokerageService;
/**
* Creates a new TradeStationClient instance
* @param config Optional configuration object. If not provided, values will be read from environment variables
* @example
* // Using environment variables (CLIENT_ID and CLIENT_SECRET must be set)
* const client = new TradeStationClient({
* refresh_token: 'your_refresh_token',
* environment: 'Simulation' // or 'Live'
* });
*
* // Using explicit configuration
* const client = new TradeStationClient({
* clientId: 'your_client_id',
* clientSecret: 'your_client_secret',
* refresh_token: 'your_refresh_token',
* environment: 'Simulation' // or 'Live'
* });
*/
constructor(config?: ClientConfig);
/**
* Gets the current refresh token
* @returns The current refresh token or null if none is available
*/
getRefreshToken(): string | null;
/**
* Closes all active streams
*/
closeAllStreams(): void;
}