Hi All,
In React Moralis, I have a functional component as follows that is intended to give me the address of any eth wallet.
import { useNativeBalance } from "react-moralis";
import { useMoralis } from "react-moralis";
import { useEffect } from "react";
function WalletBalance(ethADDR) {
const {
getBalances,
data: balance,
nativeToken,
error,
isLoading
} = useNativeBalance({address:ethADDR});
return (
<div className="text-gray-300 italic opacity-80">Wallet Balance: {balance.formatted}</div>
)
}
export default WalletBalance
From my parent code, I am calling it like this:
<WalletBalance ethADDR={message.get("ethAddress")} />
I have a class called Messages where each chat message stores the users ethAddress.
When I call the function, I get error 400 back from Moralis. However if I change this line in the fuction to hardcode an ethAddress, it works:
This:
} = useNativeBalance({address:ethADDR});
To this:
} = useNativeBalance({address:"05x90456908456456lkfgg455"});
Help?