if I go to the link used in the fetch then there is data but as you can see in the screenshot it logs an object with an empty sales array if I hardcode the link then the information is returned correctly
the res variable is an object returned by an event listener and isn't the problem
const { transactionHash } = res;
console.log(transactionHash);
const url = `https://api.reservoir.tools/sales/v3?txHash=${transactionHash}`;
console.log(url);
fetch(url, {
method: 'GET',
headers: { Accept: '*/*', 'x-api-key': '' },
})
.then((response) => response.json())
.then((response) => console.log(response))
.catch((err) => console.error(err));
edit:
when I use
const url = `https://api.reservoir.tools/sales/v3?txHash=${transactionHash}`;
then the fetch returns an empty sales array but if I hardcode the hash directly onto the link like this then it returns data inside the sales array (123 being the hash for demonstration)
const url = `https://api.reservoir.tools/sales/v3?txHash=123`;