Skip to content

feat: Cross-chain route filters (bridge/DEX-source filtering)#6

Merged
sohai merged 3 commits into
mainfrom
worktree-cross-chain-route-filters
Jul 2, 2026
Merged

feat: Cross-chain route filters (bridge/DEX-source filtering)#6
sohai merged 3 commits into
mainfrom
worktree-cross-chain-route-filters

Conversation

@sohai

@sohai sohai commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Adds three routing-filter flags to 0x cross-chain, wiring the previously-unreachable getQuotes params:

  • --included-bridges <CSV>includedBridges
  • --excluded-bridges <CSV>excludedBridges
  • --excluded-swap-sources <CSV>excludedSwapSources

CSV or repeated flags; omitted → not sent. --included-bridges and --excluded-bridges are mutually exclusive (clap conflict → exit 2). Names aren't validated client-side; unknown names pass through to the API.

Refactors get_cross_chain_quotes onto a CrossChainQuoteParams struct (drops too_many_arguments). Adds arg-parsing + query-construction unit tests. Verified live against api.0x.org: excluding across_v4 and pinning relay both change the returned bridge set.

sohai added 2 commits July 2, 2026 10:50
…swap sources)

Add --included-bridges, --excluded-bridges, and --excluded-swap-sources
flags to `0x cross-chain`, wiring the includedBridges/excludedBridges/
excludedSwapSources params of the cross-chain getQuotes endpoint.

- CSV or repeated flags (clap value_delimiter); omitted -> param not sent.
- --included-bridges and --excluded-bridges are mutually exclusive
  (clap conflicts_with -> input error, exit 2).
- No client-side name validation; unknown names pass through to the API.

Refactors get_cross_chain_quotes onto a CrossChainQuoteParams struct
(the positional signature had hit too_many_arguments) with a testable
query_pairs builder. Adds arg-parsing and query-construction unit tests
and documents the flags in the cross-chain skill reference.
@sohai sohai requested a review from pgrzesik July 2, 2026 11:17
@sohai sohai self-assigned this Jul 2, 2026
@sohai sohai marked this pull request as ready for review July 2, 2026 11:17

@pgrzesik pgrzesik left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nice 👏

@sohai sohai merged commit fbf7da1 into main Jul 2, 2026
3 checks passed
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.

2 participants