UNPKG

kucoin-universal-sdk

Version:
134 lines (133 loc) 2.99 kB
import { WsMessage } from '../../../model/common'; import { WebSocketMessageCallback } from '../../../internal/interfaces/websocket'; import { Response } from '../../../internal/interfaces/serializable'; export declare class StopOrdersEvent implements Response<WsMessage> { /** * */ createdAt: number; /** * Margin Mode */ marginMode: StopOrdersEvent.MarginModeEnum; /** * The unique order id generated by the trading system */ orderId: string; /** * Order Price */ orderPrice: string; /** * User-specified order type */ orderType: StopOrdersEvent.OrderTypeEnum; /** * buy or sell */ side: StopOrdersEvent.SideEnum; /** * User-specified order size */ size: number; /** * Either \'down\' or \'up\' */ stop: StopOrdersEvent.StopEnum; /** * Stop Price */ stopPrice: string; /** * */ stopPriceType: string; /** * Symbol of the contract. Please refer to [Get Symbol endpoint: symbol](https://www.kucoin.com/docs-new/api-221752070) */ symbol: string; /** * */ ts: number; /** * Order Type */ type: StopOrdersEvent.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): StopOrdersEvent; /** * Create an object from Js Object. */ static fromObject(jsonObject: Object): StopOrdersEvent; } export declare namespace StopOrdersEvent { enum MarginModeEnum { /** * Isolated Margin */ ISOLATED, /** * Cross Margin */ CROSS } enum OrderTypeEnum { /** * Stop order */ STOP } enum SideEnum { /** * buy */ BUY, /** * sell */ SELL } enum StopEnum { /** * Triggers when the price reaches or goes below the stopPrice */ DOWN, /** * Triggers when the price reaches or goes above the stopPrice. */ UP } enum TypeEnum { /** * the order is in the order book (maker order) */ OPEN, /** * when the stop order has been triggered */ TRIGGERED, /** * when the order has been canceled */ CANCEL } } export type StopOrdersEventCallback = (topic: string, subject: string, data: StopOrdersEvent) => void; export declare class StopOrdersEventCallbackWrapper implements WebSocketMessageCallback { private callback; constructor(callback: StopOrdersEventCallback); onMessage(msg: WsMessage): void; }