feat(v4.1.12): added new endpoints,new ws topic updated types for existing endpoints, added examples for new endpoints, updated endpoint map, bumped version

This commit is contained in:
JJ-Cro
2025-06-25 12:01:02 +02:00
parent 85940cef83
commit 2d7086fda7
11 changed files with 312 additions and 197 deletions

View File

@@ -36,6 +36,7 @@ import {
CategoryListV5,
CategorySymbolListV5,
CategoryV5,
ClosedOptionsPositionV5,
ClosedPnLV5,
CoinExchangeRecordV5,
CoinGreeksV5,
@@ -80,6 +81,7 @@ import {
GetBrokerIssuedVoucherParamsV5,
GetBrokerSubAccountDepositsV5,
GetClassicTransactionLogsParamsV5,
GetClosedOptionsPositionsParamsV5,
GetClosedPnLParamsV5,
GetCoinExchangeRecordParamsV5,
GetCompletedLoanOrderHistoryParamsV5,
@@ -160,6 +162,7 @@ import {
OpenInterestResponseV5,
OptionDeliveryPriceV5,
OrderParamsV5,
OrderPriceLimitV5,
OrderResultV5,
OrderSideV5,
OrderbookResponseV5,
@@ -733,6 +736,13 @@ export class RestClientV5 extends BaseRestClient {
return this.get('/v5/market/account-ratio', params);
}
getOrderPriceLimit(params: {
symbol: string;
category: 'spot' | 'linear' | 'inverse';
}): Promise<APIResponseV3WithTime<OrderPriceLimitV5>> {
return this.get('/v5/order/price-limit', params);
}
/**
*
****** Trade APIs
@@ -1085,6 +1095,26 @@ export class RestClientV5 extends BaseRestClient {
return this.getPrivate('/v5/position/closed-pnl', params);
}
/**
* Get Closed Options Positions
* Query user's closed options positions, sorted by closeTime in descending order
*
* INFO
* Only supports users to query closed options positions in recently 6 months
* Fee and price retain 8 decimal places and do not omit the last 0
*/
getClosedOptionsPositions(
params?: GetClosedOptionsPositionsParamsV5,
): Promise<
APIResponseV3WithTime<{
nextPageCursor: string;
category: string;
list: ClosedOptionsPositionV5[];
}>
> {
return this.getPrivate('/v5/position/get-closed-positions', params);
}
/**
* Move positions between sub-master, master-sub, or sub-sub UIDs.
*

View File

@@ -133,3 +133,12 @@ export interface ConfirmNewRiskLimitParamsV5 {
category: 'linear' | 'inverse';
symbol: string;
}
export interface GetClosedOptionsPositionsParamsV5 {
category: 'option';
symbol?: string;
startTime?: number;
endTime?: number;
limit?: number;
cursor?: string;
}

View File

@@ -19,6 +19,7 @@ export interface DeliveryRecordV5 {
strike: string;
fee: string;
deliveryRpl: string;
entryPrice: string;
}
export interface SettlementRecordV5 {

View File

@@ -332,3 +332,10 @@ export interface LongShortRatioV5 {
sellRatio: string;
timestamp: string;
}
export interface OrderPriceLimitV5 {
symbol: string;
buyLmt: string;
sellLmt: string;
ts: string;
}

View File

@@ -122,6 +122,8 @@ export interface ClosedPnLV5 {
orderType: OrderTypeV5;
execType: ExecTypeV5;
closedSize: string;
openFee: string;
closeFee: string;
cumEntryValue: string;
avgEntryPrice: string;
cumExitValue: string;
@@ -157,3 +159,18 @@ export interface MovePositionHistoryV5 {
updatedAt: number;
rejectParty: '' | 'Taker' | 'Maker' | 'bybit';
}
export interface ClosedOptionsPositionV5 {
symbol: string;
side: 'Buy' | 'Sell';
totalOpenFee: string;
deliveryFee: string;
totalCloseFee: string;
qty: string;
closeTime: number;
avgExitPrice: string;
deliveryPrice: string;
openTime: number;
avgEntryPrice: string;
totalPnl: string;
}

View File

@@ -505,3 +505,15 @@ export type WSInsuranceEventV5 = WSPublicTopicEventV5<
'snapshot' | 'delta',
WSInsuranceV5[]
>;
export interface WSPriceLimitV5 {
symbol: string;
buyLmt: string;
sellLmt: string;
}
export type WSPriceLimitEventV5 = WSPublicTopicEventV5<
string,
'snapshot',
WSPriceLimitV5
>;