Hi guys. I’m being unable to call the functions getNFTs
and getNFTsForContract
in a hardhat local dev chain. I’ve created a Local Dev Chain Server in Moralis and synced the local chain with frpc
, which seems to be working because I see the transactions I’ve done locally in the Server Dashboard .
I’m using React-Moralis inside a Next.js app, initialized (in _app.js
file) with <MoralisProvider appID={...} serverUrl={...}>
The versions in my package.json
are:
"moralis": "^0.0.124",
"react-moralis": "^0.2.8"
The endpoint is called when the user clicks a button to get the NFT info:
const { authenticate, isAuthenticated } = useMoralis()
const web3Api = useMoralisWeb3Api()
<button onClick={
isAuthenticated ?
async () => {
const result = await web3Api.account.getNFTs({
chain: 'dev',
})
console.log(result)
}
:
() => authenticate()
}>
The following is the error I get in the Log section of the Server Dashboard. For the chain
param, I’ve tried "localdevchain"
, "dev"
, "ganache"
, "hardhat"
, but the same happens:
2021-11-10T22:17:10.428Z - Error: Web3 API error while calling /:address/nft
at fetch (/moralis-server/lib/cloud-code/plugins/convenience/web3Api.js:128:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
2021-11-10T22:17:10.426Z - Failed running cloud function getNFTs for user undefined with:
Input: {"chain":"dev","address":"0x8626f6940E2eb28930eFb4CeF49B2d1F2C9C1199"}
Error: {"message":"Web3 API error while calling /:address/nft","code":141}
Thanks for your time!