From 50d8993ca229c82c5a54b4fb367e56a9cf04cb04 Mon Sep 17 00:00:00 2001 From: tiagosiebler Date: Mon, 4 Mar 2024 11:28:17 +0000 Subject: [PATCH] v3.9.6: feat(#322) add nextPageCursor type via generic --- package-lock.json | 4 ++-- package.json | 2 +- src/rest-client-v5.ts | 5 +++-- src/types/v5-shared.ts | 10 ++++++++++ 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index d2abfd23..7e6cfcd5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "3.9.5", + "version": "3.9.6", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "3.9.5", + "version": "3.9.6", "license": "MIT", "dependencies": { "axios": "^1.6.6", diff --git a/package.json b/package.json index b7194e03..08eba911 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "3.9.5", + "version": "3.9.6", "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 d3fb058f..56141260 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -38,6 +38,7 @@ import { CreateSubMemberParamsV5, CreateSubMemberResultV5, CursorListV5, + CursorRowsV5, DeleteSubMemberParamsV5, DeliveryPriceV5, DeliveryRecordV5, @@ -1206,7 +1207,7 @@ export class RestClientV5 extends BaseRestClient { */ getWithdrawalRecords( params?: GetWithdrawalRecordsParamsV5, - ): Promise> { + ): Promise> { return this.getPrivate('/v5/asset/withdraw/query-record', params); } @@ -1358,7 +1359,7 @@ export class RestClientV5 extends BaseRestClient { /** * Delete a sub UID. Before deleting the UID, please make sure there are no assets. - * + * * TIP: * The API key must have one of the permissions to be allowed to call the following API endpoint. * - master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal" diff --git a/src/types/v5-shared.ts b/src/types/v5-shared.ts index 68d2107e..4c7b72cb 100644 --- a/src/types/v5-shared.ts +++ b/src/types/v5-shared.ts @@ -200,6 +200,16 @@ export interface CursorListV5 { list: T; } +/** + * A wrapper type for any responses that have a "nextPageCursor" property, and a "rows" property with an array of elements + * + * ```{ nextPageCursor: "something", rows: someData[] }``` + */ +export interface CursorRowsV5 { + nextPageCursor: string; + rows: T; +} + export interface CategoryListV5< T extends unknown[], TCategory extends CategoryV5,