Merge pull request #211 from tiagosiebler/typefix

v3.3.7: fix nesting in contract list result type
This commit is contained in:
Tiago
2022-12-28 14:47:51 +00:00
committed by GitHub
3 changed files with 7 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "bybit-api",
"version": "3.3.6",
"version": "3.3.7",
"description": "Complete & robust node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & integration tests.",
"main": "lib/index.js",
"types": "lib/index.d.ts",

View File

@@ -24,6 +24,7 @@ import {
PaginatedResult,
ContractHistoricOrder,
ContractSymbolTicker,
ContractListResult,
} from './types';
import { REST_CLIENT_TYPE_ENUM } from './util';
import BaseRestClient from './util/BaseRestClient';
@@ -70,7 +71,7 @@ export class ContractClient extends BaseRestClient {
getSymbolTicker(
category: UMCategory | '',
symbol?: string
): Promise<APIResponseV3<ContractSymbolTicker[]>> {
): Promise<APIResponseV3<ContractListResult<ContractSymbolTicker[]>>> {
return this.get('/derivatives/v3/public/tickers', { category, symbol });
}

View File

@@ -2,6 +2,10 @@ export interface PaginatedResult<TList = any> {
nextPageCursor: string;
list: TList[];
}
export interface ContractListResult<TList = any> {
category: string;
list: TList[];
}
export interface ContractHistoricOrder {
symbol: string;