Skip to content

feat(web): NetworkSwitcher updates API base URL correctly - #677

Merged
Mimah97 merged 1 commit into
Vatix-Protocol:mainfrom
Xaxxoo:feature/565-network-switcher-api-url
Jul 27, 2026
Merged

feat(web): NetworkSwitcher updates API base URL correctly#677
Mimah97 merged 1 commit into
Vatix-Protocol:mainfrom
Xaxxoo:feature/565-network-switcher-api-url

Conversation

@Xaxxoo

@Xaxxoo Xaxxoo commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add getApiBase(network) function to constants with per-network API URL map (NEXT_PUBLIC_API_URL_TESTNET / NEXT_PUBLIC_API_URL_PUBLIC env vars)
  • Expose apiBase from NetworkContext so hooks use the correct endpoint
  • Invalidate all cached queries on network switch so hooks refetch against the new API
  • Update usePools to use network-aware apiBase and include network in the query key

Test plan

  • New test: apiBase matches the default network on mount
  • New test: apiBase updates when network is switched via NetworkSwitcher
  • New test: queries are invalidated on network change
  • New test: queries are not invalidated when same network is re-selected

Closes #565

🤖 Generated with Claude Code

…tix-Protocol#565)

Add getApiBase(network) to constants and expose apiBase from
NetworkContext. When the user switches networks, all cached queries
are invalidated so hooks refetch against the correct API endpoint.
Update usePools to use the network-aware apiBase and include
network in the query key.

Closes Vatix-Protocol#565

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Mimah97
Mimah97 merged commit 06832ae into Vatix-Protocol:main Jul 27, 2026
0 of 5 checks passed
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.

NetworkSwitcher updates API base URL correctly

2 participants