Skip to content

feat(listen-key): implement deleteListenKey endpoint and service method - #123

Open
ghzhost wants to merge 1 commit into
singlesly:mainfrom
ghzhost:feat/delete-listen-key
Open

feat(listen-key): implement deleteListenKey endpoint and service method#123
ghzhost wants to merge 1 commit into
singlesly:mainfrom
ghzhost:feat/delete-listen-key

Conversation

@ghzhost

@ghzhost ghzhost commented Aug 14, 2026

Copy link
Copy Markdown

Resolves #25

What

Implements the deleteListenKey method as requested in the paid ticket.

Changes

  • BingxDeleteListenKeyEndpoint — new endpoint class following the same pattern as BingxExtendListenKeyEndpoint, using DELETE on /openApi/user/auth/userDataStream with listenKey as a parameter. Maps to the BingX Delete Listen Key API.

  • ListenKeyService — adds deleteListenKey(listenKey: string, account: AccountInterface): Promise<void> alongside the existing generateListenKey and extendListenKey methods (also added extendListenKey which was missing from the service).

  • endpoints/index.ts — exports the new endpoint class.

  • listen-key.service.spec.ts — 6 unit tests covering all three service methods including endpoint type, HTTP method, path, and parameter assertions.

Tests

PASS src/bingx-client/services/listen-key.service.spec.ts
  ListenKeyService
    generateListenKey
      ✓ executes BingxGenerateListenKeyEndpoint
    extendListenKey
      ✓ executes BingxExtendListenKeyEndpoint with listenKey
    deleteListenKey
      ✓ executes BingxDeleteListenKeyEndpoint with listenKey
      ✓ uses DELETE HTTP method
      ✓ uses the correct BingX endpoint path
      ✓ passes the listenKey in parameters

Tests: 6 passed, 6 total

TypeScript compiles with zero errors (tsc --noEmit).

@ghzhost ghzhost mentioned this pull request Aug 14, 2026
3 tasks
Closes singlesly#25

Implements the DELETE /openApi/user/auth/userDataStream endpoint following
the pattern used by BingxExtendListenKeyEndpoint.

Changes:
- Add BingxDeleteListenKeyEndpoint class with method=delete, correct path,
  and listenKey param signed via DefaultSignatureParameters
- Export new endpoint from src/bingx/endpoints/index.ts
- Add deleteListenKey(listenKey, account) method to ListenKeyService
- Unit tests: 3 tests for endpoint, 1 test for service method (4 passing)
@ghzhost
ghzhost force-pushed the feat/delete-listen-key branch from 165d7f4 to 6b099a9 Compare August 24, 2026 09:46
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 deletion listen key

1 participant