Skip to content

URL Query Parameter for Testnet Mode #998

@alainncls

Description

@alainncls

URL Query Parameter for Testnet Mode

Problem

Users cannot share direct links to testnet assets. Currently, the mainnet/testnet toggle state is only persisted in localStorage, making it impossible to deep-link to testnet resources or bookmark testnet views.

Scope

  • Add support for a testnet URL query parameter
  • Synchronize the toggle UI with this parameter
  • Ensure VeraxSdk and all Graph queries (single-chain and multichain) respect the active network type

Behavior

URL Expected State
No testnet param Mainnet (default)
?testnet=true Testnet
?testnet=false or any other value Mainnet

Acceptance Criteria

  • Navigating to a URL with ?testnet=true switches to testnet mode
  • The UI toggle reflects the URL parameter state on initial load
  • Toggling the UI updates the URL parameter (without full page reload)
  • VeraxSdk instance used for queries matches the active network type
  • Multichain queries (findByMultiChain, etc.) target the correct chain set
  • Removing or setting testnet=false switches back to mainnet
  • Shareable URLs with ?testnet=true work correctly when opened in a new session

Edge Cases

  • Conflicting state: URL param takes precedence over localStorage on initial load
  • Invalid param values (e.g., ?testnet=maybe) default to mainnet

Metadata

Metadata

Assignees

Labels

Projects

Status

In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions