I am trying to use the Web3API but I am having trouble.
I have created an app using create-react-app, npm installed moralis and I can use the functions from useMoralis() no problem. But as soon as I try to use the API, say something like thisā¦
const options = { chain: "eth", addresses: token };
const tokenMetadata = await Moralis.Web3API.token.getTokenMetadata(options);
I get an error like thisā¦
Cannot read property ātokenā of undefined
I have tried running this code on a Cloud function on the Moralis server, but I get the exact same error.
Can anyone point me to a tutorial on how to actually hook up the API within my dapp? I have watched countless tutorials but they all only show you how to use the API, not how to set it up or connect it.
I know I am supposed to add the API key to the header but I am not sure how to do this with react. I have also tried to download the API client from Moralis but the javascript version is not available.
Thank you in advance.