feat: add bsc support to CoW swapper#11360
Conversation
📝 WalkthroughWalkthroughBNB Smart Chain Mainnet support is added to the cowswap utilities across three files: the CowNetwork enum is extended with a new Bnb member, the supported chain IDs constant is updated to include the BNB chain ID, and the chain-to-network mapping logic is extended with a corresponding case for routing. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5–10 minutes
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (5)**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/swapper{s,}/**/*.{ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/error-handling.mdc)
Files:
**/*.{js,jsx,ts,tsx}📄 CodeRabbit inference engine (.cursor/rules/naming-conventions.mdc)
Files:
packages/swapper/**/*.ts📄 CodeRabbit inference engine (.cursor/rules/swapper.mdc)
Files:
🧠 Learnings (11)📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-11-24T21:20:57.909ZApplied to files:
📚 Learning: 2025-10-23T14:27:19.073ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
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. Comment |
Description
Add Binance Smart Chain support to CoW swapper.
Issue (if applicable)
None, I just realised we didn't support this, but we should.
Risk
Low
CoW swaps on BSC
Testing
Ensure CoW trades on BSC work.
Engineering
👆
Operations
👆
Screenshots (if applicable)
Note
Adds BNB Smart Chain support by enabling BSC chain ID, network mapping, and CowNetwork enum value.
SUPPORTED_CHAIN_IDSinpackages/swapper/src/cowswap-utils/constants.tsto includeKnownChainIds.BnbSmartChainMainnet.KnownChainIds.BnbSmartChainMainnettoCowNetwork.BnbingetCowNetwork(packages/swapper/src/cowswap-utils/index.ts).CowNetwork.Bnbtopackages/types/src/cowSwap.ts.Written by Cursor Bugbot for commit b15e421. This will update automatically on new commits. Configure here.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.