feat(): updated types for Market and Trade categories
This commit is contained in:
@@ -551,7 +551,9 @@ export class RestClientV5 extends BaseRestClient {
|
||||
|
||||
cancelAllOrders(
|
||||
params: CancelAllOrdersParamsV5,
|
||||
): Promise<APIResponseV3WithTime<{ list: OrderResultV5[] }>> {
|
||||
): Promise<
|
||||
APIResponseV3WithTime<{ list: OrderResultV5[]; success: string }>
|
||||
> {
|
||||
return this.postPrivate('/v5/order/cancel-all', params);
|
||||
}
|
||||
|
||||
@@ -566,6 +568,18 @@ export class RestClientV5 extends BaseRestClient {
|
||||
return this.getPrivate('/v5/order/history', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query users' execution records, sorted by execTime in descending order
|
||||
*
|
||||
* Unified account covers: Spot / Linear contract / Options
|
||||
* Normal account covers: USDT perpetual / Inverse perpetual / Inverse futures
|
||||
*/
|
||||
getExecutionList(
|
||||
params: GetExecutionListParamsV5,
|
||||
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>> {
|
||||
return this.getPrivate('/v5/execution/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* This endpoint allows you to place more than one order in a single request.
|
||||
* Covers: Option (UTA, UTA Pro) / USDT Perpetual, UDSC Perpetual, USDC Futures (UTA Pro)
|
||||
@@ -675,7 +689,7 @@ export class RestClientV5 extends BaseRestClient {
|
||||
* Only for institutional clients!
|
||||
*/
|
||||
setDisconnectCancelAllWindowV2(params: {
|
||||
product: 'OPTION' | 'SPOT' | 'DERIVATIVES';
|
||||
product?: 'OPTION' | 'SPOT' | 'DERIVATIVES';
|
||||
timeWindow: number;
|
||||
}): Promise<APIResponseV3<undefined>> {
|
||||
return this.postPrivate('/v5/order/disconnected-cancel-all', params);
|
||||
@@ -811,18 +825,6 @@ export class RestClientV5 extends BaseRestClient {
|
||||
return this.postPrivate('/v5/position/add-margin', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query users' execution records, sorted by execTime in descending order
|
||||
*
|
||||
* Unified account covers: Spot / Linear contract / Options
|
||||
* Normal account covers: USDT perpetual / Inverse perpetual / Inverse futures
|
||||
*/
|
||||
getExecutionList(
|
||||
params: GetExecutionListParamsV5,
|
||||
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>> {
|
||||
return this.getPrivate('/v5/execution/list', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query user's closed profit and loss records. The results are sorted by createdTime in descending order.
|
||||
*
|
||||
|
||||
@@ -108,6 +108,7 @@ export interface GetInsuranceParamsV5 {
|
||||
export interface GetRiskLimitParamsV5 {
|
||||
category?: 'linear' | 'inverse';
|
||||
symbol?: string;
|
||||
cursor?: string;
|
||||
}
|
||||
|
||||
export interface GetOptionDeliveryPriceParamsV5 {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
OrderTriggerByV5,
|
||||
OrderTypeV5,
|
||||
PositionIdx,
|
||||
StopOrderTypeV5,
|
||||
} from '../shared-v5';
|
||||
|
||||
export interface OrderParamsV5 {
|
||||
@@ -51,6 +52,7 @@ export interface AmendOrderParamsV5 {
|
||||
triggerPrice?: string;
|
||||
qty?: string;
|
||||
price?: string;
|
||||
tpslMode?: 'Full' | 'Partial';
|
||||
takeProfit?: string;
|
||||
stopLoss?: string;
|
||||
tpTriggerBy?: OrderTriggerByV5;
|
||||
@@ -86,6 +88,7 @@ export interface GetAccountHistoricOrdersParamsV5 {
|
||||
category: CategoryV5;
|
||||
symbol?: string;
|
||||
baseCoin?: string;
|
||||
settleCoin?: string;
|
||||
orderId?: string;
|
||||
orderLinkId?: string;
|
||||
orderFilter?: OrderFilterV5;
|
||||
@@ -102,11 +105,13 @@ export interface CancelAllOrdersParamsV5 {
|
||||
baseCoin?: string;
|
||||
settleCoin?: string;
|
||||
orderFilter?: OrderFilterV5;
|
||||
stopOrderType?: StopOrderTypeV5;
|
||||
}
|
||||
|
||||
export interface BatchOrderParamsV5 {
|
||||
symbol: string;
|
||||
side: OrderSideV5;
|
||||
isLeverage?: 0 | 1;
|
||||
orderType: OrderTypeV5;
|
||||
qty: string;
|
||||
price?: string;
|
||||
|
||||
@@ -163,6 +163,8 @@ export interface OrderbookResponseV5 {
|
||||
a: OrderbookLevelV5[];
|
||||
ts: number;
|
||||
u: number;
|
||||
seq: number;
|
||||
cts: number;
|
||||
}
|
||||
|
||||
export interface TickerLinearInverseV5 {
|
||||
@@ -192,6 +194,7 @@ export interface TickerLinearInverseV5 {
|
||||
preOpenPrice: string;
|
||||
preQty: string;
|
||||
curPreListingPhase: string;
|
||||
basis: string;
|
||||
}
|
||||
|
||||
export interface TickerOptionV5 {
|
||||
@@ -252,6 +255,10 @@ export interface PublicTradeV5 {
|
||||
side: OrderSideV5;
|
||||
time: string;
|
||||
isBlockTrade: boolean;
|
||||
mP?: string;
|
||||
iP?: string;
|
||||
mIv?: string;
|
||||
iv?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -279,6 +286,7 @@ export interface HistoricalVolatilityV5 {
|
||||
|
||||
export interface InsuranceDataV5 {
|
||||
coin: string;
|
||||
symbols: string;
|
||||
balance: string;
|
||||
value: string;
|
||||
}
|
||||
@@ -299,6 +307,7 @@ export interface RiskLimitV5 {
|
||||
isLowestRisk: 0 | 1;
|
||||
maxLeverage: string;
|
||||
mmDeduction: string;
|
||||
nextPageCursor?: string;
|
||||
}
|
||||
|
||||
/** @deprecated use DeliveryPriceV5 instead */
|
||||
|
||||
@@ -108,6 +108,7 @@ export interface ExecutionV5 {
|
||||
underlyingPrice?: string;
|
||||
blockTradeId?: string;
|
||||
closedSize?: string;
|
||||
seq: number;
|
||||
}
|
||||
|
||||
export interface ClosedPnLV5 {
|
||||
|
||||
@@ -107,5 +107,7 @@ export interface SpotBorrowCheckResultV5 {
|
||||
side: OrderSideV5;
|
||||
maxTradeQty: string;
|
||||
maxTradeAmount: string;
|
||||
spotMaxTradeQty: string;
|
||||
spotMaxTradeAmount: string;
|
||||
borrowCoin: string;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,10 @@ export type StopOrderTypeV5 =
|
||||
| 'Stop'
|
||||
| 'PartialTakeProfit'
|
||||
| 'PartialStopLoss'
|
||||
| 'tpslOrder';
|
||||
| 'tpslOrder'
|
||||
| 'OcoOrder'
|
||||
| 'MmRateClose'
|
||||
| 'BidirectionalTpslOrder';
|
||||
|
||||
/**
|
||||
* Position index. Used to identify positions in different position modes.
|
||||
|
||||
Reference in New Issue
Block a user