Skip to content

feat: complete listen key renewal support - #127

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

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

Conversation

@AIVensk

@AIVensk AIVensk commented Sep 28, 2026

Copy link
Copy Markdown

Closes #24.

Changes

  • Add ListenKeyService.extendListenKey(listenKey, account) using the existing PUT endpoint.
  • Export BingxExtendListenKeyEndpoint through the public package entry point. Use direct imports inside the endpoint to avoid a circular import when loading that entry point.
  • 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 renewal as implemented in the README.

Verification

Passed locally:

npm test -- --runInBand --runTestsByPath src/bingx/endpoints/bingx-extend-listen-key-endpoint.spec.ts src/bingx-client/services/listen-key.service.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.spec.ts src/bingx/endpoints/index.ts src/bingx/endpoints/bingx-extend-listen-key-endpoint.ts src/bingx/endpoints/bingx-extend-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.

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 listen key validity period

1 participant