From 1abc2425e438209a27a4e710af1ed75b3db3cfd1 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 10 Feb 2025 14:03:08 +0100 Subject: [PATCH 1/5] feat(v3.10.32): add params for GetDeliveryRecord, fixed e2e tests --- .github/workflows/e2etest.yml | 23 +++++++++++------------ package-lock.json | 4 ++-- package.json | 2 +- src/types/request/v5-asset.ts | 2 ++ 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 38ef71c..9518c15 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -1,16 +1,12 @@ -name: 'Build & Test' +name: E2ETests # Changed to match KuCoin naming -on: [push] - -# on: -# # pull_request: -# # branches: -# # - "master" -# push: -# branches: +on: + push: + pull_request: # Added pull_request trigger + workflow_dispatch: # Added manual trigger option jobs: - build: + E2ETests: # Changed job ID to match KuCoin name: 'Build & Test' runs-on: ubuntu-latest @@ -30,8 +26,11 @@ jobs: - name: Build run: npm run build - - name: Test - run: npm run test + - name: Test Public API Calls # Split test command into public and private + run: npm run test -- public.test.ts + + - name: Test Private API Calls # Added separate step for private API tests + run: npm run test -- private.test.ts env: API_KEY_COM: ${{ secrets.API_KEY_COM }} API_SECRET_COM: ${{ secrets.API_SECRET_COM }} diff --git a/package-lock.json b/package-lock.json index 3f9ed24..d68a2ad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "3.10.31", + "version": "3.10.32", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "3.10.31", + "version": "3.10.32", "license": "MIT", "dependencies": { "axios": "^1.6.6", diff --git a/package.json b/package.json index 35bdc94..f3fc2d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "3.10.31", + "version": "3.10.32", "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/types/request/v5-asset.ts b/src/types/request/v5-asset.ts index 3de59cd..7e22199 100644 --- a/src/types/request/v5-asset.ts +++ b/src/types/request/v5-asset.ts @@ -10,6 +10,8 @@ export interface GetCoinExchangeRecordParamsV5 { export interface GetDeliveryRecordParamsV5 { category: CategoryV5; symbol?: string; + startTime?: number; + endTime?: number; expDate?: string; limit?: number; cursor?: string; From 0a4104dd9158596251fb991e6ed3162079ebbd43 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 10 Feb 2025 14:23:02 +0100 Subject: [PATCH 2/5] fix(): updated test file names --- .github/workflows/e2etest.yml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 9518c15..f95902d 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -26,11 +26,18 @@ jobs: - name: Build run: npm run build - - name: Test Public API Calls # Split test command into public and private - run: npm run test -- public.test.ts + - name: Test Public Read API Calls + run: npm run test -- public.read.test.ts + + - name: Test Private Read API Calls + run: npm run test -- private.read.test.ts + + - name: Test Private Write API Calls + run: npm run test -- private.write.test.ts + + - name: Test Public WS + run: npm run test -- public.ws.test.ts - - name: Test Private API Calls # Added separate step for private API tests - run: npm run test -- private.test.ts env: API_KEY_COM: ${{ secrets.API_KEY_COM }} API_SECRET_COM: ${{ secrets.API_SECRET_COM }} From 5b981d05e31c6d3e8e5ee8909541fef20294f336 Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Mon, 10 Feb 2025 14:53:40 +0100 Subject: [PATCH 3/5] chore(): removed unnecesary comments --- .github/workflows/e2etest.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index f95902d..47d3d62 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -1,12 +1,12 @@ -name: E2ETests # Changed to match KuCoin naming +name: E2ETests on: push: - pull_request: # Added pull_request trigger - workflow_dispatch: # Added manual trigger option + pull_request: + workflow_dispatch: jobs: - E2ETests: # Changed job ID to match KuCoin + E2ETests: name: 'Build & Test' runs-on: ubuntu-latest From c9dbded2a28d375c312c9e355552dee2e7c45b5a Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Mon, 10 Feb 2025 13:57:46 +0000 Subject: [PATCH 4/5] chore(): fix env vars for test split --- .github/workflows/e2etest.yml | 41 ++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/.github/workflows/e2etest.yml b/.github/workflows/e2etest.yml index 47d3d62..e50548c 100644 --- a/.github/workflows/e2etest.yml +++ b/.github/workflows/e2etest.yml @@ -1,12 +1,20 @@ -name: E2ETests +name: E2ETests on: push: - pull_request: - workflow_dispatch: + pull_request: + workflow_dispatch: + +env: + PROXY_ENABLED: ${{ secrets.PROXY_ENABLED }} + PROXY_HOST: ${{ secrets.PROXY_HOST }} + PROXY_PASS: ${{ secrets.PROXY_PASS }} + PROXY_PORT: ${{ secrets.PROXY_PORT }} + PROXY_USER: ${{ secrets.PROXY_USER }} + jobs: - E2ETests: + E2ETests: name: 'Build & Test' runs-on: ubuntu-latest @@ -26,23 +34,20 @@ jobs: - name: Build run: npm run build - - name: Test Public Read API Calls + - name: Test Public Read API Calls run: npm run test -- public.read.test.ts - - name: Test Private Read API Calls + - name: Test Private Read API Calls run: npm run test -- private.read.test.ts - - - name: Test Private Write API Calls - run: npm run test -- private.write.test.ts - - - name: Test Public WS - run: npm run test -- public.ws.test.ts - env: API_KEY_COM: ${{ secrets.API_KEY_COM }} API_SECRET_COM: ${{ secrets.API_SECRET_COM }} - PROXY_ENABLED: ${{ secrets.PROXY_ENABLED }} - PROXY_HOST: ${{ secrets.PROXY_HOST }} - PROXY_PASS: ${{ secrets.PROXY_PASS }} - PROXY_PORT: ${{ secrets.PROXY_PORT }} - PROXY_USER: ${{ secrets.PROXY_USER }} + + - name: Test Private Write API Calls + run: npm run test -- private.write.test.ts + env: + API_KEY_COM: ${{ secrets.API_KEY_COM }} + API_SECRET_COM: ${{ secrets.API_SECRET_COM }} + + - name: Test Public WS + run: npm run test -- public.ws.test.ts From addfd16fa2dcd6ff04a0ef6b8b0c085c679ae7ab Mon Sep 17 00:00:00 2001 From: JJ-Cro Date: Thu, 13 Feb 2025 15:50:49 +0100 Subject: [PATCH 5/5] feat(3.10.33): Updated return types for getSubDepositAddress, createUniversalTransfer and createInternalTransfer --- package-lock.json | 4 ++-- package.json | 2 +- src/rest-client-v5.ts | 28 ++++++++++++++++++++++------ 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index d68a2ad..2fe238b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "3.10.32", + "version": "3.10.33", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "3.10.32", + "version": "3.10.33", "license": "MIT", "dependencies": { "axios": "^1.6.6", diff --git a/package.json b/package.json index f3fc2d9..a7fa092 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "3.10.32", + "version": "3.10.33", "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 0262485..89531ae 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -57,7 +57,7 @@ import { DeleteSubMemberParamsV5, DeliveryPriceV5, DeliveryRecordV5, - DepositAddressResultV5, + DepositAddressChainV5, DepositRecordV5, ExchangeBrokerAccountInfoV5, ExchangeBrokerEarningResultV5, @@ -1305,7 +1305,7 @@ export class RestClientV5 extends BaseRestClient { amount: string, fromAccountType: AccountTypeV5, toAccountType: AccountTypeV5, - ): Promise> { + ): Promise> { return this.postPrivate('/v5/asset/transfer/inter-transfer', { transferId, coin, @@ -1365,7 +1365,7 @@ export class RestClientV5 extends BaseRestClient { */ createUniversalTransfer( params: UniversalTransferParamsV5, - ): Promise> { + ): Promise> { return this.postPrivate('/v5/asset/transfer/universal-transfer', params); } @@ -1464,7 +1464,12 @@ export class RestClientV5 extends BaseRestClient { getMasterDepositAddress( coin: string, chainType?: string, - ): Promise> { + ): Promise< + APIResponseV3WithTime<{ + coin: string; + chains: DepositAddressChainV5[]; + }> + > { return this.getPrivate('/v5/asset/deposit/query-address', { coin, chainType, @@ -1478,7 +1483,12 @@ export class RestClientV5 extends BaseRestClient { coin: string, chainType: string, subMemberId: string, - ): Promise> { + ): Promise< + APIResponseV3WithTime<{ + coin: string; + chains: DepositAddressChainV5; + }> + > { return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { coin, chainType, @@ -1488,6 +1498,7 @@ export class RestClientV5 extends BaseRestClient { /** * Query the deposit address information of SUB account. + * @deprecated Duplicate endpoint - Use getSubDepositAddress() instead * * CAUTION * Can use master UID's api key only @@ -1496,7 +1507,12 @@ export class RestClientV5 extends BaseRestClient { coin: string, chainType: string, subMemberId: string, - ): Promise> { + ): Promise< + APIResponseV3<{ + coin: string; + chains: DepositAddressChainV5; + }> + > { return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { coin, chainType,