From 84f3849ee65e464d2e560b2910ec4201d128d968 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Tue, 10 Dec 2024 16:09:27 +0100 Subject: [PATCH] chore(): added V2 suffixes --- src/types/request/v2/broker.ts | 12 +++++------ src/types/request/v2/futures.ts | 36 ++++++++++++++++----------------- src/types/request/v2/margin.ts | 30 +++++++++++++-------------- 3 files changed, 39 insertions(+), 39 deletions(-) diff --git a/src/types/request/v2/broker.ts b/src/types/request/v2/broker.ts index b144e14..5655666 100644 --- a/src/types/request/v2/broker.ts +++ b/src/types/request/v2/broker.ts @@ -12,7 +12,7 @@ export interface GetSubAccountsRequestV2 { endTime?: string; } -export type SubAccountPermission = +export type SubAccountPermissionV2 = | 'withdraw' | 'transfer' | 'spot_trade' @@ -21,7 +21,7 @@ export type SubAccountPermission = | 'deposit' | 'margin_trade'; -export type SubAccountLanguage = +export type SubAccountLanguageV2 = | 'en_US' | 'zh_CN' | 'ja_JP' @@ -35,13 +35,13 @@ export type SubAccountLanguage = | 'pt_PT' | 'th_TH'; -export type SubAccountStatus = 'normal' | 'freeze'; +export type SubAccountStatusV2 = 'normal' | 'freeze'; export interface ModifySubRequestV2 { subUid: string; - permList: SubAccountPermission[]; - status: SubAccountStatus; - language?: SubAccountLanguage; + permList: SubAccountPermissionV2[]; + status: SubAccountStatusV2; + language?: SubAccountLanguageV2; } export interface SubWithdrawalRequestV2 { diff --git a/src/types/request/v2/futures.ts b/src/types/request/v2/futures.ts index 5f8ddcb..695ecdb 100644 --- a/src/types/request/v2/futures.ts +++ b/src/types/request/v2/futures.ts @@ -261,7 +261,7 @@ export interface FuturesGetOpenOrdersRequestV2 { limit?: string; } -export type FuturesOrderSource = +export type FuturesOrderSourceV2 = | 'normal' | 'market' | 'profit_market' @@ -287,7 +287,7 @@ export interface FuturesGetHistoryOrdersRequestV2 { symbol?: string; productType: FuturesProductTypeV2; idLessThan?: string; - orderSource?: FuturesOrderSource; + orderSource?: FuturesOrderSourceV2; startTime?: string; endTime?: string; limit?: string; @@ -307,9 +307,9 @@ export interface FuturesCancelAllOrdersRequestV2 { * */ -export type FuturesTriggerType = 'fill_price' | 'mark_price'; +export type FuturesTriggerTypeV2 = 'fill_price' | 'mark_price'; -export type FuturesStpMode = +export type FuturesStpModeV2 = | 'none' | 'cancel_taker' | 'cancel_maker' @@ -321,16 +321,16 @@ export interface FuturesTPSLOrderRequestV2 { symbol: string; planType: FuturesPlanTypeV2; triggerPrice: string; - triggerType?: FuturesTriggerType; + triggerType?: FuturesTriggerTypeV2; executePrice?: string; holdSide: 'long' | 'short' | 'buy' | 'sell'; size: string; rangeRate?: string; clientOid?: string; - stpMode?: FuturesStpMode; + stpMode?: FuturesStpModeV2; } -export type FuturesTriggerPriceType = +export type FuturesTriggerPriceTypeV2 = | 'fill_price' | 'mark_price' | 'index_price'; @@ -353,11 +353,11 @@ export interface FuturesPlanOrderRequestV2 { reduceOnly?: 'YES' | 'NO'; stopSurplusTriggerPrice?: string; stopSurplusExecutePrice?: string; - stopSurplusTriggerType?: FuturesTriggerPriceType; + stopSurplusTriggerType?: FuturesTriggerPriceTypeV2; stopLossTriggerPrice?: string; stopLossExecutePrice?: string; - stopLossTriggerType?: FuturesTriggerPriceType; - stpMode?: FuturesStpMode; + stopLossTriggerType?: FuturesTriggerPriceTypeV2; + stpMode?: FuturesStpModeV2; } export interface FuturesModifyTPSLOrderRequestV2 { @@ -386,10 +386,10 @@ export interface FuturesModifyPlanOrderRequestV2 { newTriggerType?: 'fill_price' | 'mark_price'; newStopSurplusTriggerPrice?: string; newStopSurplusExecutePrice?: string; - newStopSurplusTriggerType?: FuturesTriggerPriceType; + newStopSurplusTriggerType?: FuturesTriggerPriceTypeV2; newStopLossTriggerPrice?: string; newStopLossExecutePrice?: string; - newStopLossTriggerType?: FuturesTriggerPriceType; + newStopLossTriggerType?: FuturesTriggerPriceTypeV2; } export interface FuturesGetPlanOrdersRequestV2 { @@ -404,12 +404,12 @@ export interface FuturesGetPlanOrdersRequestV2 { limit?: string; } -interface FuturesCancelPlanOrderItem { +interface FuturesCancelPlanOrderItemV2 { orderId?: string; clientOid?: string; } -export type FuturesPlanOrderType = +export type FuturesPlanOrderTypeV2 = | 'normal_plan' | 'profit_plan' | 'loss_plan' @@ -418,20 +418,20 @@ export type FuturesPlanOrderType = | 'moving_plan'; export interface FuturesCancelPlanOrderRequestV2 { - orderIdList?: FuturesCancelPlanOrderItem[]; + orderIdList?: FuturesCancelPlanOrderItemV2[]; symbol?: string; productType: FuturesProductTypeV2; marginCoin?: string; - planType?: FuturesPlanOrderType; + planType?: FuturesPlanOrderTypeV2; } -export type FuturesPlanStatus = 'executed' | 'fail_trigger' | 'cancelled'; +export type FuturesPlanStatusV2 = 'executed' | 'fail_trigger' | 'cancelled'; export interface FuturesGetHistoryPlanOrdersRequestV2 { orderId?: string; clientOid?: string; planType: 'normal_plan' | 'track_plan' | 'profit_loss'; - planStatus?: FuturesPlanStatus; + planStatus?: FuturesPlanStatusV2; symbol?: string; productType: FuturesProductTypeV2; idLessThan?: string; diff --git a/src/types/request/v2/margin.ts b/src/types/request/v2/margin.ts index 02e0ba1..d8fc184 100644 --- a/src/types/request/v2/margin.ts +++ b/src/types/request/v2/margin.ts @@ -58,19 +58,19 @@ export interface GetFinancialHistoryRequestV2 { * */ -export type MarginOrderType = 'limit' | 'market'; +export type MarginOrderTypeV2 = 'limit' | 'market'; -export type MarginLoanType = +export type MarginLoanTypeV2 = | 'normal' | 'autoLoan' | 'autoRepay' | 'autoLoanAndRepay'; -export type MarginTimeInForce = 'gtc' | 'post_only' | 'fok' | 'ioc'; +export type MarginTimeInForceV2 = 'gtc' | 'post_only' | 'fok' | 'ioc'; -export type MarginOrderSide = 'buy' | 'sell'; +export type MarginOrderSideV2 = 'buy' | 'sell'; -export type MarginSTPMode = +export type MarginSTPModeV2 = | 'none' | 'cancel_taker' | 'cancel_maker' @@ -78,27 +78,27 @@ export type MarginSTPMode = export interface MarginPlaceOrderRequestV2 { symbol: string; - orderType: MarginOrderType; + orderType: MarginOrderTypeV2; price?: string; - loanType: MarginLoanType; - force: MarginTimeInForce; + loanType: MarginLoanTypeV2; + force: MarginTimeInForceV2; baseSize?: string; quoteSize?: string; clientOid?: string; - side: MarginOrderSide; - stpMode?: MarginSTPMode; + side: MarginOrderSideV2; + stpMode?: MarginSTPModeV2; } export interface MarginBatchOrderEntry { - orderType: MarginOrderType; + orderType: MarginOrderTypeV2; price?: string; - loanType: MarginLoanType; - force: MarginTimeInForce; + loanType: MarginLoanTypeV2; + force: MarginTimeInForceV2; baseSize?: string; quoteSize?: string; clientOid?: string; - side: MarginOrderSide; - stpMode?: MarginSTPMode; + side: MarginOrderSideV2; + stpMode?: MarginSTPModeV2; } export interface MarginBatchOrdersRequestV2 {