UNPKG

kucoin-universal-sdk

Version:
166 lines (165 loc) 4.51 kB
import { WsMessage } from '../../../model/common'; import { WebSocketMessageCallback } from '../../../internal/interfaces/websocket'; import { Response } from '../../../internal/interfaces/serializable'; export declare class StopOrderEvent implements Response<WsMessage> { /** * Order created time (milliseconds) */ createdAt: number; /** * The unique order id generated by the trading system */ orderId: string; /** * Price */ orderPrice: string; /** * User-specified order type */ orderType: StopOrderEvent.OrderTypeEnum; /** * buy or sell */ side: StopOrderEvent.SideEnum; /** * User-specified order size */ size: string; /** * Order type */ stop: StopOrderEvent.StopEnum; /** * Stop Price */ stopPrice: string; /** * symbol */ symbol: string; /** * The type of trading: TRADE (Spot), MARGIN_TRADE (Cross Margin), MARGIN_ISOLATED_TRADE (Isolated Margin). */ tradeType: StopOrderEvent.TradeTypeEnum; /** * Push time (nanoseconds) */ ts: number; /** * Order Type */ type: StopOrderEvent.TypeEnum; private constructor(); /** * common response */ commonResponse?: WsMessage; setCommonResponse(response: WsMessage): void; /** * Convert the object to a JSON string. */ toJson(): string; /** * Create an object from a JSON string. */ static fromJson(input: string): StopOrderEvent; /** * Create an object from Js Object. */ static fromObject(jsonObject: Object): StopOrderEvent; } export declare namespace StopOrderEvent { enum OrderTypeEnum { /** * stop */ STOP } enum SideEnum { /** * buy */ BUY, /** * sell */ SELL } enum StopEnum { /** * stop loss order */ LOSS, /** * Take profit order */ ENTRY, /** * Limit stop loss OCO order */ L_L_O, /** * Trigger stop loss OCO order */ L_S_O, /** * Limit stop profit OCO order */ E_L_O, /** * Trigger stop profit OCO order */ E_S_O, /** * Moving stop loss order */ TSO } enum TradeTypeEnum { /** * Spot */ TRADE, /** * Spot margin trade */ MARGIN_TRADE, /** * Spot margin isolated trade */ MARGIN_ISOLATED_TRADE } enum TypeEnum { /** * The order is in the order book (maker order) */ OPEN, /** * The message sent when the order is matched, 1. When the status is open and the type is match, it is a maker match. 2. When the status is match and the type is match, it is a taker match. */ MATCH, /** * The message sent due to the order being modified: STP triggering, partial cancellation of the order. Includes these three scenarios: 1. When the status is open and the type is update: partial amounts of the order have been canceled, or STP triggers 2. When the status is match and the type is update: STP triggers 3. When the status is done and the type is update: partial amounts of the order have been filled and the unfilled part got canceled, or STP is triggered. */ UPDATE, /** * The message sent when the status of the order changes to DONE after the transaction */ FILLED, /** * The message sent when the status of the order changes to DONE due to being canceled */ CANCEL, /** * The message sent when the order enters the matching system. When the order has just entered the matching system and has not yet done matching logic with the counterparty, a private message with the message type &quot;received&quot; and the order status &quot;new&quot; will be pushed. */ RECEIVED } } export type StopOrderEventCallback = (topic: string, subject: string, data: StopOrderEvent) => void; export declare class StopOrderEventCallbackWrapper implements WebSocketMessageCallback { private callback; constructor(callback: StopOrderEventCallback); onMessage(msg: WsMessage): void; }