this works:
<!DOCTYPE html>
<html lang="en">
<body>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/web3.min.js"></script>
<script src="https://unpkg.com/moralis/dist/moralis.js"></script>
<script>
async function totalRewards(){
web3 = await Moralis.enable();
let contractAbi = [{"inputs":[],
"name":"viewRewardsAndLiquidityInfo",
"outputs":[
{"internalType":"uint256","name":"budsAccumulationFromRewardsFee","type":"uint256"},
{"internalType":"uint256","name":"sumOfAllHOLDRBalances","type":"uint256"},
{"internalType":"uint256","name":"theCurrentRewardsCycle","type":"uint256"},
{"internalType":"uint256","name":"lengthOfRewardsCycle","type":"uint256"},
{"internalType":"uint256","name":"budsAccumulationFromLiquidityFee","type":"uint256"},
{"internalType":"uint256","name":"lastTimeDividendsWereReleased","type":"uint256"},
{"internalType":"uint256","name":"dividendsClaimableNow","type":"uint256"},
{"internalType":"uint256","name":"dividendsLeftFromReservedSupplyForHOLDRs","type":"uint256"}
],"stateMutability":"view","type":"function"}];
const options = {
contractAddress: "0x058cdF0fF70f19629D4F50faC03610302e746e58",
functionName: "viewRewardsAndLiquidityInfo",
abi: contractAbi,
};
x = await Moralis.executeFunction(options)
return x;
}
x = totalRewards()
x.then(
function(value) {console.log(value);},
function(error) {console.log(error);}
);
</script>
</body>
</html>