feat(#261): add new pre-upgrade endpoints
This commit is contained in:
@@ -69,6 +69,9 @@ import {
|
|||||||
GetOpenInterestParamsV5,
|
GetOpenInterestParamsV5,
|
||||||
GetOptionDeliveryPriceParamsV5,
|
GetOptionDeliveryPriceParamsV5,
|
||||||
GetOrderbookParamsV5,
|
GetOrderbookParamsV5,
|
||||||
|
GetPreUpgradeClosedPnlParamsV5,
|
||||||
|
GetPreUpgradeOrderHistoryParamsV5,
|
||||||
|
GetPreUpgradeTradeHistoryParamsV5,
|
||||||
GetPremiumIndexPriceKlineParamsV5,
|
GetPremiumIndexPriceKlineParamsV5,
|
||||||
GetPublicTradingHistoryParamsV5,
|
GetPublicTradingHistoryParamsV5,
|
||||||
GetRiskLimitParamsV5,
|
GetRiskLimitParamsV5,
|
||||||
@@ -656,6 +659,52 @@ export class RestClientV5 extends BaseRestClient {
|
|||||||
return this.getPrivate('/v5/position/closed-pnl', params);
|
return this.getPrivate('/v5/position/closed-pnl', params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
****** Pre-upgrade APIs
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get those orders which occurred before you upgrade the account to Unified account.
|
||||||
|
*
|
||||||
|
* For now, it only supports to query USDT perpetual, USDC perpetual, Inverse perpetual and futures.
|
||||||
|
*
|
||||||
|
* - can get all status in 7 days
|
||||||
|
* - can only get filled orders beyond 7 days
|
||||||
|
*/
|
||||||
|
getPreUpgradeOrderHistory(
|
||||||
|
params: GetPreUpgradeOrderHistoryParamsV5,
|
||||||
|
): Promise<APIResponseV3WithTime<CategoryCursorListV5<AccountOrderV5[]>>> {
|
||||||
|
return this.getPrivate('/v5/pre-upgrade/order/history', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get users' execution records which occurred before you upgrade the account to Unified account, sorted by execTime in descending order
|
||||||
|
*
|
||||||
|
* For now, it only supports to query USDT perpetual, Inverse perpetual and futures.
|
||||||
|
*
|
||||||
|
* - You may have multiple executions in a single order.
|
||||||
|
* - You can query by symbol, baseCoin, orderId and orderLinkId, and if you pass multiple params,
|
||||||
|
* the system will process them according to this priority: orderId > orderLinkId > symbol > baseCoin.
|
||||||
|
*/
|
||||||
|
getPreUpgradeTradeHistory(
|
||||||
|
params: GetPreUpgradeTradeHistoryParamsV5,
|
||||||
|
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ExecutionV5[]>>> {
|
||||||
|
return this.getPrivate('/v5/pre-upgrade/execution/list', params);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query user's closed profit and loss records. The results are sorted by createdTime in descending order.
|
||||||
|
*
|
||||||
|
* For now, it only supports to query USDT perpetual, Inverse perpetual and futures.
|
||||||
|
*/
|
||||||
|
getPreUpgradeClosedPnl(
|
||||||
|
params: GetPreUpgradeClosedPnlParamsV5,
|
||||||
|
): Promise<APIResponseV3WithTime<CategoryCursorListV5<ClosedPnLV5[]>>> {
|
||||||
|
return this.getPrivate('/v5/pre-upgrade/position/closed-pnl', params);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
****** Account APIs
|
****** Account APIs
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ export * from './v5-account';
|
|||||||
export * from './v5-asset';
|
export * from './v5-asset';
|
||||||
export * from './v5-market';
|
export * from './v5-market';
|
||||||
export * from './v5-position';
|
export * from './v5-position';
|
||||||
|
export * from './v5-pre-upgrade';
|
||||||
export * from './v5-trade';
|
export * from './v5-trade';
|
||||||
export * from './v5-user';
|
export * from './v5-user';
|
||||||
export * from './v5-spot-leverage-token';
|
export * from './v5-spot-leverage-token';
|
||||||
|
|||||||
37
src/types/request/v5-pre-upgrade.ts
Normal file
37
src/types/request/v5-pre-upgrade.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
import { ExecTypeV5 } from '../v5-shared';
|
||||||
|
|
||||||
|
export interface GetPreUpgradeOrderHistoryParamsV5 {
|
||||||
|
category: 'linear' | 'inverse';
|
||||||
|
symbol?: string;
|
||||||
|
baseCoin?: string;
|
||||||
|
orderId?: string;
|
||||||
|
orderLinkId?: string;
|
||||||
|
orderFilter?: 'Order' | 'StopOrder';
|
||||||
|
orderStatus?: string;
|
||||||
|
startTime?: number;
|
||||||
|
endTime?: number;
|
||||||
|
limit?: number;
|
||||||
|
cursor?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetPreUpgradeTradeHistoryParamsV5 {
|
||||||
|
category: 'linear' | 'inverse';
|
||||||
|
symbol?: string;
|
||||||
|
orderId?: string;
|
||||||
|
orderLinkId?: string;
|
||||||
|
baseCoin?: string;
|
||||||
|
startTime?: number;
|
||||||
|
endTime?: number;
|
||||||
|
execType?: ExecTypeV5;
|
||||||
|
limit?: number;
|
||||||
|
cursor?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface GetPreUpgradeClosedPnlParamsV5 {
|
||||||
|
category: 'linear' | 'inverse';
|
||||||
|
symbol: string;
|
||||||
|
startTime?: number;
|
||||||
|
endTime?: number;
|
||||||
|
limit?: number;
|
||||||
|
cursor?: string;
|
||||||
|
}
|
||||||
@@ -94,6 +94,7 @@ export interface ExecutionV5 {
|
|||||||
indexPrice: string;
|
indexPrice: string;
|
||||||
underlyingPrice?: string;
|
underlyingPrice?: string;
|
||||||
blockTradeId?: string;
|
blockTradeId?: string;
|
||||||
|
closedSize?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ClosedPnLV5 {
|
export interface ClosedPnLV5 {
|
||||||
|
|||||||
Reference in New Issue
Block a user