Conversation
size-limit report 📦
|
There was a problem hiding this comment.
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
ExtraFetchParamstype to include optionalheadersfield - Updated axios, fetch, and simple SDK fetcher implementations to merge extra headers with request headers
- Added
keepaliveparameter support for the fetch-based fetcher - Exported
ExtraFetchParamstype 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.
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
keepaliveusage could subtly change request behavior for existing consumers.Overview
Adds support for passing extra request headers via
ExtraFetchParamsand ensures they are merged into outgoing requests forconstructAxiosFetcher,constructFetchFetcher, and theSimpleSDKcustom fetcher path (including when anapiKeyis set).The fetch-based fetcher now optionally forwards
keepalive, andExtraFetchParamsis exported fromsrc/index.tsfor external typing. Also updates the documented defaultversionfor/pricesrate queries to 6.2, and bumpspackage.jsonto9.3.2-dev.1.Written by Cursor Bugbot for commit b9fa5d6. This will update automatically on new commits. Configure here.