Merge pull request #453 from JJ-Cro/updateOptionTicker

feat(4.1.10): add new WSTickerOptionV5 and WSTickerSpotV5 interfaces for enhanced websocket event handling
This commit is contained in:
Tiago
2025-06-07 11:48:56 +01:00
committed by GitHub
3 changed files with 47 additions and 4 deletions

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "bybit-api", "name": "bybit-api",
"version": "4.1.9", "version": "4.1.10",
"lockfileVersion": 2, "lockfileVersion": 2,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "bybit-api", "name": "bybit-api",
"version": "4.1.9", "version": "4.1.10",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"axios": "^1.7.9", "axios": "^1.7.9",

View File

@@ -1,6 +1,6 @@
{ {
"name": "bybit-api", "name": "bybit-api",
"version": "4.1.9", "version": "4.1.10",
"description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@@ -106,6 +106,9 @@ export type WSTradeEventV5 = WSPublicTopicEventV5<
WSTradeV5[] WSTradeV5[]
>; >;
/**
* WSTickerV5 is the data structure for the "linear" ticker channel
* */
export interface WSTickerV5 { export interface WSTickerV5 {
symbol: string; symbol: string;
tickDirection: string; tickDirection: string;
@@ -136,10 +139,50 @@ export interface WSTickerV5 {
curPreListingPhase?: string; curPreListingPhase?: string;
} }
export interface WSTickerOptionV5 {
symbol: string;
bidPrice: string;
bidSize: string;
bidIv: string;
askPrice: string;
askSize: string;
askIv: string;
lastPrice: string;
highPrice24h: string;
lowPrice24h: string;
markPrice: string;
indexPrice: string;
markPriceIv: string;
underlyingPrice: string;
openInterest: string;
turnover24h: string;
volume24h: string;
totalVolume: string;
totalTurnover: string;
delta: string;
gamma: string;
vega: string;
theta: string;
predictedDeliveryPrice: string;
change24h: string;
}
export interface WSTickerSpotV5 {
symbol: string;
lastPrice: string;
highPrice24h: string;
lowPrice24h: string;
prevPrice24h: string;
volume24h: string;
turnover24h: string;
price24hPcnt: string;
usdIndexPrice: string;
}
export type WSTickerEventV5 = WSPublicTopicEventV5< export type WSTickerEventV5 = WSPublicTopicEventV5<
string, string,
'snapshot' | 'delta', 'snapshot' | 'delta',
WSTickerV5 WSTickerV5 | WSTickerOptionV5 | WSTickerSpotV5
>; >;
export interface WSKlineV5 { export interface WSKlineV5 {