Skip to content

Improve best quotes endpoint#1172

Merged
ebma merged 3 commits into
stagingfrom
improve-best-quotes-endpoint
May 28, 2026
Merged

Improve best quotes endpoint#1172
ebma merged 3 commits into
stagingfrom
improve-best-quotes-endpoint

Conversation

@ebma
Copy link
Copy Markdown
Member

@ebma ebma commented May 28, 2026

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.

ebma added 3 commits May 28, 2026 20:05
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.
@ebma ebma requested a review from Copilot May 28, 2026 18:06
@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for vortexfi ready!

Name Link
🔨 Latest commit d7ceec9
🔍 Latest deploy log https://app.netlify.com/projects/vortexfi/deploys/6a188437f0e12d0008eea620
😎 Deploy Preview https://deploy-preview-1172--vortexfi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 28, 2026

Deploy Preview for vortex-sandbox ready!

Name Link
🔨 Latest commit d7ceec9
🔍 Latest deploy log https://app.netlify.com/projects/vortex-sandbox/deploys/6a18843721163300081069ef
😎 Deploy Preview https://deploy-preview-1172--vortex-sandbox.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 networks inputs.
  • 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.

Comment thread docs/api/openapi/vortex.openapi.json
@ebma ebma merged commit 0bea9e2 into staging May 28, 2026
8 checks passed
@ebma ebma deleted the improve-best-quotes-endpoint branch May 28, 2026 18:16
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