Skip to content

feat: update cow-sdk to 8.1.0#202

Merged
alfetopito merged 6 commits intomainfrom
fix/cow.finance
Apr 15, 2026
Merged

feat: update cow-sdk to 8.1.0#202
alfetopito merged 6 commits intomainfrom
fix/cow.finance

Conversation

@alfetopito
Copy link
Copy Markdown
Contributor

@alfetopito alfetopito commented Apr 14, 2026

Description

Update to latest sdk version

Summary by CodeRabbit

  • Chores
    • Bumped package version to 4.0.0 and updated SDK dependency to ^8.1.0.
    • Updated project metadata and repository housekeeping (ignored local IDE files, normalized file endings).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Warning

Rate limit exceeded

@alfetopito has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 34 minutes and 11 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 34 minutes and 11 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a8033677-f11c-4796-9318-2e25b270f8f8

📥 Commits

Reviewing files that changed from the base of the PR and between 2a8217c and 07126ec.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (3)
  • package.json
  • src/domain/polling/index.ts
  • src/services/chain.ts
📝 Walkthrough

Walkthrough

Bumps package version to 4.0.0 and updates @cowprotocol/cow-sdk constraint to ^8.1.0; adds .idea/ to .gitignore; changes imports to move OrderBookApi and related types to @cowprotocol/sdk-order-book; introduces configureSdkAdapters(provider) to register adapters with both cow-sdk and sdk-composable; adds an explicit cast in polling code.

Changes

Cohort / File(s) Summary
Dependency / Package
package.json
Version updated to 4.0.0; @cowprotocol/cow-sdk constraint bumped from ^8.0.0 to ^8.1.0; trailing newline normalized.
VCS Ignore
.gitignore
Added .idea/ ignore entry and normalized newline for config*.json line.
Polling domain
src/domain/polling/index.ts
Switched some SDK type imports to @cowprotocol/sdk-order-book; replaced direct orderBookApi assignment with orderBookApi as unknown as PollParams["orderBookApi"] to bridge differing sdk-order-book instances. Review casting at this boundary.
SDK adapter registration
src/services/chain.ts
Added configureSdkAdapters(provider) that instantiates EthersV5Adapter and registers it with both @cowprotocol/cow-sdk and @cowprotocol/sdk-composable re-export. ChainContext.init now calls this helper; imports adjusted. Inspect dual registration and import changes.

Sequence Diagram(s)

sequenceDiagram
  participant ChainCtx as ChainContext
  participant Helper as configureSdkAdapters
  participant Ethers as EthersV5Adapter
  participant CowSDK as `@cowprotocol/cow-sdk`
  participant Composable as `@cowprotocol/sdk-composable`

  ChainCtx->>Helper: init(provider)
  Helper->>Ethers: new EthersV5Adapter({provider})
  Helper->>CowSDK: setGlobalAdapter(Ethers) 
  Helper->>Composable: setGlobalAdapter(Ethers)
  Note right of Composable: Both SDKs now share the same adapter instance
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through lines and changed a string,
A version nudged, a small new thing.
I tied two SDKs with one warm paw,
Cast a type where mismatches saw.
✨📦🐇

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete and vague, missing required sections like detailed changes list, testing instructions, and related issues while providing only minimal context. Expand the description to include a detailed changelog listing all modifications, comprehensive testing instructions, and relevant issue references.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: updating cow-sdk from 8.0.0 to 8.1.0, which aligns with the primary package.json dependency update in the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/cow.finance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 49: Update the package.json dependency for the Cow Protocol SDK: replace
the non-existent version specifier "@cowprotocol/cow-sdk": "^8.1.0" with a
published version that npm/yarn can resolve (use "@cowprotocol/cow-sdk":
"^8.0.5") so the dependency installer succeeds and remains compatible with
existing packages like `@cowprotocol/sdk-composable` and
`@cowprotocol/sdk-ethers-v5-adapter`.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5bb71836-3a54-409b-b709-ce244d7eb95a

📥 Commits

Reviewing files that changed from the base of the PR and between 4fb9e1a and a03841f.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (1)
  • package.json

Comment thread package.json
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Apr 14, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​cowprotocol/​sdk-ethers-v5-adapter@​0.3.11 ⏵ 0.4.377 +11009999 +1100
Updated@​cowprotocol/​sdk-composable@​0.1.38 ⏵ 0.3.078 +11009999 +1100
Updated@​cowprotocol/​cow-sdk@​8.0.0 ⏵ 8.1.07910010099100

View full report

@alfetopito alfetopito requested a review from a team April 15, 2026 12:52
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/services/chain.ts`:
- Around line 39-43: configureSdkAdapters currently creates an EthersV5Adapter
and calls setGlobalAdapter/setComposableGlobalAdapter, which causes a race when
multiple ChainContext.init run in parallel; instead, change
configureSdkAdapters(EthersV5Adapter, provider) to produce and return a
chain-specific adapter (do not call setGlobalAdapter/setComposableGlobalAdapter
inside it), and update callers (e.g., ChainContext.init) to store that adapter
in a per-chain registry or pass it into chain-local SDK consumers;
alternatively, implement a chain-aware lookup (adapterMap keyed by chainId) and
have ChainContext.init register the adapter there rather than mutating global
state.
- Around line 6-7: The import uses a deep node_modules path for setGlobalAdapter
(aliased as setComposableGlobalAdapter); replace that import to pull
setGlobalAdapter directly from the public package "@cowprotocol/sdk-common"
(e.g., import { setGlobalAdapter as setComposableGlobalAdapter } from
"@cowprotocol/sdk-common"), and ensure package.json lists
"@cowprotocol/sdk-common" as a dependency so the module resolves correctly.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c727bcba-6e7e-44a1-81eb-afd654105343

📥 Commits

Reviewing files that changed from the base of the PR and between a03841f and 2a8217c.

📒 Files selected for processing (4)
  • .gitignore
  • package.json
  • src/domain/polling/index.ts
  • src/services/chain.ts
✅ Files skipped from review due to trivial changes (1)
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json

Comment thread src/services/chain.ts Outdated
Comment thread src/services/chain.ts Outdated
Comment thread .gitignore
/config*.json

# Idea
.idea/ No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

thank you!

@alfetopito alfetopito merged commit af8c257 into main Apr 15, 2026
5 checks passed
@alfetopito alfetopito deleted the fix/cow.finance branch April 15, 2026 13:42
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants