Skip to content

feat(routes): add a price or speed priority to the Routes tester - #1114

Open
rkrasiuk wants to merge 2 commits into
mainfrom
pyramid/d827c638-2e03-4cdd-b9f2-9800c59caa31
Open

rkrasiuk wants to merge 2 commits into
mainfrom
pyramid/d827c638-2e03-4cdd-b9f2-9800c59caa31

Conversation

@rkrasiuk

@rkrasiuk rkrasiuk commented Nov 7, 2026

Copy link
Copy Markdown
Member

Adds a Priority select (Best price / Speed) to the transfer quote form in the Routes tester (/docs/routes/test). Changing it changes the quote request; no delivery times are shown.

  • routes-test.ts: transfer quotes and creates send priority=speed when Speed is chosen; Best price sends nothing, which is the API default. Speed on deposit addresses or with 1:1 delivery is refused, matching the API's 400.
  • RoutesTester.tsx: the select is shown for transfers only. Choosing Speed turns off 1:1 delivery for that quote.
  • routes-quote.ts: the proxy now passes priority through, and doesn't add its default subsidize=true to speed quotes.
  • Added tests for the request builder and the proxy.

Merge after https://github.com/tempoxyz/api/pull/2165 deploys. That PR adds priority to /v1/routes/transfers/quote and POST /v1/routes/transfers.

Checks: pnpm check:types passes, Biome passes on the changed files, and vitest passes on routes-test and routes-quote-api (37 tests). The select was checked in the local dev server, but no live quote was requested because there was no docs quote key locally.

@vercel

vercel Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tempo-docs Ready Ready Preview Nov 7, 2026 5:42pm UTC

Request Review

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. This is a small, self-contained change that adds a transfer-only speed priority, and it comes with matching validation and tests.

What I checked:

  • Request shaping in routes-test.ts. priority is sent only for transfers set to speed. Speed is refused for deposit addresses and when combined with 1:1 delivery. pricing() always sets subsidize explicitly, so the proxy's default never overrides the demo's own choice.
  • The RoutesTester.tsx state wiring. Choosing speed turns off subsidy availability before the input is built, so the new pricing() checks can't throw on a normal quote.
  • The proxy allowlist in routes-quote.ts. The new priority param goes through the same type and length checks as the existing params, and the default subsidize=true is now skipped for speed transfers.
Extended reasoning...

The change touches the Routes tester UI, its request builder, and the docs quote proxy, adding 55 lines across 5 files. The only server-side surface is the quote proxy, which holds the docs API key. It now forwards one more allowlisted query param, under the same type and 128-character checks as the others, and it no longer adds the default subsidize=true to speed quotes. No auth, crypto, or permission logic changes, and the repository has no CODEOWNERS file. Unit tests cover the new validation, the request shaping, and the proxy's subsidize default, and there are no other reviewers' objections on the timeline. The only remaining step is the merge order the description itself points out: this PR should go in after the upstream API change that adds priority deploys.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code review found no issues

No high-confidence issues detected in this change.

This branch was successfully deployed

1 active deployment
Preview — 09db4a3e Deployed Nov 7, 2026 by vercel[bot]
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.

1 participant