import { CALENDAR_RECORD, IB_RECORD, NEWS_TOPIC_RECORD, STEP_RULE_RECORD, SYMBOL_RECORD, TRADE_RECORD, TRADE_TRANS_INFO, TRADE_TRANS_INFO_CLOSE, TRADE_TRANS_INFO_DELETE, TRADE_TRANS_INFO_MODIFY, TRADING_HOURS_RECORD } from '../../interface/Definitions'; import { getChartRequestResponse, getCommissionDefResponse, getCurrentUserDataResponse, getMarginLevelResponse, getMarginTradeResponse, getProfitCalculationResponse, getServerTimeResponse, getTickPricesResponse, getVersionResponse, tradeTransactionResponse, tradeTransactionStatusResponse } from '../../interface/Response'; import { SocketConnections } from './SocketConnections'; import { Time } from "../../utils/Time"; import { CMD_FIELD, PERIOD_FIELD } from "../../interface/Enum"; import { Transaction } from "../Transaction"; import { XAPI } from '../XAPI'; interface SocketListen { (returnData: T, jsonReceived: Time, transaction: Transaction, jsonString: string, socketId: string): void; } export declare class Socket extends SocketConnections { listen: { getAllSymbols: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getCalendar: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getChartLastRequest: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getChartRangeRequest: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getCommissionDef: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getCurrentUserData: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getIbsHistory: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getMarginLevel: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getMarginTrade: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getNews: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getProfitCalculation: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getServerTime: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getStepRules: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getSymbol: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getTickPrices: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getTradeRecords: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getTrades: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getTradesHistory: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getTradingHours: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; getVersion: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; tradeTransaction: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; tradeTransactionStatus: (callBack: SocketListen, key?: string | null) => { stopListen: () => void; }; }; send: { getAllSymbols: () => Promise<{ transaction: Transaction, Record>; data: { returnData: SYMBOL_RECORD[]; jsonReceived: Time; json: string; }; }>; getCalendar: () => Promise<{ transaction: Transaction, Record>; data: { returnData: CALENDAR_RECORD[]; jsonReceived: Time; json: string; }; }>; getChartLastRequest: (period: PERIOD_FIELD, start: number, symbol: string, socketId?: string | undefined) => Promise<{ transaction: Transaction, Record>; data: { returnData: getChartRequestResponse; jsonReceived: Time; json: string; }; }>; getChartRangeRequest: (end: number, period: PERIOD_FIELD, start: number, symbol: string, ticks?: number, socketId?: string | undefined) => Promise<{ transaction: Transaction, Record>; data: { returnData: getChartRequestResponse; jsonReceived: Time; json: string; }; }>; getCommissionDef: (symbol: string, volume: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: getCommissionDefResponse; jsonReceived: Time; json: string; }; }>; getCurrentUserData: () => Promise<{ transaction: Transaction, Record>; data: { returnData: getCurrentUserDataResponse; jsonReceived: Time; json: string; }; }>; getIbsHistory: (start: number, end: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: IB_RECORD[]; jsonReceived: Time; json: string; }; }>; getMarginLevel: () => Promise<{ transaction: Transaction, Record>; data: { returnData: getMarginLevelResponse; jsonReceived: Time; json: string; }; }>; getMarginTrade: (symbol: string, volume: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: getMarginTradeResponse; jsonReceived: Time; json: string; }; }>; getNews: (start: number, end: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: NEWS_TOPIC_RECORD[]; jsonReceived: Time; json: string; }; }>; getProfitCalculation: (closePrice: number, cmd: CMD_FIELD, openPrice: number, symbol: string, volume: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: getProfitCalculationResponse; jsonReceived: Time; json: string; }; }>; getServerTime: () => Promise<{ transaction: Transaction, Record>; data: { returnData: getServerTimeResponse; jsonReceived: Time; json: string; }; }>; getStepRules: () => Promise<{ transaction: Transaction, Record>; data: { returnData: STEP_RULE_RECORD[]; jsonReceived: Time; json: string; }; }>; getSymbol: (symbol: string) => Promise<{ transaction: Transaction, Record>; data: { returnData: SYMBOL_RECORD; jsonReceived: Time; json: string; }; }>; getTickPrices: (symbols: string[], timestamp?: number, level?: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: getTickPricesResponse; jsonReceived: Time; json: string; }; }>; getTradeRecords: (orders: number[]) => Promise<{ transaction: Transaction, Record>; data: { returnData: TRADE_RECORD[]; jsonReceived: Time; json: string; }; }>; getTrades: (openedOnly?: boolean) => Promise<{ transaction: Transaction, Record>; data: { returnData: TRADE_RECORD[]; jsonReceived: Time; json: string; }; }>; getTradesHistory: (start: number, end: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: TRADE_RECORD[]; jsonReceived: Time; json: string; }; }>; getTradingHours: (symbols: string[]) => Promise<{ transaction: Transaction, Record>; data: { returnData: TRADING_HOURS_RECORD[]; jsonReceived: Time; json: string; }; }>; getVersion: () => Promise<{ transaction: Transaction, Record>; data: { returnData: getVersionResponse; jsonReceived: Time; json: string; }; }>; tradeTransaction: ({ customComment, expiration, cmd, offset, order, price, sl, symbol, tp, type, volume }: TRADE_TRANS_INFO | TRADE_TRANS_INFO_MODIFY | TRADE_TRANS_INFO_CLOSE | TRADE_TRANS_INFO_DELETE) => Promise<{ transaction: Transaction, Record>; data: any; }>; tradeTransactionStatus: (order: number) => Promise<{ transaction: Transaction, Record>; data: { returnData: tradeTransactionStatusResponse; jsonReceived: Time; json: string; }; }>; ping: (socketId?: string) => Promise<{ transaction: Transaction, Record>; data: { returnData: unknown; jsonReceived: Time; json: string; }; }>; logout: (socketId?: string) => Promise<{ transaction: Transaction, Record>; data: { returnData: null; jsonReceived: Time; json: string; }; }>; login: (socketId?: string) => Promise<{ transaction: Transaction, Record>; data: { returnData: { streamSessionId: string; }; jsonReceived: Time; json: string; }; }>; }; private tradingDisabled; private accountId; private password; private appName?; constructor(XAPI: XAPI, accountType: string, host: string, tradingDisabled: boolean, accountId: string, password: string, appName?: string); } export {};