feat(frontend): honor Swap query params on / and /swap (#711) #1199

Merged
PlasticDigits merged 3 commits from feat/711-swap-query-params into main 2026-08-31 11:14:15 +00:00
PlasticDigits commented 2026-08-31 05:18:15 +00:00 (Migrated from gitlab.com)

Summary

  • /swap and /swap/ now redirect to / with search and hash preserved so aggregator/share links are not thrown away.
  • New swapQueryParams parser applies Uniswap/Pancake/Terra aliases (inputCurrency/outputCurrency, from/to, …) after factory tokens load. Factory-gated, checksummed, gem-hidden, hostile-ignored. Optional pay amount only; never auto-submit.
  • ust1SecondarySwapPath() now mints /?from=<ust1>&to=<quote> so /ust1 secondary CTAs deep-link a real AMM pair (U1).

Closes #711.

Test plan

  • make verify-issue-711 (Vitest parser + RTL + Create Pair C542-11 + docs/skills)
  • make verify-issue-711 retest
  • Swap acquire guidance RTL still passes
  • Playwright e2e/swap-query-params.spec.ts with factory tokens (PLAYWRIGHT_SKIP_CHAIN=1 after make dev / LocalTerra)
  • Manual: http://127.0.0.1:5173/swap?from=uluna&to=<listed> — Pay LUNC, receive that token, change token, query does not snap back
  • Coolify after merge: https://dex.cl8y.com/swap/?inputCurrency=uluna&outputCurrency=<listed>

Follow-up

cl8y-web (PlasticDigits/CL8Y-web) should update DEX share/CTA hrefs to /?from=&to= (or /swap/?…) after this MR is merged. Issue opened there, gated on this merge.

## Summary - `/swap` and `/swap/` now redirect to `/` **with `search` and `hash` preserved** so aggregator/share links are not thrown away. - New `swapQueryParams` parser applies Uniswap/Pancake/Terra aliases (`inputCurrency`/`outputCurrency`, `from`/`to`, …) after factory tokens load. Factory-gated, checksummed, gem-hidden, hostile-ignored. Optional pay amount only; never auto-submit. - `ust1SecondarySwapPath()` now mints `/?from=<ust1>&to=<quote>` so `/ust1` secondary CTAs deep-link a real AMM pair (**U1**). Closes #711. ## Test plan - [x] `make verify-issue-711` (Vitest parser + RTL + Create Pair C542-11 + docs/skills) - [x] `make verify-issue-711` retest - [x] Swap acquire guidance RTL still passes - [ ] Playwright `e2e/swap-query-params.spec.ts` with factory tokens (`PLAYWRIGHT_SKIP_CHAIN=1` after `make dev` / LocalTerra) - [ ] Manual: `http://127.0.0.1:5173/swap?from=uluna&to=<listed>` — Pay LUNC, receive that token, change token, query does not snap back - [ ] Coolify after merge: `https://dex.cl8y.com/swap/?inputCurrency=uluna&outputCurrency=<listed>` ## Follow-up `cl8y-web` (PlasticDigits/CL8Y-web) should update DEX share/CTA hrefs to `/?from=&to=` (or `/swap/?…`) **after this MR is merged**. Issue opened there, gated on this merge.
PlasticDigits commented 2026-08-31 05:20:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #711

mentioned in issue #711
PlasticDigits commented 2026-08-31 05:20:42 +00:00 (Migrated from gitlab.com)

cl8y-web follow-up (gated on this merge): https://gitlab.com/PlasticDigits/CL8Y-web/-/work_items/6

Keep https://dex.cl8y.com as the product origin. After Coolify ships this MR, point the marketing-site Trade-on-DEX row at /?from=uluna&to=<CL8Y CW20>.

cl8y-web follow-up (gated on this merge): https://gitlab.com/PlasticDigits/CL8Y-web/-/work_items/6 Keep `https://dex.cl8y.com` as the product origin. After Coolify ships this MR, point the marketing-site Trade-on-DEX row at `/?from=uluna&to=<CL8Y CW20>`.
PlasticDigits commented 2026-08-31 05:36:05 +00:00 (Migrated from gitlab.com)

mentioned in issue #713

mentioned in issue #713
PlasticDigits commented 2026-08-31 05:36:20 +00:00 (Migrated from gitlab.com)

Out of scope for this MR is tracked as #713 (URL rewrite, reverse quotes, Swap Share, Create/Trade prefill). Review !1199 as inbound parse + /swap search preservation only.

Out of scope for this MR is tracked as #713 (URL rewrite, reverse quotes, Swap Share, Create/Trade prefill). Review !1199 as inbound parse + `/swap` search preservation only.
PlasticDigits commented 2026-08-31 09:54:26 +00:00 (Migrated from gitlab.com)

mentioned in merge request !1200

mentioned in merge request !1200
PlasticDigits commented 2026-08-31 11:13:24 +00:00 (Migrated from gitlab.com)

added 8 commits

  • 38e7a7ac...56f0f7a1 - 6 commits from branch main
  • da9dc502 - Merge origin/main into feat/711-swap-query-params.
  • 36886659 - Wait for factory pairs before applying Swap query params.

Compare with previous version

added 8 commits <ul><li>38e7a7ac...56f0f7a1 - 6 commits from branch <code>main</code></li><li>da9dc502 - Merge origin/main into feat/711-swap-query-params.</li><li>36886659 - Wait for factory pairs before applying Swap query params.</li></ul> [Compare with previous version](/PlasticDigits/cl8y-dex-terraclassic/-/merge_requests/481/diffs?diff_id=1993899751&start_sha=38e7a7ac25b40ccee99d1999e41d01233c3958e7)
PlasticDigits (Migrated from gitlab.com) merged commit 13d586b9f6 into main 2026-08-31 11:14:15 +00:00
PlasticDigits commented 2026-08-31 11:14:16 +00:00 (Migrated from gitlab.com)

mentioned in commit 13d586b9f6

mentioned in commit 13d586b9f64be1bad8bc68154d3e319b657295de
PlasticDigits (Migrated from gitlab.com) merged commit 13d586b9f6 into main 2026-08-31 11:14:16 +00:00
PlasticDigits commented 2026-08-31 11:18:41 +00:00 (Migrated from gitlab.com)

mentioned in issue #714

mentioned in issue #714
PlasticDigits commented 2026-09-01 07:48:09 +00:00 (Migrated from gitlab.com)

mentioned in issue #716

mentioned in issue #716
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic!1199
No description provided.