I am using events in my contract and would like to get some logs in my angular frontend, following is my code: contract: event LogBalance(address account, uint256 balance); function balanceOf(address account) public returns (uint256 balance) { emit LogBalance(account, balances[account]); return balances[account]; } frontend: Contract.on('LogBalance', (account, balance) => { console.log("LogBalance event:", account, balance.toString()); }); But I get the error: TypeError: can't convert BigInt to number Following this answer I tried Number(balance) but didn't help. Does anyone have any idea? Thank you in advance. P.s. the error exists for both account and balance, and neither toString() not Number() worked. Continue reading...