import { Config , ExecInst , OrderStatus , OrderType } from '../types' ; import { RestBase } from './rest-base' ; import { RestOrderRequest , RestOrderResponse , RestOrdersResponse } from './types' ; export class Rest extends RestBase { constructor ( config ) { super ( config ) ; } async createLimitOrder ( request ) { return this . createOrder ( { ... request , ordType : OrderType . Limit , } ) ; } param request Return async createLimitOrderParticipateDoNotInitiate ( request ) { return this . createLimitOrder ( { ... request , execInst : ExecInst . ParticipateDoNotInitiate , } ) ; } async createStopOrder ( request ) { return this . createOrder ( { ... request , ordType : OrderType . Stop , } ) ; } async createStopOrderLastPriceReduceOnly ( request ) { return this . createStopOrder ( { ... request , execInst : `${ ExecInst . LastPrice },${ ExecInst . ReduceOnly }` , } ) ; } async getOrderById ( symbol , orderID ) { return this . fetchOrder ( { symbol , filter : { orderID , } , } ) ; } async getStopOrder ( symbol ) { return this . fetchOrder ( { symbol , filter : { ordStatus : OrderStatus . New , ordType : OrderType . Stop , } , } ) ; } }