Skip to content

feat(v3.0.0): add V3 REST APIs & WebSockets. add RSA support. Move to Web Crypto API for sign. Publish Hybrid CJS/ESM module. - #77

Merged
tiagosiebler merged 71 commits into
masterfrom
nextAPIV3
Jul 24, 2025
Merged

feat(v3.0.0): add V3 REST APIs & WebSockets. add RSA support. Move to Web Crypto API for sign. Publish Hybrid CJS/ESM module.#77
tiagosiebler merged 71 commits into
masterfrom
nextAPIV3

Conversation

@tiagosiebler

@tiagosiebler tiagosiebler commented Jul 17, 2025

Copy link
Copy Markdown
Member

Summary

  • Add full support for all V3 / Unified Trading Account APIs:
    • REST APIs
    • WebSocket consumers
    • WebSocket APIs (via dedicated WebsocketAPIClient class)
  • Upgrade underlying BaseWSClient architecture, to catch up with upgrades from other SDKs.
  • Backwards compatible V1 & V2, REST APIs & WebSockets.
  • Transition to Web Crypto API for sign. This has better compatibility across browsers than node's native crypto module. For latency sensitive users, you can inject a custom sign method to continue using Node's native crypto for request sign. See the examples/auth/fasterHmacSign.ts example for a demonstration.
  • Add support for RSA keys, for REST & WebSockets.
  • Add full support for demo trading APIs & WebSockets. Simply set demoTrading: true in the REST or WS Client.
  • SDK will be published as hybrid ESM/CJS module. No breaking changes expected from this transition. See Upgrade SDK to hybrid esm/cjs module #81 for changelog.

Breaking Changes

  • The original V1 WebsocketClient has been renamed to WebsocketClientLegacyV1.
    • If available, users should upgrade to using the UTA/V3 WebSockets.
    • V2 WebSockets (via WebsocketClientV2) can be used if you are not ready to upgrade your account to Bitget's Unified Trading Account.
  • The WebsocketClient's requestOptions parameter now represents RestClientOptions, consistent with our other SDKs.
    • The "agent" parameter for WS Client is now available under separate wsOptions object in WSClientConfigurableOptions.
  • The injectable custom logger has been simplified to 3 basic logging levels, consistent with our other SDKs.
  • Not a breaking change but the underlying sign is now generated using Web Crypto API. More universal but slightly slower than node's native crypto module. Refer to fasterHmacSign above, if you're latency sensitive.

Additional Information

PR Checklist

As part of the PR, make sure you have:

  • No breaking changes / documented all breaking changes clearly.
  • Updated & checked that all tests pass.
  • Updated the endpoint map (optional, if you know how).
  • Increased the version number in the package.json
  • Checked npm install runs without issue.
  • Included the package-lock.json, if it changed after npm install
  • Checked npm run build runs without issue.

JJ-Cro and others added 30 commits July 1, 2025 12:18
feat(): support for Bitget Rest Client V3
feat(): added http keepAlive setting
feat(): added all endpoints
chore(): update eslint config and bump dependencies
@tiagosiebler tiagosiebler changed the title feat(v3.0.0): add V3 REST APIs & WebSockets. add RSA support. Move to Web Crypto API for sign. feat(v3.0.0): add V3 REST APIs & WebSockets. add RSA support. Move to Web Crypto API for sign. Publish Hybrid CJS/ESM module. Jul 24, 2025
@tiagosiebler
tiagosiebler marked this pull request as ready for review July 24, 2025 12:15
@tiagosiebler
tiagosiebler merged commit 85a9d37 into master Jul 24, 2025
4 checks passed
@tiagosiebler
tiagosiebler deleted the nextAPIV3 branch July 24, 2025 12:19
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.

2 participants