ccxt
Version:
124 lines (123 loc) • 7.32 kB
TypeScript
import whitebitRest from '../whitebit.js';
import type { Int, Str, OrderBook, Order, Trade, Ticker, OHLCV, Balances, Strings, Tickers } from '../base/types.js';
import Client from '../base/ws/Client.js';
export default class whitebit extends whitebitRest {
describe(): any;
/**
* @method
* @name whitebit#watchOHLCV
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
* @see https://docs.whitebit.com/public/websocket/#kline
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
* @param {string} timeframe the length of time each candle represents
* @param {int} [since] timestamp in ms of the earliest candle to fetch
* @param {int} [limit] the maximum amount of candles to fetch
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
*/
watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
handleOHLCV(client: Client, message: any): any;
/**
* @method
* @name whitebit#watchOrderBook
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
* @see https://docs.whitebit.com/public/websocket/#market-depth
* @param {string} symbol unified symbol of the market to fetch the order book for
* @param {int} [limit] the maximum amount of order book entries to return
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
*/
watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
handleOrderBook(client: Client, message: any): void;
handleDelta(bookside: any, delta: any): void;
handleDeltas(bookside: any, deltas: any): void;
/**
* @method
* @name whitebit#watchTicker
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
* @see https://docs.whitebit.com/public/websocket/#market-statistics
* @param {string} symbol unified symbol of the market to fetch the ticker for
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
*/
watchTicker(symbol: string, params?: {}): Promise<Ticker>;
/**
* @method
* @name whitebit#watchTickers
* @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
* @see https://docs.whitebit.com/public/websocket/#market-statistics
* @param {string[]} [symbols] unified symbol of the market to fetch the ticker for
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
*/
watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
handleTicker(client: Client, message: any): any;
/**
* @method
* @name whitebit#watchTrades
* @description get the list of most recent trades for a particular symbol
* @see https://docs.whitebit.com/public/websocket/#market-trades
* @param {string} symbol unified symbol of the market to fetch trades for
* @param {int} [since] timestamp in ms of the earliest trade to fetch
* @param {int} [limit] the maximum amount of trades to fetch
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
*/
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
handleTrades(client: Client, message: any): void;
/**
* @method
* @name whitebit#watchMyTrades
* @description watches trades made by the user
* @see https://docs.whitebit.com/private/websocket/#deals
* @param {str} symbol unified market symbol
* @param {int} [since] the earliest time in ms to fetch trades for
* @param {int} [limit] the maximum number of trades structures to retrieve
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
*/
watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
handleMyTrades(client: Client, message: any, subscription?: any): void;
parseWsTrade(trade: any, market?: any): Trade;
/**
* @method
* @name whitebit#watchOrders
* @description watches information on multiple orders made by the user
* @see https://docs.whitebit.com/private/websocket/#orders-pending
* @param {string} symbol unified market symbol of the market orders were made in
* @param {int} [since] the earliest time in ms to fetch orders for
* @param {int} [limit] the maximum number of order structures to retrieve
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
*/
watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
handleOrder(client: Client, message: any, subscription?: any): void;
parseWsOrder(order: any, market?: any): Order;
parseWsOrderType(status: any): string;
/**
* @method
* @name whitebit#watchBalance
* @description watch balance and get the amount of funds available for trading or funds locked in orders
* @see https://docs.whitebit.com/private/websocket/#balance-spot
* @see https://docs.whitebit.com/private/websocket/#balance-margin
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @param {str} [params.type] spot or contract if not provided this.options['defaultType'] is used
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
*/
watchBalance(params?: {}): Promise<Balances>;
handleBalance(client: Client, message: any): void;
watchPublic(messageHash: any, method: any, reqParams?: any[], params?: {}): Promise<any>;
watchMultipleSubscription(messageHash: any, method: any, symbol: any, isNested?: boolean, params?: {}): Promise<any>;
watchPrivate(messageHash: any, method: any, reqParams?: any[], params?: {}): Promise<any>;
authenticate(params?: {}): Promise<any>;
handleAuthenticate(client: Client, message: any): any;
handleErrorMessage(client: Client, message: any): any;
handleMessage(client: Client, message: any): void;
handleSubscriptionStatus(client: Client, message: any, id: any): void;
handlePong(client: Client, message: any): any;
ping(client: Client): {
id: number;
method: string;
params: any[];
};
}