The following code gives me undefined. I tried fixing it with various async/await but it came up as an error. Anyone know how to fix? EDIT: To be more specific, I need the value of "output" stored. I am using console.log just to guarantee it is getting the information I need it to have.
const URL = 'https://api.1inch.exchange/v3.0/1/quote?fromTokenAddress=0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE&toTokenAddress=0x6b175474e89094c44da98b954eedeac495271d0f&amount=1&protocols=';
function getAmount(){
axios.get(URL).then((response) => {
//console.log(response.data)
const output = response.data.toTokenAmount
//console.log(output)
return output
})
//console.log(output)
}
console.log(getAmount());