Skip to content

Chore/fetcher extra params#222

Open
Velenir wants to merge 8 commits intomasterfrom
chore/fetcher_extras
Open

Chore/fetcher extra params#222
Velenir wants to merge 8 commits intomasterfrom
chore/fetcher_extras

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
Touches shared request construction logic across all SDK API calls; incorrect header merge precedence or keepalive usage could subtly change request behavior for existing consumers.

Overview
Adds support for passing extra request headers via ExtraFetchParams and ensures they are merged into outgoing requests for constructAxiosFetcher, constructFetchFetcher, and the SimpleSDK custom fetcher path (including when an apiKey is set).

The fetch-based fetcher now optionally forwards keepalive, and ExtraFetchParams is exported from src/index.ts for external typing. Also updates the documented default version for /prices rate queries to 6.2, and bumps package.json to 9.3.2-dev.1.

Written by Cursor Bugbot for commit b9fa5d6. 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.04% 🔺)
dist/sdk.esm.js 15.75 KB (+0.38% 🔺)

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.

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.

1 participant