add position v5 rest apis

This commit is contained in:
tiagosiebler
2023-02-16 12:25:25 +00:00
parent 47e1255159
commit 71c6c9b6a5
4 changed files with 276 additions and 6 deletions

View File

@@ -1,4 +1,4 @@
import { CategoryV5 } from '../v5-shared';
import { CategoryV5, TPSLModeV5 } from '../v5-shared';
export interface PositionInfoParamsV5 {
category: CategoryV5;
@@ -8,3 +8,81 @@ export interface PositionInfoParamsV5 {
limit?: number;
cursor?: string;
}
export interface SetLeverageParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
buyLeverage: string;
sellLeverage: string;
}
export interface SwitchIsolatedMarginParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
tradeMode: 0 | 1;
buyLeverage: string;
sellLeverage: string;
}
export interface SetTPSLModeParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
tpSlMode: TPSLModeV5;
}
export interface SwitchPositionModeParamsV5 {
category: 'linear' | 'inverse';
symbol?: string;
coin?: string;
mode: 0 | 3;
}
export interface SetRiskLimitParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
riskId: number;
positionIdx?: number;
}
export interface SetTradingStopParamsV5 {
symbol: string;
category: CategoryV5;
takeProfit?: string;
stopLoss?: string;
trailingStop?: string;
tpTriggerBy?: string;
slTriggerBy?: string;
activePrice?: string;
tpSize?: string;
slSize?: string;
positionIdx: number;
}
export interface SetAutoAddMarginParamsV5 {
category: 'linear';
symbol: string;
autoAddMargin: 0 | 1;
positionIdx?: number;
}
export interface GetExecutionListParamsV5 {
category: CategoryV5;
symbol?: string;
orderId?: string;
orderLinkId?: string;
baseCoin?: string;
startTime?: number;
endTime?: number;
execType?: string;
limit?: number;
cursor?: string;
}
export interface GetClosedPnLParamsV5 {
category: CategoryV5;
symbol?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}