Skip to content

Add market depth and kline websocket subscriptions#109

Open
zaixincheng174-ai wants to merge 2 commits into
singlesly:mainfrom
zaixincheng174-ai:codex/market-depth-kline-91-92
Open

Add market depth and kline websocket subscriptions#109
zaixincheng174-ai wants to merge 2 commits into
singlesly:mainfrom
zaixincheng174-ai:codex/market-depth-kline-91-92

Conversation

@zaixincheng174-ai
Copy link
Copy Markdown

/claim #91
/claim #92

Closes #91
Closes #92

Summary

  • add typed market depth and K-Line websocket data types to the market socket event model
  • expose marketDepth$ and kline$ streams on BingxMarketSocketStream
  • add subscribeMarketDepth(...) and subscribeKline(...) helpers while preserving the existing generic subscribe(...) API
  • export the new public market websocket types
  • mark the README market depth and K-Line websocket features as supported

Validation

  • npx jest src/bingx-socket/bingx-market-socket-subscriptions.spec.ts --runInBand
  • npx eslint src/bingx-socket/bingx-market-socket-stream.ts src/bingx-socket/events/market-websocket-events.ts src/bingx-socket/events/index.ts src/bingx-socket/bingx-market-socket-subscriptions.spec.ts
  • npx prettier --check src/bingx-socket/bingx-market-socket-stream.ts src/bingx-socket/events/market-websocket-events.ts src/bingx-socket/events/index.ts src/bingx-socket/bingx-market-socket-subscriptions.spec.ts
  • git diff --check
  • npm run build

Disclosure

Prepared with AI assistance and locally validated.

@zaixincheng174-ai
Copy link
Copy Markdown
Author

zaixincheng174-ai commented May 12, 2026

Follow-up pushed in 3fbb8f6: aligned the market depth stream name with the current BingX swapV2 websocket docs. The docs list depth subscriptions as <symbol>@depth<level> (for example BTC-USDT@depth5, BTC-USDT@depth20, BTC-USDT@depth100), so I removed the unsupported interval suffix from subscribeMarketDepth(...) and its public depth data type. K-Line remains unchanged because swapV2 docs use BTC-USDT@kline_1m and the existing interval union matches that format.

Validation:

  • npm test -- --runInBand --forceExit bingx-market-socket-stream.spec.ts bingx-market-socket-subscriptions.spec.ts
  • npm run build
  • npx eslint src/bingx-socket/bingx-market-socket-stream.ts src/bingx-socket/events/market-websocket-events.ts src/bingx-socket/events/index.ts src/bingx-socket/bingx-market-socket-subscriptions.spec.ts
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement K-Line websocket subscription Implement market depth websocket subscription

1 participant