I have an nftmarket site. How do I link Metamask wallet to transact on my site. Artists will sell nft through my site, so how do I connect the metamask?

1 Answer 1


I give you basic and simplest code for connect metamask form using ethers. For more ways to connect metamask wallet read you can prefer is metamask docs.

import {ethers} from 'ethers'

const connectWalletHandler = () => {
        if (window.ethereum && window.ethereum.isMetaMask) {
            console.log('MetaMask Here!');

            window.ethereum.request({ method: 'eth_requestAccounts'})
            .then(result => {
                setConnButtonText('Wallet Connected');
            .catch(error => {

        } else {
            console.log('Need to install MetaMask');
            setErrorMessage('Please install MetaMask browser extension to interact');
  • thank you can you send me your e-mail I want to talk to you or can you give me your watsapp number Mar 17, 2022 at 7:25
  • Sorry but I can't give you my whatsapp number. Mar 17, 2022 at 7:32
  • can you email me i want help Mar 17, 2022 at 8:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.