explicitly update config on switchChain

This commit is contained in:
Tony D'Addeo
2024-12-03 12:05:13 -06:00
committed by lucas-neynar
parent 6691998a1d
commit e89dd14566
3 changed files with 162 additions and 24 deletions

View File

@@ -67,6 +67,11 @@ export function frameConnector() {
method: "wallet_switchEthereumChain",
params: [{ chainId: numberToHex(chainId) }],
});
// explicitly emit this event as a workaround for ethereum provider not
// emitting events, can remove once events are flowing
config.emitter.emit("change", { chainId });
return chain;
},
onAccountsChanged(accounts) {