Skip to content

feat: add listen key deletion support - #128

Open
AIVensk wants to merge 1 commit into
singlesly:mainfrom
AIVensk:codex/bingx-25-listen-key-deletion
Open

AIVensk wants to merge 1 commit into
singlesly:mainfrom
AIVensk:codex/bingx-25-listen-key-deletion

Conversation

@AIVensk

@AIVensk AIVensk commented Sep 28, 2026

Copy link
Copy Markdown

Closes #25.

Changes

  • Add ListenKeyService.deleteListenKey(listenKey, account) and a new DELETE endpoint for /openApi/user/auth/userDataStream.
  • Export BingxDeleteListenKeyEndpoint through the public package entry point. The endpoint uses direct imports to keep public entry-point loading safe.
  • Add nine regression tests for the public export, method/path/parameters, API key and signature, service completion/error propagation, and existing key generation.
  • Mark listen-key deletion as implemented in the README.

Verification

Passed locally:

npm test -- --runInBand --runTestsByPath src/bingx/endpoints/bingx-delete-listen-key-endpoint.spec.ts src/bingx-client/services/listen-key.service.delete.spec.ts src/bingx-client/bingx-api.client.spec.ts src/nest-bingx/nest-bingx.module.spec.ts
npx --no-install tsc --noEmit --incremental false
npm run build
npx --no-install eslint src/bingx-client/services/listen-key.service.ts src/bingx-client/services/listen-key.service.delete.spec.ts src/bingx/endpoints/index.ts src/bingx/endpoints/bingx-delete-listen-key-endpoint.ts src/bingx/endpoints/bingx-delete-listen-key-endpoint.spec.ts
git diff --check

The focused run passes 18 tests across four suites, including all nine new tests. The tests use synthetic credentials and mocked executors.

Existing baseline failures

I also compared the broader local WebSocket/unit suite against clean upstream e10420ed2294be869424088f5eb699ecff6e4a82, excluding the credential-dependent exchange playground:

timeout 35s npm test -- --runInBand --testPathIgnorePatterns=/playground/
  • This branch: 31 passed, two failed.
  • Unchanged upstream: 22 passed, the same two failed.
  • Both runs encounter the account-WebSocket reconnect timeout and order-push undefined-socket failures, then lingering handles and the 35-second timeout.
  • Whole-project ESLint reports the same existing unused OrderTypeEnum import in src/bingx/interfaces/websocket-event.ts:1 on both revisions. All changed TypeScript files pass lint.

Implementation and review used AI assistance; the checks above were actually executed.

Related work

Renewal is implemented separately in #127 for paid ticket #24. Both branches independently target current main; after either PR merges, the other will need rebasing to preserve both service methods, exports and README entries. Their new service tests use distinct filenames so both suites can coexist.

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