feat(#261): add missing tpsl req/response types

This commit is contained in:
tiagosiebler
2023-06-09 15:25:41 +01:00
parent 9013bf749d
commit 2327dcc7ec
4 changed files with 91 additions and 50 deletions

View File

@@ -5,21 +5,24 @@ import { USDCOrderFilter, USDCTimeInForce } from './usdc-shared';
export interface ContractOrderRequest {
symbol: string;
side: OrderSide;
positionIdx?: '0' | '1' | '2';
orderType: UMOrderType;
qty: string;
timeInForce: USDCTimeInForce;
price?: string;
triggerDirection?: '1' | '2';
triggerPrice?: string;
triggerBy?: string;
tpTriggerBy?: string;
slTriggerBy?: string;
timeInForce: USDCTimeInForce;
positionIdx?: '0' | '1' | '2';
orderLinkId?: string;
takeProfit?: string;
stopLoss?: string;
tpTriggerBy?: string;
slTriggerBy?: string;
reduceOnly?: boolean;
closeOnTrigger?: boolean;
tpslMode?: 'Partial' | 'Full';
tpOrderType?: UMOrderType;
slOrderType?: UMOrderType;
}
export interface ContractHistoricOrdersRequest {
@@ -39,17 +42,19 @@ export interface ContractCancelOrderRequest {
}
export interface ContractModifyOrderRequest {
symbol: string;
orderId?: string;
orderLinkId?: string;
symbol: string;
qty?: string;
price?: string;
qty?: string;
triggerPrice?: string;
takeProfit?: string;
stopLoss?: string;
tpTriggerBy?: string;
slTriggerBy?: string;
triggerBy?: string;
triggerPrice?: string;
tpLimitPrice?: string;
slLimitPrice?: string;
}
export interface ContractActiveOrdersRequest {
@@ -91,12 +96,17 @@ export interface ContractSetTPSLRequest {
symbol: string;
takeProfit?: string;
stopLoss?: string;
activePrice?: string;
trailingStop?: string;
tpslMode?: 'Full' | 'Partial';
tpSize?: string;
slSize?: string;
tpTriggerBy?: string;
slTriggerBy?: string;
slSize?: string;
tpSize?: string;
trailingStop?: string;
activePrice?: string;
tpLimitPrice?: string;
slLimitPrice?: string;
tpOrderType?: UMOrderType;
slOrderType?: UMOrderType;
/** 0-one-way, 1-buy side, 2-sell side */
positionIdx?: 0 | 1 | 2;
}

View File

@@ -10,33 +10,43 @@ export interface ContractListResult<TList = any> {
export interface ContractHistoricOrder {
symbol: string;
orderId: string;
orderLinkId: string;
side: string;
orderType: string;
price: string;
iv: string;
qty: string;
reduceOnly: boolean;
timeInForce: string;
orderStatus: string;
leavesQty: string;
leavesValue: string;
cumExecQty: string;
cumExecValue: string;
cumExecFee: string;
positionIdx: number;
lastPriceOnCreated: string;
rejectReason: string;
orderLinkId: string;
createdTime: string;
updatedTime: string;
orderId: string;
cancelType: string;
rejectReason: string;
stopOrderType: string;
triggerDirection: number;
triggerBy: string;
triggerPrice: string;
cumExecValue: string;
cumExecFee: string;
cumExecQty: string;
leavesValue: string;
leavesQty: string;
takeProfit: string;
stopLoss: string;
tpslMode: string;
tpLimitPrice: string;
slLimitPrice: string;
tpTriggerBy: string;
slTriggerBy: string;
triggerPrice: string;
reduceOnly: boolean;
closeOnTrigger: boolean;
triggerDirection: number;
positionIdx: number;
blockTradeId: string;
smpType: string;
smpGroup: number;
smpOrderId: string;
}
export interface ContractSymbolTicker {

View File

@@ -42,6 +42,9 @@ export interface AccountOrderV5 {
triggerPrice?: string;
takeProfit?: string;
stopLoss?: string;
tpslMode: 'Full' | 'Partial' | '';
tpLimitPrice: string;
slLimitPrice: string;
tpTriggerBy?: OrderTriggerByV5;
slTriggerBy?: OrderTriggerByV5;
triggerDirection?: number;
@@ -49,6 +52,10 @@ export interface AccountOrderV5 {
lastPriceOnCreated?: string;
reduceOnly?: boolean;
closeOnTrigger?: boolean;
placeType: 'iv' | 'price' | '';
smpType: string;
smpGroup: string;
smpOrderId: string;
createdTime: string;
updatedTime: string;
}