v3.3.6: add response type for contract ticker
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "bybit-api",
|
"name": "bybit-api",
|
||||||
"version": "3.3.5",
|
"version": "3.3.6",
|
||||||
"description": "Complete & robust node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & integration tests.",
|
"description": "Complete & robust node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & integration tests.",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "lib/index.d.ts",
|
"types": "lib/index.d.ts",
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import {
|
|||||||
ContractWalletFundRecordRequest,
|
ContractWalletFundRecordRequest,
|
||||||
PaginatedResult,
|
PaginatedResult,
|
||||||
ContractHistoricOrder,
|
ContractHistoricOrder,
|
||||||
|
ContractSymbolTicker,
|
||||||
} from './types';
|
} from './types';
|
||||||
import { REST_CLIENT_TYPE_ENUM } from './util';
|
import { REST_CLIENT_TYPE_ENUM } from './util';
|
||||||
import BaseRestClient from './util/BaseRestClient';
|
import BaseRestClient from './util/BaseRestClient';
|
||||||
@@ -67,9 +68,9 @@ export class ContractClient extends BaseRestClient {
|
|||||||
|
|
||||||
/** Get a symbol price/statistics ticker */
|
/** Get a symbol price/statistics ticker */
|
||||||
getSymbolTicker(
|
getSymbolTicker(
|
||||||
category: UMCategory,
|
category: UMCategory | '',
|
||||||
symbol?: string
|
symbol?: string
|
||||||
): Promise<APIResponseV3<any>> {
|
): Promise<APIResponseV3<ContractSymbolTicker[]>> {
|
||||||
return this.get('/derivatives/v3/public/tickers', { category, symbol });
|
return this.get('/derivatives/v3/public/tickers', { category, symbol });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,3 +33,27 @@ export interface ContractHistoricOrder {
|
|||||||
triggerDirection: number;
|
triggerDirection: number;
|
||||||
positionIdx: number;
|
positionIdx: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface ContractSymbolTicker {
|
||||||
|
symbol: string;
|
||||||
|
bidPrice: string;
|
||||||
|
askPrice: string;
|
||||||
|
lastPrice: string;
|
||||||
|
lastTickDirection: string;
|
||||||
|
prevPrice24h: string;
|
||||||
|
price24hPcnt: string;
|
||||||
|
highPrice24h: string;
|
||||||
|
lowPrice24h: string;
|
||||||
|
prevPrice1h: string;
|
||||||
|
markPrice: string;
|
||||||
|
indexPrice: string;
|
||||||
|
openInterest: string;
|
||||||
|
turnover24h: string;
|
||||||
|
volume24h: string;
|
||||||
|
fundingRate: string;
|
||||||
|
nextFundingTime: string;
|
||||||
|
predictedDeliveryPrice: string;
|
||||||
|
basisRate: string;
|
||||||
|
deliveryFeeRate: string;
|
||||||
|
deliveryTime: string;
|
||||||
|
}
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ export function getWsKeyForTopic(
|
|||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to determine wskey for unified perps topic: "${topic}`
|
`Failed to determine wskey for unified perps topic: "${topic}"`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
case 'contractInverse': {
|
case 'contractInverse': {
|
||||||
|
|||||||
Reference in New Issue
Block a user