Here’s the code for axios call. I’ve read that i could need to add – " ‘maxContentLength’: Infinity, ‘maxBodyLength’: Infinity " —
import axios from “axios”
export const toneGardenMarket = ‘0x45846bD83C49ee0148354a491703cad98Da17Dfc’
export const allowedChains = { ‘5’: ‘goerli’, ‘80001’: ‘mumbai’, ‘97’: ‘binance’, ‘1’: ‘eth’ }
export const contractsAddresses = { ‘0x5’: ‘’, ‘0x13881’: ‘0x45846bD83C49ee0148354a491703cad98Da17Dfc’, ‘0x61’: ‘’, ‘0x1’: ‘eth’ }
export const MAX_FILE_UPLOAD_SIZE = 8589934592
export const returnMetaData = (token_uri) => {
const options = {
" Content-Type": "application/json"
}
axios.get(`${token_uri}?format=json`, options).then((res) => { return res.data }).catch((err) => { })
}
export const returnImage = (image, image_url) => {
if (image != undefined) {
if (image.toString().startsWith('ipfs://')) {
return image.replace('ipfs://', 'https://ipfs.moralis.io:2053/ipfs/')
} else {
return image
}
} else if (image_url != undefined) {
if (image_url.toString().startsWith('ipfs://')) {
return image_url.replace('ipfs://', 'https://ipfs.io/ipfs/')
} else {
return image_url
}
}
}