starknet-react icon indicating copy to clipboard operation
starknet-react copied to clipboard

Check user connected network after connecting wallet

Open kootsZhin opened this issue 2 years ago • 2 comments

At the moment there seems to be no support in checking which network the user is connected to (e.g. Goeril or mainnet), i.e. the chainId.

It would be nice if we could possibly add some new features (e.g. hooks) for checking this - similar to what we have for chainId in wagmi for EVM chains.

This is crucial because when mainnet launch we would not want the users to sign the message on the wrong network to cause any inconvenience or financial loss.

kootsZhin avatar Jul 13 '22 21:07 kootsZhin

I agree with this. The hook should also listen for network changed events on the wallet to keep the current network updated.

fracek avatar Jul 14 '22 08:07 fracek

@clementjuventin is going to work on this contribution

onlydust-bot avatar Sep 15 '22 12:09 onlydust-bot

Is it still open ? If yes can I work on it ?

J4ckyLIM avatar Jan 02 '23 20:01 J4ckyLIM

It seams like I did it https://github.com/apibara/starknet-react/pull/167. However I see that there were some unmerged commits. As the repo was going through some big refactors I assumed it had been done manually.

clementjuventin avatar Jan 02 '23 20:01 clementjuventin

Yep, forgot to close this issue when I merged your PR manually.

fracek avatar Jan 03 '23 11:01 fracek