astro-perp-ccxt-dev
Version:
108 lines (107 loc) • 6.41 kB
TypeScript
import astrosRest from '../astros.js';
import type { Int, OHLCV, Str, Strings, OrderBook, Order, Trade, Position, Market, Balances, Dict } from '../base/types.js';
import Client from '../base/ws/Client.js';
/**
* @class astros
* @augments Exchange
* @description watching delivery future markets is not yet implemented (perpertual future & swap is implemented)
*/
export default class astros extends astrosRest {
describe(): any;
subscribe(event: any, messageHash: any, subscriptionHash: any, params?: {}): Promise<any>;
requestId(): any;
ping(client: Client): string;
handlePong(client: Client, message: any): void;
handleErrorMessage(client: Client, message: any): void;
handleMessage(client: Client, message: any): void;
handleBalance(client: Client, message: any): void;
/**
* @method
* @name astros#watchBalance
* @description watch balance and get the amount of funds available for trading or funds locked in orders
* @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>;
/**
* @method
* @name astros#watchOHLCV
* @description watches historical candlestick data containing the open, high, low, close price, and the volume of a market
* @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): void;
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
/**
* @method
* @name astros#watchOrderBook
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
* @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;
/**
* @method
* @name astros#watchTrades
* @description get the list of most recent trades for a particular symbol
* @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;
parseWsTradeSide(direction: any): "buy" | "sell";
/**
* @method
* @name astros#watchMyTrades
* @description watches information on multiple trades made by the user
* @param {string} symbol unified market symbol of the market trades were made in
* @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
* @param {string} [params.method] '/spotMarket/tradeOrders' or '/spot/tradeFills' default is '/spotMarket/tradeOrders'
* @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[]>;
handleMyTrade(client: Client, message: any): void;
parseWsMyTrade(trade: any, market?: any): Trade;
/**
* @method
* @name astros#watchPositions
* @description watch all open positions
* @param {string[]|undefined} symbols list of unified market symbols
* @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
* @param {string} [params.instType] one of 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES', default is 'USDT-FUTURES'
* @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[]>;
handlePositions(client: Client, message: any): void;
parseWsPosition(position: any, market?: any): Position;
/**
* @method
* @name astros#watchOrders
* @description watches information on an order made by the user
* @param {string} symbol unified symbol of the market the order was made in
* @param {int} [since] timestamp in ms of the earliest order to watch
* @param {int} [limit] the maximum amount of orders to watch
* @param {object} [params] extra parameters specific to the exchange API endpoint
* @param {string} [params.channel] choose what channel to use. Can open_order or order_history.
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
*/
watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
handleOrders(client: Client, message: any): void;
parseOrder(order: Dict, market?: Market): Order;
}