v3.2.1: add another UM response type.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
export interface UMPaginatedResult<List = any> {
|
||||
nextPageCursor: string;
|
||||
category: string;
|
||||
list: List[];
|
||||
}
|
||||
|
||||
export interface UMLeverageFilter {
|
||||
minLeverage: string;
|
||||
maxLeverage: string;
|
||||
@@ -31,8 +37,34 @@ export interface UMInstrumentInfo {
|
||||
lotSizeFilter: UMLotSizeFilter;
|
||||
}
|
||||
|
||||
export interface UMInstrumentInfoResult {
|
||||
category: string;
|
||||
list: UMInstrumentInfo[];
|
||||
nextPageCursor: string;
|
||||
export interface UMHistoricOrder {
|
||||
symbol: string;
|
||||
orderType: string;
|
||||
orderLinkId: string;
|
||||
orderId: string;
|
||||
stopOrderType: string;
|
||||
orderStatus: string;
|
||||
takeProfit: string;
|
||||
cumExecValue: string;
|
||||
blockTradeId: string;
|
||||
rejectReason: string;
|
||||
price: string;
|
||||
createdTime: number;
|
||||
tpTriggerBy: string;
|
||||
timeInForce: string;
|
||||
basePrice: string;
|
||||
leavesValue: string;
|
||||
updatedTime: number;
|
||||
side: string;
|
||||
triggerPrice: string;
|
||||
cumExecFee: string;
|
||||
slTriggerBy: string;
|
||||
leavesQty: string;
|
||||
closeOnTrigger: boolean;
|
||||
cumExecQty: string;
|
||||
reduceOnly: boolean;
|
||||
qty: string;
|
||||
stopLoss: string;
|
||||
triggerBy: string;
|
||||
orderIM: string;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,9 @@ import {
|
||||
InternalTransferRequest,
|
||||
UMExchangeCoinsRequest,
|
||||
UMBorrowHistoryRequest,
|
||||
UMInstrumentInfoResult,
|
||||
UMPaginatedResult,
|
||||
UMHistoricOrder,
|
||||
UMInstrumentInfo,
|
||||
} from './types';
|
||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||
import BaseRestClient from './util/BaseRestClient';
|
||||
@@ -79,7 +81,7 @@ export class UnifiedMarginClient extends BaseRestClient {
|
||||
/** Get trading rules per symbol/contract, incl price/amount/value/leverage filters */
|
||||
getInstrumentInfo(
|
||||
params: UMInstrumentInfoRequest
|
||||
): Promise<APIResponseV3<UMInstrumentInfoResult>> {
|
||||
): Promise<APIResponseV3<UMPaginatedResult<UMInstrumentInfo>>> {
|
||||
return this.get('/derivatives/v3/public/instruments-info', params);
|
||||
}
|
||||
|
||||
@@ -168,7 +170,7 @@ export class UnifiedMarginClient extends BaseRestClient {
|
||||
/** Query order history. As order creation/cancellation is asynchronous, the data returned from the interface may be delayed. To access order information in real-time, call getActiveOrders() */
|
||||
getHistoricOrders(
|
||||
params: UMHistoricOrdersRequest
|
||||
): Promise<APIResponseV3<any>> {
|
||||
): Promise<APIResponseV3<UMPaginatedResult<UMHistoricOrder>>> {
|
||||
return this.getPrivate('/unified/v3/private/order/list', params);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user