Move NEAR pages out from under the chain: /near/tx/<hash> and /near/intents/<account> #50

Open
opened 2026-10-07 14:15:39 +00:00 by grenade · 0 comments
Owner

Why

The NEAR pages from #44 live at /quantus/near/tx/<hash> and /quantus/near/intents/<account>. That reads as though a NEAR transaction were something on the Quantus chain, and the header agrees: on those pages the chain switcher marks Quantus as the chain being viewed, and the section nav marks Markets. A NEAR transaction is on NEAR. Most transactions anyone could paste into the page have nothing to do with Quantus at all (a USDC swap, a ZEC withdrawal), and the page still says "Quantus" above them.

They were put under the chain for two reasons, both recorded on #44:

  • The URL grammar is /:chain/:kind/…, so /near/… would have parsed as a chain called "near".
  • The API reads NEAR with the chain's own configuration ([chains.intents]: our node URLs, the archive, the Intents contract), at /v1/chains/{chain}/near/….

Neither is a reason the user should see. Both can be fixed where they live.

What

Routes. /near/tx/<hash> and /near/intents/<account>.

  • near becomes a reserved first segment, recognised in parse before the chain, the same way the chainless /miner/… and /runtime/… forms already are. A chain slug can never be near, so the registry and the telemetry directory must refuse one rather than let it shadow the route.
  • href, isStandings and sectionOf cover the new form. A NEAR page belongs to no chain section.
  • Old links keep working: /quantus/near/tx/<hash> and /quantus/near/intents/<account> redirect (replace, not push) to the new form, as legacy window names already do. Those URLs have been handed out since #44.

The header on a NEAR page.

  • The chain switcher marks no chain as current, and the section nav, which is a list of one chain's sections, is not shown or shows nothing as current.
  • The page says it is on NEAR, so a reader who arrived from a link knows where they are.
  • The search box (#49) still works there. It needs a chain only to resolve Quantus kinds; NEAR hits route to /near/….

API. GET /v1/near/tx/{hash} and GET /v1/near/intents/{account}.

  • NEAR's endpoints are one set for the whole observer, not one per chain. Today they sit in [chains.intents] because only one chain follows a token on NEAR. Either move the node URLs to a top-level [near] section, or keep one NearReader built from the first chain that configures NEAR. Decide when implementing, and say which in the commit.
  • The old /v1/chains/{chain}/near/… routes stay as aliases until the frontend no longer calls them.

What stays chain-specific, and where it shows.

  • Bridge memos name their source chain: BRIDGED_FROM carries networkType: "qtc" and chainId: "mainnet". A Quantus transaction they name is resolved against the configured chain that is that network's mainnet, and links to /quantus/tx/<hash>. Resolved by what the memo says, never by which chain's page you came from.
  • The Intents account page's history is this observer's index of the tokens it follows (#44). Today that is QTC alone, via quantus's [chains.intents]. On a chainless page it is "every token this observer follows on NEAR", labelled by token. With one token today nothing visible changes, but the code must not assume one.

Done when

  • /near/tx/<hash> and /near/intents/<account> render, and nothing on them claims a Quantus context.
  • Every internal link (bridge tables, fills, swaps, the NEAR pages themselves, search hits) produces the new form.
  • /quantus/near/… redirects. A route test pins both the new parse and the redirect, and that near is never accepted as a chain slug.

Related: #44, #47, #49.

## Why The NEAR pages from #44 live at `/quantus/near/tx/<hash>` and `/quantus/near/intents/<account>`. That reads as though a NEAR transaction were something on the Quantus chain, and the header agrees: on those pages the chain switcher marks **Quantus** as the chain being viewed, and the section nav marks **Markets**. A NEAR transaction is on NEAR. Most transactions anyone could paste into the page have nothing to do with Quantus at all (a USDC swap, a ZEC withdrawal), and the page still says "Quantus" above them. They were put under the chain for two reasons, both recorded on #44: - **The URL grammar** is `/:chain/:kind/…`, so `/near/…` would have parsed as a chain called "near". - **The API reads NEAR with the chain's own configuration** (`[chains.intents]`: our node URLs, the archive, the Intents contract), at `/v1/chains/{chain}/near/…`. Neither is a reason the user should see. Both can be fixed where they live. ## What **Routes.** `/near/tx/<hash>` and `/near/intents/<account>`. - `near` becomes a reserved first segment, recognised in `parse` **before** the chain, the same way the chainless `/miner/…` and `/runtime/…` forms already are. A chain slug can never be `near`, so the registry and the telemetry directory must refuse one rather than let it shadow the route. - `href`, `isStandings` and `sectionOf` cover the new form. A NEAR page belongs to no chain section. - **Old links keep working:** `/quantus/near/tx/<hash>` and `/quantus/near/intents/<account>` redirect (replace, not push) to the new form, as legacy window names already do. Those URLs have been handed out since #44. **The header on a NEAR page.** - The chain switcher marks **no chain** as current, and the section nav, which is a list of one chain's sections, is not shown or shows nothing as current. - The page says it is on NEAR, so a reader who arrived from a link knows where they are. - The search box (#49) still works there. It needs a chain only to resolve Quantus kinds; NEAR hits route to `/near/…`. **API.** `GET /v1/near/tx/{hash}` and `GET /v1/near/intents/{account}`. - NEAR's endpoints are one set for the whole observer, not one per chain. Today they sit in `[chains.intents]` because only one chain follows a token on NEAR. Either move the node URLs to a top-level `[near]` section, or keep one `NearReader` built from the first chain that configures NEAR. Decide when implementing, and say which in the commit. - The old `/v1/chains/{chain}/near/…` routes stay as aliases until the frontend no longer calls them. **What stays chain-specific, and where it shows.** - **Bridge memos** name their source chain: `BRIDGED_FROM` carries `networkType: "qtc"` and `chainId: "mainnet"`. A Quantus transaction they name is resolved against the configured chain that is that network's mainnet, and links to `/quantus/tx/<hash>`. Resolved by what the memo says, never by which chain's page you came from. - **The Intents account page's history** is this observer's index of the tokens it follows (#44). Today that is QTC alone, via `quantus`'s `[chains.intents]`. On a chainless page it is "every token this observer follows on NEAR", labelled by token. With one token today nothing visible changes, but the code must not assume one. ## Done when - `/near/tx/<hash>` and `/near/intents/<account>` render, and nothing on them claims a Quantus context. - Every internal link (bridge tables, fills, swaps, the NEAR pages themselves, search hits) produces the new form. - `/quantus/near/…` redirects. A route test pins both the new parse and the redirect, and that `near` is never accepted as a chain slug. Related: #44, #47, #49.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: blackbeard/observer#50