We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent be483bd commit 29281c6Copy full SHA for 29281c6
.changeset/four-apes-mix.md
@@ -0,0 +1,5 @@
1
+---
2
+'@web3-ui/hooks': minor
3
4
+
5
+Bug fixing for adding network to MetaMask
packages/hooks/src/hooks/useWallet.ts
@@ -51,19 +51,7 @@ export function useWallet() {
51
// If it is not, then install it into the user's MetaMask
52
// @ts-expect-error unknown error type
53
if (error.code === 4902) {
54
- try {
55
- await window.ethereum.request({
56
- method: 'wallet_addEthereumChain',
57
- params: [
58
- {
59
- chainId: '0x61',
60
- rpcUrl: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
61
- },
62
- ],
63
- });
64
- } catch (addError) {
65
- console.error(addError);
66
- }
+ alert('Please add the network to your MetaMask');
67
}
68
69
} else {
0 commit comments