diff --git a/src/futures-client.ts b/src/futures-client.ts index daa4ffe..1cd2e48 100644 --- a/src/futures-client.ts +++ b/src/futures-client.ts @@ -24,6 +24,7 @@ import { FuturesMarketTrade, FuturesPlanType, FuturesKlineInterval, + FuturesHistoricPositions, } from './types'; import { REST_CLIENT_TYPE_ENUM } from './util'; import BaseRestClient from './util/BaseRestClient'; @@ -316,23 +317,11 @@ export class FuturesClient extends BaseRestClient { }); } - /** Get All historic positions, only supports Query within 3 monthso */ + /** Get All historic positions, only supports Query within 3 months */ getHistoryPositions( - startTime: string, - endTime: string, - productType?: FuturesProductType, - symbol?: string, - pageSize?: number, - lastEndId?: string, + params: FuturesHistoricPositions, ): Promise> { - return this.getPrivate('/api/mix/v1/position/history-position', { - startTime, - endTime, - productType, - symbol, - pageSize, - lastEndId, - }); + return this.getPrivate('/api/mix/v1/position/history-position', params); } /** Get Account Bill */ diff --git a/src/types/request/futures.ts b/src/types/request/futures.ts index 07273c1..865c234 100644 --- a/src/types/request/futures.ts +++ b/src/types/request/futures.ts @@ -88,6 +88,15 @@ export interface NewBatchFuturesOrder { clientOid?: string; } +export interface FuturesHistoricPositions { + startTime: string; + endTime: string; + productType?: FuturesProductType; + symbol?: string; + pageSize?: number; + lastEndId?: string; +} + export interface FuturesPagination { startTime?: string; endTime?: string;