ccxt
Version:
265 lines (264 loc) • 16.4 kB
TypeScript
import backpackRest from '../backpack.js';
import type { Bool, Dict, Int, Market, OHLCV, Order, OrderBook, Position, Str, Strings, Ticker, Tickers, Trade } from '../base/types.js';
import Client from '../base/ws/Client.js';
export default class backpack extends backpackRest {
describe(): any;
watchPublic(topics: any, messageHashes: any, params?: {}, unwatch?: boolean): Promise<any>;
watchPrivate(topics: any, messageHashes: any, params?: {}, unwatch?: boolean): Promise<any>;
handleUnsubscriptions(url: string, messageHashes: string[], message: Dict): void;
/**
* @method
* @name backpack#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.backpack.exchange/#tag/Streams/Public/Ticker
* @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 backpack#unWatchTicker
* @description unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
* @see https://docs.backpack.exchange/#tag/Streams/Public/Ticker
* @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}
*/
unWatchTicker(symbol: string, params?: {}): Promise<any>;
/**
* @method
* @name backpack#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.backpack.exchange/#tag/Streams/Public/Ticker
* @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>;
/**
* @method
* @name backpack#unWatchTickers
* @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.backpack.exchange/#tag/Streams/Public/Ticker
* @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}
*/
unWatchTickers(symbols?: Strings, params?: {}): Promise<any>;
handleTicker(client: Client, message: any): void;
parseWsTicker(ticker: Dict, market?: Market): Ticker;
/**
* @method
* @name backpack#watchBidsAsks
* @description watches best bid & ask for symbols
* @see https://docs.backpack.exchange/#tag/Streams/Public/Book-ticker
* @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}
*/
watchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>;
/**
* @method
* @name backpack#unWatchBidsAsks
* @description unWatches best bid & ask for symbols
* @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}
*/
unWatchBidsAsks(symbols?: Strings, params?: {}): Promise<any>;
handleBidAsk(client: Client, message: any): void;
parseWsBidAsk(ticker: any, market?: any): Ticker;
/**
* @method
* @name backpack#watchOHLCV
* @description watches historical candlestick data containing the open, high, low, close price, and the volume of a market
* @see https://docs.backpack.exchange/#tag/Streams/Public/K-Line
* @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[]>;
/**
* @method
* @name backpack#unWatchOHLCV
* @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
* @see https://docs.backpack.exchange/#tag/Streams/Public/K-Line
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
* @param {string} timeframe the length of time each candle represents
* @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
*/
unWatchOHLCV(symbol: string, timeframe?: string, params?: {}): Promise<any>;
/**
* @method
* @name backpack#watchOHLCVForSymbols
* @description watches historical candlestick data containing the open, high, low, close price, and the volume of a market
* @see https://docs.backpack.exchange/#tag/Streams/Public/K-Line
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
* @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
*/
watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
/**
* @method
* @name backpack#unWatchOHLCVForSymbols
* @description unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
* @see https://docs.backpack.exchange/#tag/Streams/Public/K-Line
* @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
* @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
*/
unWatchOHLCVForSymbols(symbolsAndTimeframes: string[][], params?: {}): Promise<any>;
handleOHLCV(client: Client, message: any): void;
parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
/**
* @method
* @name backpack#watchTrades
* @description watches information on multiple trades made in a market
* @see https://docs.backpack.exchange/#tag/Streams/Public/Trade
* @param {string} symbol unified symbol of the market to fetch the ticker for
* @param {int} [since] the earliest time in ms to fetch trades for
* @param {int} [limit] the maximum number of trade structures to retrieve
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
*/
watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
/**
* @method
* @name backpack#unWatchTrades
* @description unWatches from the stream channel
* @see https://docs.backpack.exchange/#tag/Streams/Public/Trade
* @param {string} symbol unified symbol of the market to fetch trades for
* @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}
*/
unWatchTrades(symbol: string, params?: {}): Promise<any>;
/**
* @method
* @name backpack#watchTradesForSymbols
* @description watches information on multiple trades made in a market
* @see https://docs.backpack.exchange/#tag/Streams/Public/Trade
* @param {string[]} symbols unified symbol of the market to fetch trades for
* @param {int} [since] the earliest time in ms to fetch trades for
* @param {int} [limit] the maximum number of trade structures to retrieve
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
*/
watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
/**
* @method
* @name backpack#unWatchTradesForSymbols
* @description unWatches from the stream channel
* @see https://docs.backpack.exchange/#tag/Streams/Public/Trade
* @param {string[]} symbols unified symbol of the market to fetch trades for
* @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}
*/
unWatchTradesForSymbols(symbols: string[], params?: {}): Promise<any>;
handleTrades(client: Client, message: any): void;
parseWsTrade(trade: any, market?: any): Trade;
/**
* @method
* @name backpack#watchOrderBook
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
* @see https://docs.backpack.exchange/#tag/Streams/Public/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>;
/**
* @method
* @name backpack#watchOrderBookForSymbols
* @see https://docs.backpack.exchange/#tag/Streams/Public/Depth
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
* @param {string[]} symbols unified array of symbols
* @param {int} [limit] the maximum amount of order book entries to return
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @param {string} [params.method] either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
*/
watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
/**
* @method
* @name backpack#unWatchOrderBook
* @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
* @param {string} symbol unified array of symbols
* @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
*/
unWatchOrderBook(symbol: string, params?: {}): Promise<any>;
/**
* @method
* @name kucoin#unWatchOrderBookForSymbols
* @description unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
* @param {string[]} symbols unified array of symbols
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @param {string} [params.method] either '/market/level2' or '/spotMarket/level2Depth5' or '/spotMarket/level2Depth50' default is '/market/level2'
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
*/
unWatchOrderBookForSymbols(symbols: string[], params?: {}): Promise<any>;
handleOrderBook(client: Client, message: any): void;
handleDelta(orderbook: any, delta: any): void;
handleBidAsks(bookSide: any, bidAsks: any): void;
getCacheIndex(orderbook: any, cache: any): any;
/**
* @method
* @name backpack#watchOrders
* @description watches information on multiple orders made by the user
* @see https://docs.backpack.exchange/#tag/Streams/Private/Order-update
* @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[]>;
/**
* @method
* @name backpack#unWatchOrders
* @description unWatches information on multiple orders made by the user
* @see https://docs.backpack.exchange/#tag/Streams/Private/Order-update
* @param {string} [symbol] unified market symbol of the market orders were made in
* @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}
*/
unWatchOrders(symbol?: Str, params?: {}): Promise<any>;
handleOrder(client: Client, message: any): void;
parseWsOrder(order: any, market?: any): Order;
parseWsOrderStatus(status: any, market?: any): string;
parseWsOrderSide(side: Str): string;
/**
* @method
* @name backpack#watchPositions
* @description watch all open positions
* @see https://docs.backpack.exchange/#tag/Streams/Private/Position-update
* @param {string[]} [symbols] list of unified market symbols to watch positions for
* @param {int} [since] the earliest time in ms to fetch positions for
* @param {int} [limit] the maximum number of positions to retrieve
* @param {object} params extra parameters specific to the exchange API endpoint
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
*/
watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
/**
* @method
* @name backpack#unWatchPositions
* @description unWatches from the stream channel
* @see https://docs.backpack.exchange/#tag/Streams/Private/Position-update
* @param {string[]} [symbols] list of unified market symbols to watch positions for
* @param {object} params extra parameters specific to the exchange API endpoint
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
*/
unWatchPositions(symbols?: Strings, params?: {}): Promise<any[]>;
handlePositions(client: any, message: any): void;
parseWsPosition(position: any, market?: any): Position;
handleMessage(client: Client, message: any): void;
handleErrorMessage(client: Client, message: any): Bool;
}