Getting 0 when calling Web3Api.account.getNativeBalance

I am trying to fetch the balance of 2 real life ETH wallets on Binance website but the balance always comes back as 0. When trying to fetch from a Ropsten chain that i created with 0.15 ETH, i successfully get that value in my application. Web3 is enabled and all so thatā€™s not the problemā€¦

This works when Iā€™m connected to the Ropsten chain on MetaMask:

const Web3Api = useMoralisWeb3Api();

const getBalance = async () => {
    const balance = await Web3Api.account.getNativeBalance({
      chain: "ropsten",
      address: "my_metamask_wallet",
    });

    console.log(balance); // I get my 0.15 ETH
};

However calling this function with an address from binance with more than 0 ETH, it doesnā€™t work:

const getBalance = async () => {
    const balance = await Web3Api.account.getNativeBalance({
      chain: "eth",
      address: "my_binance_wallet_address",
    });

    console.log(balance); // I get 0 ETH, not true...
};

I also tried with a polygon wallet and it still doesnt workā€¦

Some info about my project:

  • Itā€™s using react-moralis and everything is plugged in correctly
  • Iā€™m using moralis in a NextJS project

Does the Web3API not work with wallets outside of MetaMask? Iā€™m very confusedā€¦

Thank you!

you may need to specify BSC there maybe, what you mean by my_binance_wallet_address ?

I get the address from binance.com by following this guide for my Ethereum wallet:
https://www.followchain.org/binance-wallet-address/#:~:text=To%20find%20your%20wallet%20address%20on%20Binance%2C%20you%20need%20to,and%20click%20on%20ā€œDepositā€.

I tried ā€œbscā€ as a value and it gave me the same result (0 ETH)

I donā€™t know what address you got from Binance, if you search that address in a block explorer for that corresponding chain you see that it has native currency?

@cryptokid Thanks for the advice. Searching for that address on a block explorer yielded the same result. Iā€™ll be using that as reference to my application.