I would like to know if the token balance only showing if its not 0 value
because i have some token on my metamask only eth have some amount other token are 0 value.
can i also ask some help how to resolve this issue
index.html:60 Uncaught (in promise) ReferenceError: tokenValue is not defined
at index.html:60
at Array.map ()
at getStats (index.html:57)
and some time this error are showing when i refresh my browser
moralis.js:29067 POST https://hvvgp61mmee7.usemoralis.com:2053/server/functions/getTokenBalances 400
index.html:65 Uncaught (in promise) {code: 141, error: 'required param address not provided'}
moralis code
const serverUrl = "";
const appId = "";
Moralis.start({ serverUrl, appId });
// Log in with Metamask
async function login() {
let user = Moralis.User.current();
if (!user) {
user = await Moralis.authenticate();
}
console.log("logged in user:", user);
getStats();
}
// getstats
async function getStats() {
const balances = await Moralis.Web3API.account.getTokenBalances({chain: 'bsc'});
console.log(balances);
}
// Log out
async function logOut() {
await Moralis.User.logOut();
console.log("logged out");
}
// bind button click handlers
document.getElementById("btn-login").onclick = login;
document.getElementById("btn-logout").onclick = logOut;