# Error network does not support ENS taking balance

**URL:** <https://forum.openzeppelin.com/t/error-network-does-not-support-ens-taking-balance/12392>\
**Category:** Support\
**Created:** [July 13, 2021, 12:19pm UTC](https://forum.openzeppelin.com/t/error-network-does-not-support-ens-taking-balance/12392 "2021-07-13T12:19:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cainuriel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cainuriel/32/5410_2.png) [@Cainuriel](https://forum.openzeppelin.com/u/Cainuriel)\
**Post date:** [July 13, 2021, 12:19pm UTC](https://forum.openzeppelin.com/t/error-network-does-not-support-ens-taking-balance/12392/1 "2021-07-13T12:19:31Z")

</div>

hi everybody…

I am trying to capture the balance of the user connecting to my DAPP with ethers.js

According to its documentation it is done like this:

```auto
// Get the balance of an account (by address or ENS name, if supported by network)
balance = await provider.getBalance("ethers.eth")
// { BigNumber: "2337132817842795605" }

```

I work in BSC testnet. I don’t know very well what the ENS refers to.

I copy the function of my App.js that tries to capture this data

```auto
  async function requestAccount() {
    const account = await window.ethereum.request({ method: 'eth_requestAccounts' });

    const provider = new ethers.providers.Web3Provider(window.ethereum)
    const balance = await provider.getBalance("ethers.eth");

     document.querySelector('#wallet').innerHTML=account.toString();
     document.querySelector('#balance').innerHTML=balance.toString();
  }

```

---

<div class="post-metadata">

**Author:** ![Cainuriel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cainuriel/32/5410_2.png) [@Cainuriel](https://forum.openzeppelin.com/u/Cainuriel)\
**Post date:** [July 13, 2021, 12:33pm UTC](https://forum.openzeppelin.com/t/error-network-does-not-support-ens-taking-balance/12392/2 "2021-07-13T12:33:44Z")

</div>

I have solved like this…

Sorry for doing this post then.

```auto
    const provider = new ethers.providers.Web3Provider(window.ethereum)
    const signer = provider.getSigner(); // user
    const contractUser = await signer.getAddress();
    const contractUserBalance = await provider.getBalance(contractUser);
    const amount = ethers.utils.formatEther(contractUserBalance)

```

---

<div class="post-metadata">

**Author:** ![Cainuriel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/cainuriel/32/5410_2.png) [@Cainuriel](https://forum.openzeppelin.com/u/Cainuriel)\
**Post date:** [July 13, 2021, 12:35pm UTC](https://forum.openzeppelin.com/t/error-network-does-not-support-ens-taking-balance/12392/3 "2021-07-13T12:35:32Z")

</div>

If someone knows how to update the data in the front every time the account is changed in the metamask I would appreciate it …  
Greetings.
