From caf205fe3395a84f78b5d418183f07809b43ed43 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Thu, 23 Feb 2023 12:15:47 +0000 Subject: [PATCH] v3.5.0: release v5 rest client for bybit APIs --- src/rest-client-v5.ts | 24 +++++++++++++----------- src/types/request/v5-market.ts | 2 +- src/types/response/v5-trade.ts | 10 +++++----- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 58d4c0a..4128779 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -12,12 +12,12 @@ import { ApiKeyInfoV5, AssetInfoV5, BatchAmendOrderParamsV5, - BatchAmendOrderResult, + BatchAmendOrderResultV5, BatchCancelOrderParamsV5, - BatchCancelOrderResult, + BatchCancelOrderResultV5, + BatchCreateOrderResultV5, BatchOrderParamsV5, - BatchOrderResult, - BatchOrdersResult, + BatchOrdersResponseV5, BorrowHistoryRecordV5, CancelAllOrdersParamsV5, CancelOrderParamsV5, @@ -63,7 +63,7 @@ import { GetOpenInterestParamsV5, GetOptionDeliveryPriceParamsV5, GetOrderbookParamsV5, - GetPremiumIndexPriceKlineParams, + GetPremiumIndexPriceKlineParamsV5, GetPublicTradingHistoryParamsV5, GetRiskLimitParamsV5, GetSettlementRecordParamsV5, @@ -105,7 +105,7 @@ import { SetTPSLModeParamsV5, SetTradingStopParamsV5, SettlementRecordV5, - SpotBorrowCheckResult, + SpotBorrowCheckResultV5, SpotLeveragedTokenOrderHistoryV5, SubMemberV5, SwitchIsolatedMarginParamsV5, @@ -205,7 +205,7 @@ export class RestClientV5 extends BaseRestClient { * Covers: Linear contract */ getPremiumIndexPriceKline( - params: GetPremiumIndexPriceKlineParams + params: GetPremiumIndexPriceKlineParamsV5 ): Promise< APIResponseV3WithTime> > { @@ -403,7 +403,9 @@ export class RestClientV5 extends BaseRestClient { batchSubmitOrders( category: 'option', orders: BatchOrderParamsV5[] - ): Promise>> { + ): Promise< + APIResponseV3WithTime> + > { return this.postPrivate('/v5/order/create-batch', { category, request: orders, @@ -421,7 +423,7 @@ export class RestClientV5 extends BaseRestClient { category: 'option', orders: BatchAmendOrderParamsV5[] ): Promise< - APIResponseV3WithTime> + APIResponseV3WithTime> > { return this.postPrivate('/v5/order/amend-batch', { category, @@ -440,7 +442,7 @@ export class RestClientV5 extends BaseRestClient { category: 'option', orders: BatchCancelOrderParamsV5[] ): Promise< - APIResponseV3WithTime> + APIResponseV3WithTime> > { return this.postPrivate('/v5/order/cancel-batch', { category, @@ -456,7 +458,7 @@ export class RestClientV5 extends BaseRestClient { getSpotBorrowCheck( symbol: string, side: OrderSideV5 - ): Promise> { + ): Promise> { return this.getPrivate('/v5/order/spot-borrow-check', { category: 'spot', symbol, diff --git a/src/types/request/v5-market.ts b/src/types/request/v5-market.ts index dd4e512..9b118bb 100644 --- a/src/types/request/v5-market.ts +++ b/src/types/request/v5-market.ts @@ -28,7 +28,7 @@ export interface GetIndexPriceKlineParamsV5 { limit?: number; } -export interface GetPremiumIndexPriceKlineParams { +export interface GetPremiumIndexPriceKlineParamsV5 { category: 'linear'; symbol: string; interval: KlineIntervalV3; diff --git a/src/types/response/v5-trade.ts b/src/types/response/v5-trade.ts index c2f3289..f9f4edc 100644 --- a/src/types/response/v5-trade.ts +++ b/src/types/response/v5-trade.ts @@ -53,7 +53,7 @@ export interface AccountOrderV5 { updatedTime: string; } -export interface BatchOrderResult { +export interface BatchCreateOrderResultV5 { category: CategoryV5; symbol: string; orderId: string; @@ -61,7 +61,7 @@ export interface BatchOrderResult { createAt: string; } -export interface BatchOrdersResult { +export interface BatchOrdersResponseV5 { result: { list: T; }; @@ -73,21 +73,21 @@ export interface BatchOrdersResult { }; } -export interface BatchAmendOrderResult { +export interface BatchAmendOrderResultV5 { category: CategoryV5; symbol: string; orderId: string; orderLinkId: string; } -export interface BatchCancelOrderResult { +export interface BatchCancelOrderResultV5 { category: CategoryV5; symbol: string; orderId: string; orderLinkId: string; } -export interface SpotBorrowCheckResult { +export interface SpotBorrowCheckResultV5 { symbol: string; side: OrderSideV5; maxTradeQty: string;