Difference between getNativeBalance & getTokenBalances?

In the below image I tried to the get balance of rinkeby wallet using getNativeBalance & getTokenBalances.

I go the balance using getNativeBalance. But when I tried the same with getTokenBalances it gave nothing.

My wallet add: 0xCC072A19678534e25D5636d229E3680603E46221

Can someone explain if I am doing it right?

getTokenBalances will not include what you get with getNativeBalance, getNativeBalance will return only the native currency balance as ETH or BNB and getTokenBalances will return what tokens has that particular address

The below code should give me the balance of 0xCC072A19678534e25D5636d229E3680603E46221 right?

const balance = await Moralis.Web3API.account.getTokenBalances({ chain: "rinkeby", address: "0xCC072A19678534e25D5636d229E3680603E46221" });
In this format

or am i using it wrong

It looks like you don’t have tokens for that 0xCC072A19678534e25D5636d229E3680603E46221 address on rinkeby. What token would you expect to get in the response?

I am expecting rinkeby balance

that balance you get with getNativeBalance, ETH is not a token, is a native currency.

1 Like