Skip to content

Conversation

dan437
Copy link
Contributor

@dan437 dan437 commented Oct 7, 2025

Explanation

Adds the optional "Client-Version" header into API calls from the Bridge Controller. E.g. "Client-Version": "13.5.0"

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Adds an optional Client-Version header to bridge and price API requests, plumbed from BridgeController to fetch utilities, and updates exports, tests, and changelog.

  • Bridge Controller:
    • Accepts optional clientVersion in BridgeController constructor and stores it.
    • Passes clientVersion to fetchBridgeQuotes and fetchAssetPrices.
  • Fetch Utilities:
    • Replace getClientIdHeader with getClientHeaders(clientId, clientVersion) to include optional Client-Version.
    • Update fetchBridgeTokens, fetchBridgeQuotes, and price fetching to use getClientHeaders and accept clientVersion.
    • Export getClientHeaders from src/index.ts.
  • Tests:
    • Update unit tests to pass clientVersion and assert Client-Version header in requests and call signatures.
    • Snapshot expectations updated accordingly.
  • Changelog:
    • Note addition of optional Client-Version header to bridge API requests.

Written by Cursor Bugbot for commit 448977d. This will update automatically on new commits. Configure here.

Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@dan437 dan437 requested a review from a team as a code owner October 7, 2025 15:48
export const getClientIdHeader = (clientId: string) => ({
export const getClientHeaders = (clientId: string, clientVersion?: string) => ({
'X-Client-Id': clientId,
...(clientVersion ? { 'Client-Version': clientVersion } : {}),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the “X-” prefix for custom HTTP headers (like X-Client-Id) was deprecated by IETF in RFC 6648 (2012). RFC 6648 states new parameters SHOULD NOT use the “X-” prefix, that's why I just simply call it "Client-Version" here.

infiniteflower
infiniteflower previously approved these changes Oct 7, 2025
micaelae
micaelae previously approved these changes Oct 7, 2025
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
@dan437 dan437 dismissed stale reviews from micaelae and infiniteflower via 1197c66 October 7, 2025 16:42
@dan437 dan437 requested a review from a team as a code owner October 7, 2025 16:42
cursor[bot]

This comment was marked as outdated.

dan437 added 2 commits October 7, 2025 18:58
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
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.

3 participants