import WebSocket from 'ws'; import { APIOptions, BotOptionalParams, BotsParams, BotsStatsParams, CurrencyParams, DealsParams, FundParams, MarketCurrencyParams, SmartTradeHistoryParams, SmartTradeParams, TransferHistoryParams, TransferParams } from './types/types'; import { Order } from './types/generated-types'; export declare class API { private readonly KEY; private readonly SECRETS; private readonly errorHandler?; private axios; private ws?; constructor(options?: APIOptions); private request; ping(): Promise; time(): Promise; transfer(params: TransferParams): Promise; getTransferHistory(params: TransferHistoryParams): Promise; getTransferData(): Promise; addExchangeAccount(params: any): Promise; editExchangeAccount(params: any): Promise; getExchange(): Promise; getMarketList(): Promise; getMarketPairs(params?: any): Promise; getCurrencyRate(params: CurrencyParams): Promise; getCurrencyRateWithLeverageData(params: MarketCurrencyParams): Promise; getActiveTradeEntities(account_id: number | string): Promise; sellAllToUSD(account_id: number | string): Promise; sellAllToBTC(account_id: number | string): Promise; getBalanceChartData(account_id: number | string, params: any): Promise; loadBalances(account_id: number | string): Promise; renameExchangeAccount(account_id: number | string, name: string): Promise; removeExchangeAccount(account_id: number | string): Promise; getPieChartData(account_id: number | string): Promise; getAccountTableData(account_id: number | string): Promise; getAccountInfo(account_id?: number): Promise; getLeverageData(account_id: number | string, pair: string): Promise; changeUserMode(mode: 'paper' | 'real'): Promise; getSmartTradeHistory(params?: SmartTradeHistoryParams): Promise; smartTrade(params: SmartTradeParams): Promise; getSmartTrade(id: number): Promise; cancelSmartTrade(id: number): Promise; updateSmartTrade(id: number, params: any): Promise; averageSmartTrade(id: number, params: FundParams): Promise; reduceFund(id: number, params: FundParams): Promise; closeSmartTrade(id: number): Promise; forceStartSmartTrade(id: number): Promise; forceProcessSmartTrade(id: number): Promise; setNoteSmartTrade(id: number, note: string): Promise; /** * Get the sub trades of a smart trade, including entry and take profit orders. * * @param id smart trade id * @returns SmartTrade Order */ getSubTrade(id: number): Promise; closeSubTrade(smartTradeId: number, subTradeId: number): Promise; cancelSubTrade(smartTradeId: number, subTradeId: number): Promise; getBots(params?: BotsParams): Promise; getBotsStats(params?: BotsStatsParams): Promise; getBot(id: number, options?: BotOptionalParams): Promise; getDeals(params?: DealsParams): Promise; getDeal(id: number): Promise; getDealSafetyOrders(id: number): Promise; customRequest(method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH', version: 1 | 2, path: string, payload?: any): Promise; private buildIdentifier; private subscribe; subscribeSmartTrade(callback?: (data: WebSocket.Data) => void): void; subscribeDeal(callback?: (data: WebSocket.Data) => void): void; unsubscribe(): void; /** * Validate the response order is consistent with the generated type * Or, an error is thrown * * @param order order */ validateOrderType(order: Order): Order; }