1 year ago

#74250

test-img

drg_iulian

How can I see the metadata from the MINT NFTs in react after MINT

how can I see the metadata from the NFT mint on react? And get access to them as soon as I press the mint button on the page? after clicking on the mint I have access to some information from the transaction, such as "hash", does it help?

mint file function

async function handleMint() {
    if (window.ethereum) {
      const provider = new ethers.providers.Web3Provider(window.ethereum);
      const signer = provider.getSigner();
      const contract = new ethers.Contract(
        mintExampleAddress,
        mintExampleABI.abi,
        signer
      );
      try {
        const cost = await contract.cost();
        const response = await contract.mint(mint, {
          value: cost.mul(BigNumber.from(mint)),
        });
        console.log(response);
        toast.success("Mint successfully!", {
          theme: "dark",
        });
      } catch (err) {
        console.log(err);
      }
    }
  }

reactjs

solidity

web3js

ethers.js

0 Answers

Your Answer

Accepted video resources