I changed V1 to V2 is OK.
But my function get balance not work:
const fetchNativeBalance = async () => {
const result = await Web3Api.account
.getNativeBalance({
chain: process.env.NEXT_PUBLIC_MAIN_NET,
address: user?.get('ethAddress'),
})
.catch((e) => console.log(e));
if (result && result.balance) {
setEthBalance(Math.round(Moralis.Units.FromWei(result.balance) * 10000) / 10000);
}
};
I must change code for V2 ?