@@ -79,14 +79,19 @@ export default function LoginSelector({
7979
8080 const selectMetamask = useCallback(async () => {
8181 try {
82+ if (!window.ethereum) {
83+ throw new Error(
84+ 'Device does not have an Ethereum provider available (is Metamask or Brave Wallet installed?)'
85+ );
86+ }
8287 setMetamask(true);
8388 setMetamaskSelected(true);
84− const accounts = await (window as any).ethereum.send(
85− 'eth_requestAccounts'
86− );
87− const wallet = new MetamaskWallet(accounts.result[0]);
89+ const accounts = await window.ethereum.request({
90+ method: 'eth_requestAccounts',
91+ });
92+ const wallet = new MetamaskWallet(accounts[0]);
8893
89− const web3 = new Web3((window as any).ethereum);
94+ const web3 = new Web3(window.ethereum);
9095 const authToken = await getAuthToken({
9196 address: wallet.address,
9297 walletType: WALLET_TYPES.METAMASK,