Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

155
Vistas
Web3 .send() method promise remains <pending>

I'm working on a DAPP that connects to a smart contract through Web3 and MetaMask. I'm calling a claim method on the contract as follows:

try {
    const claimRes = await batchClaimTokenRewards(tokensArray, weeksArray);
    console.log('claim response: ', claimRes);
    this.getNftDataFromContract();
} catch(error) {
    console.log('claim error: ', error);
}

The batchClaimTokenRewards function is imported from another file, here's that function as well:

export async function batchClaimTokenRewards(tokensArray:string[], weeksArray:string[]) {
  return distributionContract.methods.batchClaimTokenRewards(tokensArray, [weeksArray]).send({from: web3.utils.toChecksumAddress('<metamask address>')});
}

From my understanding, the .send() method called on the contract instance should return a promise, which I should be able to await, however, the line where I'm trying to console.log claimRes is never reached, even as MetaMask shows the transaction as completed. The catch() expression is never reached either. When I log claimRes without using await on the promise, I get a <pending> promise in the Chrome console that remains in the <pending> state and never gets resolved, again, even as MetaMask itself reports the transaction as completed. What can I do to reliably get confirmation of a completed transaction?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda