import { AxiosRequestConfig } from 'axios'; import { RestClientOptions } from './util/requestUtils'; export interface V5APIResponse { retCode: number; retMsg: string; result: T; retExtInfo: any; time: number; } export interface V5RestClientOptions extends RestClientOptions { /** Override the base URL for v5 API endpoints */ baseUrl?: string; } export default class RestClientV5 { private timeOffset; private syncTimePromise; private options; private baseUrl; private globalRequestOptions; private key; private secret; constructor(restOptions?: V5RestClientOptions, networkOptions?: AxiosRequestConfig); private getV5BaseUrl; get(endpoint: string, params?: any): Promise>; getPrivate(endpoint: string, params?: any): Promise>; post(endpoint: string, params?: any): Promise>; postPrivate(endpoint: string, params?: any): Promise>; deletePrivate(endpoint: string, params?: any): Promise>; getServerTime(): Promise>; getKline(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol: string; interval: string; start?: number; end?: number; limit?: number; }): Promise>; getOrderbook(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol: string; limit?: number; }): Promise>; getTickers(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol?: string; baseCoin?: string; expDate?: string; }): Promise>; getInstrumentsInfo(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol?: string; baseCoin?: string; limit?: number; cursor?: string; }): Promise>; placeOrder(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol: string; side: 'Buy' | 'Sell'; orderType: 'Market' | 'Limit'; qty: string; price?: string; timeInForce?: 'GTC' | 'IOC' | 'FOK' | 'PostOnly'; orderLinkId?: string; isLeverage?: 0 | 1; orderFilter?: 'Order' | 'tpslOrder' | 'StopOrder'; triggerDirection?: 1 | 2; triggerPrice?: string; triggerBy?: 'LastPrice' | 'IndexPrice' | 'MarkPrice'; orderIv?: string; positionIdx?: 0 | 1 | 2; takeProfit?: string; stopLoss?: string; tpTriggerBy?: 'LastPrice' | 'IndexPrice' | 'MarkPrice'; slTriggerBy?: 'LastPrice' | 'IndexPrice' | 'MarkPrice'; reduceOnly?: boolean; closeOnTrigger?: boolean; mmp?: boolean; }): Promise>; cancelOrder(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol: string; orderId?: string; orderLinkId?: string; orderFilter?: 'Order' | 'tpslOrder' | 'StopOrder'; }): Promise>; getOrders(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol?: string; baseCoin?: string; settleCoin?: string; orderId?: string; orderLinkId?: string; openOnly?: 0 | 1; orderFilter?: 'Order' | 'tpslOrder' | 'StopOrder'; limit?: number; cursor?: string; }): Promise>; getOrderHistory(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol?: string; baseCoin?: string; settleCoin?: string; orderId?: string; orderLinkId?: string; orderFilter?: 'Order' | 'tpslOrder' | 'StopOrder'; orderStatus?: string; startTime?: number; endTime?: number; limit?: number; cursor?: string; }): Promise>; getPositionInfo(params: { category: 'linear' | 'inverse' | 'option'; symbol?: string; baseCoin?: string; settleCoin?: string; limit?: number; cursor?: string; }): Promise>; setLeverage(params: { category: 'linear' | 'inverse'; symbol: string; buyLeverage: string; sellLeverage: string; }): Promise>; getWalletBalance(params: { accountType: 'UNIFIED' | 'CONTRACT' | 'SPOT' | 'INVESTMENT' | 'OPTION' | 'FUND'; coin?: string; }): Promise>; getFeeRate(params: { category: 'spot' | 'linear' | 'inverse' | 'option'; symbol?: string; baseCoin?: string; }): Promise>; getCoinBalance(params: { accountType: 'SPOT' | 'CONTRACT' | 'INVESTMENT' | 'OPTION' | 'UNIFIED' | 'FUND'; coin?: string; }): Promise>; getAllCoinBalance(params: { accountType: 'SPOT' | 'CONTRACT' | 'INVESTMENT' | 'OPTION' | 'UNIFIED' | 'FUND'; }): Promise>; private buildRequest; private _call; private parseException; private syncTime; private fetchTimeOffset; }