UNPKG

ccxt

Version:

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges

90 lines (89 loc) 5.43 kB
import blockchaincomRest from '../blockchaincom.js'; import type { Int, Str, OrderBook, Order, Trade, Ticker, OHLCV, Balances } from '../base/types.js'; import Client from '../base/ws/Client.js'; export default class blockchaincom extends blockchaincomRest { describe(): any; /** * @method * @name blockchaincom#watchBalance * @description watch balance and get the amount of funds available for trading or funds locked in orders * @see https://exchange.blockchain.com/api/#balances * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure} */ watchBalance(params?: {}): Promise<Balances>; handleBalance(client: Client, message: any): void; /** * @method * @name blockchaincom#watchOHLCV * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market. * @see https://exchange.blockchain.com/api/#prices * @param {string} symbol unified symbol of the market to fetch OHLCV data for * @param {string} timeframe the length of time each candle represents. Allows '1m', '5m', '15m', '1h', '6h' '1d'. Can only watch one timeframe per symbol. * @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): void; /** * @method * @name blockchaincom#watchTicker * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market * @see https://exchange.blockchain.com/api/#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>; handleTicker(client: Client, message: any): void; parseWsUpdatedTicker(ticker: any, lastTicker?: any, market?: any): Ticker; /** * @method * @name blockchaincom#watchTrades * @description get the list of most recent trades for a particular symbol * @see https://exchange.blockchain.com/api/#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; parseWsTrade(trade: any, market?: any): Trade; /** * @method * @name blockchaincom#fetchOrders * @description watches information on multiple orders made by the user * @see https://exchange.blockchain.com/api/#mass-order-status-request-ordermassstatusrequest * @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[]>; handleOrders(client: Client, message: any): void; parseWsOrder(order: any, market?: any): Order; parseWsOrderStatus(status: any): string; /** * @method * @name blockchaincom#watchOrderBook * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data * @see https://exchange.blockchain.com/api/#l2-order-book * @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 {objectConstructor} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.type] accepts l2 or l3 for level 2 or level 3 order book * @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; handleMessage(client: Client, message: any): void; handleAuthenticationMessage(client: Client, message: any): void; authenticate(params?: {}): Promise<any>; }