mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
The Lux primary network is a family of VM-specialized chains (C=EVM, X=UTXO, D=DEX, P=platform, + A/B/Q/T/Z/G/K/O/R/I/M), mirrored from node/node/vms.go. - configs/app/primaryChains.ts: single source of truth (PRIMARY_VMS, getPrimaryVm, per-VM `view`, hasBespokeView, chainsAwaitingBespokeView). Decomplects the two lists that duplicated this — ChainsPage + ChainDetailPage now consume it (ChainDetailPage drops ~110 lines of copy). - D-Chain (DexVM) renders the DEX order-book UI (ui/dex/DexPage) via view:'dex', not a generic block list. C-Chain=EVM core, P-Chain=platform/validators, X-Chain + the custom VMs render the generic detail fallback (info + indexer DAG stats + validators) — graceful, never blank. chainsAwaitingBespokeView() FLAGS the backlog: X-Chain (UTXO) + the 11 custom VMs still need a bespoke view. - These VMs are Lux-primary, so the primary-VM surfaces (Chains/DEX/Bridge/AI Compute nav + /chains, /chains/[slug], /dex pages) gate on isPrimaryNetworkExplorer(). ui/shared/PrimaryNetworkGuard backstops direct-URL access so the VMs never leak onto a brand explorer (Hanzo/Zoo/Pars). - Tests: configs/app/primaryChains.spec.ts (26 cases) — registry, per-VM view, bespoke-view flag, and the lux-only visibility keystone. 38/38 green with the existing chainRegistry.spec.ts.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import React from 'react';
|
|
|
|
import { isPrimaryNetworkExplorer } from 'configs/app/chainRegistry';
|
|
import PageTitle from 'ui/shared/Page/PageTitle';
|
|
|
|
// Primary-network VM surfaces (Chains / Chain detail / DEX) belong to the Lux
|
|
// primary network only. On a brand explorer (Hanzo / Zoo / Pars / SPC / Osage)
|
|
// these chains must never appear — see the chain-visibility rule in
|
|
// chainRegistry.ts. The nav hides the entries; this guard backstops direct-URL
|
|
// access so the primary VMs can never leak onto a brand explorer.
|
|
|
|
interface Props {
|
|
readonly title: string;
|
|
readonly children: React.ReactNode;
|
|
}
|
|
|
|
const PrimaryNetworkGuard = ({ title, children }: Props) => {
|
|
if (!isPrimaryNetworkExplorer()) {
|
|
return (
|
|
<>
|
|
<PageTitle title={ title }/>
|
|
<div className="px-4 py-10 text-center text-sm text-[var(--color-text-secondary)]">
|
|
This explorer shows only its own chain. The Lux primary-network chains
|
|
are available on the Lux explorer.
|
|
</div>
|
|
</>
|
|
);
|
|
}
|
|
return children;
|
|
};
|
|
|
|
export default PrimaryNetworkGuard;
|