Improve best quotes endpoint#1172
Merged
Merged
Conversation
Adds CreateBestQuoteRequest with an optional networks?: Networks[] field that integrators can use to restrict best-quote computation to a subset of supported chains. The validator normalizes entries case-insensitively via getCaseSensitiveNetwork so integrators don't have to match the exact casing of canonical Networks values (e.g. polygonAmoy, base-sepolia). The service intersects the whitelist with getEligibleNetworks and returns 400 InvalidNetworks when the resulting set is empty.
Updates the OpenAPI schema and partner-facing quotes-and-pricing guide to describe the optional networks parameter and the InvalidNetworks error response.
Adds a friendly error message mapping for QuoteError.InvalidNetworks in the quote store and the corresponding English and Portuguese translation strings under pages.swap.error.invalidNetworks.
✅ Deploy Preview for vortexfi ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for vortex-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Pull request overview
Adds optional network whitelisting to the best-quote endpoint so API consumers can restrict which eligible chains are evaluated.
Changes:
- Extends best-quote request types, validation, controller forwarding, and quote service filtering for
networks. - Adds validator tests for omitted, valid, normalized, empty, and invalid
networksinputs. - Updates OpenAPI/docs and frontend error message mappings/translations.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/shared/src/endpoints/quote.endpoints.ts |
Adds networks to best-quote request and introduces InvalidNetworks. |
apps/api/src/api/middlewares/validators.ts |
Validates and normalizes optional networks arrays. |
apps/api/src/api/middlewares/validators.test.ts |
Adds coverage for best-quote network whitelist validation. |
apps/api/src/api/controllers/quote.controller.ts |
Passes normalized networks to the quote service. |
apps/api/src/api/services/quote/index.ts |
Filters eligible quote networks using the optional whitelist. |
docs/api/openapi/vortex.openapi.json |
Documents the new networks request property. |
docs/api/pages/06-quotes-and-pricing.md |
Describes best-quote network whitelist behavior. |
apps/frontend/src/stores/quote/useQuoteStore.ts |
Maps the new quote error to a frontend translation key. |
apps/frontend/src/translations/en.json |
Adds English text for invalid networks. |
apps/frontend/src/translations/pt.json |
Adds Portuguese text for invalid networks. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Adds support for a new field 'networks' to the best-quote endpoint that allows defining a subset of networks that the caller is interested in.