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

303
Views
Problemas asincrónicos y sincrónicos en la función de devolución de llamada de la tabla de arranque
<link href="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.css" rel="stylesheet"> // link Jquery & Web3.js <script src="https://unpkg.com/bootstrap-table@1.19.1/dist/bootstrap-table.min.js"></script> <table id="table" data-toggle="table" data-height="460" data-url="json/data1.json"> <thead> <tr> <th data-field="owner" data-formatter="ownerFormatter">Owner Address</th> <th data-field="balance" data-formatter="balanceFormatter">Balance</th> </tr> </thead> </table> <script> function ownerFormatter(value, row) { return '<span>'+value+'</span>'; } async function balanceFormatter(value, row) { let wallet_address = row['owner']; let sss_balance = 0; //window.abi_json is defined elsewhere let MyContract = new web3.eth.Contract(window.abi_json,'0xC3028FbC1742a16A5D69dE1B334cbce28f5d7EB3'); //According to the WEB3 document to read the balance of a certain currency online, console.log(sss_balance) can print the balance normally sss_balance = await MyContract.methods.balanceOf(wallet_address).call(); //return balance return sss_balance; } </script>

Quiero hacer una tabla que enumere las billeteras de los usuarios y sus saldos en una determinada moneda en Binance Smart Chain. Las direcciones de las billeteras están todas en data1.json, y el saldo debe obtenerse de la cadena en tiempo real. El balanceFormatter anterior puede imprimir sss_balance normalmente en el cuerpo de la función, pero no puede devolver un valor de coma flotante normal. Sé que el motivo del error es que async solo puede devolver objetos de promesa. Demasiado

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!