fcl-js
fcl-js copied to clipboard
[BUG] FCL/Hybrid Apps with the Rainbowkit Connecter Don't Respect Rainbowkit Switching Chains
Current Behavior
Adding multiple chains to config in wagmi with Rainbowkit automatically enables a UI element that allows the user to switch chains:
export const config = createConfig({ chains: [ flowMainnet, flowTestnet, ], connectors, ssr: true, transports: { [flowMainnet.id]: http(), [flowTestnet.id]: http(), } });
In a hybrid app, when attempting to enable both Flow EVM testnet and Flow EVM mainnet, the network is locked to whichever is set in accessNode.api
fcl.config({ "accessNode.api": "https://rest-mainnet.onflow.org", "discovery.wallet": "https://fcl-discovery.onflow.org/mainnet/authn", "walletconnect.projectId": "9b70cfa398b2355a5eb9b1cf99f4a981", })
Expected Behavior
Hybrid apps should respect the network selected by Rainbowkit
Steps To Reproduce
- Start with Jordan's hybrid app scaffold or similar
- Add both flowMainnet and flowTestnet to the wagmi config
- Run the app
- Attempt to switch networks
- Observe that the network does not switch and is stuck on the one selected in
fcl.config - Switch the network endpoint in
fcl.configto the opposite - Restart the app and observe it is now stuck in that network
Environment
- OS:
- Node:
- npm:
What are you currently working on that this is blocking?
No response