Hi, everyone. I was trying to create a function that shows every second the current price of one token, which address is given by a parameter. The function works and shows the price in the console, but I have constantly this two errors:
- moralis.js:29036 POST https://b6hr8gxghw0m.usemoralis.com:2053/server/functions/getTokenPrice 400
- script.js:391 Uncaught (in promise) {code: 141, error: 'required param address not provided'}
What do these errors mean? What could I do to fix them?
HERE IS THE CODE:
async function getPrice(tA) {
var options = { address: "", chain: "bsc" }
options.address = tA
setInterval(async function gtp(options) {
const price = await Moralis.Web3API.token.getTokenPrice(options);
console.log((price.usdPrice).toFixed(18));
}, 1000)
}