import { Component, OnInit } from '@angular/core'; import { ethers } from 'ethers'; import { MetaMaskInpageProvider } from '@metamask/providers'; @Component({ selector: 'app-connect-wallet', templateUrl: './connect-wallet.component.html', styleUrls: ['./connect-wallet.component.css'], }) export class ConnectWalletComponent implements OnInit { constructor(private window: Window) {} ngOnInit(): void {} connectWallet() { if (typeof window.ethereum !== 'undefined') { console.log('MetaMask is installed!'); } } }
I create a component like this to get metamask and I’m constantly getting error:
Cannot find module '@metamask/providers' or its corresponding type declarations. Property 'ethereum' does not exist on type 'Window & typeof globalThis'.
Can anybody who can access to metamask with using Angular show me the way?