From 331756d47e287c9b3c0e8244b6087050551ed842 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 14 Jul 2025 12:01:41 +0200 Subject: [PATCH 1/3] chore(v4.1.15): marked removed functions for deprecation, updated tests --- package-lock.json | 4 ++-- package.json | 2 +- src/rest-client-v5.ts | 10 ++++++++++ test/v5/private.write.test.ts | 35 ----------------------------------- 4 files changed, 13 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 826965c..85802d4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "4.1.14", + "version": "4.1.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "4.1.14", + "version": "4.1.15", "license": "MIT", "dependencies": { "axios": "^1.7.9", diff --git a/package.json b/package.json index 23dbd66..a49b471 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "4.1.14", + "version": "4.1.15", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index a9082bf..c0ab651 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -2143,6 +2143,8 @@ export class RestClientV5 extends BaseRestClient { /** * Query leverage token information + * + * @deprecated */ getLeveragedTokenInfo( ltCoin?: string, @@ -2152,6 +2154,8 @@ export class RestClientV5 extends BaseRestClient { /** * Get leverage token market information. + * + * @deprecated */ getLeveragedTokenMarket( ltCoin: string, @@ -2161,6 +2165,8 @@ export class RestClientV5 extends BaseRestClient { /** * This endpoint allows you to purchase a leveraged token with a specified amount. + * + * @deprecated */ purchaseSpotLeveragedToken( params: PurchaseSpotLeveragedTokenParamsV5, @@ -2170,6 +2176,8 @@ export class RestClientV5 extends BaseRestClient { /** * Redeem leveraged token. + * + * @deprecated */ redeemSpotLeveragedToken( params: RedeemSpotLeveragedTokenParamsV5, @@ -2179,6 +2187,8 @@ export class RestClientV5 extends BaseRestClient { /** * Get purchase or redemption history + * + * @deprecated */ getSpotLeveragedTokenOrderHistory( params?: GetSpotLeveragedTokenOrderHistoryParamsV5, diff --git a/test/v5/private.write.test.ts b/test/v5/private.write.test.ts index d115116..21e752f 100644 --- a/test/v5/private.write.test.ts +++ b/test/v5/private.write.test.ts @@ -432,41 +432,6 @@ describe('Private WRITE V5 REST API Endpoints', () => { }); }); - describe('Spot Leverage Token APIs', () => { - let leverageToken: LeverageTokenInfoV5; - - beforeAll(async () => { - const tokenResult = await api.getLeveragedTokenInfo(); - leverageToken = tokenResult.result.list[0]; - }); - - it('purchaseSpotLeveragedToken()', async () => { - expect( - await api.purchaseSpotLeveragedToken({ - amount: '100', - ltCoin: leverageToken.ltCoin, - }), - ).toMatchObject({ - // ...successResponseObjectV3(), - retCode: 175025, - // retMsg: '', - }); - }); - - it('redeemSpotLeveragedToken()', async () => { - expect( - await api.redeemSpotLeveragedToken({ - quantity: '100', - ltCoin: leverageToken.ltCoin, - }), - ).toMatchObject({ - // ...successResponseObjectV3(), - retCode: 175025, - // retMsg: '', - }); - }); - }); - describe('Spot Margin APIs', () => { it('toggleSpotMarginTrade()', async () => { expect(await api.toggleSpotMarginTrade('1')).toMatchObject({ From e16b0f88e66211361cd742509ffdfa14ef0253b5 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 14 Jul 2025 12:10:47 +0200 Subject: [PATCH 2/3] chore(): remove unused imports --- test/v5/private.write.test.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/test/v5/private.write.test.ts b/test/v5/private.write.test.ts index 21e752f..996a225 100644 --- a/test/v5/private.write.test.ts +++ b/test/v5/private.write.test.ts @@ -1,6 +1,5 @@ import { API_ERROR_CODE, - LeverageTokenInfoV5, OrderSideV5, OrderTypeV5, RestClientV5, From 0ece9c8908b3dbf7e38f5b7f14f0b5fcc980a6c3 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 14 Jul 2025 13:30:53 +0200 Subject: [PATCH 3/3] chore(): remove deprecated functions from SDK --- src/rest-client-v5.ts | 71 ------------------------------------------- 1 file changed, 71 deletions(-) diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index c0ab651..230a406 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -127,7 +127,6 @@ import { GetRepaymentHistoryParamsV5, GetRiskLimitParamsV5, GetSettlementRecordParamsV5, - GetSpotLeveragedTokenOrderHistoryParamsV5, GetSpreadInstrumentsInfoParamsV5, GetSpreadOpenOrdersParamsV5, GetSpreadOrderHistoryParamsV5, @@ -147,8 +146,6 @@ import { InternalDepositRecordV5, InternalTransferRecordV5, IssueVoucherParamsV5, - LeverageTokenInfoV5, - LeveragedTokenMarketResultV5, LoanLTVAdjustmentHistoryV5, LongShortRatioV5, MMPModifyParamsV5, @@ -184,10 +181,6 @@ import { PreUpgradeTransaction, PreUpgradeUSDCSessionSettlement, PublicTradeV5, - PurchaseSpotLeveragedTokenParamsV5, - PurchaseSpotLeveragedTokenResultV5, - RedeemSpotLeveragedTokenParamsV5, - RedeemSpotLeveragedTokenResultV5, RepayLiabilityParamsV5, RepayLiabilityResultV5, RepaymentHistoryV5, @@ -203,7 +196,6 @@ import { SetTradingStopParamsV5, SettlementRecordV5, SpotBorrowCheckResultV5, - SpotLeveragedTokenOrderHistoryV5, SpotMarginStateV5, SpreadInstrumentInfoV5, SpreadOpenOrderV5, @@ -2135,69 +2127,6 @@ export class RestClientV5 extends BaseRestClient { return this.getPrivate('/v5/user/aff-customer-info', params); } - /** - * - ****** Spot Leverage Token APIs - * - */ - - /** - * Query leverage token information - * - * @deprecated - */ - getLeveragedTokenInfo( - ltCoin?: string, - ): Promise> { - return this.get('/v5/spot-lever-token/info', { ltCoin }); - } - - /** - * Get leverage token market information. - * - * @deprecated - */ - getLeveragedTokenMarket( - ltCoin: string, - ): Promise> { - return this.get('/v5/spot-lever-token/reference', { ltCoin }); - } - - /** - * This endpoint allows you to purchase a leveraged token with a specified amount. - * - * @deprecated - */ - purchaseSpotLeveragedToken( - params: PurchaseSpotLeveragedTokenParamsV5, - ): Promise> { - return this.postPrivate('/v5/spot-lever-token/purchase', params); - } - - /** - * Redeem leveraged token. - * - * @deprecated - */ - redeemSpotLeveragedToken( - params: RedeemSpotLeveragedTokenParamsV5, - ): Promise> { - return this.postPrivate('/v5/spot-lever-token/redeem', params); - } - - /** - * Get purchase or redemption history - * - * @deprecated - */ - getSpotLeveragedTokenOrderHistory( - params?: GetSpotLeveragedTokenOrderHistoryParamsV5, - ): Promise< - APIResponseV3WithTime<{ list: SpotLeveragedTokenOrderHistoryV5[] }> - > { - return this.getPrivate('/v5/spot-lever-token/order-record', params); - } - /** * ****** Spot Margin Trade APIs (UTA)