Skip to content

Conversation

@Velenir
Copy link
Member

@Velenir Velenir commented Feb 4, 2026

Extra parameters to pass to fetcher (axios, fetch, or custom in simpleSDK)


Note

Medium Risk
Changes request header composition for all fetcher paths, which could alter authentication/caching behavior or override user-provided headers. Other updates are type-level/query-param additions with limited runtime risk.

Overview
Adds richer extra fetcher params across axios/fetch/simple fetchers by extending ExtraFetchParams with optional headers, merging them into request headers (alongside X-API-KEY), and allowing fetch requests to pass through keepalive.

Extends public API types to support partner fee configuration via partnerFeeBps on getDeltaPrice, getQuote, and swap RateOptions, and updates docs/tests accordingly (including snapshot expectations for dynamic partnerFee and bridge protocol icon fields).

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

@github-actions
Copy link

github-actions bot commented Feb 4, 2026

size-limit report 📦

Path Size
dist/sdk.cjs.production.min.js 15.83 KB (0%)
dist/sdk.esm.js 15.75 KB (0%)

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for passing extra parameters to fetcher functions, specifically adding a headers field to ExtraFetchParams and a keepalive option for the fetch implementation.

Changes:

  • Extended ExtraFetchParams type to include optional headers field
  • Updated axios, fetch, and simple SDK fetcher implementations to merge extra headers with request headers
  • Added keepalive parameter support for the fetch-based fetcher
  • Exported ExtraFetchParams type for external use
  • Updated documentation for swap rate protocol version default from 5 to 6.2

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/types.ts Extended ExtraFetchParams to include optional headers
src/helpers/fetchers/axios.ts Updated header merging to include extra headers from options
src/helpers/fetchers/fetch.ts Updated header merging to include extra headers and added keepalive parameter support
src/sdk/simple.ts Updated custom fetcher wrapper to merge extra headers
src/index.ts Exported ExtraFetchParams type for public API
src/methods/swap/rates.ts Updated documentation for protocol version default value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Contributor

@andriy-shymkiv andriy-shymkiv left a comment

Choose a reason for hiding this comment

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

I'd like to ask you about adding partnerFeeBps query param to Delta and Market price params 🙏🏻

@Velenir
Copy link
Member Author

Velenir commented Feb 10, 2026

I'd like to ask you about adding partnerFeeBps query param to Delta and Market price params 🙏🏻

Added, maybe will also add to /quote, depending on BE

@Velenir Velenir merged commit 5663d95 into master Feb 11, 2026
2 of 4 checks passed
@Velenir Velenir deleted the chore/fetcher_extras branch February 11, 2026 09:33
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