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.
andriy-shymkiv
left a comment
There was a problem hiding this comment.
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 |
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
ExtraFetchParamswith optionalheaders, merging them into request headers (alongsideX-API-KEY), and allowingfetchrequests to pass throughkeepalive.Extends public API types to support partner fee configuration via
partnerFeeBpsongetDeltaPrice,getQuote, and swapRateOptions, and updates docs/tests accordingly (including snapshot expectations for dynamicpartnerFeeand bridge protocol icon fields).Written by Cursor Bugbot for commit aa81ba5. This will update automatically on new commits. Configure here.