ok im just getting frustrated.
here is the code in my cloud function:
Moralis.cloud.define("getPrice", async (request) => {
let url = 'https://deep-index.moralis.io/api/v2/erc20/' + request.params.address + '/price'
logger.info(url);
return Moralis.Cloud.httpRequest({
url: url,
params: {chain: 'eth', chain_name: 'mainnet'},
headers: {
'accept': 'application/json',
'X-API-Key': xxx
}
}).then(function(httpResponse){
return httpResponse.data;
}, function(httpResponse){
logger.info("error");
logger.info(httpResponse);
})
});
Thereโs got to be a simple way to call this cloud function and simply get the ETH price from my react app.
someone please helpโฆ