@sharplygroup/xtb-api-js
Version:
A module for interacting with the XTB API
32 lines (31 loc) • 1.31 kB
TypeScript
import { WebSocketManager } from "../utils/WebSocketManager";
import { ITradesResponse } from "../interfaces";
export declare class TradeOperations {
private readonly wsManager;
constructor(wsManager: WebSocketManager);
/**
* Returns array of user's trades.
* @param {boolean} openedOnly - if true then only opened trades will be returned
* @returns {Promise<ITradesResponse>}
*/
getTrades(openedOnly: boolean): Promise<ITradesResponse>;
/**
* Returns array of trades listed in `orders` argument.
* @param {number[]} orders - Array of orders (position numbers)
* @returns {Promise<ITradesResponse>}
*/
getTradeRecords(orders: number[]): Promise<ITradesResponse>;
/**
* Returns array of user's trades which were closed within specified period of time.
* @param {number} end - Time, 0 means current time for simplicity
* @param {number} start - Time, 0 means last month interval
* @returns {Promise<ITradesResponse>}
*/
getTradesHistory(end: number, start: number): Promise<ITradesResponse>;
/**
* Returns current transaction status.
* @param {number} order - order
* @returns {Promise<any>} // TODO: Create ITradeStatusResponse interface
*/
getTradeStatus(order: number): Promise<any>;
}