UNPKG

xoh-xapi

Version:
70 lines (69 loc) 1.91 kB
import { ACCOUNT } from './helpers'; export default class Xapi { private password; private accountId; private type; private broker; private streamSessionId?; private loginStatus?; private host; private hostStream; private webSocket; private pingTimerId?; private streamer?; /** * Main Object for API communication * @constructor */ constructor(args: ACCOUNT); /** * Used to start session with the server * @param {Function} onReady - Function to run when everything is ready * @param {Function} onError - Function to run when errors happen during initialization with Error object carrying the message */ private onReady; /** * Used to initiate connection to the server separately other than using onReady */ private init; /** * Used for login to the trading server */ private login; /** * Logs out the user/client */ private logOut; /** * Returns array of all symbols available for the user */ private getAllSymbols; /** * Returns calendar with market events */ private getCalendar; /** * Returns chart info, from start date to the current time. */ private getChartLastRequest; private getChartRangeRequest; private getCommissionDef; private getCurrentUserData; private getIbsHistory; private getMarginLevel; private getMarginTrade; private getNews; private getProfitCalculation; private getServerTime; private getStepRules; private getSymbol; private getTickPrices; private getTradeRecords; private getTrades; private getTradesHistory; private getTradingHours; private getVersion; private ping; private tradeTransaction; private tradeTransactionStatus; }