Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

156
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!