Hello,
I’m trying to write a specific method from a CA but, it fails while using the Speedy Nodes. Error below:
Access to XMLHttpRequest at 'https://speedy-nodes-nyc.moralis.io/{number}/bsc/mainnet' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
VM346:1 POST https://speedy-nodes-nyc.moralis.io/{number}/bsc/mainnet net::ERR_FAILED 401
Error: Invalid JSON RPC response: ""
at Object.InvalidResponse (errors.js:43:1)
at XMLHttpRequest.request.onreadystatechange (index.js:95:1)
Code:
await _contract.methods.increaseAllowance("0xd5f363f83b36e10e8a823166b992c0bdc3dede2c", allowance)
.send({ 'from': userAddress })
.then(console.log).catch(console.error);
and
await _lottery.methods.getTicket()
.send({ from: userAddress })
.then(function (receipt) {
console.log(receipt)
}).catch(console.log);