so the goal here is to get the balance of the connected account and display it in the table. Ive been working on this all day and im feeling stuck. Heres what I have:

         function App(){
 const Web3 = require("web3");
  const web3 = new Web3(
    Web3.givenProvider ||

  async function checkBalance() {
    try {
      await web3.eth.getBalance(account).then(web3.utils.fromWei());
    } catch (error) {
  ////.....//// {checkBalance} to be displayed in a table
  <Table variant="striped" width="100%">
            <TableCaption>Token balances of {account}</TableCaption>
                <Th>Contract Address</Th>
                <Th>Contract Address</Th>
  • Hi Atticus! This question isn't related to Ethereum, you have to learn how to deal with http request to fill a table from react.
    – Ismael
    Oct 28 at 5:25
  • await web3.eth.getBalance(account).then(web3.utils.fromWei()); this is wrong not sure if then and await work in the same line
    – Majd TL
    Oct 29 at 9:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.