You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, so I'm trying to interact with Axie Infinity's Lands contract on Ronin Mainnet. I can call contract.name() and get the name. contract.balanceOf(wallet) also works fine.
The issue comes when I want to look into the transfer events, or any event at all.
Summarized Error here :
Access to fetch at 'https://api.roninchain.com/rpc' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
geturl.js?0d04:30 POST https://api.roninchain.com/rpc net::ERR_FAILED 403
index.js?ffb2:185 Uncaught (in promise) Error: missing response (requestBody="{\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"0x0\",\"toBlock\":\"latest\",\"address\":\"0x8c811e3c958e190f5ec15fb376533a3398620500\",\"topics\":[\"0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f\"]}],\"id\":45,\"jsonrpc\":\"2.0\"}", requestMethod="POST", serverError={}, url="https://api.roninchain.com/rpc", code=SERVER_ERROR, version=web/5.5.1)
at Logger.makeError (index.js?ffb2:185:1)
at Logger.throwError (index.js?ffb2:194:1)
at eval (index.js?37b9:205:1)
at Generator.throw (<anonymous>)
at rejected (index.js?37b9:6:42)
I see that it looks like a CORS issue but I'm not sure why would my previous requests work fine. I'm guessing since we are accessing their own evm maybe things are different? I'm not sure if I would need an APIKey (which I haven't seen the axie team posting about anywhere) or if there's anyway to change the JsonRpcProvider to change its CORS.
My Code Below
Also if anybody wants to try the rpcUrl is : 'https://api.roninchain.com/rpc'
and contractAddress is 8c811e3c958e190f5ec15fb376533a3398620500 // It shows up like this, but works without the 'ronin:' ronin:8c811e3c958e190f5ec15fb376533a3398620500
They do have their own methods, but any ERC-721 ABI should work for this example
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey, so I'm trying to interact with Axie Infinity's Lands contract on Ronin Mainnet. I can call
contract.name()
and get the name.contract.balanceOf(wallet)
also works fine.The issue comes when I want to look into the transfer events, or any event at all.
Summarized Error here :
I see that it looks like a CORS issue but I'm not sure why would my previous requests work fine. I'm guessing since we are accessing their own evm maybe things are different? I'm not sure if I would need an APIKey (which I haven't seen the axie team posting about anywhere) or if there's anyway to change the
JsonRpcProvider
to change its CORS.My Code Below
Also if anybody wants to try the rpcUrl is :
'https://api.roninchain.com/rpc'
and contractAddress is
8c811e3c958e190f5ec15fb376533a3398620500
// It shows up like this, but works without the 'ronin:' ronin:8c811e3c958e190f5ec15fb376533a3398620500
They do have their own methods, but any ERC-721 ABI should work for this example
Beta Was this translation helpful? Give feedback.
All reactions