feat(): expand v5 client with trade endpoints

This commit is contained in:
tiagosiebler
2023-02-15 11:12:27 +00:00
parent 5b44e31207
commit 145f17d4f1
7 changed files with 400 additions and 6 deletions

View File

@@ -4,3 +4,5 @@ export * from './shared';
export * from './spot';
export * from './usdt-perp';
export * from './unified-margin';
export * from './v5-market';
export * from './v5-trade';

View File

@@ -0,0 +1,98 @@
import {
CategoryV5,
OrderSideV5,
OrderTimeInForceV5,
OrderTriggerByV5,
OrderTypeV5,
PositionIdx,
} from '../v5-shared';
export interface OrderResultV5 {
orderId: string;
orderLinkId: string;
}
export interface AccountOrderV5 {
orderId: string;
orderLinkId?: string;
blockTradeId?: string;
symbol: string;
price: string;
qty: string;
side: OrderSideV5;
isLeverage?: string;
positionIdx?: PositionIdx;
orderStatus: string;
cancelType?: string;
rejectReason?: string;
avgPrice: string;
leavesQty: string;
leavesValue: string;
cumExecQty: string;
cumExecValue: string;
cumExecFee: string;
timeInForce?: OrderTimeInForceV5;
orderType?: OrderTypeV5;
stopOrderType?: string;
orderIv?: string;
triggerPrice?: string;
takeProfit?: string;
stopLoss?: string;
tpTriggerBy?: OrderTriggerByV5;
slTriggerBy?: OrderTriggerByV5;
triggerDirection?: number;
triggerBy?: OrderTriggerByV5;
lastPriceOnCreated?: string;
reduceOnly?: boolean;
closeOnTrigger?: boolean;
createdTime: string;
updatedTime: string;
}
export interface AccountOrdersResultV5 {
category: CategoryV5;
nextPageCursor?: string;
list: AccountOrderV5[];
}
export interface BatchOrderResult {
category: CategoryV5;
symbol: string;
orderId: string;
orderLinkId: string;
createAt: string;
}
export interface BatchOrdersResult<T extends unknown[]> {
result: {
list: T;
};
retExtInfo: {
list: {
code: number;
msg: string;
}[];
};
}
export interface BatchAmendOrderResult {
category: CategoryV5;
symbol: string;
orderId: string;
orderLinkId: string;
}
export interface BatchCancelOrderResult {
category: CategoryV5;
symbol: string;
orderId: string;
orderLinkId: string;
}
export interface SpotBorrowCheckResult {
symbol: string;
side: OrderSideV5;
maxTradeQty: string;
maxTradeAmount: string;
borrowCoin: string;
}