Invalid Chain getNFTs

Hello,

I am having a similar issue as to this issue, they seem to have solved it but i am not sure how.

@nutrina @ivan

@mayjer - Appears to have no issues with this, but his chain is set to ‘dev’ not the chain id ‘0x539’. Could this be related? I am not at all clear on how this should all work. (NOTE/UPDATE: ‘dev’ did not work for me, same error response)

From this post, it appears what i am trying to do is possible but their explanation is not entirely clear.

Here’s what i did.

I have a Local Dev Chain server running with code using moralis-react adapted form the ethereum boiler plate code.

My ERC721 contracts seem to work fine (it mints correctly via my Moralis-React app) and the chain Id is 0x539.

I made a bunch of contracts ERC721. It migrated to Ganache and i can access them from my react app. I can mint an NFT, where metamask shows the transaction as confirmed and i can see it in my wallet. Fantastic!

I have setup FRPC with my Moralis Server. Everything is looking good.

Here is my code that attempts to fetch the NFT data from my current setup.

  const { chainId } = useMoralis();
  const { getNFTBalances, data, error, isLoading, isFetching } =
    useNFTBalances();

  const someFunctionThatICallLater = () => {
    if (chainId) {
      getNFTBalances({ params: { chain: chainId } });
    }
  };
  console.log("======");
  console.log(chainId);
  console.log(error);
  console.log(data);

Here is the console error

Here is the network tab… (Request)

Here is the network tab… (Response)

web3api doesn’t work with local dev chain now

1 Like