neo-wallet-adapter icon indicating copy to clipboard operation
neo-wallet-adapter copied to clipboard

Add a way to react on network and wallet changes

Open csmuller opened this issue 2 years ago • 5 comments

We need a functionality that allows the user of the wallet-adapt to react on network changes (e.g., changing from mainnet to testnet) and wallet changes. Currently the adapter simply disconnects the wallet on such changes.

It would be nice if the WALLET_CHANGED/NETWORK_CHANGED events would bubble up to the library user or the useWallet() method would return variables that hold such state. Something like:

const { address, wallet, connecting, walletChanged, networkChaged } = useWallet();

csmuller avatar Jun 27 '22 16:06 csmuller