Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

322
Visualizações
Web3js : Error when trying to call methods from Angular

I just deployed the most simple NFT contract on the polygon mainnet at "0xda528AccACF4eec33EF21c6078273eBfe52609df". I can mint some token using Alchemy as a web3 provider and I do it in a simple Nodejs app.

Now, I wanted to use an independant Angular app to check if the user own one or more token with Metamask as a web3 provider. I get the provider from window.ethereum after I check that the user is connected to the polygon chain with his Metamask. Whenever I try to call a web3 method such as :

const contract = new this.web3.eth.Contract(HuntingJSON.abi, "0xda528AccACF4eec33EF21c6078273eBfe52609df");
const name = await contract.methods.name().call(function(data: any,error: any) {
      console.log(data);
      console.log(error);
    }); 

I get this kind of error : Uncaught (in promise): TypeError: process.nextTick is not a function

Is it possible to call a contract with a Metamask provider ? I imagined method such as ownerOf(), owner() or name() wouldn't need a sendTransaction, am I wrong ?

On the other side, I can successfully call the JSON RPC API from Metamask or Ethereum such as : window.ethereum.request({method: 'eth_requestAccounts'});

Is there a way to check if a user owns a NFT tokenID with Metamask as a provider ? And how ?

Thank you!

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda