Hello, I don’t know why I am getting this error.
const auth = "Basic " + Buffer.from(projectId + ":" + projectSecretKey).toString("base64");
const client = create({
host: "ipfs.infura.io",
port: 5001,
protocol: "https",
headers: {
authorization: auth,
},
});
//Create NFTs
const uploadToIPFS = async (file) => {
try {
const added = await client.add({ content: file });
const url = `${subdomain}/ipfs/${added.path}`;
return url;
} catch (error) {
console.log("Error Uploading to IPFS", error);
}
};
// Fetch NFTs
function fetchNFts(tokenId){
const tokenURI = await contract.tokenURI(tokenId);
const {
data: { image, name, description },
} = await axios.get(tokenURI) ;
}
}