Several frontend pages still fetch read-only data from STACKS_MAINNET directly instead of using the active network from the app context.
Evidence:
frontend/src/pages/TradePage.tsx:4,66-73 imports STACKS_MAINNET and passes it to fetchCallReadOnlyFunction for get-market.
frontend/src/pages/PortfolioPage.tsx:4,40-47,74-81 does the same for get-user-position.
- The app already exposes network switching through
NetworkContext, so these pages bypass the selected network.
Impact:
- Switching to testnet still leaves these pages reading mainnet contract state.
- Trade/portfolio views can show the wrong market data or fail outright when the selected network differs from mainnet.
Reproduction:
- Switch the app to testnet.
- Open a market in Trade or Portfolio.
- Observe that the read-only contract calls still target mainnet.
Priority: High
Suggested scope:
Use the active network from the network context or network utilities for all read-only contract calls in these pages.
Several frontend pages still fetch read-only data from
STACKS_MAINNETdirectly instead of using the active network from the app context.Evidence:
frontend/src/pages/TradePage.tsx:4,66-73importsSTACKS_MAINNETand passes it tofetchCallReadOnlyFunctionforget-market.frontend/src/pages/PortfolioPage.tsx:4,40-47,74-81does the same forget-user-position.NetworkContext, so these pages bypass the selected network.Impact:
Reproduction:
Priority: High
Suggested scope:
Use the active network from the network context or network utilities for all read-only contract calls in these pages.